]> www.infradead.org Git - users/hch/misc.git/commitdiff
octeontx2-pf: Reconfigure RSS table after enabling AF_XDP zerocopy on rx queue
authorSuman Ghosh <sumang@marvell.com>
Thu, 13 Feb 2025 05:31:39 +0000 (11:01 +0530)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 18 Feb 2025 10:36:27 +0000 (11:36 +0100)
RSS table needs to be reconfigured once a rx queue is enabled or
disabled for AF_XDP zerocopy support. After enabling UMEM on a rx queue,
that queue should not be part of RSS queue selection algorithm.
Similarly the queue should be considered again after UMEM is disabled.

Signed-off-by: Suman Ghosh <sumang@marvell.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c
drivers/net/ethernet/marvell/octeontx2/nic/otx2_xsk.c

index 92b0dba07853add0d101a151dac82d67726d361f..6f7c11d59942f181a457af0547b2f5d15874503b 100644 (file)
@@ -331,6 +331,10 @@ int otx2_set_rss_table(struct otx2_nic *pfvf, int ctx_id)
        rss_ctx = rss->rss_ctx[ctx_id];
        /* Get memory to put this msg */
        for (idx = 0; idx < rss->rss_size; idx++) {
+               /* Ignore the queue if AF_XDP zero copy is enabled */
+               if (test_bit(rss_ctx->ind_tbl[idx], pfvf->af_xdp_zc_qidx))
+                       continue;
+
                aq = otx2_mbox_alloc_msg_nix_aq_enq(mbox);
                if (!aq) {
                        /* The shared memory buffer can be full.
index 2d53dc77ef1eff42e2d368cb4e874bc2ee9b17eb..010385b2998869545325eb90c93eb671e623a0b0 100644 (file)
@@ -910,8 +910,12 @@ static int otx2_get_rxfh(struct net_device *dev,
                return -ENOENT;
 
        if (indir) {
-               for (idx = 0; idx < rss->rss_size; idx++)
+               for (idx = 0; idx < rss->rss_size; idx++) {
+                       /* Ignore if the rx queue is AF_XDP zero copy enabled */
+                       if (test_bit(rss_ctx->ind_tbl[idx], pfvf->af_xdp_zc_qidx))
+                               continue;
                        indir[idx] = rss_ctx->ind_tbl[idx];
+               }
        }
        if (rxfh->key)
                memcpy(rxfh->key, rss->key, sizeof(rss->key));
index 894c1e0aea6f110dce80e14a2c90d052687bc74f..3bdee1603facc04b275c60fbcae0412baefce677 100644 (file)
@@ -130,6 +130,8 @@ int otx2_xsk_pool_enable(struct otx2_nic *pf, struct xsk_buff_pool *pool, u16 qi
 
        set_bit(qidx, pf->af_xdp_zc_qidx);
        otx2_clean_up_rq(pf, qidx);
+       /* Reconfigure RSS table as 'qidx' cannot be part of RSS now */
+       otx2_set_rss_table(pf, DEFAULT_RSS_CONTEXT_GROUP);
        /* Kick start the NAPI context so that receiving will start */
        return otx2_xsk_wakeup(pf->netdev, qidx, XDP_WAKEUP_RX);
 }
@@ -146,6 +148,8 @@ int otx2_xsk_pool_disable(struct otx2_nic *pf, u16 qidx)
        otx2_clean_up_rq(pf, qidx);
        clear_bit(qidx, pf->af_xdp_zc_qidx);
        xsk_pool_dma_unmap(pool, DMA_ATTR_SKIP_CPU_SYNC | DMA_ATTR_WEAK_ORDERING);
+       /* Reconfigure RSS table as 'qidx' now need to be part of RSS now */
+       otx2_set_rss_table(pf, DEFAULT_RSS_CONTEXT_GROUP);
 
        return 0;
 }