ethdev: add hairpin queue operations
authorBing Zhao <bingz@nvidia.com>
Thu, 15 Oct 2020 13:08:54 +0000 (21:08 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 16 Oct 2020 17:48:19 +0000 (19:48 +0200)
commitbc6e15de08d925ab88ee1c2591e08756d2bb0226
tree0b7ccdf662c5cb10ed3fd1020ed1e97172e77672
parent9a9ba10ada5eaf4af0f7e17090b22eeab346a2a4
ethdev: add hairpin queue operations

Every hairpin queue pair should be configured properly and the
connection between Tx and Rx queues should be established, before
hairpin function works. In single port hairpin mode, the queues of
each pair belong to the same device. It is easy to get the hardware
and software information of each queue and configure the hairpin
connection with such information. In two ports hairpin mode, it is
not easy or inappropriate to access one queue's information from
another device.

Since hairpin is configured per queue pair, three new APIs are
introduced and they are internal for the PMD using.

The peer update API helps to pass one queue's information to the
peer queue and get the peer's information back for the next step.
The peer bind API configures the current queue with the peer's
information. For each hairpin queue pair, this API may need to be
called twice to configure the Tx, Rx queues separately.
The peer unbind API resets the current queue configuration and state
to disconnect it from the peer queue. Also, it may need to be called
twice to disconnect Tx, Rx queues from each other.

Some parameter of the above APIs might not be mandatory, and it
depends on the PMD implementation.

The structure of `rte_hairpin_peer_info` is only a declaration and
the actual members will be defined in each PMD when being used.

Signed-off-by: Bing Zhao <bingz@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
lib/librte_ethdev/rte_ethdev.c
lib/librte_ethdev/rte_ethdev_driver.h
lib/librte_ethdev/rte_ethdev_version.map