Hi Bing

> -----Original Message-----
> From: Bing Zhao <bi...@nvidia.com>
> Sent: Thursday, October 8, 2020 11:52 AM
> Subject: [PATCH v2 1/6] ethdev: add hairpin bind and unbind APIs
> 
> In single port hairpin mode, all the hairpin TX and RX queues belong
> to the same device. After the queues are set up properly, there is
> no other dependency between the TX queue and its RX peer queue. The
> binding process that connected the TX and RX queues together from
> hardware level will be done automatically during the device start
> procedure. Everything required is configured and initialized already
> for the binding process.
> 
> But in two ports hairpin mode, there will be some cross-dependences
> between two different ports. Usually, the ports will be initialized
> serially by the main thread but not in parallel. The earlier port
> will not be able to enable the bind if the following peer port is
> not yet configured with HW resources. What's more, if one port is
> detached / attached dynamically, it would introduce more trouble
> for the hairpin binding.
> 
> To overcome these, new APIs for binding and unbinding are added.
> During startup, only the hairpin TX and RX peer queues will be set
> up. Nothing will be done when starting the device if the queues are
> without auto-bind attribute. Only after the required ports pair
> started, the `rte_eth_hairpin_bind()` API can be called to bind the
> all TX queues of the egress port to the RX queues of the peer port.
> Then the connection between the egress and ingress ports pair will
> be established.
> 
> The `rte_eth_hairpin_unbind()` API could be used to disconnect the
> egress and the peer ingress ports. This should only be called before
> the device is closed if needed. When doing the clean up, all the
> egress and ingress pairs related to a single port should be taken
> into consideration, especially in the hot unplug case.
> 
> Signed-off-by: Bing Zhao <bi...@nvidia.com>
> ---
> v2: remove the all peer ports logic from rte API
> ---

Acked-by: Ori Kam <or...@nvidia.com>
Thanks,
Ori


Reply via email to