Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

xsk: add usage of XDP features flags

Change necessary condition check for XSK from ndo functions to
xdp features flags.

Signed-off-by: Marek Majtyka <alardam@gmail.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://lore.kernel.org/r/45a98ec67b4556a6a22dfd85df3eb8276beeeb74.1675245258.git.lorenzo@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>

authored by

Marek Majtyka and committed by
Alexei Starovoitov
0ae0cb2b 66c0e13a

+5 -2
+5 -2
net/xdp/xsk_buff_pool.c
··· 140 140 } 141 141 } 142 142 143 + #define NETDEV_XDP_ACT_ZC (NETDEV_XDP_ACT_BASIC | \ 144 + NETDEV_XDP_ACT_REDIRECT | \ 145 + NETDEV_XDP_ACT_XSK_ZEROCOPY) 146 + 143 147 int xp_assign_dev(struct xsk_buff_pool *pool, 144 148 struct net_device *netdev, u16 queue_id, u16 flags) 145 149 { ··· 182 178 /* For copy-mode, we are done. */ 183 179 return 0; 184 180 185 - if (!netdev->netdev_ops->ndo_bpf || 186 - !netdev->netdev_ops->ndo_xsk_wakeup) { 181 + if ((netdev->xdp_features & NETDEV_XDP_ACT_ZC) != NETDEV_XDP_ACT_ZC) { 187 182 err = -EOPNOTSUPP; 188 183 goto err_unreg_pool; 189 184 }