openwrt/package/kernel/qca-nss-dp/patches/0018-nss-dp-adapt-to-netif_napi_add-changes.patch
Robert Marko 87b03d9961
kernel: qca-nss-dp: add kernel 6.1 support
Add the required changes for kernel 6.1 support.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-05-28 08:57:08 +02:00

85 lines
3.2 KiB
Diff

From ba748ab91a62db57f9bdf69dd306e6557315db85 Mon Sep 17 00:00:00 2001
From: Robert Marko <robimarko@gmail.com>
Date: Mon, 3 Oct 2022 23:05:14 +0200
Subject: [PATCH] nss-dp: adapt to netif_napi_add() changes
netif_napi_add() removed the weight argument and just uses the default
NAPI_POLL_WEIGHT in background, so for those requiring custom weight use
netif_napi_add_weight() instead.
Signed-off-by: Robert Marko <robimarko@gmail.com>
---
hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c | 6 +++++-
hal/dp_ops/edma_dp/edma_v2/edma_cfg_rx.c | 8 +++++++-
hal/dp_ops/edma_dp/edma_v2/edma_cfg_tx.c | 7 ++++++-
hal/dp_ops/syn_gmac_dp/syn_dp.c | 5 +++++
4 files changed, 23 insertions(+), 3 deletions(-)
--- a/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c
+++ b/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c
@@ -838,8 +838,12 @@ static int edma_register_netdevice(struc
* NAPI add
*/
if (!edma_hw.napi_added) {
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
netif_napi_add(netdev, &edma_hw.napi, edma_napi,
- NAPI_POLL_WEIGHT);
+ NAPI_POLL_WEIGHT);
+#else
+ netif_napi_add(netdev, &edma_hw.napi, edma_napi);
+#endif
/*
* Register the interrupt handlers and enable interrupts
*/
--- a/hal/dp_ops/edma_dp/edma_v2/edma_cfg_rx.c
+++ b/hal/dp_ops/edma_dp/edma_v2/edma_cfg_rx.c
@@ -1097,8 +1097,14 @@ void edma_cfg_rx_napi_add(struct edma_gb
for (i = 0; i < egc->num_rxdesc_rings; i++) {
struct edma_rxdesc_ring *rxdesc_ring = &egc->rxdesc_rings[i];
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
netif_napi_add(netdev, &rxdesc_ring->napi,
- edma_rx_napi_poll, nss_dp_rx_napi_budget);
+ edma_rx_napi_poll, nss_dp_rx_napi_budget);
+
+#else
+ netif_napi_add_weight(netdev, &rxdesc_ring->napi,
+ edma_rx_napi_poll, nss_dp_rx_napi_budget);
+#endif
rxdesc_ring->napi_added = true;
}
edma_info("%s: Rx NAPI budget: %d\n", netdev->name, nss_dp_rx_napi_budget);
--- a/hal/dp_ops/edma_dp/edma_v2/edma_cfg_tx.c
+++ b/hal/dp_ops/edma_dp/edma_v2/edma_cfg_tx.c
@@ -672,8 +672,13 @@ void edma_cfg_tx_napi_add(struct edma_gb
for (i = 0; i < egc->num_txcmpl_rings; i++) {
struct edma_txcmpl_ring *txcmpl_ring = &egc->txcmpl_rings[i];
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
netif_napi_add(netdev, &txcmpl_ring->napi,
- edma_tx_napi_poll, nss_dp_tx_napi_budget);
+ edma_tx_napi_poll, nss_dp_tx_napi_budget);
+#else
+ netif_napi_add_weight(netdev, &txcmpl_ring->napi,
+ edma_tx_napi_poll, nss_dp_tx_napi_budget);
+#endif
txcmpl_ring->napi_added = true;
}
edma_info("Tx NAPI budget: %d\n", nss_dp_tx_napi_budget);
--- a/hal/dp_ops/syn_gmac_dp/syn_dp.c
+++ b/hal/dp_ops/syn_gmac_dp/syn_dp.c
@@ -189,8 +189,13 @@ static int syn_dp_if_init(struct nss_dp_
}
if (!dev_info->napi_added) {
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
netif_napi_add(netdev, &rx_info->napi_rx, syn_dp_napi_poll_rx, SYN_DP_NAPI_BUDGET_RX);
netif_napi_add(netdev, &tx_info->napi_tx, syn_dp_napi_poll_tx, SYN_DP_NAPI_BUDGET_TX);
+#else
+ netif_napi_add_weight(netdev, &rx_info->napi_rx, syn_dp_napi_poll_rx, SYN_DP_NAPI_BUDGET_RX);
+ netif_napi_add_weight(netdev, &tx_info->napi_tx, syn_dp_napi_poll_tx, SYN_DP_NAPI_BUDGET_TX);
+#endif
/*
* Requesting irq. Set IRQ_DISABLE_UNLAZY flag, this flag