ethdev: introduce shared Rx queue
authorXueming Li <xuemingl@nvidia.com>
Thu, 21 Oct 2021 10:41:36 +0000 (18:41 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 21 Oct 2021 22:08:50 +0000 (00:08 +0200)
commitdd22740cc291568f354279f5c38eef4a1d1dd3a0
tree46efdb2202b81d0723699dffcc8ccd7e16eb8435
parent17faaed85449b58b209150906d2ad2cbfd853150
ethdev: introduce shared Rx queue

In current DPDK framework, each Rx queue is pre-loaded with mbufs to
save incoming packets. For some PMDs, when number of representors scale
out in a switch domain, the memory consumption became significant.
Polling all ports also leads to high cache miss, high latency and low
throughput.

This patch introduces shared Rx queue. Ports in same Rx domain and
switch domain could share Rx queue set by specifying non-zero sharing
group in Rx queue configuration.

Shared Rx queue is identified by share_rxq field of Rx queue
configuration. Port A RxQ X can share RxQ with Port B RxQ Y by using
same shared Rx queue ID.

No special API is defined to receive packets from shared Rx queue.
Polling any member port of a shared Rx queue receives packets of that
queue for all member ports, port_id is identified by mbuf->port. PMD is
responsible to resolve shared Rx queue from device and queue data.

Shared Rx queue must be polled in same thread or core, polling a queue
ID of any member port is essentially same.

Multiple share groups are supported. PMD should support mixed
configuration by allowing multiple share groups and non-shared Rx queue
on one port.

Example grouping and polling model to reflect service priority:
 Group1, 2 shared Rx queues per port: PF, rep0, rep1
 Group2, 1 shared Rx queue per port: rep2, rep3, ... rep127
 Core0: poll PF queue0
 Core1: poll PF queue1
 Core2: poll rep2 queue0

PMD advertise shared Rx queue capability via RTE_ETH_DEV_CAPA_RXQ_SHARE.

PMD is responsible for shared Rx queue consistency checks to avoid
member port's configuration contradict each other.

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
doc/guides/nics/features.rst
doc/guides/nics/features/default.ini
doc/guides/prog_guide/switch_representation.rst
doc/guides/rel_notes/release_21_11.rst
lib/ethdev/rte_ethdev.c
lib/ethdev/rte_ethdev.h