kernel: bump 5.15 to 5.15.67
[openwrt/openwrt.git] / target / linux / mvebu / patches-5.15 / 702-net-next-ethernet-marvell-mvnetaMQPrioOffload.patch
1 From 75fa71e3acadbb4ab5eda18505277eb9a1f69b23 Mon Sep 17 00:00:00 2001
2 From: Maxime Chevallier <maxime.chevallier@bootlin.com>
3 Date: Fri, 26 Nov 2021 12:20:53 +0100
4 Subject: net: mvneta: Use struct tc_mqprio_qopt_offload for MQPrio
5 configuration
6
7 The struct tc_mqprio_qopt_offload is a container for struct tc_mqprio_qopt,
8 that allows passing extra parameters, such as traffic shaping. This commit
9 converts the current mqprio code to that new struct.
10
11 Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
12 Signed-off-by: David S. Miller <davem@davemloft.net>
13 ---
14 drivers/net/ethernet/marvell/mvneta.c | 17 ++++++++++-------
15 1 file changed, 10 insertions(+), 7 deletions(-)
16
17 (limited to 'drivers/net/ethernet/marvell/mvneta.c')
18
19 --- a/drivers/net/ethernet/marvell/mvneta.c
20 +++ b/drivers/net/ethernet/marvell/mvneta.c
21 @@ -38,6 +38,7 @@
22 #include <net/ipv6.h>
23 #include <net/tso.h>
24 #include <net/page_pool.h>
25 +#include <net/pkt_cls.h>
26 #include <linux/bpf_trace.h>
27
28 /* Registers */
29 @@ -4903,14 +4904,14 @@ static void mvneta_setup_rx_prio_map(str
30 }
31
32 static int mvneta_setup_mqprio(struct net_device *dev,
33 - struct tc_mqprio_qopt *qopt)
34 + struct tc_mqprio_qopt_offload *mqprio)
35 {
36 struct mvneta_port *pp = netdev_priv(dev);
37 u8 num_tc;
38 int i;
39
40 - qopt->hw = TC_MQPRIO_HW_OFFLOAD_TCS;
41 - num_tc = qopt->num_tc;
42 + mqprio->qopt.hw = TC_MQPRIO_HW_OFFLOAD_TCS;
43 + num_tc = mqprio->qopt.num_tc;
44
45 if (num_tc > rxq_number)
46 return -EINVAL;
47 @@ -4921,13 +4922,15 @@ static int mvneta_setup_mqprio(struct ne
48 return 0;
49 }
50
51 - memcpy(pp->prio_tc_map, qopt->prio_tc_map, sizeof(pp->prio_tc_map));
52 + memcpy(pp->prio_tc_map, mqprio->qopt.prio_tc_map,
53 + sizeof(pp->prio_tc_map));
54
55 mvneta_setup_rx_prio_map(pp);
56
57 - netdev_set_num_tc(dev, qopt->num_tc);
58 - for (i = 0; i < qopt->num_tc; i++)
59 - netdev_set_tc_queue(dev, i, qopt->count[i], qopt->offset[i]);
60 + netdev_set_num_tc(dev, mqprio->qopt.num_tc);
61 + for (i = 0; i < mqprio->qopt.num_tc; i++)
62 + netdev_set_tc_queue(dev, i, mqprio->qopt.count[i],
63 + mqprio->qopt.offset[i]);
64
65 return 0;
66 }