Skip to content

Commit e5641da

Browse files
MeghanaMalladiTIkuba-moo
authored andcommitted
net: ti: icssg-prueth: Set XDP feature flags for ndev
xdp_features demonstrates what all XDP capabilities are supported on a given network device. The driver needs to set these xdp_features flag to let the network stack know what XDP features a given driver is supporting. These flags need to be set for a given ndev irrespective of any XDP program being loaded or not. Fixes: 62aa324 ("net: ti: icssg-prueth: Add XDP support") Signed-off-by: Meghana Malladi <[email protected]> Reviewed-by: Jacob Keller <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent f5c79ff commit e5641da

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

drivers/net/ethernet/ti/icssg/icssg_prueth.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,11 +1109,6 @@ static int emac_xdp_xmit(struct net_device *dev, int n, struct xdp_frame **frame
11091109
static int emac_xdp_setup(struct prueth_emac *emac, struct netdev_bpf *bpf)
11101110
{
11111111
struct bpf_prog *prog = bpf->prog;
1112-
xdp_features_t val;
1113-
1114-
val = NETDEV_XDP_ACT_BASIC | NETDEV_XDP_ACT_REDIRECT |
1115-
NETDEV_XDP_ACT_NDO_XMIT;
1116-
xdp_set_features_flag(emac->ndev, val);
11171112

11181113
if (!emac->xdpi.prog && !prog)
11191114
return 0;
@@ -1291,6 +1286,10 @@ static int prueth_netdev_init(struct prueth *prueth,
12911286
ndev->hw_features = NETIF_F_SG;
12921287
ndev->features = ndev->hw_features | NETIF_F_HW_VLAN_CTAG_FILTER;
12931288
ndev->hw_features |= NETIF_PRUETH_HSR_OFFLOAD_FEATURES;
1289+
xdp_set_features_flag(ndev,
1290+
NETDEV_XDP_ACT_BASIC |
1291+
NETDEV_XDP_ACT_REDIRECT |
1292+
NETDEV_XDP_ACT_NDO_XMIT);
12941293

12951294
netif_napi_add(ndev, &emac->napi_rx, icssg_napi_rx_poll);
12961295
hrtimer_setup(&emac->rx_hrtimer, &emac_rx_timer_callback, CLOCK_MONOTONIC,

0 commit comments

Comments
 (0)