]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: lan966x: Add define for number of priority queues NUM_PRIO_QUEUES
authorHoratiu Vultur <horatiu.vultur@microchip.com>
Wed, 21 Sep 2022 12:25:35 +0000 (14:25 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 23 Sep 2022 11:31:26 +0000 (12:31 +0100)
Add a define for the number of priority queues on lan966x. Because there
will be more checks for this, so instead of using hardcoded value all
over the place add a define for this.

Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/microchip/lan966x/lan966x_main.c
drivers/net/ethernet/microchip/lan966x/lan966x_main.h

index 371fa995e9e01e3759f926eacb36f1377e225a35..ee9b8ebba6d0a2cb9cee4f10e5388034c84e3508 100644 (file)
@@ -738,7 +738,8 @@ static int lan966x_probe_port(struct lan966x *lan966x, u32 p,
                return -EINVAL;
 
        dev = devm_alloc_etherdev_mqs(lan966x->dev,
-                                     sizeof(struct lan966x_port), 8, 1);
+                                     sizeof(struct lan966x_port),
+                                     NUM_PRIO_QUEUES, 1);
        if (!dev)
                return -ENOMEM;
 
index 6135d311c407739b238827b4cce876c4e0ef0b7c..a5d5987852d46e30ad9846cd45365be5ec920fb5 100644 (file)
@@ -36,6 +36,7 @@
 
 #define NUM_PHYS_PORTS                 8
 #define CPU_PORT                       8
+#define NUM_PRIO_QUEUES                        8
 
 /* Reserved PGIDs */
 #define PGID_CPU                       (PGID_AGGR - 6)