> From: Feifei Wang [mailto:feifei.wa...@arm.com] > Sent: Sunday, 26 December 2021 10.50 > > > 发件人: Stephen Hemminger <step...@networkplumber.org> > > 发送时间: Saturday, December 25, 2021 3:38 AM > > > > On Sat, 25 Dec 2021 00:46:10 +0800 > > Feifei Wang <feifei.wa...@arm.com> wrote: > > > > > +rte_eth_direct_rxrearm_map(uint16_t rx_port_id, uint16_t > rx_queue_id, > > > + uint16_t tx_port_id, uint16_t tx_queue_id) { > > > + struct rte_eth_dev *dev; > > > + > > > + dev = &rte_eth_devices[rx_port_id]; > > > + (*dev->dev_ops->rx_queue_direct_rearm_enable)(dev, > > rx_queue_id); > > > + (*dev->dev_ops->rx_queue_direct_rearm_map)(dev, rx_queue_id, > > > + tx_port_id, tx_queue_id); > > > + > > > > Indirect calls are expensive, maybe better to combine these? > Thanks for your comment. I'm a little confused about this. > > Whether 'expensive' is due to 'enable direct_rearm mode' and 'map > queue' use > different api, and we should combine them into the same API. > If this, I think you are right, and just one api is enough to enable > direct rearm mode and > map queue. >
It's used in the control plane, so prefer readability over performance. Also, the Ethdev API has separate _enable/_disable/_configure functions for many features like this. I would prefer the API to this feature to be similar, i.e. separate functions for enable and configure. In other words: Disregard Stephen's comment about combining.