Message ID | 168132893055.340624.16209448340644513469.stgit@firesoul (mailing list archive) |
---|---|
State | Accepted |
Commit | 96b1a098f3db06223a6b6268e756f980d5c07f10 |
Delegated to: | BPF |
Headers | show |
Series | XDP-hints: API change for RX-hash kfunc bpf_xdp_metadata_rx_hash | expand |
diff --git a/drivers/net/veth.c b/drivers/net/veth.c index 424e8876a16b..e1b38fbf1dd9 100644 --- a/drivers/net/veth.c +++ b/drivers/net/veth.c @@ -1652,11 +1652,14 @@ static int veth_xdp_rx_hash(const struct xdp_md *ctx, u32 *hash, enum xdp_rss_hash_type *rss_type) { struct veth_xdp_buff *_ctx = (void *)ctx; + struct sk_buff *skb = _ctx->skb; - if (!_ctx->skb) + if (!skb) return -ENODATA; - *hash = skb_get_hash(_ctx->skb); + *hash = skb_get_hash(skb); + *rss_type = skb->l4_hash ? XDP_RSS_TYPE_L4_ANY : XDP_RSS_TYPE_NONE; + return 0; }