On Tue, 6 Sep 2022 22:53:10 +0800
Peng Zhang <[email protected]> wrote:
> + if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
> + struct fwd_stream *fs = fwd_streams[i];
> + struct rte_eth_dev_data *dev_rx_data,
> *dev_tx_data;
> +
> + dev_rx_data =
> (&rte_eth_devices[fs->rx_port])->data;
> + dev_tx_data =
> (&rte_eth_devices[fs->tx_port])->data;
> +
> + uint8_t rx_state =
> dev_rx_data->rx_queue_state[fs->rx_queue];
> + ports[fs->rx_port].rxq[fs->rx_queue].state =
> rx_state;
> + uint8_t tx_state =
> dev_tx_data->tx_queue_state[fs->tx_queue];
> + ports[fs->tx_port].txq[fs->tx_queue].state =
> tx_state;
> + }
Could the logic be put in stream_init() like this?
It keeps with the function pointer model object style model in that code.
Also, it makes testpmd more dependent on data structures that should be
hidden and internal only (rte_eth_devices).