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: 62aa3246f4 ("net: ti: icssg-prueth: Add XDP support")
Signed-off-by: Meghana Malladi <m-malladi@ti.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://patch.msgid.link/20250506110546.4065715-2-m-malladi@ti.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
f5c79ffdc2
commit
e5641daa0e
@@ -1109,11 +1109,6 @@ static int emac_xdp_xmit(struct net_device *dev, int n, struct xdp_frame **frame
|
||||
static int emac_xdp_setup(struct prueth_emac *emac, struct netdev_bpf *bpf)
|
||||
{
|
||||
struct bpf_prog *prog = bpf->prog;
|
||||
xdp_features_t val;
|
||||
|
||||
val = NETDEV_XDP_ACT_BASIC | NETDEV_XDP_ACT_REDIRECT |
|
||||
NETDEV_XDP_ACT_NDO_XMIT;
|
||||
xdp_set_features_flag(emac->ndev, val);
|
||||
|
||||
if (!emac->xdpi.prog && !prog)
|
||||
return 0;
|
||||
@@ -1291,6 +1286,10 @@ static int prueth_netdev_init(struct prueth *prueth,
|
||||
ndev->hw_features = NETIF_F_SG;
|
||||
ndev->features = ndev->hw_features | NETIF_F_HW_VLAN_CTAG_FILTER;
|
||||
ndev->hw_features |= NETIF_PRUETH_HSR_OFFLOAD_FEATURES;
|
||||
xdp_set_features_flag(ndev,
|
||||
NETDEV_XDP_ACT_BASIC |
|
||||
NETDEV_XDP_ACT_REDIRECT |
|
||||
NETDEV_XDP_ACT_NDO_XMIT);
|
||||
|
||||
netif_napi_add(ndev, &emac->napi_rx, icssg_napi_rx_poll);
|
||||
hrtimer_setup(&emac->rx_hrtimer, &emac_rx_timer_callback, CLOCK_MONOTONIC,
|
||||
|
||||
Reference in New Issue
Block a user