Skip to content

Commit

Permalink
libxdp: Supress unnecessary warning when converting xdp flags.
Browse files Browse the repository at this point in the history
Signed-off-by: Martzki <570213867@qq.com>
  • Loading branch information
Martzki authored and tohojo committed Feb 3, 2023
1 parent 5074abc commit 11ed296
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/libxdp/xsk.c
Original file line number Diff line number Diff line change
Expand Up @@ -380,12 +380,10 @@ static int xsk_init_xsk_struct(struct xsk_socket *xsk, int ifindex)
return 0;
}

#define XDP_FLAGS_SUPPORTED (XDP_FLAGS_SKB_MODE | XDP_FLAGS_DRV_MODE | XDP_FLAGS_HW_MODE)

static enum xdp_attach_mode xsk_convert_xdp_flags(__u32 xdp_flags)
{
if (xdp_flags & ~XDP_FLAGS_SUPPORTED)
pr_warn("XDP flag not supported by libxdp.\n");
if (xdp_flags & ~XDP_FLAGS_MASK)
pr_warn("XDP flag: 0x%x contains flags not supported by libxdp.\n", xdp_flags);

if (xdp_flags & XDP_FLAGS_SKB_MODE)
return XDP_MODE_SKB;
Expand Down

0 comments on commit 11ed296

Please sign in to comment.