]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: fbnic: Fix page chunking logic when PAGE_SIZE > 4K
authorDimitri Daskalakis <dimitri.daskalakis1@gmail.com>
Mon, 13 Oct 2025 21:14:48 +0000 (14:14 -0700)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 16 Oct 2025 09:36:29 +0000 (11:36 +0200)
The HW always works on a 4K page size. When the OS supports larger
pages, we fragment them across multiple BDQ descriptors.
We were not properly incrementing the descriptor, which resulted in us
specifying the last chunks id/addr and then 15 zero descriptors. This
would cause packet loss and driver crashes. This is not a fix since the
Kconfig prevents use outside of x86.

Signed-off-by: Dimitri Daskalakis <dimitri.daskalakis1@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20251013211449.1377054-2-dimitri.daskalakis1@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/meta/fbnic/fbnic_txrx.c

index b1e8ce89870f73c76568fdc7f46fd879aa19762a..57e18a68f5d2348f650a72175c44d6796ee5cf96 100644 (file)
@@ -887,6 +887,7 @@ static void fbnic_bd_prep(struct fbnic_ring *bdq, u16 id, netmem_ref netmem)
                *bdq_desc = cpu_to_le64(bd);
                bd += FIELD_PREP(FBNIC_BD_DESC_ADDR_MASK, 1) |
                      FIELD_PREP(FBNIC_BD_DESC_ID_MASK, 1);
+               bdq_desc++;
        } while (--i);
 }