net: rework setup_tc ndo op to consume general tc operand
[platform/kernel/linux-starfive.git] / drivers / net / ethernet / mellanox / mlx4 / en_netdev.c
index 0c7e3f6..01d6a96 100644 (file)
@@ -69,6 +69,15 @@ int mlx4_en_setup_tc(struct net_device *dev, u8 up)
        return 0;
 }
 
+static int __mlx4_en_setup_tc(struct net_device *dev, u32 handle, __be16 proto,
+                             struct tc_to_netdev *tc)
+{
+       if (handle != TC_H_ROOT || tc->type != TC_SETUP_MQPRIO)
+               return -EINVAL;
+
+       return mlx4_en_setup_tc(dev, tc->tc);
+}
+
 #ifdef CONFIG_RFS_ACCEL
 
 struct mlx4_en_filter {
@@ -2466,7 +2475,7 @@ static const struct net_device_ops mlx4_netdev_ops = {
 #endif
        .ndo_set_features       = mlx4_en_set_features,
        .ndo_fix_features       = mlx4_en_fix_features,
-       .ndo_setup_tc           = mlx4_en_setup_tc,
+       .ndo_setup_tc           = __mlx4_en_setup_tc,
 #ifdef CONFIG_RFS_ACCEL
        .ndo_rx_flow_steer      = mlx4_en_filter_rfs,
 #endif
@@ -2504,7 +2513,7 @@ static const struct net_device_ops mlx4_netdev_ops_master = {
 #endif
        .ndo_set_features       = mlx4_en_set_features,
        .ndo_fix_features       = mlx4_en_fix_features,
-       .ndo_setup_tc           = mlx4_en_setup_tc,
+       .ndo_setup_tc           = __mlx4_en_setup_tc,
 #ifdef CONFIG_RFS_ACCEL
        .ndo_rx_flow_steer      = mlx4_en_filter_rfs,
 #endif