> -----Original Message-----
> From: Tianyi Gao <[email protected]>
> Sent: Tuesday, November 10, 2026 4:57 AM
> To: [email protected]; [email protected]; Alexei Starovoitov
> <[email protected]>; Daniel Borkmann <[email protected]>; Andrii
> Nakryiko <[email protected]>; Martin KaFai Lau <[email protected]>;
> Jakub Kicinski <[email protected]>; Jesper Dangaard Brouer
> <[email protected]>
> Cc: John Fastabend <[email protected]>; Stanislav Fomichev
> <[email protected]>; Lorenzo Bianconi <[email protected]>; Vladimir
> Vdovin <[email protected]>; David S. Miller <[email protected]>; Eric
> Dumazet <[email protected]>; Paolo Abeni <[email protected]>; Simon
> Horman <[email protected]>; Andrew Lunn <[email protected]>; Donald
> Hunter <[email protected]>; Eduard Zingerman <[email protected]>;
> Kumar Kartikeya Dwivedi <[email protected]>; Song Liu <[email protected]>;
> Yonghong Song <[email protected]>; Jiri Olsa <[email protected]>;
> Emil Tsalapatis <[email protected]>; Ihor Solodrai
> <[email protected]>; Nguyen, Anthony L
> <[email protected]>; Kitszel, Przemyslaw
> <[email protected]>; Fijalkowski, Maciej
> <[email protected]>; Lobakin, Aleksander
> <[email protected]>; Karlsson, Magnus
> <[email protected]>; Vyavahare, Tushar
> <[email protected]>; Jason Xing <[email protected]>;
> Nikolay Aleksandrov <[email protected]>; Madalin Bucur
> <[email protected]>; Ioana Ciornei <[email protected]>; Jonathan
> Corbet <[email protected]>; Shuah Khan <[email protected]>; Shuah
> Khan <[email protected]>; Randy Dunlap <[email protected]>; Nathan
> Chancellor <[email protected]>; Nick Desaulniers
> <[email protected]>; Bill Wendling <[email protected]>; Justin
> Stitt <[email protected]>; Chris J Arges <[email protected]>;
> Jakub Sitnicki <[email protected]>; [email protected]; linux-
> [email protected]; [email protected];
> [email protected]; [email protected]; Tianyi Gao
> <[email protected]>
> Subject: [PATCH bpf-next 02/15] net: dpaa, dpaa2: clear the skb core
> extension flag
> 
> dpaa_run_xdp() and dpaa2_eth_run_xdp() move data_hard_start to the start
> of the buffer after the XDP program runs and before XDP_REDIRECT.
> xdp_skb_ext() then returns a different address from the one used while
> storing the entries. These drivers have not implemented the XDP RX
> metadata kfuncs. Hence they now clear the XDP_FLAGS_HAS_SKB_EXT flag
> before XDP_REDIRECT, and their redirected frames carry no stored
> entries.
> 
> With the A050385 erratum workaround, dpaa already moves data_hard_start
> before the XDP program runs, so the entries remain valid. The flag is
> cleared on that path too, to keep the change simple. This can change
> when dpaa implements the XDP RX metadata kfuncs.
> 
> Signed-off-by: Tianyi Gao <[email protected]>
> ---
>  drivers/net/ethernet/freescale/dpaa/dpaa_eth.c   | 2 ++
>  drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 2 ++
>  2 files changed, 4 insertions(+)
> 
> diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
> b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
> index ad2d8256eb8d..4cafc0b84dc9 100644
> --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
> +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
> @@ -2654,6 +2654,8 @@ static u32 dpaa_run_xdp(struct dpaa_priv *priv,
> struct qm_fd *fd, void *vaddr,
>               /* Allow redirect to use the full headroom */
>               xdp.data_hard_start = vaddr;
>               xdp.frame_sz = DPAA_BP_RAW_SIZE;
> +             /* data_hard_start moves, so the stored entries are lost
> */
> +             xdp_buff_clear_skb_ext_flag(&xdp);
> 
>               err = xdp_do_redirect(priv->net_dev, &xdp, xdp_prog);
>               if (err) {
> diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
> b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
> index 7227a35dfaf2..fcefdc9daf2b 100644
> --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
> +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
> @@ -472,6 +472,8 @@ static u32 dpaa2_eth_run_xdp(struct dpaa2_eth_priv
> *priv,
>               /* Allow redirect use of full headroom */
>               xdp.data_hard_start = vaddr;
>               xdp.frame_sz = DPAA2_ETH_RX_BUF_RAW_SIZE;
> +             /* data_hard_start moves, so the stored entries are lost
> */
> +             xdp_buff_clear_skb_ext_flag(&xdp);
> 
>               err = xdp_do_redirect(priv->net_dev, &xdp, xdp_prog);
>               if (unlikely(err)) {
> --
> 2.56.0

Reviewed-by: Aleksandr Loktionov <[email protected]>

Reply via email to