Skip to content

Commit a8781f1

Browse files
committed
net: mana: Add metadata support for xdp mode
jira LE-4385 Rebuild_History Non-Buildable kernel-5.14.0-570.52.1.el9_6 commit-author Lorenzo Bianconi <[email protected]> commit c313d35 Set metadata size building the skb from xdp_buff in mana driver. mana driver sets xdp headroom to XDP_PACKET_HEADROOM so the headroom is large enough to contain xdp_frame and xdp metadata. Please note this patch is just compiled tested. Reviewed-by: Michal Kubiak <[email protected]> Signed-off-by: Lorenzo Bianconi <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> (cherry picked from commit c313d35) Signed-off-by: Jonathan Maple <[email protected]>
1 parent 258114f commit a8781f1

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

drivers/net/ethernet/microsoft/mana/mana_bpf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ u32 mana_run_xdp(struct net_device *ndev, struct mana_rxq *rxq,
9191
goto out;
9292

9393
xdp_init_buff(xdp, PAGE_SIZE, &rxq->xdp_rxq);
94-
xdp_prepare_buff(xdp, buf_va, XDP_PACKET_HEADROOM, pkt_len, false);
94+
xdp_prepare_buff(xdp, buf_va, XDP_PACKET_HEADROOM, pkt_len, true);
9595

9696
act = bpf_prog_run_xdp(prog, xdp);
9797

drivers/net/ethernet/microsoft/mana/mana_en.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1557,8 +1557,12 @@ static struct sk_buff *mana_build_skb(struct mana_rxq *rxq, void *buf_va,
15571557
return NULL;
15581558

15591559
if (xdp->data_hard_start) {
1560+
u32 metasize = xdp->data - xdp->data_meta;
1561+
15601562
skb_reserve(skb, xdp->data - xdp->data_hard_start);
15611563
skb_put(skb, xdp->data_end - xdp->data);
1564+
if (metasize)
1565+
skb_metadata_set(skb, metasize);
15621566
return skb;
15631567
}
15641568

0 commit comments

Comments
 (0)