> 
> > +                   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).
> 
'strean_init' is a function pointer, putting this logic in will produce a lot 
of similar redundant code in all forwarding modules, like 'iofwd' 'macfwd'  and 
etc.
It's better to hide 'rte_eth_devices' from testpmd, but this requires an API at 
the EAL layer to access the queue state,
'rte_eth_rx/tx_queue_info_get()' can not get queue's state now.

Reply via email to