]> Git Repo - linux.git/commitdiff
net/mlx5e: clear xdp features on non-uplink representors
authorWilliam Tu <[email protected]>
Thu, 7 Nov 2024 18:35:25 +0000 (20:35 +0200)
committerJakub Kicinski <[email protected]>
Tue, 12 Nov 2024 03:23:38 +0000 (19:23 -0800)
Non-uplink representor port does not support XDP. The patch clears
the xdp feature by checking the net_device_ops.ndo_bpf is set or not.

Verify using the netlink tool:
$ tools/net/ynl/cli.py --spec Documentation/netlink/specs/netdev.yaml --dump dev-get

Representor netdev before the patch:
{'ifindex': 8,
  'xdp-features': {'basic',
                   'ndo-xmit',
                   'ndo-xmit-sg',
                   'redirect',
                   'rx-sg',
                   'xsk-zerocopy'},
  'xdp-rx-metadata-features': set(),
  'xdp-zc-max-segs': 1,
  'xsk-features': set()},
With the patch:
 {'ifindex': 8,
  'xdp-features': set(),
  'xdp-rx-metadata-features': set(),
  'xsk-features': set()},

Fixes: 4d5ab0ad964d ("net/mlx5e: take into account device reconfiguration for xdp_features flag")
Signed-off-by: William Tu <[email protected]>
Signed-off-by: Tariq Toukan <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
drivers/net/ethernet/mellanox/mlx5/core/en_main.c

index e601324a690a2b4d87d7340e357f5f7e2c64c82d..13a3fa8dc0cb093e99d3b48957b3e40724bfa188 100644 (file)
@@ -4267,7 +4267,8 @@ void mlx5e_set_xdp_feature(struct net_device *netdev)
        struct mlx5e_params *params = &priv->channels.params;
        xdp_features_t val;
 
-       if (params->packet_merge.type != MLX5E_PACKET_MERGE_NONE) {
+       if (!netdev->netdev_ops->ndo_bpf ||
+           params->packet_merge.type != MLX5E_PACKET_MERGE_NONE) {
                xdp_clear_features_flag(netdev);
                return;
        }
This page took 0.089095 seconds and 4 git commands to generate.