> -----邮件原件----- > 发件人: Jerin Jacob <jerinjac...@gmail.com> > 发送时间: Wednesday, April 20, 2022 6:50 PM > 收件人: Feifei Wang <feifei.wa...@arm.com> > 抄送: tho...@monjalon.net; Ferruh Yigit <ferruh.yi...@intel.com>; Andrew > Rybchenko <andrew.rybche...@oktetlabs.ru>; Ray Kinsella > <m...@ashroe.eu>; dpdk-dev <dev@dpdk.org>; nd <n...@arm.com>; > Honnappa Nagarahalli <honnappa.nagaraha...@arm.com>; Ruifeng Wang > <ruifeng.w...@arm.com> > 主题: Re: [PATCH v1 3/5] ethdev: add API for direct rearm mode > > On Wed, Apr 20, 2022 at 1:47 PM Feifei Wang <feifei.wa...@arm.com> > wrote: > > > > Add API for enabling direct rearm mode and for mapping RX and TX > > queues. Currently, the API supports 1:1(txq : rxq) mapping. > > > > Suggested-by: Honnappa Nagarahalli <honnappa.nagaraha...@arm.com> > > Signed-off-by: Feifei Wang <feifei.wa...@arm.com> > > Reviewed-by: Ruifeng Wang <ruifeng.w...@arm.com> > > Reviewed-by: Honnappa Nagarahalli <honnappa.nagaraha...@arm.com> > > --- > > > + * > > + * @return > > + * - (0) if successful. > > + */ > > +__rte_experimental > > +int 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); > > Won't existing rte_eth_hairpin_* APIs work to achieve the same? [Feifei] Thanks for the comment. Look at the hairpin feature which is enabled in MLX5 driver.
I think the most important difference is that hairpin just re-directs the packet from the Rx queue to Tx queue in the same port, and Rx/Tx queue just can record the peer queue id. For direct rearm, it can map Rx queue to the Tx queue which are from different ports. And this needs Rx queue records paired port id and queue id. Furthermore, hairpin needs to set up new hairpin queue and then it can bind Rx queue to Tx queue. and direct-rearm just can use normal queue to map. This is due to direct rearm needs used buffers and it doesn't care about packet.