On 3/11/2024 7:45 PM, Stephen Hemminger wrote: > The TAP device can use same file descriptopr for both rx and tx queues. > This allows up to 8 queues (versus 4). > > Signed-off-by: Stephen Hemminger <step...@networkplumber.org> > --- > v4 - fix typos reported by check patch > > drivers/net/tap/meson.build | 2 +- > drivers/net/tap/rte_eth_tap.c | 197 +++++++++++++++------------------- > drivers/net/tap/rte_eth_tap.h | 3 +- > drivers/net/tap/tap_flow.c | 3 +- > drivers/net/tap/tap_intr.c | 7 +- > 5 files changed, 92 insertions(+), 120 deletions(-) > > diff --git a/drivers/net/tap/meson.build b/drivers/net/tap/meson.build > index 5099ccdff11b..9cd124d53e23 100644 > --- a/drivers/net/tap/meson.build > +++ b/drivers/net/tap/meson.build > @@ -16,7 +16,7 @@ sources = files( > > deps = ['bus_vdev', 'gso', 'hash'] > > -cflags += '-DTAP_MAX_QUEUES=16' > +cflags += '-DTAP_MAX_QUEUES=8' >
OK to merge file descriptors instead of duplicating them. But we have this 4 queue limitation only for multi process case, right? If user is planning to use only with primary, this will reduce the supported queue number. Does it make sense to enforce this limitation for secondary only and keep TAP_MAX_QUEUES same? So for multi process usecase supported queue number will be 8, for primary only use case it will remain 16. <...> > @@ -1482,52 +1480,34 @@ tap_setup_queue(struct rte_eth_dev *dev, > uint16_t qid, > int is_rx) > { > - int ret; > - int *fd; > - int *other_fd; > - const char *dir; > + int fd, ret; > struct pmd_internals *pmd = dev->data->dev_private; > struct pmd_process_private *process_private = dev->process_private; > struct rx_queue *rx = &internals->rxq[qid]; > struct tx_queue *tx = &internals->txq[qid]; > - struct rte_gso_ctx *gso_ctx; > + struct rte_gso_ctx *gso_ctx = NULL; > + const char *dir = is_rx ? "rx" : "tx"; > > - if (is_rx) { > - fd = &process_private->rxq_fds[qid]; > - other_fd = &process_private->txq_fds[qid]; > - dir = "rx"; > - gso_ctx = NULL; > - } else { > - fd = &process_private->txq_fds[qid]; > - other_fd = &process_private->rxq_fds[qid]; > - dir = "tx"; > + if (is_rx) > gso_ctx = &tx->gso_ctx; > Should this be 'if (!is_rx)' ?