[dpdk-dev] [PATCH v5 4/7] ethdev: copy fast-path API into separate structure

Ananyev, Konstantin konstantin.ananyev at intel.com
Mon Oct 11 17:24:08 CEST 2021


> 
> Sorry to self-reply.
> 
> I think it's better the 'struct rte_eth_dev *dev' hold a pointer to the
> 'struct rte_eth_fp_ops', e.g.
> 
> 	struct rte_eth_dev {
> 		struct rte_eth_fp_ops *fp_ops;
> 		...  // other field
> 	}
> 
> The eth framework set the pointer in the rte_eth_dev_pci_allocate(), and driver fill
> corresponding callback:
> 	dev->fp_ops->rx_pkt_burst = xxx_recv_pkts;
> 	dev->fp_ops->tx_pkt_burst = xxx_xmit_pkts;
> 	...
> 
> In this way, the behavior of the primary and secondary processes can be unified, which
> is basically the same as that of the original process.

I don't think it is a good thing to do, as it nullifies one of the main thing of this approach:
fp_ops[] points to actual rx/tx functions and data only when PMD is really ready to do rx/tx
(device is properly configured and started), in other cases it points to dummy stubs.
As another drawback it will mean code changes in aach and every driver.



More information about the dev mailing list