Skip to content

Commit 9f4b283

Browse files
CCX-Stingraydavem330
authored andcommitted
bnxt: XDP multibuffer enablement
Allow aggregation buffers to be in place in the receive path and allow XDP programs to be attached when using a larger than 4k MTU. v3: Add a check to sure XDP program supports multipage packets. Signed-off-by: Andy Gospodarek <[email protected]> Signed-off-by: Michael Chan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent a7559bc commit 9f4b283

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

drivers/net/ethernet/broadcom/bnxt/bnxt.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1939,8 +1939,7 @@ static int bnxt_rx_pkt(struct bnxt *bp, struct bnxt_cp_ring_info *cpr,
19391939
xdp_active = true;
19401940
}
19411941

1942-
/* skip running XDP prog if there are aggregation bufs */
1943-
if (!agg_bufs && xdp_active) {
1942+
if (xdp_active) {
19441943
if (bnxt_rx_xdp(bp, rxr, cons, xdp, data, &len, event)) {
19451944
rc = 1;
19461945
goto next_rx;

drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,8 +387,9 @@ static int bnxt_xdp_set(struct bnxt *bp, struct bpf_prog *prog)
387387
int tx_xdp = 0, rc, tc;
388388
struct bpf_prog *old;
389389

390-
if (prog && bp->dev->mtu > BNXT_MAX_PAGE_MODE_MTU) {
391-
netdev_warn(dev, "MTU %d larger than largest XDP supported MTU %d.\n",
390+
if (prog && !prog->aux->xdp_has_frags &&
391+
bp->dev->mtu > BNXT_MAX_PAGE_MODE_MTU) {
392+
netdev_warn(dev, "MTU %d larger than %d without XDP frag support.\n",
392393
bp->dev->mtu, BNXT_MAX_PAGE_MODE_MTU);
393394
return -EOPNOTSUPP;
394395
}

0 commit comments

Comments
 (0)