gve: add XDP metadata support for DQ RDA
Subsystems (4)
Joshua Washington
maintainerPATCH v2 1/1 gve: add XDP metadata support for DQ RDA
Commit 1b42e07af1ee ("gve: Add Rx HWTS metadata to AF_XDP ZC mode") exposes support for the XDP RX timestamping metadata operation in the DQ RDA mode. While the operation works on its own, the intent was to enable XDP metadata support for the queue format as a whole along with it. Currently bfp_xdp_adjust_meta fails because meta_valid is set to false. This change updates xdp_buff preparation to set meta_valid to true, so metadata can be fully used by XDP programs.
--- drivers/net/ethernet/google/gve/gve_rx_dqo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/google/gve/gve_rx_dqo.c +1 -1
@@ -877,7 +877,7 @@ static int gve_rx_dqo(struct napi_struct *napi, struct gve_rx_ring *rx, buf_state->page_info.page_address + buf_state->page_info.page_offset, buf_state->page_info.pad, - buf_len, false); + buf_len, true); gve_xdp.gve = priv; gve_xdp.compl_desc = compl_desc;
Signature · 1 line
2.53.0.851.ga537e3e6e9-goog
Jakub Kicinski
maintainerQuoted 5 lines · On Wed, 18 Mar 2026 12:24:50 -0700 Joshua Washington wrote:
Commit
1b42e07af1ee("gve: Add Rx HWTS metadata toAF_XDPZC mode") exposes support for the XDP RX timestamping metadata operation in the DQ RDA mode. While the operation works on its own, the intent was to enable XDP metadata support for the queue format as a whole along with it. Currentlybfp_xdp_adjust_metafails becausemeta_validis set to false.
bfp -> bpf
Quoted 15 lines
This change updates
xdp_buffpreparation to setmeta_validto true, so metadata can be fully used by XDP programs.Reviewed-by Harshitha Ramamurthy <[email protected]>Reviewed-by Jordan Rhee <[email protected]>Signed-off-by Joshua Washington <[email protected]>--- drivers/net/ethernet/google/gve/gve_rx_dqo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/ethernet/google/gve/gve_rx_dqo.c +0
-0
drivers/net/ethernet/google/gve/gve_rx_dqo.c static int gve_rx_dqo(struct napi_struct *napi, struct gve_rx_ring *rx, · line 883
Quoted 8 lines
drivers/net/ethernet/google/gve/gve_rx_dqo.c +1
-1@@ -877,7 +877,7 @@ static int gve_rx_dqo(struct napi_struct *napi, struct gve_rx_ring *rx, buf_state->page_info.page_address + buf_state->page_info.page_offset, buf_state->page_info.pad, - buf_len, false); + buf_len, true); gve_xdp.gve = priv; gve_xdp.compl_desc = compl_desc;
AI says:
While this allows XDP programs to write custom metadata via bpf_xdp_adjust_meta(), does the driver correctly propagate this metadata to the SKB after XDP_PASS?
https://sashiko.dev/#/patchset/20260318192450.3400774-1-joshwash%40google.com
Signature · 1 line
pw-bot: cr
Joshua Washington
maintainerQuoted 9 lines · Jakub Kicinski
Quoted 5 lines · On Wed, 18 Mar 2026 12:24:50 -0700 Joshua Washington wrote:
Commit
1b42e07af1ee("gve: Add Rx HWTS metadata toAF_XDPZC mode") exposes support for the XDP RX timestamping metadata operation in the DQ RDA mode. While the operation works on its own, the intent was to enable XDP metadata support for the queue format as a whole along with it. Currentlybfp_xdp_adjust_metafails becausemeta_validis set to false.bfp -> bpf
Will make this change in V3.
Quoted 27 lines
Quoted 16 lines
This change updates
xdp_buffpreparation to setmeta_validto true, so metadata can be fully used by XDP programs.Reviewed-by Harshitha Ramamurthy <[email protected]>Reviewed-by Jordan Rhee <[email protected]>Signed-off-by Joshua Washington <[email protected]>--- drivers/net/ethernet/google/gve/gve_rx_dqo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/ethernet/google/gve/gve_rx_dqo.c +0
-0drivers/net/ethernet/google/gve/gve_rx_dqo.c static int gve_rx_dqo(struct napi_struct *napi, struct gve_rx_ring *rx, · line 883
Quoted 8 lines
drivers/net/ethernet/google/gve/gve_rx_dqo.c +1
-1@@ -877,7 +877,7 @@ static int gve_rx_dqo(struct napi_struct *napi, struct gve_rx_ring *rx, buf_state->page_info.page_address + buf_state->page_info.page_offset, buf_state->page_info.pad, - buf_len, false); + buf_len, true); gve_xdp.gve = priv; gve_xdp.compl_desc = compl_desc;AI says:
Quoted 7 lines
While this allows XDP programs to write custom metadata via
bpf_xdp_adjust_meta(), does the driver correctly propagate this metadata to the SKB afterXDP_PASS?https://sashiko.dev/#/patchset/20260318192450.3400774-1-joshwash%40google.com
--
pw-bot: cr
Thanks for bringing this to my attention. I'll introduce a new patch updating the XDP_PASS paths to make use of xdp_build_skb kernel methods, which should handle metadata implicitly. Besides commonization, this also removes an extra copy in the XDP_PASS case for copy mode XDP.