In Tap PMD, file descriptors for rxq and txq are paired by dup(2) [1].
Here, rxq and txq are created for the number of PMD threads +1 each. One
additional fd will be created for keepalive [2]. For example, if the
number of PMD threads is 4, the number of fd is 5 for rxq, 5 for txq, and
1 for keepalive, so a total of 11 fd will be created.

The user can specify any value as rxq from the CLI, but it must bespecified
here as rxq = PMD threads count +1. If you forget to specify rxq, or if you
specify a small value, there will be a queue that will not be watched, and
some packets will fail to be received.

On the other hand, txq will be overwritten by PMD threads count +1
regardless of the value specified by the user [3], so it is not mentioned
in the documentation.

[1]: 
https://github.com/DPDK/dpdk/blob/0c6e27549c/drivers/net/tap/rte_eth_tap.c#L1432-L1497
[2]: 
https://github.com/DPDK/dpdk/blob/0c6e27549c/drivers/net/tap/rte_eth_tap.c#L1967-L1973
[3]: https://github.com/openvswitch/ovs/blob/7b8aeadd60/lib/netdev.c#L763-L778

Signed-off-by: Nobuhiro MIKI <[email protected]>
---
 Documentation/topics/dpdk/vdev.rst | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/Documentation/topics/dpdk/vdev.rst 
b/Documentation/topics/dpdk/vdev.rst
index 7bd48165e..848f046cc 100644
--- a/Documentation/topics/dpdk/vdev.rst
+++ b/Documentation/topics/dpdk/vdev.rst
@@ -60,6 +60,13 @@ run::
    $ ovs-vsctl add-port br0 myeth0 -- set Interface myeth0 type=dpdk \
        options:dpdk-devargs=eth_af_packet0,iface=eth0
 
+Also, to add a ``dpdk`` port that uses the ``tap`` DPDK PMD driver, run::
+
+   $ ovs-vsctl add-port br0 myeth0 -- set Interface myeth0 type=dpdk \
+       options:dpdk-devargs="net_tap0,iface=myeth0" options:n_rxq=5
+
+Here, ``n_rxq`` should be the number of PMD threads + 1.
+
 More information on the different types of virtual DPDK PMDs can be found in
 the `DPDK documentation`__.
 
-- 
2.24.4

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to