openwrt/target/linux/mvebu/patches-5.15/702-net-next-ethernet-marvell-mvnetaMQPrioOffload.patch
Rui Salvaterra 7d139bd5f3 mvebu: refresh 5.15 patches
Deleted (upstreamed):
303-linksys_hardcode_nand_ecc_settings.patch [1]

Deleted (not needed):
314-arm64-dts-uDPU-switch-PHY-operation-mode-to-2500base.patch [2]

Manually rebased:
700-mvneta-tx-queue-workaround.patch

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=4daff3e5b42422cd4af758cc7768223d2b7f6e14
[2] https://git.openwrt.org/?p=openwrt/openwrt.git;a=commitdiff;h=7f73acade0cde61341cb77e0dc74de51ac059d4f

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2022-08-16 22:38:31 +01:00

67 lines
2.0 KiB
Diff

From 75fa71e3acadbb4ab5eda18505277eb9a1f69b23 Mon Sep 17 00:00:00 2001
From: Maxime Chevallier <maxime.chevallier@bootlin.com>
Date: Fri, 26 Nov 2021 12:20:53 +0100
Subject: net: mvneta: Use struct tc_mqprio_qopt_offload for MQPrio
configuration
The struct tc_mqprio_qopt_offload is a container for struct tc_mqprio_qopt,
that allows passing extra parameters, such as traffic shaping. This commit
converts the current mqprio code to that new struct.
Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
drivers/net/ethernet/marvell/mvneta.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
(limited to 'drivers/net/ethernet/marvell/mvneta.c')
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -38,6 +38,7 @@
#include <net/ipv6.h>
#include <net/tso.h>
#include <net/page_pool.h>
+#include <net/pkt_cls.h>
#include <linux/bpf_trace.h>
/* Registers */
@@ -4947,14 +4948,14 @@ static void mvneta_setup_rx_prio_map(str
}
static int mvneta_setup_mqprio(struct net_device *dev,
- struct tc_mqprio_qopt *qopt)
+ struct tc_mqprio_qopt_offload *mqprio)
{
struct mvneta_port *pp = netdev_priv(dev);
u8 num_tc;
int i;
- qopt->hw = TC_MQPRIO_HW_OFFLOAD_TCS;
- num_tc = qopt->num_tc;
+ mqprio->qopt.hw = TC_MQPRIO_HW_OFFLOAD_TCS;
+ num_tc = mqprio->qopt.num_tc;
if (num_tc > rxq_number)
return -EINVAL;
@@ -4965,13 +4966,15 @@ static int mvneta_setup_mqprio(struct ne
return 0;
}
- memcpy(pp->prio_tc_map, qopt->prio_tc_map, sizeof(pp->prio_tc_map));
+ memcpy(pp->prio_tc_map, mqprio->qopt.prio_tc_map,
+ sizeof(pp->prio_tc_map));
mvneta_setup_rx_prio_map(pp);
- netdev_set_num_tc(dev, qopt->num_tc);
- for (i = 0; i < qopt->num_tc; i++)
- netdev_set_tc_queue(dev, i, qopt->count[i], qopt->offset[i]);
+ netdev_set_num_tc(dev, mqprio->qopt.num_tc);
+ for (i = 0; i < mqprio->qopt.num_tc; i++)
+ netdev_set_tc_queue(dev, i, mqprio->qopt.count[i],
+ mqprio->qopt.offset[i]);
return 0;
}