mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-04-16 04:13:31 +00:00
qca-ssdk: revert to QSDK 11.4
This commit is contained in:
parent
4ae038fae6
commit
64099b947a
@ -8,9 +8,9 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=nss-firmware
|
||||
PKG_SOURCE_DATE:=2022-07-13
|
||||
PKG_SOURCE_VERSION:=ade6bff594377c9d9c79b45e39bf104303d919bc
|
||||
PKG_MIRROR_HASH:=fa3868853a9a3c1b6c6999fd5f8672ad5f0588cb7bff98cd9d44ce670a5666db
|
||||
PKG_SOURCE_DATE:=2021-03-12
|
||||
PKG_SOURCE_VERSION:=73f378d6be21a9c20a69b77000dbb54a537006a9
|
||||
PKG_MIRROR_HASH:=0c21afe29002754edf2983bc9e8543dddd722e75bd12e961e300e99a310d1f62
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
@ -22,7 +22,7 @@ PKG_MAINTAINER:=Robert Marko <robimarko@gmail.com>
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
VERSION_PATH=$(PKG_BUILD_DIR)/QCA_Networking_2022.SPF_12.0.0/ED1
|
||||
VERSION_PATH=$(PKG_BUILD_DIR)/QCA_Networking_2020.SPF_11.3/CS
|
||||
|
||||
define Package/nss-firmware-default
|
||||
SECTION:=firmware
|
||||
@ -34,13 +34,13 @@ endef
|
||||
define Package/nss-firmware-ipq6018
|
||||
$(Package/nss-firmware-default)
|
||||
TITLE:=NSS firmware for IPQ6018 devices
|
||||
NSS_ARCHIVE:=$(VERSION_PATH)/IPQ6018.ATH.12.0/BIN-NSS.FW.12.1-022-CP.R.tar.bz2
|
||||
NSS_ARCHIVE:=$(VERSION_PATH)/IPQ6018.ATH.11.3/BIN-NSS.CP.11.3-9-R.tar.bz2
|
||||
endef
|
||||
|
||||
define Package/nss-firmware-ipq8074
|
||||
$(Package/nss-firmware-default)
|
||||
TITLE:=NSS firmware for IPQ8074 devices
|
||||
NSS_ARCHIVE:=$(VERSION_PATH)/IPQ8074.ATH.12.0.0/BIN-NSS.FW.12.1-022-HK.R.tar.bz2
|
||||
NSS_ARCHIVE:=$(VERSION_PATH)/IPQ8074.ATH.11.3/BIN-NSS.HK.11.3-9-R.tar.bz2
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
@ -48,23 +48,21 @@ define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/nss-firmware-ipq6018/install
|
||||
mkdir -p $(PKG_BUILD_DIR)/IPQ6018
|
||||
$(TAR) -C $(PKG_BUILD_DIR)/IPQ6018 -xf $(NSS_ARCHIVE) --strip-components=1
|
||||
$(TAR) -C $(PKG_BUILD_DIR) -xf $(NSS_ARCHIVE)
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/IPQ6018/retail_router0.bin \
|
||||
$(PKG_BUILD_DIR)/BIN-NSS.CP.11.3-9-R/retail_router0.bin \
|
||||
$(1)/lib/firmware/qca-nss0-retail.bin
|
||||
endef
|
||||
|
||||
define Package/nss-firmware-ipq8074/install
|
||||
mkdir -p $(PKG_BUILD_DIR)/IPQ8074
|
||||
$(TAR) -C $(PKG_BUILD_DIR)/IPQ8074 -xf $(NSS_ARCHIVE) --strip-components=1
|
||||
$(TAR) -C $(PKG_BUILD_DIR) -xf $(NSS_ARCHIVE)
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/IPQ8074/retail_router0.bin \
|
||||
$(PKG_BUILD_DIR)/BIN-NSS.HK.11.3-9-R/retail_router0.bin \
|
||||
$(1)/lib/firmware/qca-nss0-retail.bin
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/IPQ8074/retail_router1.bin \
|
||||
$(PKG_BUILD_DIR)/BIN-NSS.HK.11.3-9-R/retail_router1.bin \
|
||||
$(1)/lib/firmware/qca-nss1-retail.bin
|
||||
endef
|
||||
|
||||
|
@ -3,11 +3,11 @@ include $(TOPDIR)/rules.mk
|
||||
PKG_NAME:=qca-nss-clients-64
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE_URL:=https://git.codelinaro.org/clo/qsdk/oss/lklm/nss-clients.git
|
||||
PKG_SOURCE_URL:=https://source.codeaurora.org/quic/cc-qrdk/oss/lklm/nss-clients
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_DATE:=2022-04-23
|
||||
PKG_SOURCE_VERSION:=7e86daa6a51e8c1427a6342cc2076394ea0eab93
|
||||
PKG_MIRROR_HASH:=af8f20110bad3b57e4d9ed179b614f4079b8408c72071db1d7979fc64449f9ab
|
||||
PKG_SOURCE_DATE:=2021-04-29
|
||||
PKG_SOURCE_VERSION:=b93c72c1b72c591c2ddc2f0b24f0e2b457720118
|
||||
PKG_MIRROR_HASH:=fbfba64a364b095ea7c9a24cd7af96b63ab0bc29c179e1628c675aa223c0d063
|
||||
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
@ -17,7 +17,7 @@ define KernelPackage/qca-nss-drv-pppoe-64
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
TITLE:=Kernel driver for NSS (connection manager) - PPPoE
|
||||
DEPENDS:=@(TARGET_ipq60xx||TARGET_ipq807x) +kmod-qca-nss-drv-64 +kmod-ppp +kmod-pppoe
|
||||
DEPENDS:=@TARGET_ipq807x +kmod-qca-nss-drv-64 +kmod-ppp +kmod-pppoe
|
||||
FILES:=$(PKG_BUILD_DIR)/pppoe/qca-nss-pppoe.ko
|
||||
AUTOLOAD:=$(call AutoLoad,51,qca-nss-pppoe)
|
||||
endef
|
||||
@ -31,7 +31,7 @@ define KernelPackage/qca-nss-drv-bridge-mgr-64
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
TITLE:=Kernel driver for NSS bridge manager
|
||||
DEPENDS:=@(LINUX_5_10||LINUX_5_15) @(TARGET_ipq60xx||TARGET_ipq807x) +kmod-qca-nss-drv-64 +kmod-qca-nss-drv-vlan-mgr-64
|
||||
DEPENDS:=@LINUX_5_10 @TARGET_ipq807x +kmod-qca-nss-drv-64 +kmod-qca-nss-drv-vlan-mgr-64
|
||||
FILES:=$(PKG_BUILD_DIR)/bridge/qca-nss-bridge-mgr.ko
|
||||
AUTOLOAD:=$(call AutoLoad,51,qca-nss-bridge-mgr)
|
||||
endef
|
||||
@ -45,7 +45,7 @@ define KernelPackage/qca-nss-drv-vlan-mgr-64
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
TITLE:=Kernel driver for NSS vlan manager
|
||||
DEPENDS:=@(LINUX_5_10||LINUX_5_15) @(TARGET_ipq60xx||TARGET_ipq807x) +kmod-qca-nss-drv-64
|
||||
DEPENDS:=@LINUX_5_10 @TARGET_ipq807x +kmod-qca-nss-drv-64
|
||||
FILES:=$(PKG_BUILD_DIR)/vlan/qca-nss-vlan.ko
|
||||
AUTOLOAD:=$(call AutoLoad,51,qca-nss-vlan)
|
||||
endef
|
||||
|
@ -3,11 +3,11 @@ include $(TOPDIR)/rules.mk
|
||||
PKG_NAME:=qca-nss-dp
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE_URL:=https://git.codelinaro.org/clo/qsdk/oss/lklm/nss-dp.git
|
||||
PKG_SOURCE_URL:=https://source.codeaurora.org/quic/cc-qrdk/oss/lklm/nss-dp
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_DATE:=2022-06-15
|
||||
PKG_SOURCE_VERSION:=1465dd2aa5f5d9bd36d5b6cd24afed7b6e904bda
|
||||
PKG_MIRROR_HASH:=f483a93ca5c05b6ab16d55bd7d130a83964d76fff150f1edfd7d2a5ac2bb48d4
|
||||
PKG_SOURCE_DATE:=2021-03-26
|
||||
PKG_SOURCE_VERSION:=e0c89348d5ad99559ce2fbe15d37b3b5bc66aa03
|
||||
PKG_MIRROR_HASH:=f369f0c3b33b5f4ad6d0a6ad6ac5495f63c9ecaf94e4e7fa345169f3e44fcf45
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
@ -21,7 +21,7 @@ define KernelPackage/qca-nss-dp
|
||||
DEPENDS:=@(TARGET_ipq807x||TARGET_ipq60xx) +kmod-qca-ssdk-nohnat
|
||||
TITLE:=Kernel driver for NSS data plane
|
||||
FILES:=$(PKG_BUILD_DIR)/qca-nss-dp.ko
|
||||
AUTOLOAD:=$(call AutoLoad,31,qca-nss-dp,1)
|
||||
AUTOLOAD:=$(call AutoLoad,31,qca-nss-dp)
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-dp/Description
|
||||
@ -38,16 +38,22 @@ EXTRA_CFLAGS+= \
|
||||
|
||||
NSS_DP_HAL_DIR:=$(PKG_BUILD_DIR)/hal
|
||||
define Build/Configure
|
||||
$(LN) $(NSS_DP_HAL_DIR)/soc_ops/$(CONFIG_TARGET_BOARD)/nss_$(CONFIG_TARGET_BOARD).h \
|
||||
$(LN) $(NSS_DP_HAL_DIR)/arch/$(CONFIG_TARGET_BOARD)/nss_$(CONFIG_TARGET_BOARD).h \
|
||||
$(PKG_BUILD_DIR)/exports/nss_dp_arch.h
|
||||
endef
|
||||
|
||||
ifeq ($(CONFIG_TARGET_BOARD), "ipq807x")
|
||||
SOC="ipq807x_64"
|
||||
else ifeq ($(CONFIG_TARGET_BOARD), "ipq60xx")
|
||||
SOC="ipq60xx_64"
|
||||
endif
|
||||
|
||||
define Build/Compile
|
||||
+$(MAKE) -C "$(LINUX_DIR)" \
|
||||
CROSS_COMPILE="$(TARGET_CROSS)" \
|
||||
ARCH="$(LINUX_KARCH)" \
|
||||
M="$(PKG_BUILD_DIR)" \
|
||||
EXTRA_CFLAGS="$(EXTRA_CFLAGS)" SoC="$(CONFIG_TARGET_BOARD)" \
|
||||
EXTRA_CFLAGS="$(EXTRA_CFLAGS)" SoC="$(SOC)" \
|
||||
$(KERNEL_MAKE_FLAGS) \
|
||||
$(PKG_JOBS) \
|
||||
modules
|
||||
|
@ -5,12 +5,12 @@ Date: Mon, 3 May 2021 20:07:36 +0300
|
||||
Subject: [PATCH 1/3] edma_tx_rx: support newer kernels time stamping API
|
||||
|
||||
---
|
||||
hal/dp_ops/edma_dp/edma_v1/edma_tx_rx.c | 11 +++++++++++
|
||||
hal/edma/edma_tx_rx.c | 11 +++++++++++
|
||||
1 file changed, 11 insertions(+)
|
||||
|
||||
--- a/hal/dp_ops/edma_dp/edma_v1/edma_tx_rx.c
|
||||
+++ b/hal/dp_ops/edma_dp/edma_v1/edma_tx_rx.c
|
||||
@@ -227,10 +227,16 @@ void nss_phy_tstamp_rx_buf(__attribute__
|
||||
--- a/hal/edma/edma_tx_rx.c
|
||||
+++ b/hal/edma/edma_tx_rx.c
|
||||
@@ -226,10 +226,16 @@ void nss_phy_tstamp_rx_buf(__attribute__
|
||||
* set to the correct PTP class value by calling ptp_classify_raw
|
||||
* in drv->rxtstamp function.
|
||||
*/
|
||||
@ -27,7 +27,7 @@ Subject: [PATCH 1/3] edma_tx_rx: support newer kernels time stamping API
|
||||
|
||||
netif_receive_skb(skb);
|
||||
}
|
||||
@@ -248,9 +254,14 @@ void nss_phy_tstamp_tx_buf(struct net_de
|
||||
@@ -247,9 +253,14 @@ void nss_phy_tstamp_tx_buf(struct net_de
|
||||
* set to the correct PTP class value by calling ptp_classify_raw
|
||||
* in the drv->txtstamp function.
|
||||
*/
|
||||
|
@ -14,16 +14,16 @@ Subject: [PATCH 2/3] nss_dp_main: make phy mode code compatible with newer
|
||||
|
||||
--- a/include/nss_dp_dev.h
|
||||
+++ b/include/nss_dp_dev.h
|
||||
@@ -22,7 +22,7 @@
|
||||
#include <linux/etherdevice.h>
|
||||
@@ -25,7 +25,7 @@
|
||||
#include <linux/netdevice.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/if_vlan.h>
|
||||
-#include <linux/switch.h>
|
||||
+#include <linux/phy.h>
|
||||
#include <linux/version.h>
|
||||
|
||||
#include "nss_dp_api_if.h"
|
||||
@@ -99,7 +99,7 @@ struct nss_dp_dev {
|
||||
#include "nss_dp_hal_if.h"
|
||||
@@ -46,7 +46,7 @@ struct nss_dp_dev {
|
||||
/* Phy related stuff */
|
||||
struct phy_device *phydev; /* Phy device */
|
||||
struct mii_bus *miibus; /* MII bus */
|
||||
@ -34,7 +34,7 @@ Subject: [PATCH 2/3] nss_dp_main: make phy mode code compatible with newer
|
||||
uint32_t forced_speed; /* Forced speed? */
|
||||
--- a/nss_dp_main.c
|
||||
+++ b/nss_dp_main.c
|
||||
@@ -584,7 +584,11 @@ static int32_t nss_dp_of_get_pdata(struc
|
||||
@@ -463,7 +463,11 @@ static int32_t nss_dp_of_get_pdata(struc
|
||||
hal_pdata->netdev = netdev;
|
||||
hal_pdata->macid = dp_priv->macid;
|
||||
|
||||
|
@ -8,14 +8,14 @@ Subject: [PATCH 3/3] Drop _nocache variants of ioremap()
|
||||
|
||||
Recent kernels removed them.
|
||||
---
|
||||
hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c | 2 +-
|
||||
hal/gmac_ops/qcom/qcom_if.c | 2 +-
|
||||
hal/gmac_ops/syn/xgmac/syn_if.c | 2 +-
|
||||
hal/edma/edma_data_plane.c | 2 +-
|
||||
hal/gmac_hal_ops/qcom/qcom_if.c | 2 +-
|
||||
hal/gmac_hal_ops/syn/xgmac/syn_if.c | 2 +-
|
||||
3 files changed, 3 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
|
||||
@@ -279,7 +279,7 @@ int edma_init(void)
|
||||
--- a/hal/edma/edma_data_plane.c
|
||||
+++ b/hal/edma/edma_data_plane.c
|
||||
@@ -797,7 +797,7 @@ int edma_init(void)
|
||||
/*
|
||||
* Remap register resource
|
||||
*/
|
||||
@ -24,9 +24,9 @@ Recent kernels removed them.
|
||||
resource_size(edma_hw.reg_resource));
|
||||
if (!edma_hw.reg_base) {
|
||||
pr_warn("Unable to remap EDMA register memory.\n");
|
||||
--- a/hal/gmac_ops/qcom/qcom_if.c
|
||||
+++ b/hal/gmac_ops/qcom/qcom_if.c
|
||||
@@ -418,7 +418,7 @@ static void *qcom_init(struct nss_gmac_h
|
||||
--- a/hal/gmac_hal_ops/qcom/qcom_if.c
|
||||
+++ b/hal/gmac_hal_ops/qcom/qcom_if.c
|
||||
@@ -400,7 +400,7 @@ static void *qcom_init(struct gmac_hal_p
|
||||
qhd->nghd.mac_id = gmacpdata->macid;
|
||||
|
||||
/* Populate the mac base addresses */
|
||||
@ -35,9 +35,9 @@ Recent kernels removed them.
|
||||
res->start, resource_size(res));
|
||||
if (!qhd->nghd.mac_base) {
|
||||
netdev_dbg(ndev, "ioremap fail.\n");
|
||||
--- a/hal/gmac_ops/syn/xgmac/syn_if.c
|
||||
+++ b/hal/gmac_ops/syn/xgmac/syn_if.c
|
||||
@@ -432,7 +432,7 @@ static void *syn_init(struct nss_gmac_ha
|
||||
--- a/hal/gmac_hal_ops/syn/xgmac/syn_if.c
|
||||
+++ b/hal/gmac_hal_ops/syn/xgmac/syn_if.c
|
||||
@@ -422,7 +422,7 @@ static void *syn_init(struct gmac_hal_pl
|
||||
|
||||
/* Populate the mac base addresses */
|
||||
shd->nghd.mac_base =
|
||||
|
@ -9,12 +9,12 @@ cause NAPI over budget warnings.
|
||||
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
|
||||
Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
---
|
||||
hal/dp_ops/edma_dp/edma_v1/edma_tx_rx.c | 4 ++--
|
||||
hal/edma/edma_tx_rx.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/hal/dp_ops/edma_dp/edma_v1/edma_tx_rx.c
|
||||
+++ b/hal/dp_ops/edma_dp/edma_v1/edma_tx_rx.c
|
||||
@@ -459,12 +459,12 @@ int edma_napi(struct napi_struct *napi,
|
||||
--- a/hal/edma/edma_tx_rx.c
|
||||
+++ b/hal/edma/edma_tx_rx.c
|
||||
@@ -458,12 +458,12 @@ int edma_napi(struct napi_struct *napi,
|
||||
|
||||
for (i = 0; i < ehw->txcmpl_rings; i++) {
|
||||
txcmpl_ring = &ehw->txcmpl_ring[i];
|
||||
|
@ -14,13 +14,13 @@ So use NAPI_POLL_WEIGHT as the weight.
|
||||
|
||||
Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
---
|
||||
hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c | 2 +-
|
||||
hal/dp_ops/edma_dp/edma_v1/edma_data_plane.h | 1 -
|
||||
hal/edma/edma_data_plane.c | 2 +-
|
||||
hal/edma/edma_data_plane.h | 1 -
|
||||
2 files changed, 1 insertion(+), 2 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
|
||||
@@ -837,7 +837,7 @@ static int edma_register_netdevice(struc
|
||||
--- a/hal/edma/edma_data_plane.c
|
||||
+++ b/hal/edma/edma_data_plane.c
|
||||
@@ -582,7 +582,7 @@ static int edma_register_netdevice(struc
|
||||
*/
|
||||
if (!edma_hw.napi_added) {
|
||||
netif_napi_add(netdev, &edma_hw.napi, edma_napi,
|
||||
@ -29,13 +29,13 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
/*
|
||||
* Register the interrupt handlers and enable interrupts
|
||||
*/
|
||||
--- a/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.h
|
||||
+++ b/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.h
|
||||
@@ -26,7 +26,6 @@
|
||||
--- a/hal/edma/edma_data_plane.h
|
||||
+++ b/hal/edma/edma_data_plane.h
|
||||
@@ -27,7 +27,6 @@
|
||||
#define EDMA_RX_PREHDR_SIZE (sizeof(struct edma_rx_preheader))
|
||||
#define EDMA_TX_PREHDR_SIZE (sizeof(struct edma_tx_preheader))
|
||||
#define EDMA_RING_SIZE 128
|
||||
-#define EDMA_NAPI_WORK 100
|
||||
#define EDMA_START_GMACS NSS_DP_HAL_START_IFNUM
|
||||
#define EDMA_START_GMACS NSS_DP_START_IFNUM
|
||||
#define EDMA_MAX_GMACS NSS_DP_HAL_MAX_PORTS
|
||||
#define EDMA_TX_PKT_MIN_SIZE 33 /* IPQ807x EDMA needs a minimum packet size of 33 bytes */
|
||||
|
@ -13,11 +13,13 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
nss_dp_main.c | 13 ++++---------
|
||||
1 file changed, 4 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/nss_dp_main.c b/nss_dp_main.c
|
||||
index 5580b13..28df280 100644
|
||||
--- a/nss_dp_main.c
|
||||
+++ b/nss_dp_main.c
|
||||
@@ -555,9 +555,10 @@ static int32_t nss_dp_of_get_pdata(struc
|
||||
@@ -434,9 +434,10 @@ static int32_t nss_dp_of_get_pdata(struct device_node *np,
|
||||
struct net_device *netdev,
|
||||
struct nss_gmac_hal_platform_data *hal_pdata)
|
||||
struct gmac_hal_platform_data *hal_pdata)
|
||||
{
|
||||
- uint8_t *maddr;
|
||||
+ u8 maddr[ETH_ALEN];
|
||||
@ -27,7 +29,7 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
|
||||
dp_priv = netdev_priv(netdev);
|
||||
|
||||
@@ -600,14 +601,8 @@ static int32_t nss_dp_of_get_pdata(struc
|
||||
@@ -475,14 +476,8 @@ static int32_t nss_dp_of_get_pdata(struct device_node *np,
|
||||
of_property_read_u32(np, "qcom,forced-speed", &dp_priv->forced_speed);
|
||||
of_property_read_u32(np, "qcom,forced-duplex", &dp_priv->forced_duplex);
|
||||
|
||||
@ -44,3 +46,5 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
ether_addr_copy(netdev->dev_addr, maddr);
|
||||
} else {
|
||||
random_ether_addr(netdev->dev_addr);
|
||||
--
|
||||
2.31.1
|
||||
|
@ -18,8 +18,8 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
+++ b/include/nss_dp_dev.h
|
||||
@@ -24,6 +24,9 @@
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/if_vlan.h>
|
||||
#include <linux/phy.h>
|
||||
#include <linux/version.h>
|
||||
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 12, 0))
|
||||
+#include <net/switchdev.h>
|
||||
+#endif
|
||||
|
@ -1,189 +0,0 @@
|
||||
From 8293a26ca56ee2e9a88e4efb5dcc7f647803cd8c Mon Sep 17 00:00:00 2001
|
||||
From: Alexandru Gagniuc <mr.nuke.me@gmail.com>
|
||||
Date: Sun, 5 Jun 2022 21:45:09 -0500
|
||||
Subject: [PATCH] nss_dp_main: Use a 'phy-handle' property to connect to the
|
||||
PHY
|
||||
|
||||
The original method of connecting a PHY to the ethernet controller
|
||||
requires the "qcom,link-poll", and "qcom,phy-mdio-addr" devicetree
|
||||
properties. This is redundant. The PHY node already contains the MDIO
|
||||
address, and attaching a PHY implies "link-poll".
|
||||
|
||||
Allow using a "phy-handle" property. Remove the following properties,
|
||||
as they are no longer used:
|
||||
* "qcom,link-poll"
|
||||
* "qcom,phy-mdio-addr"
|
||||
* "mdio-bus"
|
||||
* "qcom,forced-speed"
|
||||
* "qcom,forced-duplex"
|
||||
|
||||
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
|
||||
---
|
||||
include/nss_dp_dev.h | 5 +--
|
||||
nss_dp_main.c | 91 +++++---------------------------------------
|
||||
2 files changed, 10 insertions(+), 86 deletions(-)
|
||||
|
||||
diff --git a/include/nss_dp_dev.h b/include/nss_dp_dev.h
|
||||
index 19b3e78..63a857a 100644
|
||||
--- a/include/nss_dp_dev.h
|
||||
+++ b/include/nss_dp_dev.h
|
||||
@@ -100,13 +100,10 @@ struct nss_dp_dev {
|
||||
unsigned long drv_flags; /* Driver specific feature flags */
|
||||
|
||||
/* Phy related stuff */
|
||||
+ struct device_node *phy_node;
|
||||
struct phy_device *phydev; /* Phy device */
|
||||
struct mii_bus *miibus; /* MII bus */
|
||||
phy_interface_t phy_mii_type; /* RGMII/SGMII/QSGMII */
|
||||
- uint32_t phy_mdio_addr; /* Mdio address */
|
||||
- bool link_poll; /* Link polling enable? */
|
||||
- uint32_t forced_speed; /* Forced speed? */
|
||||
- uint32_t forced_duplex; /* Forced duplex? */
|
||||
uint32_t link_state; /* Current link state */
|
||||
uint32_t pause; /* Current flow control settings */
|
||||
|
||||
diff --git a/nss_dp_main.c b/nss_dp_main.c
|
||||
index 441c300..a1e8627 100644
|
||||
--- a/nss_dp_main.c
|
||||
+++ b/nss_dp_main.c
|
||||
@@ -399,7 +399,7 @@ static int nss_dp_open(struct net_device *netdev)
|
||||
|
||||
netif_start_queue(netdev);
|
||||
|
||||
- if (!dp_priv->link_poll) {
|
||||
+ if (!dp_priv->phydev) {
|
||||
/* Notify data plane link is up */
|
||||
if (dp_priv->data_plane_ops->link_state(dp_priv->dpc, 1)) {
|
||||
netdev_dbg(netdev, "Data plane set link failed\n");
|
||||
@@ -576,6 +576,8 @@ static int32_t nss_dp_of_get_pdata(struct device_node *np,
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
+ dp_priv->phy_node = of_parse_phandle(np, "phy-handle", 0);
|
||||
+
|
||||
if (of_property_read_u32(np, "qcom,mactype", &hal_pdata->mactype)) {
|
||||
pr_err("%s: error reading mactype\n", np->name);
|
||||
return -EFAULT;
|
||||
@@ -594,16 +596,6 @@ static int32_t nss_dp_of_get_pdata(struct device_node *np,
|
||||
#else
|
||||
of_get_phy_mode(np, &dp_priv->phy_mii_type);
|
||||
#endif
|
||||
- dp_priv->link_poll = of_property_read_bool(np, "qcom,link-poll");
|
||||
- if (of_property_read_u32(np, "qcom,phy-mdio-addr",
|
||||
- &dp_priv->phy_mdio_addr) && dp_priv->link_poll) {
|
||||
- pr_err("%s: mdio addr required if link polling is enabled\n",
|
||||
- np->name);
|
||||
- return -EFAULT;
|
||||
- }
|
||||
-
|
||||
- of_property_read_u32(np, "qcom,forced-speed", &dp_priv->forced_speed);
|
||||
- of_property_read_u32(np, "qcom,forced-duplex", &dp_priv->forced_duplex);
|
||||
|
||||
ret = of_get_mac_address(np, maddr);
|
||||
if (!ret && is_valid_ether_addr(maddr)) {
|
||||
@@ -636,50 +628,6 @@ static int32_t nss_dp_of_get_pdata(struct device_node *np,
|
||||
return 0;
|
||||
}
|
||||
|
||||
-/*
|
||||
- * nss_dp_mdio_attach()
|
||||
- */
|
||||
-static struct mii_bus *nss_dp_mdio_attach(struct platform_device *pdev)
|
||||
-{
|
||||
- struct device_node *mdio_node;
|
||||
- struct platform_device *mdio_plat;
|
||||
- struct ipq40xx_mdio_data *mdio_data;
|
||||
-
|
||||
- /*
|
||||
- * Find mii_bus using "mdio-bus" handle.
|
||||
- */
|
||||
- mdio_node = of_parse_phandle(pdev->dev.of_node, "mdio-bus", 0);
|
||||
- if (mdio_node) {
|
||||
- return of_mdio_find_bus(mdio_node);
|
||||
- }
|
||||
-
|
||||
- mdio_node = of_find_compatible_node(NULL, NULL, "qcom,qca-mdio");
|
||||
- if (!mdio_node) {
|
||||
- mdio_node = of_find_compatible_node(NULL, NULL,
|
||||
- "qcom,ipq40xx-mdio");
|
||||
- if (!mdio_node) {
|
||||
- dev_err(&pdev->dev, "cannot find mdio node by phandle\n");
|
||||
- return NULL;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- mdio_plat = of_find_device_by_node(mdio_node);
|
||||
- if (!mdio_plat) {
|
||||
- dev_err(&pdev->dev, "cannot find platform device from mdio node\n");
|
||||
- of_node_put(mdio_node);
|
||||
- return NULL;
|
||||
- }
|
||||
-
|
||||
- mdio_data = dev_get_drvdata(&mdio_plat->dev);
|
||||
- if (!mdio_data) {
|
||||
- dev_err(&pdev->dev, "cannot get mii bus reference from device data\n");
|
||||
- of_node_put(mdio_node);
|
||||
- return NULL;
|
||||
- }
|
||||
-
|
||||
- return mdio_data->mii_bus;
|
||||
-}
|
||||
-
|
||||
#ifdef CONFIG_NET_SWITCHDEV
|
||||
/*
|
||||
* nss_dp_is_phy_dev()
|
||||
@@ -738,7 +686,6 @@ static int32_t nss_dp_probe(struct platform_device *pdev)
|
||||
struct device_node *np = pdev->dev.of_node;
|
||||
struct nss_gmac_hal_platform_data gmac_hal_pdata;
|
||||
int32_t ret = 0;
|
||||
- uint8_t phy_id[MII_BUS_ID_SIZE + 3];
|
||||
#if defined(NSS_DP_PPE_SUPPORT)
|
||||
uint32_t vsi_id;
|
||||
fal_port_t port_id;
|
||||
@@ -813,37 +760,17 @@ static int32_t nss_dp_probe(struct platform_device *pdev)
|
||||
|
||||
dp_priv->drv_flags |= NSS_DP_PRIV_FLAG(INIT_DONE);
|
||||
|
||||
- if (dp_priv->link_poll) {
|
||||
- dp_priv->miibus = nss_dp_mdio_attach(pdev);
|
||||
- if (!dp_priv->miibus) {
|
||||
- netdev_dbg(netdev, "failed to find miibus\n");
|
||||
- goto phy_setup_fail;
|
||||
- }
|
||||
- snprintf(phy_id, MII_BUS_ID_SIZE + 3, PHY_ID_FMT,
|
||||
- dp_priv->miibus->id, dp_priv->phy_mdio_addr);
|
||||
-
|
||||
+ if (dp_priv->phy_node) {
|
||||
SET_NETDEV_DEV(netdev, &pdev->dev);
|
||||
-
|
||||
- dp_priv->phydev = phy_connect(netdev, phy_id,
|
||||
- &nss_dp_adjust_link,
|
||||
- dp_priv->phy_mii_type);
|
||||
+ dp_priv->phydev = of_phy_connect(netdev, dp_priv->phy_node,
|
||||
+ &nss_dp_adjust_link, 0,
|
||||
+ dp_priv->phy_mii_type);
|
||||
if (IS_ERR(dp_priv->phydev)) {
|
||||
- netdev_dbg(netdev, "failed to connect to phy device\n");
|
||||
+ dev_err(&pdev->dev, "Could not attach to PHY\n");
|
||||
goto phy_setup_fail;
|
||||
}
|
||||
|
||||
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0))
|
||||
- dp_priv->phydev->advertising |=
|
||||
- (ADVERTISED_Pause | ADVERTISED_Asym_Pause);
|
||||
- dp_priv->phydev->supported |=
|
||||
- (SUPPORTED_Pause | SUPPORTED_Asym_Pause);
|
||||
-#else
|
||||
- linkmode_set_bit(ETHTOOL_LINK_MODE_Pause_BIT, dp_priv->phydev->advertising);
|
||||
- linkmode_set_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT, dp_priv->phydev->advertising);
|
||||
-
|
||||
- linkmode_set_bit(ETHTOOL_LINK_MODE_Pause_BIT, dp_priv->phydev->supported);
|
||||
- linkmode_set_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT, dp_priv->phydev->supported);
|
||||
-#endif
|
||||
+ phy_attached_info(dp_priv->phydev);
|
||||
}
|
||||
|
||||
#if defined(NSS_DP_PPE_SUPPORT)
|
||||
--
|
||||
2.36.1
|
||||
|
@ -1,46 +0,0 @@
|
||||
From 57b521e876986844dfe34457f39c62dc8100424d Mon Sep 17 00:00:00 2001
|
||||
From: Robert Marko <robimarko@gmail.com>
|
||||
Date: Thu, 23 Jun 2022 14:18:50 +0200
|
||||
Subject: [PATCH] nss-dp: edma-v1: switch to napi_gro_receive
|
||||
|
||||
Utilize napi_gro_receive instead of plain netif_receive_skb on EDMA v1.
|
||||
It provides significant performance improvements when testing with iperf3.
|
||||
|
||||
Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
---
|
||||
Makefile | 2 +-
|
||||
hal/dp_ops/edma_dp/edma_v1/edma_tx_rx.c | 4 ++++
|
||||
2 files changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 8e81317..dcfa8ca 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -25,7 +25,7 @@ qca-nss-dp-objs += hal/dp_ops/edma_dp/edma_v1/edma_cfg.o \
|
||||
hal/gmac_ops/qcom/qcom_if.o \
|
||||
hal/gmac_ops/syn/xgmac/syn_if.o
|
||||
NSS_DP_INCLUDE += -I$(obj)/hal/dp_ops/edma_dp/edma_v1/include
|
||||
-ccflags-y += -DNSS_DP_PPE_SUPPORT
|
||||
+ccflags-y += -DNSS_DP_PPE_SUPPORT -DNSS_DP_ENABLE_NAPI_GRO
|
||||
endif
|
||||
|
||||
ifeq ($(SoC),$(filter $(SoC),ipq807x))
|
||||
diff --git a/hal/dp_ops/edma_dp/edma_v1/edma_tx_rx.c b/hal/dp_ops/edma_dp/edma_v1/edma_tx_rx.c
|
||||
index 5780a30..6ee1451 100644
|
||||
--- a/hal/dp_ops/edma_dp/edma_v1/edma_tx_rx.c
|
||||
+++ b/hal/dp_ops/edma_dp/edma_v1/edma_tx_rx.c
|
||||
@@ -411,7 +411,11 @@ static uint32_t edma_clean_rx(struct edma_hw *ehw,
|
||||
NSS_PTP_EVENT_SERVICE_CODE))
|
||||
nss_phy_tstamp_rx_buf(ndev, skb);
|
||||
else
|
||||
+#if defined(NSS_DP_ENABLE_NAPI_GRO)
|
||||
+ napi_gro_receive(&ehw->napi, skb);
|
||||
+#else
|
||||
netif_receive_skb(skb);
|
||||
+#endif
|
||||
|
||||
next_rx_desc:
|
||||
/*
|
||||
--
|
||||
2.36.1
|
||||
|
@ -1,239 +0,0 @@
|
||||
From e80ad87476fe55f602c4e76f6b1068036b34b7a0 Mon Sep 17 00:00:00 2001
|
||||
From: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Date: Fri, 24 Jun 2022 15:04:44 +0200
|
||||
Subject: [PATCH 1/3] edma_v1: convert rx/tx_store to idr implementation
|
||||
|
||||
Convert rx/tx store to idr implementation to correctly scale in
|
||||
preparation for support of multiqueue implementation.
|
||||
|
||||
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
---
|
||||
hal/dp_ops/edma_dp/edma_v1/edma_cfg.c | 32 +++++++++----
|
||||
hal/dp_ops/edma_dp/edma_v1/edma_data_plane.h | 8 +++-
|
||||
hal/dp_ops/edma_dp/edma_v1/edma_tx_rx.c | 49 ++++++++++++++------
|
||||
3 files changed, 63 insertions(+), 26 deletions(-)
|
||||
|
||||
diff --git a/hal/dp_ops/edma_dp/edma_v1/edma_cfg.c b/hal/dp_ops/edma_dp/edma_v1/edma_cfg.c
|
||||
index fbd315a..2e98aaf 100644
|
||||
--- a/hal/dp_ops/edma_dp/edma_v1/edma_cfg.c
|
||||
+++ b/hal/dp_ops/edma_dp/edma_v1/edma_cfg.c
|
||||
@@ -72,8 +72,12 @@ static void edma_cleanup_rxfill_ring_res(struct edma_hw *ehw,
|
||||
* Get sk_buff and free it
|
||||
*/
|
||||
store_idx = rxph->opaque;
|
||||
- skb = ehw->rx_skb_store[store_idx];
|
||||
- ehw->rx_skb_store[store_idx] = NULL;
|
||||
+
|
||||
+ spin_lock_bh(&ehw->rx_skb_idr_lock);
|
||||
+ skb = idr_find(&ehw->rx_skb_idr, store_idx);
|
||||
+ idr_remove(&ehw->rx_skb_idr, store_idx);
|
||||
+ spin_unlock_bh(&ehw->rx_skb_idr_lock);
|
||||
+
|
||||
dev_kfree_skb_any(skb);
|
||||
cons_idx++;
|
||||
if (cons_idx == rxfill_ring->count)
|
||||
@@ -173,8 +177,12 @@ static void edma_cleanup_rxdesc_ring_res(struct edma_hw *ehw,
|
||||
dma_unmap_single(&pdev->dev, rxdesc_desc->buffer_addr,
|
||||
ehw->rx_alloc_size, DMA_FROM_DEVICE);
|
||||
store_idx = rxph->opaque;
|
||||
- skb = ehw->rx_skb_store[store_idx];
|
||||
- ehw->rx_skb_store[store_idx] = NULL;
|
||||
+
|
||||
+ spin_lock_bh(&ehw->rx_skb_idr_lock);
|
||||
+ skb = idr_find(&ehw->rx_skb_idr, store_idx);
|
||||
+ idr_remove(&ehw->rx_skb_idr, store_idx);
|
||||
+ spin_unlock_bh(&ehw->rx_skb_idr_lock);
|
||||
+
|
||||
dev_kfree_skb_any(skb);
|
||||
|
||||
/*
|
||||
@@ -270,8 +278,11 @@ static void edma_cleanup_txdesc_ring_res(struct edma_hw *ehw,
|
||||
while (cons_idx != prod_idx) {
|
||||
txdesc = EDMA_TXDESC_DESC(txdesc_ring, cons_idx);
|
||||
store_idx = txdesc->buffer_addr;
|
||||
- skb = ehw->tx_skb_store[store_idx];
|
||||
- ehw->tx_skb_store[store_idx] = NULL;
|
||||
+
|
||||
+ spin_lock_bh(&ehw->tx_skb_idr_lock);
|
||||
+ skb = idr_find(&ehw->tx_skb_idr, store_idx);
|
||||
+ idr_remove(&ehw->tx_skb_idr, store_idx);
|
||||
+ spin_unlock_bh(&ehw->tx_skb_idr_lock);
|
||||
|
||||
buf_len = (txdesc->word1 & EDMA_TXDESC_DATA_LENGTH_MASK) >>
|
||||
EDMA_TXDESC_DATA_LENGTH_SHIFT;
|
||||
@@ -675,10 +686,11 @@ static void edma_configure_rings(struct edma_hw *ehw)
|
||||
/*
|
||||
* Initialize the store
|
||||
*/
|
||||
- for (i = 0; i < EDMA_RING_SIZE; i++) {
|
||||
- ehw->tx_skb_store[i] = NULL;
|
||||
- ehw->rx_skb_store[i] = NULL;
|
||||
- }
|
||||
+ idr_init(&ehw->rx_skb_idr);
|
||||
+ spin_lock_init(&ehw->rx_skb_idr_lock);
|
||||
+
|
||||
+ idr_init(&ehw->tx_skb_idr);
|
||||
+ spin_lock_init(&ehw->tx_skb_idr_lock);
|
||||
|
||||
/*
|
||||
* Configure TXDESC ring
|
||||
diff --git a/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.h b/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.h
|
||||
index 0b28fe8..2bbe478 100644
|
||||
--- a/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.h
|
||||
+++ b/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.h
|
||||
@@ -44,6 +44,8 @@
|
||||
#define EDMA_RXPH_SRC_INFO_TYPE_GET(rxph) (((rxph)->src_info >> 8) & 0xf0)
|
||||
#define EDMA_RXPH_SERVICE_CODE_GET(rxph) (((rxph)->rx_pre4) & 0xff)
|
||||
|
||||
+#define EDMA_TX_IDR_MAX EDMA_RING_SIZE * EDMA_MAX_TXDESC_RINGS
|
||||
+#define EDMA_RX_IDR_MAX EDMA_RING_SIZE * EDMA_MAX_RXDESC_RINGS
|
||||
/*
|
||||
* Tx descriptor
|
||||
*/
|
||||
@@ -202,8 +204,10 @@ struct edma_hw {
|
||||
/*
|
||||
* Store for tx and rx skbs
|
||||
*/
|
||||
- struct sk_buff *rx_skb_store[EDMA_RING_SIZE];
|
||||
- struct sk_buff *tx_skb_store[EDMA_RING_SIZE];
|
||||
+ struct idr rx_skb_idr;
|
||||
+ spinlock_t rx_skb_idr_lock;
|
||||
+ struct idr tx_skb_idr;
|
||||
+ spinlock_t tx_skb_idr_lock;
|
||||
|
||||
struct edma_rxfill_ring *rxfill_ring;
|
||||
/* Rx Fill Ring, SW is producer */
|
||||
diff --git a/hal/dp_ops/edma_dp/edma_v1/edma_tx_rx.c b/hal/dp_ops/edma_dp/edma_v1/edma_tx_rx.c
|
||||
index 5780a30..8cded66 100644
|
||||
--- a/hal/dp_ops/edma_dp/edma_v1/edma_tx_rx.c
|
||||
+++ b/hal/dp_ops/edma_dp/edma_v1/edma_tx_rx.c
|
||||
@@ -37,9 +37,9 @@ int edma_alloc_rx_buffer(struct edma_hw *ehw,
|
||||
uint16_t cons, next, counter;
|
||||
struct edma_rxfill_desc *rxfill_desc;
|
||||
uint32_t reg_data = 0;
|
||||
- uint32_t store_index = 0;
|
||||
uint32_t alloc_size = ehw->rx_alloc_size;
|
||||
struct edma_rx_preheader *rxph = NULL;
|
||||
+ int store_index;
|
||||
|
||||
/*
|
||||
* Read RXFILL ring producer index
|
||||
@@ -82,12 +82,16 @@ int edma_alloc_rx_buffer(struct edma_hw *ehw,
|
||||
/*
|
||||
* Store the skb in the rx store
|
||||
*/
|
||||
- store_index = next;
|
||||
- if (ehw->rx_skb_store[store_index] != NULL) {
|
||||
+ spin_lock_bh(&ehw->rx_skb_idr_lock);
|
||||
+ store_index = idr_alloc(&ehw->rx_skb_idr,
|
||||
+ skb, 0, EDMA_RX_IDR_MAX, GFP_ATOMIC);
|
||||
+ spin_unlock_bh(&ehw->rx_skb_idr_lock);
|
||||
+
|
||||
+ if (store_index < 0) {
|
||||
dev_kfree_skb_any(skb);
|
||||
break;
|
||||
}
|
||||
- ehw->rx_skb_store[store_index] = skb;
|
||||
+
|
||||
memcpy((uint8_t *)&rxph->opaque, (uint8_t *)&store_index, 4);
|
||||
/*
|
||||
* Save buffer size in RXFILL descriptor
|
||||
@@ -106,7 +110,9 @@ int edma_alloc_rx_buffer(struct edma_hw *ehw,
|
||||
|
||||
if (!rxfill_desc->buffer_addr) {
|
||||
dev_kfree_skb_any(skb);
|
||||
- ehw->rx_skb_store[store_index] = NULL;
|
||||
+ spin_lock_bh(&ehw->rx_skb_idr_lock);
|
||||
+ idr_remove(&ehw->rx_skb_idr, store_index);
|
||||
+ spin_unlock_bh(&ehw->rx_skb_idr_lock);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -173,15 +179,19 @@ uint32_t edma_clean_tx(struct edma_hw *ehw,
|
||||
* buffer address (opaque) of txcmpl
|
||||
*/
|
||||
store_index = txcmpl->buffer_addr;
|
||||
- skb = ehw->tx_skb_store[store_index];
|
||||
- ehw->tx_skb_store[store_index] = NULL;
|
||||
+ spin_lock_bh(&ehw->tx_skb_idr_lock);
|
||||
+ skb = idr_find(&ehw->tx_skb_idr, store_index);
|
||||
|
||||
if (unlikely(!skb)) {
|
||||
pr_warn("Invalid skb: cons_idx:%u prod_idx:%u status %x\n",
|
||||
cons_idx, prod_idx, txcmpl->status);
|
||||
+ spin_unlock_bh(&ehw->tx_skb_idr_lock);
|
||||
goto next_txcmpl_desc;
|
||||
}
|
||||
|
||||
+ idr_remove(&ehw->tx_skb_idr, store_index);
|
||||
+ spin_unlock_bh(&ehw->tx_skb_idr_lock);
|
||||
+
|
||||
len = skb_headlen(skb);
|
||||
daddr = (dma_addr_t)virt_to_phys(skb->data);
|
||||
|
||||
@@ -322,14 +332,19 @@ static uint32_t edma_clean_rx(struct edma_hw *ehw,
|
||||
DMA_FROM_DEVICE);
|
||||
|
||||
store_index = rxph->opaque;
|
||||
- skb = ehw->rx_skb_store[store_index];
|
||||
- ehw->rx_skb_store[store_index] = NULL;
|
||||
+ spin_lock_bh(&ehw->rx_skb_idr_lock);
|
||||
+ skb = idr_find(&ehw->rx_skb_idr, store_index);
|
||||
+
|
||||
if (unlikely(!skb)) {
|
||||
+ spin_unlock_bh(&ehw->rx_skb_idr_lock);
|
||||
pr_warn("WARN: empty skb reference in rx_store:%d\n",
|
||||
cons_idx);
|
||||
goto next_rx_desc;
|
||||
}
|
||||
|
||||
+ idr_remove(&ehw->rx_skb_idr, store_index);
|
||||
+ spin_unlock_bh(&ehw->rx_skb_idr_lock);
|
||||
+
|
||||
/*
|
||||
* Check src_info from Rx preheader
|
||||
*/
|
||||
@@ -539,7 +554,7 @@ enum edma_tx edma_ring_xmit(struct edma_hw *ehw,
|
||||
uint16_t buf_len;
|
||||
uint16_t hw_next_to_use, hw_next_to_clean, chk_idx;
|
||||
uint32_t data;
|
||||
- uint32_t store_index = 0;
|
||||
+ int store_index = 0;
|
||||
struct edma_tx_preheader *txph = NULL;
|
||||
|
||||
/*
|
||||
@@ -616,13 +631,16 @@ enum edma_tx edma_ring_xmit(struct edma_hw *ehw,
|
||||
/*
|
||||
* Store the skb in tx_store
|
||||
*/
|
||||
- store_index = hw_next_to_use & (txdesc_ring->count - 1);
|
||||
- if (unlikely(ehw->tx_skb_store[store_index] != NULL)) {
|
||||
+ spin_lock_bh(&ehw->tx_skb_idr_lock);
|
||||
+ store_index = idr_alloc(&ehw->tx_skb_idr,
|
||||
+ skb, 0, EDMA_RX_IDR_MAX, GFP_ATOMIC);
|
||||
+ spin_unlock_bh(&ehw->tx_skb_idr_lock);
|
||||
+
|
||||
+ if (unlikely(store_index < 0)) {
|
||||
spin_unlock_bh(&txdesc_ring->tx_lock);
|
||||
return EDMA_TX_DESC;
|
||||
}
|
||||
|
||||
- ehw->tx_skb_store[store_index] = skb;
|
||||
memcpy(skb->data, &store_index, 4);
|
||||
|
||||
/*
|
||||
@@ -645,7 +663,10 @@ enum edma_tx edma_ring_xmit(struct edma_hw *ehw,
|
||||
*/
|
||||
dev_kfree_skb_any(skb);
|
||||
|
||||
- ehw->tx_skb_store[store_index] = NULL;
|
||||
+ spin_lock_bh(&ehw->tx_skb_idr_lock);
|
||||
+ idr_remove(&ehw->tx_skb_idr, store_index);
|
||||
+ spin_unlock_bh(&ehw->tx_skb_idr_lock);
|
||||
+
|
||||
spin_unlock_bh(&txdesc_ring->tx_lock);
|
||||
return EDMA_TX_OK;
|
||||
}
|
||||
--
|
||||
2.36.1
|
||||
|
@ -1,125 +0,0 @@
|
||||
From b7fe6524ef7e1b3579141030a784b311c913f721 Mon Sep 17 00:00:00 2001
|
||||
From: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Date: Fri, 24 Jun 2022 16:33:07 +0200
|
||||
Subject: [PATCH 1/2] edma_v1: move rxfill to specific irq handler
|
||||
|
||||
Move rxfill logic to specific irq handler.
|
||||
|
||||
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
---
|
||||
hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c | 2 +-
|
||||
hal/dp_ops/edma_dp/edma_v1/edma_data_plane.h | 1 +
|
||||
hal/dp_ops/edma_dp/edma_v1/edma_tx_rx.c | 52 +++++++++++++-------
|
||||
3 files changed, 36 insertions(+), 19 deletions(-)
|
||||
|
||||
diff --git a/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c b/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c
|
||||
index 1d748db..65bd0db 100644
|
||||
--- a/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c
|
||||
+++ b/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c
|
||||
@@ -731,7 +731,7 @@ static int edma_irq_init(void)
|
||||
*/
|
||||
for (i = 0; i < edma_hw.rxfill_rings; i++) {
|
||||
err = request_irq(edma_hw.rxfill_intr[i],
|
||||
- edma_handle_irq, IRQF_SHARED,
|
||||
+ edma_rx_fill_handle_irq, IRQF_SHARED,
|
||||
"edma_rxfill", (void *)edma_hw.pdev);
|
||||
if (err) {
|
||||
pr_debug("RXFILL ring IRQ:%d request failed\n",
|
||||
diff --git a/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.h b/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.h
|
||||
index 2bbe478..d0237ba 100644
|
||||
--- a/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.h
|
||||
+++ b/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.h
|
||||
@@ -283,6 +283,7 @@ enum edma_tx edma_ring_xmit(struct edma_hw *ehw,
|
||||
uint32_t edma_clean_tx(struct edma_hw *ehw,
|
||||
struct edma_txcmpl_ring *txcmpl_ring);
|
||||
irqreturn_t edma_handle_irq(int irq, void *ctx);
|
||||
+irqreturn_t edma_rx_fill_handle_irq(int irq, void *ctx);
|
||||
irqreturn_t edma_handle_misc_irq(int irq, void *ctx);
|
||||
int edma_napi(struct napi_struct *napi, int budget);
|
||||
void edma_cleanup_rings(struct edma_hw *ehw);
|
||||
diff --git a/hal/dp_ops/edma_dp/edma_v1/edma_tx_rx.c b/hal/dp_ops/edma_dp/edma_v1/edma_tx_rx.c
|
||||
index 355fe83..374c90f 100644
|
||||
--- a/hal/dp_ops/edma_dp/edma_v1/edma_tx_rx.c
|
||||
+++ b/hal/dp_ops/edma_dp/edma_v1/edma_tx_rx.c
|
||||
@@ -740,11 +740,9 @@ irqreturn_t edma_handle_irq(int irq, void *ctx)
|
||||
uint32_t reg_data = 0;
|
||||
uint32_t rxdesc_intr_status = 0;
|
||||
uint32_t txcmpl_intr_status = 0;
|
||||
- uint32_t rxfill_intr_status = 0;
|
||||
int i;
|
||||
struct edma_txcmpl_ring *txcmpl_ring = NULL;
|
||||
struct edma_rxdesc_ring *rxdesc_ring = NULL;
|
||||
- struct edma_rxfill_ring *rxfill_ring = NULL;
|
||||
struct edma_hw *ehw = NULL;
|
||||
struct platform_device *pdev = (struct platform_device *)ctx;
|
||||
|
||||
@@ -788,9 +786,40 @@ irqreturn_t edma_handle_irq(int irq, void *ctx)
|
||||
EDMA_MASK_INT_DISABLE);
|
||||
}
|
||||
|
||||
+ if ((rxdesc_intr_status == 0) && (txcmpl_intr_status == 0))
|
||||
+ return IRQ_NONE;
|
||||
+
|
||||
+ for (i = 0; i < ehw->rxdesc_rings; i++) {
|
||||
+ rxdesc_ring = &ehw->rxdesc_ring[i];
|
||||
+ edma_reg_write(EDMA_REG_RXDESC_INT_MASK(rxdesc_ring->id),
|
||||
+ EDMA_MASK_INT_DISABLE);
|
||||
+ }
|
||||
+
|
||||
/*
|
||||
- * Read RxFill intr status
|
||||
+ *TODO - per core NAPI
|
||||
*/
|
||||
+ if (rxdesc_intr_status || txcmpl_intr_status)
|
||||
+ if (likely(napi_schedule_prep(&ehw->napi)))
|
||||
+ __napi_schedule(&ehw->napi);
|
||||
+
|
||||
+ return IRQ_HANDLED;
|
||||
+}
|
||||
+
|
||||
+irqreturn_t edma_rx_fill_handle_irq(int irq, void *ctx)
|
||||
+{
|
||||
+ struct platform_device *pdev = (struct platform_device *)ctx;
|
||||
+ struct edma_rxfill_ring *rxfill_ring;
|
||||
+ uint32_t rxfill_intr_status;
|
||||
+ struct edma_hw *ehw;
|
||||
+ uint32_t reg_data;
|
||||
+ int i;
|
||||
+
|
||||
+ ehw = platform_get_drvdata(pdev);
|
||||
+ if (!ehw) {
|
||||
+ pr_info("Unable to retrieve platrofm data");
|
||||
+ return IRQ_HANDLED;
|
||||
+ }
|
||||
+
|
||||
for (i = 0; i < ehw->rxfill_rings; i++) {
|
||||
rxfill_ring = &ehw->rxfill_ring[i];
|
||||
reg_data = edma_reg_read(
|
||||
@@ -806,22 +835,9 @@ irqreturn_t edma_handle_irq(int irq, void *ctx)
|
||||
|
||||
}
|
||||
|
||||
- if ((rxdesc_intr_status == 0) && (txcmpl_intr_status == 0) &&
|
||||
- (rxfill_intr_status == 0))
|
||||
+ if (!rxfill_intr_status)
|
||||
return IRQ_NONE;
|
||||
|
||||
- for (i = 0; i < ehw->rxdesc_rings; i++) {
|
||||
- rxdesc_ring = &ehw->rxdesc_ring[i];
|
||||
- edma_reg_write(EDMA_REG_RXDESC_INT_MASK(rxdesc_ring->id),
|
||||
- EDMA_MASK_INT_DISABLE);
|
||||
- }
|
||||
-
|
||||
- /*
|
||||
- *TODO - per core NAPI
|
||||
- */
|
||||
- if (rxdesc_intr_status || txcmpl_intr_status || rxfill_intr_status)
|
||||
- if (likely(napi_schedule_prep(&ehw->napi)))
|
||||
- __napi_schedule(&ehw->napi);
|
||||
-
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
+
|
||||
--
|
||||
2.36.1
|
||||
|
@ -1,313 +0,0 @@
|
||||
From 0c0f9befa1ae766add49e1aa70a9028809526ad0 Mon Sep 17 00:00:00 2001
|
||||
From: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Date: Fri, 24 Jun 2022 16:35:55 +0200
|
||||
Subject: [PATCH 3/6] edma_v1: split rx and tx napi path and irq handler
|
||||
|
||||
Split rx and tx napi and irq handler to own handler.
|
||||
|
||||
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
---
|
||||
hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c | 18 ++-
|
||||
hal/dp_ops/edma_dp/edma_v1/edma_data_plane.h | 10 +-
|
||||
hal/dp_ops/edma_dp/edma_v1/edma_tx_rx.c | 131 +++++++++++++------
|
||||
3 files changed, 109 insertions(+), 50 deletions(-)
|
||||
|
||||
diff --git a/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c b/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c
|
||||
index 65bd0db..8932f40 100644
|
||||
--- a/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c
|
||||
+++ b/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c
|
||||
@@ -407,7 +407,8 @@ void edma_cleanup(bool is_dp_override)
|
||||
synchronize_irq(edma_hw.misc_intr);
|
||||
free_irq(edma_hw.misc_intr, (void *)(edma_hw.pdev));
|
||||
|
||||
- netif_napi_del(&edma_hw.napi);
|
||||
+ netif_napi_del(&edma_hw.rx_napi);
|
||||
+ netif_napi_del(&edma_hw.tx_napi);
|
||||
edma_hw.napi_added = 0;
|
||||
}
|
||||
|
||||
@@ -451,7 +452,8 @@ static int edma_if_open(struct nss_dp_data_plane_ctx *dpc,
|
||||
if (edma_hw.active++ != 0)
|
||||
return NSS_DP_SUCCESS;
|
||||
|
||||
- napi_enable(&edma_hw.napi);
|
||||
+ napi_enable(&edma_hw.rx_napi);
|
||||
+ napi_enable(&edma_hw.tx_napi);
|
||||
|
||||
/*
|
||||
* Enable the interrupt masks.
|
||||
@@ -478,7 +480,8 @@ static int edma_if_close(struct nss_dp_data_plane_ctx *dpc)
|
||||
/*
|
||||
* Disable NAPI
|
||||
*/
|
||||
- napi_disable(&edma_hw.napi);
|
||||
+ napi_disable(&edma_hw.rx_napi);
|
||||
+ napi_disable(&edma_hw.tx_napi);
|
||||
return NSS_DP_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -716,7 +719,7 @@ static int edma_irq_init(void)
|
||||
*/
|
||||
for (i = 0; i < edma_hw.txcmpl_rings; i++) {
|
||||
err = request_irq(edma_hw.txcmpl_intr[i],
|
||||
- edma_handle_irq, IRQF_SHARED,
|
||||
+ edma_tx_handle_irq, IRQF_SHARED,
|
||||
"edma_txcmpl", (void *)edma_hw.pdev);
|
||||
if (err) {
|
||||
pr_debug("TXCMPL ring IRQ:%d request failed\n",
|
||||
@@ -745,7 +748,7 @@ static int edma_irq_init(void)
|
||||
*/
|
||||
for (i = 0; i < edma_hw.rxdesc_rings; i++) {
|
||||
err = request_irq(edma_hw.rxdesc_intr[i],
|
||||
- edma_handle_irq, IRQF_SHARED,
|
||||
+ edma_rx_handle_irq, IRQF_SHARED,
|
||||
"edma_rxdesc", (void *)edma_hw.pdev);
|
||||
if (err) {
|
||||
pr_debug("RXDESC ring IRQ:%d request failed\n",
|
||||
@@ -836,7 +839,10 @@ static int edma_register_netdevice(struct net_device *netdev, uint32_t macid)
|
||||
* NAPI add
|
||||
*/
|
||||
if (!edma_hw.napi_added) {
|
||||
- netif_napi_add(netdev, &edma_hw.napi, edma_napi,
|
||||
+ netif_napi_add(netdev, &edma_hw.rx_napi, edma_rx_napi,
|
||||
+ NAPI_POLL_WEIGHT);
|
||||
+
|
||||
+ netif_tx_napi_add(netdev, &edma_hw.tx_napi, edma_tx_napi,
|
||||
NAPI_POLL_WEIGHT);
|
||||
/*
|
||||
* Register the interrupt handlers and enable interrupts
|
||||
diff --git a/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.h b/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.h
|
||||
index d0237ba..a45fb99 100644
|
||||
--- a/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.h
|
||||
+++ b/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.h
|
||||
@@ -172,7 +172,9 @@ enum edma_tx {
|
||||
* EDMA private data structure
|
||||
*/
|
||||
struct edma_hw {
|
||||
- struct napi_struct napi;
|
||||
+ struct napi_struct rx_napi;
|
||||
+ /* napi structure */
|
||||
+ struct napi_struct tx_napi;
|
||||
/* napi structure */
|
||||
struct net_device *netdev_arr[EDMA_MAX_GMACS];
|
||||
/* netdev for each gmac port */
|
||||
@@ -282,10 +284,12 @@ enum edma_tx edma_ring_xmit(struct edma_hw *ehw,
|
||||
struct edma_txdesc_ring *txdesc_ring);
|
||||
uint32_t edma_clean_tx(struct edma_hw *ehw,
|
||||
struct edma_txcmpl_ring *txcmpl_ring);
|
||||
-irqreturn_t edma_handle_irq(int irq, void *ctx);
|
||||
+irqreturn_t edma_tx_handle_irq(int irq, void *ctx);
|
||||
+irqreturn_t edma_rx_handle_irq(int irq, void *ctx);
|
||||
irqreturn_t edma_rx_fill_handle_irq(int irq, void *ctx);
|
||||
irqreturn_t edma_handle_misc_irq(int irq, void *ctx);
|
||||
-int edma_napi(struct napi_struct *napi, int budget);
|
||||
+int edma_rx_napi(struct napi_struct *napi, int budget);
|
||||
+int edma_tx_napi(struct napi_struct *napi, int budget);
|
||||
void edma_cleanup_rings(struct edma_hw *ehw);
|
||||
int edma_hw_init(struct edma_hw *ehw);
|
||||
#endif /* __NSS_DP_EDMA_DATAPLANE__ */
|
||||
diff --git a/hal/dp_ops/edma_dp/edma_v1/edma_tx_rx.c b/hal/dp_ops/edma_dp/edma_v1/edma_tx_rx.c
|
||||
index 7c84455..ace8140 100644
|
||||
--- a/hal/dp_ops/edma_dp/edma_v1/edma_tx_rx.c
|
||||
+++ b/hal/dp_ops/edma_dp/edma_v1/edma_tx_rx.c
|
||||
@@ -456,14 +456,12 @@ next_rx_desc:
|
||||
* edma_napi()
|
||||
* EDMA NAPI handler
|
||||
*/
|
||||
-int edma_napi(struct napi_struct *napi, int budget)
|
||||
+int edma_rx_napi(struct napi_struct *napi, int budget)
|
||||
{
|
||||
- struct edma_hw *ehw = container_of(napi, struct edma_hw, napi);
|
||||
- struct edma_txcmpl_ring *txcmpl_ring = NULL;
|
||||
+ struct edma_hw *ehw = container_of(napi, struct edma_hw, rx_napi);
|
||||
struct edma_rxdesc_ring *rxdesc_ring = NULL;
|
||||
struct edma_rxfill_ring *rxfill_ring = NULL;
|
||||
|
||||
- struct net_device *ndev;
|
||||
int work_done = 0;
|
||||
int i;
|
||||
|
||||
@@ -472,16 +470,56 @@ int edma_napi(struct napi_struct *napi, int budget)
|
||||
work_done += edma_clean_rx(ehw, budget, rxdesc_ring);
|
||||
}
|
||||
|
||||
+ /*
|
||||
+ * TODO - rework and fix the budget control
|
||||
+ */
|
||||
+ if (work_done < budget) {
|
||||
+ /*
|
||||
+ * TODO per core NAPI
|
||||
+ */
|
||||
+ napi_complete(napi);
|
||||
+
|
||||
+ /*
|
||||
+ * Set RXDESC ring interrupt mask
|
||||
+ */
|
||||
+ for (i = 0; i < ehw->rxdesc_rings; i++) {
|
||||
+ rxdesc_ring = &ehw->rxdesc_ring[i];
|
||||
+ edma_reg_write(
|
||||
+ EDMA_REG_RXDESC_INT_MASK(rxdesc_ring->id),
|
||||
+ ehw->rxdesc_intr_mask);
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
+ * Set RXFILL ring interrupt mask
|
||||
+ */
|
||||
+ for (i = 0; i < ehw->rxfill_rings; i++) {
|
||||
+ rxfill_ring = &ehw->rxfill_ring[i];
|
||||
+ edma_reg_write(EDMA_REG_RXFILL_INT_MASK(
|
||||
+ rxfill_ring->id),
|
||||
+ edma_hw.rxfill_intr_mask);
|
||||
+ }
|
||||
+ }
|
||||
+ return work_done;
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * edma_napi()
|
||||
+ * EDMA NAPI handler
|
||||
+ */
|
||||
+int edma_tx_napi(struct napi_struct *napi, int budget)
|
||||
+{
|
||||
+ struct edma_hw *ehw = container_of(napi, struct edma_hw, tx_napi);
|
||||
+ struct edma_txcmpl_ring *txcmpl_ring = NULL;
|
||||
+
|
||||
+ struct net_device *ndev;
|
||||
+ int work_done = 0;
|
||||
+ int i;
|
||||
+
|
||||
for (i = 0; i < ehw->txcmpl_rings; i++) {
|
||||
txcmpl_ring = &ehw->txcmpl_ring[i];
|
||||
edma_clean_tx(ehw, txcmpl_ring);
|
||||
}
|
||||
|
||||
- for (i = 0; i < ehw->rxfill_rings; i++) {
|
||||
- rxfill_ring = &ehw->rxfill_ring[i];
|
||||
- edma_alloc_rx_buffer(ehw, rxfill_ring);
|
||||
- }
|
||||
-
|
||||
/*
|
||||
* Resume netdev Tx queue
|
||||
*/
|
||||
@@ -508,16 +546,6 @@ int edma_napi(struct napi_struct *napi, int budget)
|
||||
*/
|
||||
napi_complete(napi);
|
||||
|
||||
- /*
|
||||
- * Set RXDESC ring interrupt mask
|
||||
- */
|
||||
- for (i = 0; i < ehw->rxdesc_rings; i++) {
|
||||
- rxdesc_ring = &ehw->rxdesc_ring[i];
|
||||
- edma_reg_write(
|
||||
- EDMA_REG_RXDESC_INT_MASK(rxdesc_ring->id),
|
||||
- ehw->rxdesc_intr_mask);
|
||||
- }
|
||||
-
|
||||
/*
|
||||
* Set TXCMPL ring interrupt mask
|
||||
*/
|
||||
@@ -527,15 +555,6 @@ int edma_napi(struct napi_struct *napi, int budget)
|
||||
ehw->txcmpl_intr_mask);
|
||||
}
|
||||
|
||||
- /*
|
||||
- * Set RXFILL ring interrupt mask
|
||||
- */
|
||||
- for (i = 0; i < ehw->rxfill_rings; i++) {
|
||||
- rxfill_ring = &ehw->rxfill_ring[i];
|
||||
- edma_reg_write(EDMA_REG_RXFILL_INT_MASK(
|
||||
- rxfill_ring->id),
|
||||
- edma_hw.rxfill_intr_mask);
|
||||
- }
|
||||
}
|
||||
return work_done;
|
||||
}
|
||||
@@ -736,13 +755,11 @@ irqreturn_t edma_handle_misc_irq(int irq, void *ctx)
|
||||
* edma_handle_irq()
|
||||
* Process IRQ and schedule napi
|
||||
*/
|
||||
-irqreturn_t edma_handle_irq(int irq, void *ctx)
|
||||
+irqreturn_t edma_rx_handle_irq(int irq, void *ctx)
|
||||
{
|
||||
uint32_t reg_data = 0;
|
||||
uint32_t rxdesc_intr_status = 0;
|
||||
- uint32_t txcmpl_intr_status = 0;
|
||||
int i;
|
||||
- struct edma_txcmpl_ring *txcmpl_ring = NULL;
|
||||
struct edma_rxdesc_ring *rxdesc_ring = NULL;
|
||||
struct edma_hw *ehw = NULL;
|
||||
struct platform_device *pdev = (struct platform_device *)ctx;
|
||||
@@ -770,6 +787,44 @@ irqreturn_t edma_handle_irq(int irq, void *ctx)
|
||||
EDMA_MASK_INT_DISABLE);
|
||||
}
|
||||
|
||||
+ if (rxdesc_intr_status == 0)
|
||||
+ return IRQ_NONE;
|
||||
+
|
||||
+ for (i = 0; i < ehw->rxdesc_rings; i++) {
|
||||
+ rxdesc_ring = &ehw->rxdesc_ring[i];
|
||||
+ edma_reg_write(EDMA_REG_RXDESC_INT_MASK(rxdesc_ring->id),
|
||||
+ EDMA_MASK_INT_DISABLE);
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
+ *TODO - per core NAPI
|
||||
+ */
|
||||
+ if (rxdesc_intr_status)
|
||||
+ if (likely(napi_schedule_prep(&ehw->rx_napi)))
|
||||
+ __napi_schedule(&ehw->rx_napi);
|
||||
+
|
||||
+ return IRQ_HANDLED;
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * edma_handle_irq()
|
||||
+ * Process IRQ and schedule napi
|
||||
+ */
|
||||
+irqreturn_t edma_tx_handle_irq(int irq, void *ctx)
|
||||
+{
|
||||
+ uint32_t reg_data = 0;
|
||||
+ uint32_t txcmpl_intr_status = 0;
|
||||
+ int i;
|
||||
+ struct edma_txcmpl_ring *txcmpl_ring = NULL;
|
||||
+ struct edma_hw *ehw = NULL;
|
||||
+ struct platform_device *pdev = (struct platform_device *)ctx;
|
||||
+
|
||||
+ ehw = platform_get_drvdata(pdev);
|
||||
+ if (!ehw) {
|
||||
+ pr_info("Unable to retrieve platrofm data");
|
||||
+ return IRQ_HANDLED;
|
||||
+ }
|
||||
+
|
||||
/*
|
||||
* Read TxCmpl intr status
|
||||
*/
|
||||
@@ -787,21 +842,15 @@ irqreturn_t edma_handle_irq(int irq, void *ctx)
|
||||
EDMA_MASK_INT_DISABLE);
|
||||
}
|
||||
|
||||
- if ((rxdesc_intr_status == 0) && (txcmpl_intr_status == 0))
|
||||
+ if (txcmpl_intr_status == 0)
|
||||
return IRQ_NONE;
|
||||
|
||||
- for (i = 0; i < ehw->rxdesc_rings; i++) {
|
||||
- rxdesc_ring = &ehw->rxdesc_ring[i];
|
||||
- edma_reg_write(EDMA_REG_RXDESC_INT_MASK(rxdesc_ring->id),
|
||||
- EDMA_MASK_INT_DISABLE);
|
||||
- }
|
||||
-
|
||||
/*
|
||||
*TODO - per core NAPI
|
||||
*/
|
||||
- if (rxdesc_intr_status || txcmpl_intr_status)
|
||||
- if (likely(napi_schedule_prep(&ehw->napi)))
|
||||
- __napi_schedule(&ehw->napi);
|
||||
+ if (txcmpl_intr_status)
|
||||
+ if (likely(napi_schedule_prep(&ehw->tx_napi)))
|
||||
+ __napi_schedule(&ehw->tx_napi);
|
||||
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
--
|
||||
2.36.1
|
||||
|
@ -1,267 +0,0 @@
|
||||
From 21ffe52de4834569486619b93a059a7a92000827 Mon Sep 17 00:00:00 2001
|
||||
From: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Date: Fri, 24 Jun 2022 18:07:32 +0200
|
||||
Subject: [PATCH 18/21] edma_v1: move rx napi to per ring implementation
|
||||
|
||||
Move rx napi to per ring implementation.
|
||||
|
||||
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
---
|
||||
hal/dp_ops/edma_dp/edma_v1/edma_cfg.c | 1 +
|
||||
hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c | 25 +++++--
|
||||
hal/dp_ops/edma_dp/edma_v1/edma_data_plane.h | 4 +-
|
||||
hal/dp_ops/edma_dp/edma_v1/edma_tx_rx.c | 76 +++++++-------------
|
||||
4 files changed, 47 insertions(+), 59 deletions(-)
|
||||
|
||||
diff --git a/hal/dp_ops/edma_dp/edma_v1/edma_cfg.c b/hal/dp_ops/edma_dp/edma_v1/edma_cfg.c
|
||||
index 2e98aaf..20d055e 100644
|
||||
--- a/hal/dp_ops/edma_dp/edma_v1/edma_cfg.c
|
||||
+++ b/hal/dp_ops/edma_dp/edma_v1/edma_cfg.c
|
||||
@@ -410,6 +410,7 @@ static int edma_setup_ring_resources(struct edma_hw *ehw)
|
||||
*/
|
||||
for (i = 0; i < ehw->rxdesc_rings; i++) {
|
||||
rxdesc_ring = &ehw->rxdesc_ring[i];
|
||||
+ rxdesc_ring->ehw = ehw;
|
||||
rxdesc_ring->count = EDMA_RING_SIZE;
|
||||
rxdesc_ring->id = ehw->rxdesc_ring_start + i;
|
||||
|
||||
diff --git a/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c b/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c
|
||||
index 8932f40..565564a 100644
|
||||
--- a/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c
|
||||
+++ b/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c
|
||||
@@ -407,7 +407,9 @@ void edma_cleanup(bool is_dp_override)
|
||||
synchronize_irq(edma_hw.misc_intr);
|
||||
free_irq(edma_hw.misc_intr, (void *)(edma_hw.pdev));
|
||||
|
||||
- netif_napi_del(&edma_hw.rx_napi);
|
||||
+ for (i = 0; i < edma_hw.rxdesc_rings; i++)
|
||||
+ netif_napi_del(&edma_hw.rxdesc_ring[i].napi);
|
||||
+
|
||||
netif_napi_del(&edma_hw.tx_napi);
|
||||
edma_hw.napi_added = 0;
|
||||
}
|
||||
@@ -443,6 +445,8 @@ static int edma_if_open(struct nss_dp_data_plane_ctx *dpc,
|
||||
uint32_t tx_desc_ring, uint32_t rx_desc_ring,
|
||||
uint32_t mode)
|
||||
{
|
||||
+ int i;
|
||||
+
|
||||
if (!dpc->dev)
|
||||
return NSS_DP_FAILURE;
|
||||
|
||||
@@ -452,7 +456,9 @@ static int edma_if_open(struct nss_dp_data_plane_ctx *dpc,
|
||||
if (edma_hw.active++ != 0)
|
||||
return NSS_DP_SUCCESS;
|
||||
|
||||
- napi_enable(&edma_hw.rx_napi);
|
||||
+ for (i = 0; i < edma_hw.rxdesc_rings; i++)
|
||||
+ napi_enable(&edma_hw.rxdesc_ring[i].napi);
|
||||
+
|
||||
napi_enable(&edma_hw.tx_napi);
|
||||
|
||||
/*
|
||||
@@ -469,6 +475,8 @@ static int edma_if_open(struct nss_dp_data_plane_ctx *dpc,
|
||||
*/
|
||||
static int edma_if_close(struct nss_dp_data_plane_ctx *dpc)
|
||||
{
|
||||
+ int i;
|
||||
+
|
||||
if (--edma_hw.active != 0)
|
||||
return NSS_DP_SUCCESS;
|
||||
|
||||
@@ -480,7 +488,9 @@ static int edma_if_close(struct nss_dp_data_plane_ctx *dpc)
|
||||
/*
|
||||
* Disable NAPI
|
||||
*/
|
||||
- napi_disable(&edma_hw.rx_napi);
|
||||
+ for (i = 0; i < edma_hw.rxdesc_rings; i++)
|
||||
+ napi_disable(&edma_hw.rxdesc_ring[i].napi);
|
||||
+
|
||||
napi_disable(&edma_hw.tx_napi);
|
||||
return NSS_DP_SUCCESS;
|
||||
}
|
||||
@@ -749,7 +759,7 @@ static int edma_irq_init(void)
|
||||
for (i = 0; i < edma_hw.rxdesc_rings; i++) {
|
||||
err = request_irq(edma_hw.rxdesc_intr[i],
|
||||
edma_rx_handle_irq, IRQF_SHARED,
|
||||
- "edma_rxdesc", (void *)edma_hw.pdev);
|
||||
+ "edma_rxdesc", (void *)&edma_hw.rxdesc_ring[i]);
|
||||
if (err) {
|
||||
pr_debug("RXDESC ring IRQ:%d request failed\n",
|
||||
edma_hw.rxdesc_intr[i]);
|
||||
@@ -814,6 +824,8 @@ rx_fill_ring_intr_req_fail:
|
||||
*/
|
||||
static int edma_register_netdevice(struct net_device *netdev, uint32_t macid)
|
||||
{
|
||||
+ int i;
|
||||
+
|
||||
if (!netdev) {
|
||||
pr_info("nss_dp_edma: Invalid netdev pointer %px\n", netdev);
|
||||
return -EINVAL;
|
||||
@@ -839,8 +851,9 @@ static int edma_register_netdevice(struct net_device *netdev, uint32_t macid)
|
||||
* NAPI add
|
||||
*/
|
||||
if (!edma_hw.napi_added) {
|
||||
- netif_napi_add(netdev, &edma_hw.rx_napi, edma_rx_napi,
|
||||
- NAPI_POLL_WEIGHT);
|
||||
+ for (i = 0; i < edma_hw.rxdesc_rings; i++)
|
||||
+ netif_napi_add(netdev, &edma_hw.rxdesc_ring[i].napi, edma_rx_napi,
|
||||
+ NAPI_POLL_WEIGHT);
|
||||
|
||||
netif_tx_napi_add(netdev, &edma_hw.tx_napi, edma_tx_napi,
|
||||
NAPI_POLL_WEIGHT);
|
||||
diff --git a/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.h b/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.h
|
||||
index a45fb99..01a6453 100644
|
||||
--- a/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.h
|
||||
+++ b/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.h
|
||||
@@ -116,6 +116,8 @@ struct edma_rxfill_ring {
|
||||
* RxDesc ring
|
||||
*/
|
||||
struct edma_rxdesc_ring {
|
||||
+ struct napi_struct napi; /* napi structure */
|
||||
+ struct edma_hw *ehw;
|
||||
uint32_t id; /* RXDESC ring number */
|
||||
struct edma_rxfill_ring *rxfill; /* RXFILL ring used */
|
||||
void *desc; /* descriptor ring virtual address */
|
||||
@@ -172,8 +174,6 @@ enum edma_tx {
|
||||
* EDMA private data structure
|
||||
*/
|
||||
struct edma_hw {
|
||||
- struct napi_struct rx_napi;
|
||||
- /* napi structure */
|
||||
struct napi_struct tx_napi;
|
||||
/* napi structure */
|
||||
struct net_device *netdev_arr[EDMA_MAX_GMACS];
|
||||
diff --git a/hal/dp_ops/edma_dp/edma_v1/edma_tx_rx.c b/hal/dp_ops/edma_dp/edma_v1/edma_tx_rx.c
|
||||
index 1fb8cbf..1d2fa8a 100644
|
||||
--- a/hal/dp_ops/edma_dp/edma_v1/edma_tx_rx.c
|
||||
+++ b/hal/dp_ops/edma_dp/edma_v1/edma_tx_rx.c
|
||||
@@ -427,7 +427,7 @@ static uint32_t edma_clean_rx(struct edma_hw *ehw,
|
||||
nss_phy_tstamp_rx_buf(ndev, skb);
|
||||
else
|
||||
#if defined(NSS_DP_ENABLE_NAPI_GRO)
|
||||
- napi_gro_receive(&ehw->napi, skb);
|
||||
+ napi_gro_receive(&rxdesc_ring->napi, skb);
|
||||
#else
|
||||
netif_receive_skb(skb);
|
||||
#endif
|
||||
@@ -462,17 +462,13 @@ next_rx_desc:
|
||||
*/
|
||||
int edma_rx_napi(struct napi_struct *napi, int budget)
|
||||
{
|
||||
- struct edma_hw *ehw = container_of(napi, struct edma_hw, rx_napi);
|
||||
- struct edma_rxdesc_ring *rxdesc_ring = NULL;
|
||||
- struct edma_rxfill_ring *rxfill_ring = NULL;
|
||||
+ struct edma_rxdesc_ring *rxdesc_ring = container_of(napi, struct edma_rxdesc_ring, napi);
|
||||
+ struct edma_rxfill_ring *rxfill_ring = rxdesc_ring->rxfill;
|
||||
+ struct edma_hw *ehw = rxdesc_ring->ehw;
|
||||
|
||||
int work_done = 0;
|
||||
- int i;
|
||||
|
||||
- for (i = 0; i < ehw->rxdesc_rings; i++) {
|
||||
- rxdesc_ring = &ehw->rxdesc_ring[i];
|
||||
- work_done += edma_clean_rx(ehw, budget, rxdesc_ring);
|
||||
- }
|
||||
+ work_done += edma_clean_rx(ehw, budget, rxdesc_ring);
|
||||
|
||||
/*
|
||||
* TODO - rework and fix the budget control
|
||||
@@ -486,22 +482,15 @@ int edma_rx_napi(struct napi_struct *napi, int budget)
|
||||
/*
|
||||
* Set RXDESC ring interrupt mask
|
||||
*/
|
||||
- for (i = 0; i < ehw->rxdesc_rings; i++) {
|
||||
- rxdesc_ring = &ehw->rxdesc_ring[i];
|
||||
- edma_reg_write(
|
||||
- EDMA_REG_RXDESC_INT_MASK(rxdesc_ring->id),
|
||||
- ehw->rxdesc_intr_mask);
|
||||
- }
|
||||
+ edma_reg_write(
|
||||
+ EDMA_REG_RXDESC_INT_MASK(rxdesc_ring->id),
|
||||
+ ehw->rxdesc_intr_mask);
|
||||
|
||||
/*
|
||||
* Set RXFILL ring interrupt mask
|
||||
*/
|
||||
- for (i = 0; i < ehw->rxfill_rings; i++) {
|
||||
- rxfill_ring = &ehw->rxfill_ring[i];
|
||||
- edma_reg_write(EDMA_REG_RXFILL_INT_MASK(
|
||||
- rxfill_ring->id),
|
||||
- edma_hw.rxfill_intr_mask);
|
||||
- }
|
||||
+ edma_reg_write(EDMA_REG_RXFILL_INT_MASK(rxfill_ring->id),
|
||||
+ edma_hw.rxfill_intr_mask);
|
||||
}
|
||||
return work_done;
|
||||
}
|
||||
@@ -761,51 +750,36 @@ irqreturn_t edma_handle_misc_irq(int irq, void *ctx)
|
||||
*/
|
||||
irqreturn_t edma_rx_handle_irq(int irq, void *ctx)
|
||||
{
|
||||
- uint32_t reg_data = 0;
|
||||
+ struct edma_rxdesc_ring *rxdesc_ring = (struct edma_rxdesc_ring *)ctx;
|
||||
uint32_t rxdesc_intr_status = 0;
|
||||
- int i;
|
||||
- struct edma_rxdesc_ring *rxdesc_ring = NULL;
|
||||
- struct edma_hw *ehw = NULL;
|
||||
- struct platform_device *pdev = (struct platform_device *)ctx;
|
||||
-
|
||||
- ehw = platform_get_drvdata(pdev);
|
||||
- if (!ehw) {
|
||||
- pr_info("Unable to retrieve platrofm data");
|
||||
- return IRQ_HANDLED;
|
||||
- }
|
||||
+ uint32_t reg_data = 0;
|
||||
|
||||
/*
|
||||
* Read RxDesc intr status
|
||||
*/
|
||||
- for (i = 0; i < ehw->rxdesc_rings; i++) {
|
||||
- rxdesc_ring = &ehw->rxdesc_ring[i];
|
||||
- reg_data = edma_reg_read(
|
||||
- EDMA_REG_RXDESC_INT_STAT(rxdesc_ring->id));
|
||||
- rxdesc_intr_status |= reg_data &
|
||||
- EDMA_RXDESC_RING_INT_STATUS_MASK;
|
||||
+ reg_data = edma_reg_read(
|
||||
+ EDMA_REG_RXDESC_INT_STAT(rxdesc_ring->id));
|
||||
+ rxdesc_intr_status |= reg_data &
|
||||
+ EDMA_RXDESC_RING_INT_STATUS_MASK;
|
||||
|
||||
- /*
|
||||
- * Disable RxDesc intr
|
||||
- */
|
||||
- edma_reg_write(EDMA_REG_RXDESC_INT_MASK(rxdesc_ring->id),
|
||||
- EDMA_MASK_INT_DISABLE);
|
||||
- }
|
||||
+ /*
|
||||
+ * Disable RxDesc intr
|
||||
+ */
|
||||
+ edma_reg_write(EDMA_REG_RXDESC_INT_MASK(rxdesc_ring->id),
|
||||
+ EDMA_MASK_INT_DISABLE);
|
||||
|
||||
if (rxdesc_intr_status == 0)
|
||||
return IRQ_NONE;
|
||||
|
||||
- for (i = 0; i < ehw->rxdesc_rings; i++) {
|
||||
- rxdesc_ring = &ehw->rxdesc_ring[i];
|
||||
- edma_reg_write(EDMA_REG_RXDESC_INT_MASK(rxdesc_ring->id),
|
||||
- EDMA_MASK_INT_DISABLE);
|
||||
- }
|
||||
+ edma_reg_write(EDMA_REG_RXDESC_INT_MASK(rxdesc_ring->id),
|
||||
+ EDMA_MASK_INT_DISABLE);
|
||||
|
||||
/*
|
||||
*TODO - per core NAPI
|
||||
*/
|
||||
if (rxdesc_intr_status)
|
||||
- if (likely(napi_schedule_prep(&ehw->rx_napi)))
|
||||
- __napi_schedule(&ehw->rx_napi);
|
||||
+ if (likely(napi_schedule_prep(&rxdesc_ring->napi)))
|
||||
+ __napi_schedule(&rxdesc_ring->napi);
|
||||
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
--
|
||||
2.36.1
|
||||
|
@ -1,206 +0,0 @@
|
||||
From de169603dcfa7a33026587c4cef9938cc6c28b1e Mon Sep 17 00:00:00 2001
|
||||
From: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Date: Fri, 24 Jun 2022 18:25:16 +0200
|
||||
Subject: [PATCH 19/21] edma_v1: move tx napi to per ring implementation
|
||||
|
||||
Move tx napi to per ring implementation.
|
||||
|
||||
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
---
|
||||
hal/dp_ops/edma_dp/edma_v1/edma_cfg.c | 1 +
|
||||
hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c | 17 +++---
|
||||
hal/dp_ops/edma_dp/edma_v1/edma_data_plane.h | 4 +-
|
||||
hal/dp_ops/edma_dp/edma_v1/edma_tx_rx.c | 55 +++++++-------------
|
||||
4 files changed, 32 insertions(+), 45 deletions(-)
|
||||
|
||||
diff --git a/hal/dp_ops/edma_dp/edma_v1/edma_cfg.c b/hal/dp_ops/edma_dp/edma_v1/edma_cfg.c
|
||||
index 20d055e..6f2c082 100644
|
||||
--- a/hal/dp_ops/edma_dp/edma_v1/edma_cfg.c
|
||||
+++ b/hal/dp_ops/edma_dp/edma_v1/edma_cfg.c
|
||||
@@ -373,6 +373,7 @@ static int edma_setup_ring_resources(struct edma_hw *ehw)
|
||||
*/
|
||||
for (i = 0; i < ehw->txcmpl_rings; i++) {
|
||||
txcmpl_ring = &ehw->txcmpl_ring[i];
|
||||
+ txcmpl_ring->ehw = ehw;
|
||||
txcmpl_ring->count = EDMA_RING_SIZE;
|
||||
txcmpl_ring->id = ehw->txcmpl_ring_start + i;
|
||||
|
||||
diff --git a/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c b/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c
|
||||
index 565564a..49c7f8c 100644
|
||||
--- a/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c
|
||||
+++ b/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c
|
||||
@@ -410,7 +410,8 @@ void edma_cleanup(bool is_dp_override)
|
||||
for (i = 0; i < edma_hw.rxdesc_rings; i++)
|
||||
netif_napi_del(&edma_hw.rxdesc_ring[i].napi);
|
||||
|
||||
- netif_napi_del(&edma_hw.tx_napi);
|
||||
+ for (i = 0; i < edma_hw.txcmpl_rings; i++)
|
||||
+ netif_napi_del(&edma_hw.txcmpl_ring[i].napi);
|
||||
edma_hw.napi_added = 0;
|
||||
}
|
||||
|
||||
@@ -459,7 +460,8 @@ static int edma_if_open(struct nss_dp_data_plane_ctx *dpc,
|
||||
for (i = 0; i < edma_hw.rxdesc_rings; i++)
|
||||
napi_enable(&edma_hw.rxdesc_ring[i].napi);
|
||||
|
||||
- napi_enable(&edma_hw.tx_napi);
|
||||
+ for (i = 0; i < edma_hw.txcmpl_rings; i++)
|
||||
+ napi_enable(&edma_hw.txcmpl_ring[i].napi);
|
||||
|
||||
/*
|
||||
* Enable the interrupt masks.
|
||||
@@ -491,7 +493,9 @@ static int edma_if_close(struct nss_dp_data_plane_ctx *dpc)
|
||||
for (i = 0; i < edma_hw.rxdesc_rings; i++)
|
||||
napi_disable(&edma_hw.rxdesc_ring[i].napi);
|
||||
|
||||
- napi_disable(&edma_hw.tx_napi);
|
||||
+ for (i = 0; i < edma_hw.txcmpl_rings; i++)
|
||||
+ napi_disable(&edma_hw.txcmpl_ring[i].napi);
|
||||
+
|
||||
return NSS_DP_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -730,7 +734,7 @@ static int edma_irq_init(void)
|
||||
for (i = 0; i < edma_hw.txcmpl_rings; i++) {
|
||||
err = request_irq(edma_hw.txcmpl_intr[i],
|
||||
edma_tx_handle_irq, IRQF_SHARED,
|
||||
- "edma_txcmpl", (void *)edma_hw.pdev);
|
||||
+ "edma_txcmpl", (void *)&edma_hw.txcmpl_ring[i]);
|
||||
if (err) {
|
||||
pr_debug("TXCMPL ring IRQ:%d request failed\n",
|
||||
edma_hw.txcmpl_intr[i]);
|
||||
@@ -855,8 +859,9 @@ static int edma_register_netdevice(struct net_device *netdev, uint32_t macid)
|
||||
netif_napi_add(netdev, &edma_hw.rxdesc_ring[i].napi, edma_rx_napi,
|
||||
NAPI_POLL_WEIGHT);
|
||||
|
||||
- netif_tx_napi_add(netdev, &edma_hw.tx_napi, edma_tx_napi,
|
||||
- NAPI_POLL_WEIGHT);
|
||||
+ for (i = 0; i < edma_hw.txcmpl_rings; i++)
|
||||
+ netif_tx_napi_add(netdev, &edma_hw.txcmpl_ring[i].napi, edma_tx_napi,
|
||||
+ NAPI_POLL_WEIGHT);
|
||||
/*
|
||||
* Register the interrupt handlers and enable interrupts
|
||||
*/
|
||||
diff --git a/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.h b/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.h
|
||||
index 01a6453..8ec7e35 100644
|
||||
--- a/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.h
|
||||
+++ b/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.h
|
||||
@@ -95,6 +95,8 @@ struct edma_txdesc_ring {
|
||||
* TxCmpl ring
|
||||
*/
|
||||
struct edma_txcmpl_ring {
|
||||
+ struct napi_struct napi; /* napi structure */
|
||||
+ struct edma_hw *ehw;
|
||||
uint32_t id; /* TXCMPL ring number */
|
||||
void *desc; /* descriptor ring virtual address */
|
||||
dma_addr_t dma; /* descriptor ring physical address */
|
||||
@@ -174,8 +176,6 @@ enum edma_tx {
|
||||
* EDMA private data structure
|
||||
*/
|
||||
struct edma_hw {
|
||||
- struct napi_struct tx_napi;
|
||||
- /* napi structure */
|
||||
struct net_device *netdev_arr[EDMA_MAX_GMACS];
|
||||
/* netdev for each gmac port */
|
||||
struct device_node *device_node;
|
||||
diff --git a/hal/dp_ops/edma_dp/edma_v1/edma_tx_rx.c b/hal/dp_ops/edma_dp/edma_v1/edma_tx_rx.c
|
||||
index 1d2fa8a..8221a9c 100644
|
||||
--- a/hal/dp_ops/edma_dp/edma_v1/edma_tx_rx.c
|
||||
+++ b/hal/dp_ops/edma_dp/edma_v1/edma_tx_rx.c
|
||||
@@ -501,17 +501,14 @@ int edma_rx_napi(struct napi_struct *napi, int budget)
|
||||
*/
|
||||
int edma_tx_napi(struct napi_struct *napi, int budget)
|
||||
{
|
||||
- struct edma_hw *ehw = container_of(napi, struct edma_hw, tx_napi);
|
||||
- struct edma_txcmpl_ring *txcmpl_ring = NULL;
|
||||
+ struct edma_txcmpl_ring *txcmpl_ring = container_of(napi, struct edma_txcmpl_ring, napi);
|
||||
+ struct edma_hw *ehw = txcmpl_ring->ehw;
|
||||
|
||||
struct net_device *ndev;
|
||||
int work_done = 0;
|
||||
int i;
|
||||
|
||||
- for (i = 0; i < ehw->txcmpl_rings; i++) {
|
||||
- txcmpl_ring = &ehw->txcmpl_ring[i];
|
||||
- edma_clean_tx(ehw, txcmpl_ring);
|
||||
- }
|
||||
+ edma_clean_tx(ehw, txcmpl_ring);
|
||||
|
||||
/*
|
||||
* Resume netdev Tx queue
|
||||
@@ -542,12 +539,8 @@ int edma_tx_napi(struct napi_struct *napi, int budget)
|
||||
/*
|
||||
* Set TXCMPL ring interrupt mask
|
||||
*/
|
||||
- for (i = 0; i < ehw->txcmpl_rings; i++) {
|
||||
- txcmpl_ring = &ehw->txcmpl_ring[i];
|
||||
- edma_reg_write(EDMA_REG_TX_INT_MASK(txcmpl_ring->id),
|
||||
- ehw->txcmpl_intr_mask);
|
||||
- }
|
||||
-
|
||||
+ edma_reg_write(EDMA_REG_TX_INT_MASK(txcmpl_ring->id),
|
||||
+ ehw->txcmpl_intr_mask);
|
||||
}
|
||||
return work_done;
|
||||
}
|
||||
@@ -790,35 +783,23 @@ irqreturn_t edma_rx_handle_irq(int irq, void *ctx)
|
||||
*/
|
||||
irqreturn_t edma_tx_handle_irq(int irq, void *ctx)
|
||||
{
|
||||
- uint32_t reg_data = 0;
|
||||
+ struct edma_txcmpl_ring *txcmpl_ring = (struct edma_txcmpl_ring *)ctx;
|
||||
uint32_t txcmpl_intr_status = 0;
|
||||
- int i;
|
||||
- struct edma_txcmpl_ring *txcmpl_ring = NULL;
|
||||
- struct edma_hw *ehw = NULL;
|
||||
- struct platform_device *pdev = (struct platform_device *)ctx;
|
||||
-
|
||||
- ehw = platform_get_drvdata(pdev);
|
||||
- if (!ehw) {
|
||||
- pr_info("Unable to retrieve platrofm data");
|
||||
- return IRQ_HANDLED;
|
||||
- }
|
||||
+ uint32_t reg_data = 0;
|
||||
|
||||
/*
|
||||
* Read TxCmpl intr status
|
||||
*/
|
||||
- for (i = 0; i < ehw->txcmpl_rings; i++) {
|
||||
- txcmpl_ring = &ehw->txcmpl_ring[i];
|
||||
- reg_data = edma_reg_read(
|
||||
- EDMA_REG_TX_INT_STAT(txcmpl_ring->id));
|
||||
- txcmpl_intr_status |= reg_data &
|
||||
- EDMA_TXCMPL_RING_INT_STATUS_MASK;
|
||||
+ reg_data = edma_reg_read(
|
||||
+ EDMA_REG_TX_INT_STAT(txcmpl_ring->id));
|
||||
+ txcmpl_intr_status |= reg_data &
|
||||
+ EDMA_TXCMPL_RING_INT_STATUS_MASK;
|
||||
|
||||
- /*
|
||||
- * Disable TxCmpl intr
|
||||
- */
|
||||
- edma_reg_write(EDMA_REG_TX_INT_MASK(txcmpl_ring->id),
|
||||
- EDMA_MASK_INT_DISABLE);
|
||||
- }
|
||||
+ /*
|
||||
+ * Disable TxCmpl intr
|
||||
+ */
|
||||
+ edma_reg_write(EDMA_REG_TX_INT_MASK(txcmpl_ring->id),
|
||||
+ EDMA_MASK_INT_DISABLE);
|
||||
|
||||
if (txcmpl_intr_status == 0)
|
||||
return IRQ_NONE;
|
||||
@@ -827,8 +808,8 @@ irqreturn_t edma_tx_handle_irq(int irq, void *ctx)
|
||||
*TODO - per core NAPI
|
||||
*/
|
||||
if (txcmpl_intr_status)
|
||||
- if (likely(napi_schedule_prep(&ehw->tx_napi)))
|
||||
- __napi_schedule(&ehw->tx_napi);
|
||||
+ if (likely(napi_schedule_prep(&txcmpl_ring->napi)))
|
||||
+ __napi_schedule(&txcmpl_ring->napi);
|
||||
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
--
|
||||
2.36.1
|
||||
|
@ -1,112 +0,0 @@
|
||||
From 0f7bf6cf6fd536cd5965d596067e469e84559761 Mon Sep 17 00:00:00 2001
|
||||
From: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Date: Fri, 24 Jun 2022 20:04:17 +0200
|
||||
Subject: [PATCH 20/21] edma_v1: add support for threaded napi
|
||||
|
||||
Add required changed to enable threaded napi. Also change rxfill to use
|
||||
napi_alloc_skb.
|
||||
|
||||
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
---
|
||||
hal/dp_ops/edma_dp/edma_v1/edma_cfg.c | 5 -----
|
||||
hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c | 12 ++++++++++--
|
||||
hal/dp_ops/edma_dp/edma_v1/edma_data_plane.h | 4 ++--
|
||||
hal/dp_ops/edma_dp/edma_v1/edma_tx_rx.c | 7 ++++---
|
||||
4 files changed, 16 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/hal/dp_ops/edma_dp/edma_v1/edma_cfg.c b/hal/dp_ops/edma_dp/edma_v1/edma_cfg.c
|
||||
index 6f2c082..33f4297 100644
|
||||
--- a/hal/dp_ops/edma_dp/edma_v1/edma_cfg.c
|
||||
+++ b/hal/dp_ops/edma_dp/edma_v1/edma_cfg.c
|
||||
@@ -670,11 +670,6 @@ static void edma_configure_rxfill_ring(struct edma_hw *ehw,
|
||||
|
||||
data = rxfill_ring->count & EDMA_RXFILL_RING_SIZE_MASK;
|
||||
edma_reg_write(EDMA_REG_RXFILL_RING_SIZE(rxfill_ring->id), data);
|
||||
-
|
||||
- /*
|
||||
- * Alloc Rx buffers
|
||||
- */
|
||||
- edma_alloc_rx_buffer(ehw, rxfill_ring);
|
||||
}
|
||||
|
||||
/*
|
||||
diff --git a/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c b/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c
|
||||
index 49c7f8c..3736254 100644
|
||||
--- a/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c
|
||||
+++ b/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c
|
||||
@@ -457,8 +457,15 @@ static int edma_if_open(struct nss_dp_data_plane_ctx *dpc,
|
||||
if (edma_hw.active++ != 0)
|
||||
return NSS_DP_SUCCESS;
|
||||
|
||||
- for (i = 0; i < edma_hw.rxdesc_rings; i++)
|
||||
- napi_enable(&edma_hw.rxdesc_ring[i].napi);
|
||||
+ for (i = 0; i < edma_hw.rxdesc_rings; i++) {
|
||||
+ struct edma_rxdesc_ring *rxdesc_ring = &edma_hw.rxdesc_ring[i];
|
||||
+ /*
|
||||
+ * Alloc Rx buffers
|
||||
+ */
|
||||
+ edma_alloc_rx_buffer(&edma_hw, &rxdesc_ring->napi, rxdesc_ring->rxfill);
|
||||
+
|
||||
+ napi_enable(&rxdesc_ring->napi);
|
||||
+ }
|
||||
|
||||
for (i = 0; i < edma_hw.txcmpl_rings; i++)
|
||||
napi_enable(&edma_hw.txcmpl_ring[i].napi);
|
||||
@@ -899,6 +906,7 @@ static int edma_if_init(struct nss_dp_data_plane_ctx *dpc)
|
||||
* Headroom needed for Tx preheader
|
||||
*/
|
||||
netdev->needed_headroom += EDMA_TX_PREHDR_SIZE;
|
||||
+ dev_set_threaded(netdev, true);
|
||||
|
||||
return NSS_DP_SUCCESS;
|
||||
}
|
||||
diff --git a/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.h b/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.h
|
||||
index 8ec7e35..7f8a8d4 100644
|
||||
--- a/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.h
|
||||
+++ b/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.h
|
||||
@@ -276,8 +276,8 @@ extern struct edma_hw edma_hw;
|
||||
uint32_t edma_reg_read(uint32_t reg_off);
|
||||
void edma_reg_write(uint32_t reg_off, uint32_t val);
|
||||
|
||||
-int edma_alloc_rx_buffer(struct edma_hw *ehw,
|
||||
- struct edma_rxfill_ring *rxfill_ring);
|
||||
+int edma_alloc_rx_buffer(struct edma_hw *ehw, struct napi_struct *napi,
|
||||
+ struct edma_rxfill_ring *rxfill_ring);
|
||||
enum edma_tx edma_ring_xmit(struct edma_hw *ehw,
|
||||
struct net_device *netdev,
|
||||
struct sk_buff *skb,
|
||||
diff --git a/hal/dp_ops/edma_dp/edma_v1/edma_tx_rx.c b/hal/dp_ops/edma_dp/edma_v1/edma_tx_rx.c
|
||||
index 8221a9c..001f883 100644
|
||||
--- a/hal/dp_ops/edma_dp/edma_v1/edma_tx_rx.c
|
||||
+++ b/hal/dp_ops/edma_dp/edma_v1/edma_tx_rx.c
|
||||
@@ -29,7 +29,8 @@
|
||||
* Alloc Rx buffers for one RxFill ring
|
||||
*/
|
||||
int edma_alloc_rx_buffer(struct edma_hw *ehw,
|
||||
- struct edma_rxfill_ring *rxfill_ring)
|
||||
+ struct napi_struct *napi,
|
||||
+ struct edma_rxfill_ring *rxfill_ring)
|
||||
{
|
||||
struct platform_device *pdev = ehw->pdev;
|
||||
struct sk_buff *skb;
|
||||
@@ -64,7 +65,7 @@ int edma_alloc_rx_buffer(struct edma_hw *ehw,
|
||||
/*
|
||||
* Allocate buffer
|
||||
*/
|
||||
- skb = dev_alloc_skb(alloc_size);
|
||||
+ skb = napi_alloc_skb(napi, alloc_size);
|
||||
if (unlikely(!skb))
|
||||
break;
|
||||
|
||||
@@ -445,7 +446,7 @@ next_rx_desc:
|
||||
work_done++;
|
||||
}
|
||||
|
||||
- edma_alloc_rx_buffer(ehw, rxdesc_ring->rxfill);
|
||||
+ edma_alloc_rx_buffer(ehw, &rxdesc_ring->napi, rxdesc_ring->rxfill);
|
||||
|
||||
/*
|
||||
* make sure the consumer index is updated
|
||||
--
|
||||
2.36.1
|
||||
|
@ -1,204 +0,0 @@
|
||||
From 1e1543fb908e382001881d2aad7ab9d4a903c0ee Mon Sep 17 00:00:00 2001
|
||||
From: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Date: Fri, 24 Jun 2022 22:08:25 +0200
|
||||
Subject: [PATCH] edma_v1: improve handling with rx/tx irq and napi pool
|
||||
|
||||
Correctly disable interrupt and schedule napi instead of consuming the
|
||||
entire ring and emit napi_complete.
|
||||
|
||||
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
---
|
||||
hal/dp_ops/edma_dp/edma_v1/edma_tx_rx.c | 133 ++++++++----------------
|
||||
1 file changed, 46 insertions(+), 87 deletions(-)
|
||||
|
||||
diff --git a/hal/dp_ops/edma_dp/edma_v1/edma_tx_rx.c b/hal/dp_ops/edma_dp/edma_v1/edma_tx_rx.c
|
||||
index 2bf1467..82fb697 100644
|
||||
--- a/hal/dp_ops/edma_dp/edma_v1/edma_tx_rx.c
|
||||
+++ b/hal/dp_ops/edma_dp/edma_v1/edma_tx_rx.c
|
||||
@@ -460,35 +460,30 @@ next_rx_desc:
|
||||
int edma_rx_napi(struct napi_struct *napi, int budget)
|
||||
{
|
||||
struct edma_rxdesc_ring *rxdesc_ring = container_of(napi, struct edma_rxdesc_ring, napi);
|
||||
- struct edma_rxfill_ring *rxfill_ring = rxdesc_ring->rxfill;
|
||||
struct edma_hw *ehw = rxdesc_ring->ehw;
|
||||
+ uint32_t status;
|
||||
|
||||
int work_done = 0;
|
||||
|
||||
- work_done += edma_clean_rx(ehw, budget, rxdesc_ring);
|
||||
+ do {
|
||||
+ work_done += edma_clean_rx(ehw, budget, rxdesc_ring);
|
||||
+ if (likely(work_done >= budget)) {
|
||||
+ return work_done;
|
||||
+ }
|
||||
+
|
||||
+ status = EDMA_RXDESC_RING_INT_STATUS_MASK & edma_reg_read(
|
||||
+ EDMA_REG_RXDESC_INT_STAT(rxdesc_ring->id));
|
||||
+ } while (likely(status));
|
||||
+
|
||||
+ napi_complete(napi);
|
||||
|
||||
/*
|
||||
- * TODO - rework and fix the budget control
|
||||
+ * Set RXDESC ring interrupt mask
|
||||
*/
|
||||
- if (work_done < budget) {
|
||||
- /*
|
||||
- * TODO per core NAPI
|
||||
- */
|
||||
- napi_complete(napi);
|
||||
+ edma_reg_write(
|
||||
+ EDMA_REG_RXDESC_INT_MASK(rxdesc_ring->id),
|
||||
+ ehw->rxdesc_intr_mask);
|
||||
|
||||
- /*
|
||||
- * Set RXDESC ring interrupt mask
|
||||
- */
|
||||
- edma_reg_write(
|
||||
- EDMA_REG_RXDESC_INT_MASK(rxdesc_ring->id),
|
||||
- ehw->rxdesc_intr_mask);
|
||||
-
|
||||
- /*
|
||||
- * Set RXFILL ring interrupt mask
|
||||
- */
|
||||
- edma_reg_write(EDMA_REG_RXFILL_INT_MASK(rxfill_ring->id),
|
||||
- edma_hw.rxfill_intr_mask);
|
||||
- }
|
||||
return work_done;
|
||||
}
|
||||
|
||||
@@ -503,10 +498,27 @@ int edma_tx_napi(struct napi_struct *napi, int budget)
|
||||
|
||||
struct net_device *ndev;
|
||||
int work_done = 0;
|
||||
+ uint32_t status;
|
||||
int i;
|
||||
|
||||
- edma_clean_tx(ehw, txcmpl_ring);
|
||||
+ do {
|
||||
+ work_done += edma_clean_tx(ehw, txcmpl_ring);
|
||||
+ if (work_done >= budget) {
|
||||
+ goto exit;
|
||||
+ }
|
||||
+
|
||||
+ status = EDMA_TXCMPL_RING_INT_STATUS_MASK & edma_reg_read(EDMA_REG_TX_INT_STAT(txcmpl_ring->id));
|
||||
+ } while (status);
|
||||
|
||||
+ napi_complete(napi);
|
||||
+
|
||||
+ /*
|
||||
+ * Set TXCMPL ring interrupt mask
|
||||
+ */
|
||||
+ edma_reg_write(EDMA_REG_TX_INT_MASK(txcmpl_ring->id),
|
||||
+ ehw->txcmpl_intr_mask);
|
||||
+
|
||||
+exit:
|
||||
/*
|
||||
* Resume netdev Tx queue
|
||||
*/
|
||||
@@ -524,21 +536,6 @@ int edma_tx_napi(struct napi_struct *napi, int budget)
|
||||
netif_start_queue(ndev);
|
||||
}
|
||||
|
||||
- /*
|
||||
- * TODO - rework and fix the budget control
|
||||
- */
|
||||
- if (work_done < budget) {
|
||||
- /*
|
||||
- * TODO per core NAPI
|
||||
- */
|
||||
- napi_complete(napi);
|
||||
-
|
||||
- /*
|
||||
- * Set TXCMPL ring interrupt mask
|
||||
- */
|
||||
- edma_reg_write(EDMA_REG_TX_INT_MASK(txcmpl_ring->id),
|
||||
- ehw->txcmpl_intr_mask);
|
||||
- }
|
||||
return work_done;
|
||||
}
|
||||
|
||||
@@ -741,35 +738,14 @@ irqreturn_t edma_handle_misc_irq(int irq, void *ctx)
|
||||
irqreturn_t edma_rx_handle_irq(int irq, void *ctx)
|
||||
{
|
||||
struct edma_rxdesc_ring *rxdesc_ring = (struct edma_rxdesc_ring *)ctx;
|
||||
- uint32_t rxdesc_intr_status = 0;
|
||||
- uint32_t reg_data = 0;
|
||||
|
||||
- /*
|
||||
- * Read RxDesc intr status
|
||||
- */
|
||||
- reg_data = edma_reg_read(
|
||||
- EDMA_REG_RXDESC_INT_STAT(rxdesc_ring->id));
|
||||
- rxdesc_intr_status |= reg_data &
|
||||
- EDMA_RXDESC_RING_INT_STATUS_MASK;
|
||||
+ if (likely(napi_schedule_prep(&rxdesc_ring->napi))) {
|
||||
|
||||
- /*
|
||||
- * Disable RxDesc intr
|
||||
- */
|
||||
- edma_reg_write(EDMA_REG_RXDESC_INT_MASK(rxdesc_ring->id),
|
||||
+ edma_reg_write(EDMA_REG_RXDESC_INT_MASK(rxdesc_ring->id),
|
||||
EDMA_MASK_INT_DISABLE);
|
||||
|
||||
- if (rxdesc_intr_status == 0)
|
||||
- return IRQ_NONE;
|
||||
-
|
||||
- edma_reg_write(EDMA_REG_RXDESC_INT_MASK(rxdesc_ring->id),
|
||||
- EDMA_MASK_INT_DISABLE);
|
||||
-
|
||||
- /*
|
||||
- *TODO - per core NAPI
|
||||
- */
|
||||
- if (rxdesc_intr_status)
|
||||
- if (likely(napi_schedule_prep(&rxdesc_ring->napi)))
|
||||
- __napi_schedule(&rxdesc_ring->napi);
|
||||
+ __napi_schedule(&rxdesc_ring->napi);
|
||||
+ }
|
||||
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
@@ -781,32 +757,15 @@ irqreturn_t edma_rx_handle_irq(int irq, void *ctx)
|
||||
irqreturn_t edma_tx_handle_irq(int irq, void *ctx)
|
||||
{
|
||||
struct edma_txcmpl_ring *txcmpl_ring = (struct edma_txcmpl_ring *)ctx;
|
||||
- uint32_t txcmpl_intr_status = 0;
|
||||
- uint32_t reg_data = 0;
|
||||
|
||||
- /*
|
||||
- * Read TxCmpl intr status
|
||||
- */
|
||||
- reg_data = edma_reg_read(
|
||||
- EDMA_REG_TX_INT_STAT(txcmpl_ring->id));
|
||||
- txcmpl_intr_status |= reg_data &
|
||||
- EDMA_TXCMPL_RING_INT_STATUS_MASK;
|
||||
-
|
||||
- /*
|
||||
- * Disable TxCmpl intr
|
||||
- */
|
||||
- edma_reg_write(EDMA_REG_TX_INT_MASK(txcmpl_ring->id),
|
||||
- EDMA_MASK_INT_DISABLE);
|
||||
-
|
||||
- if (txcmpl_intr_status == 0)
|
||||
- return IRQ_NONE;
|
||||
-
|
||||
- /*
|
||||
- *TODO - per core NAPI
|
||||
- */
|
||||
- if (txcmpl_intr_status)
|
||||
- if (likely(napi_schedule_prep(&txcmpl_ring->napi)))
|
||||
- __napi_schedule(&txcmpl_ring->napi);
|
||||
+ if (likely(napi_schedule_prep(&txcmpl_ring->napi))) {
|
||||
+ /*
|
||||
+ * Disable TxCmpl intr
|
||||
+ */
|
||||
+ edma_reg_write(EDMA_REG_TX_INT_MASK(txcmpl_ring->id),
|
||||
+ EDMA_MASK_INT_DISABLE);
|
||||
+ __napi_schedule(&txcmpl_ring->napi);
|
||||
+ }
|
||||
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
--
|
||||
2.36.1
|
||||
|
@ -3,11 +3,11 @@ include $(TOPDIR)/rules.mk
|
||||
PKG_NAME:=qca-nss-drv-64
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE_URL:=https://git.codelinaro.org/clo/qsdk/oss/lklm/nss-drv.git
|
||||
PKG_SOURCE_URL:=https://source.codeaurora.org/quic/qsdk/oss/lklm/nss-drv
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_DATE:=2022-06-15
|
||||
PKG_SOURCE_VERSION:=0bbd153ec2698a17e9dd32dd72a2c65f22b449e0
|
||||
PKG_MIRROR_HASH:=0e6caadc5b31ee1c6b8c6592ac3a346337ff7daa0a2005d21603cd3625c6e2d8
|
||||
PKG_SOURCE_DATE:=2021-04-26
|
||||
PKG_SOURCE_VERSION:=1cf4bf81fd395f61648efeae78cdf1df60e954ff
|
||||
PKG_MIRROR_HASH:=3dd84a548a530188021fd4dab54ca4e1eb9056ca77381b24f587365fc7c16f21
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
@ -50,10 +50,7 @@ define Build/InstallDev
|
||||
$(CP) $(PKG_BUILD_DIR)/exports/* $(1)/usr/include/qca-nss-drv/
|
||||
endef
|
||||
|
||||
EXTRA_CFLAGS+= -I$(STAGING_DIR)/usr/include/qca-nss-gmac \
|
||||
-I$(STAGING_DIR)/usr/include/qca-nss-dp \
|
||||
-I$(STAGING_DIR)/usr/include/qca-ssdk \
|
||||
-Wno-unused-variable
|
||||
EXTRA_CFLAGS+= -I$(STAGING_DIR)/usr/include/qca-nss-gmac -I$(STAGING_DIR)/usr/include/qca-nss-dp -I$(STAGING_DIR)/usr/include/qca-ssdk
|
||||
|
||||
ifneq (, $(findstring $(CONFIG_TARGET_BOARD), "ipq807x" "ipq60xx"))
|
||||
EXTRA_CFLAGS+= -DNSS_MEM_PROFILE_MEDIUM
|
||||
@ -66,12 +63,11 @@ endif
|
||||
|
||||
DRV_MAKE_OPTS:=
|
||||
ifeq ($(LOW_MEM_PROFILE_MAKE_OPTS),y)
|
||||
DRV_MAKE_OPTS+= \
|
||||
NSS_DRV_C2C_ENABLE=n \
|
||||
DRV_MAKE_OPTS+=NSS_DRV_C2C_ENABLE=n \
|
||||
NSS_DRV_CAPWAP_ENABLE=n \
|
||||
NSS_DRV_CLMAP_ENABLE=n \
|
||||
NSS_DRV_CRYPTO_ENABLE=y \
|
||||
NSS_DRV_DTLS_ENABLE=y \
|
||||
NSS_DRV_CRYPTO_ENABLE=n \
|
||||
NSS_DRV_DTLS_ENABLE=n \
|
||||
NSS_DRV_GRE_ENABLE=n \
|
||||
NSS_DRV_GRE_REDIR_ENABLE=n \
|
||||
NSS_DRV_GRE_TUNNEL_ENABLE=n \
|
||||
@ -89,20 +85,14 @@ DRV_MAKE_OPTS+= \
|
||||
NSS_DRV_RMNET_ENABLE=n \
|
||||
NSS_DRV_SHAPER_ENABLE=n \
|
||||
NSS_DRV_SJACK_ENABLE=n \
|
||||
NSS_DRV_TLS_ENABLE=y \
|
||||
NSS_DRV_TLS_ENABLE=n \
|
||||
NSS_DRV_TRUSTSEC_ENABLE=n \
|
||||
NSS_DRV_TSTAMP_ENABLE=n \
|
||||
NSS_DRV_TUN6RD_ENABLE=n \
|
||||
NSS_DRV_TUNIPIP6_ENABLE=n \
|
||||
NSS_DRV_VXLAN_ENABLE=y \
|
||||
NSS_DRV_VXLAN_ENABLE=n \
|
||||
NSS_DRV_MATCH_ENABLE=n \
|
||||
NSS_DRV_MIRROR_ENABLE=n \
|
||||
NSS_DRV_PPPOE_ENABLE=y \
|
||||
NSS_DRV_VIRT_IF_ENABLE=n \
|
||||
NSS_DRV_VLAN_ENABLE=y \
|
||||
NSS_DRV_BRIDGE_ENABLE=y \
|
||||
NSS_DRV_WIFI_EXT_VDEV_ENABLE=n \
|
||||
NSS_DRV_WIFI_MESH_ENABLE=n
|
||||
NSS_DRV_MIRROR_ENABLE=n
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_TARGET_BOARD), "ipq807x")
|
||||
@ -113,6 +103,8 @@ endif
|
||||
|
||||
define Build/Configure
|
||||
$(LN) arch/nss_$(SOC).h $(PKG_BUILD_DIR)/exports/nss_arch.h
|
||||
sed -i "s/define NSS_FW_VERSION_MAJOR.*/define NSS_FW_VERSION_MAJOR 11/" $(PKG_BUILD_DIR)/exports/nss_fw_version.h
|
||||
sed -i "s/define NSS_FW_VERSION_MINOR.*/define NSS_FW_VERSION_MINOR 3/" $(PKG_BUILD_DIR)/exports/nss_fw_version.h
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
|
@ -1,7 +1,7 @@
|
||||
From 0cffa7bb366a4e0ff5665d6fc2fa33c1437cb397 Mon Sep 17 00:00:00 2001
|
||||
From b5e2a7167ca3df9fce34f0d7c05468d4f5597275 Mon Sep 17 00:00:00 2001
|
||||
From: Robert Marko <robimarko@gmail.com>
|
||||
Date: Thu, 13 May 2021 23:33:18 +0200
|
||||
Subject: [PATCH 2/8] nss-drv: replace ioremap_nocache() with ioremap()
|
||||
Subject: [PATCH] nss-drv: replace ioremap_nocache() with ioremap()
|
||||
|
||||
ioremap_nocache() does not exist anymore.
|
||||
|
||||
@ -16,11 +16,9 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
nss_ppe.c | 2 +-
|
||||
7 files changed, 16 insertions(+), 16 deletions(-)
|
||||
|
||||
diff --git a/nss_hal/ipq50xx/nss_hal_pvt.c b/nss_hal/ipq50xx/nss_hal_pvt.c
|
||||
index 3d6dfd0..e3e4bd2 100644
|
||||
--- a/nss_hal/ipq50xx/nss_hal_pvt.c
|
||||
+++ b/nss_hal/ipq50xx/nss_hal_pvt.c
|
||||
@@ -184,13 +184,13 @@ static struct nss_platform_data *__nss_hal_of_get_pdata(struct platform_device *
|
||||
@@ -184,13 +184,13 @@ static struct nss_platform_data *__nss_h
|
||||
npd->nphys = res_nphys.start;
|
||||
npd->qgic_phys = res_qgic_phys.start;
|
||||
|
||||
@ -36,7 +34,7 @@ index 3d6dfd0..e3e4bd2 100644
|
||||
if (!npd->qgic_map) {
|
||||
nss_info_always("%px: nss%d: ioremap() fail for qgic map\n", nss_ctx, nss_ctx->id);
|
||||
goto out;
|
||||
@@ -348,7 +348,7 @@ static int __nss_hal_common_reset(struct platform_device *nss_dev)
|
||||
@@ -348,7 +348,7 @@ static int __nss_hal_common_reset(struct
|
||||
|
||||
of_node_put(cmn);
|
||||
|
||||
@ -45,11 +43,9 @@ index 3d6dfd0..e3e4bd2 100644
|
||||
if (!nss_misc_reset) {
|
||||
pr_err("%px: ioremap fail for nss_misc_reset\n", nss_dev);
|
||||
return -EFAULT;
|
||||
diff --git a/nss_hal/ipq60xx/nss_hal_pvt.c b/nss_hal/ipq60xx/nss_hal_pvt.c
|
||||
index 4c84cb9..e76ef6d 100644
|
||||
--- a/nss_hal/ipq60xx/nss_hal_pvt.c
|
||||
+++ b/nss_hal/ipq60xx/nss_hal_pvt.c
|
||||
@@ -207,13 +207,13 @@ static struct nss_platform_data *__nss_hal_of_get_pdata(struct platform_device *
|
||||
@@ -207,13 +207,13 @@ static struct nss_platform_data *__nss_h
|
||||
npd->nphys = res_nphys.start;
|
||||
npd->qgic_phys = res_qgic_phys.start;
|
||||
|
||||
@ -65,7 +61,7 @@ index 4c84cb9..e76ef6d 100644
|
||||
if (!npd->qgic_map) {
|
||||
nss_info_always("%px: nss%d: ioremap() fail for qgic map\n", nss_ctx, nss_ctx->id);
|
||||
goto out;
|
||||
@@ -433,13 +433,13 @@ static int __nss_hal_common_reset(struct platform_device *nss_dev)
|
||||
@@ -433,13 +433,13 @@ static int __nss_hal_common_reset(struct
|
||||
|
||||
of_node_put(cmn);
|
||||
|
||||
@ -81,11 +77,9 @@ index 4c84cb9..e76ef6d 100644
|
||||
if (!nss_misc_reset_flag) {
|
||||
pr_err("%px: ioremap fail for nss_misc_reset_flag\n", nss_dev);
|
||||
return -EFAULT;
|
||||
diff --git a/nss_hal/ipq806x/nss_hal_pvt.c b/nss_hal/ipq806x/nss_hal_pvt.c
|
||||
index b8733e0..52d63b0 100644
|
||||
--- a/nss_hal/ipq806x/nss_hal_pvt.c
|
||||
+++ b/nss_hal/ipq806x/nss_hal_pvt.c
|
||||
@@ -458,7 +458,7 @@ static struct nss_platform_data *__nss_hal_of_get_pdata(struct platform_device *
|
||||
@@ -458,7 +458,7 @@ static struct nss_platform_data *__nss_h
|
||||
npd->nphys = res_nphys.start;
|
||||
npd->vphys = res_vphys.start;
|
||||
|
||||
@ -94,7 +88,7 @@ index b8733e0..52d63b0 100644
|
||||
if (!npd->nmap) {
|
||||
nss_info_always("%px: nss%d: ioremap() fail for nphys\n", nss_ctx, nss_ctx->id);
|
||||
goto out;
|
||||
@@ -711,7 +711,7 @@ static int __nss_hal_common_reset(struct platform_device *nss_dev)
|
||||
@@ -711,7 +711,7 @@ static int __nss_hal_common_reset(struct
|
||||
}
|
||||
of_node_put(cmn);
|
||||
|
||||
@ -103,11 +97,9 @@ index b8733e0..52d63b0 100644
|
||||
if (!fpb_base) {
|
||||
pr_err("%px: ioremap fail for nss_fpb_base\n", nss_dev);
|
||||
return -EFAULT;
|
||||
diff --git a/nss_hal/ipq807x/nss_hal_pvt.c b/nss_hal/ipq807x/nss_hal_pvt.c
|
||||
index b95a23c..bb8f42f 100644
|
||||
--- a/nss_hal/ipq807x/nss_hal_pvt.c
|
||||
+++ b/nss_hal/ipq807x/nss_hal_pvt.c
|
||||
@@ -234,7 +234,7 @@ static struct nss_platform_data *__nss_hal_of_get_pdata(struct platform_device *
|
||||
@@ -234,7 +234,7 @@ static struct nss_platform_data *__nss_h
|
||||
npd->vphys = res_vphys.start;
|
||||
npd->qgic_phys = res_qgic_phys.start;
|
||||
|
||||
@ -116,7 +108,7 @@ index b95a23c..bb8f42f 100644
|
||||
if (!npd->nmap) {
|
||||
nss_info_always("%px: nss%d: ioremap() fail for nphys\n", nss_ctx, nss_ctx->id);
|
||||
goto out;
|
||||
@@ -247,7 +247,7 @@ static struct nss_platform_data *__nss_hal_of_get_pdata(struct platform_device *
|
||||
@@ -247,7 +247,7 @@ static struct nss_platform_data *__nss_h
|
||||
goto out;
|
||||
}
|
||||
|
||||
@ -125,7 +117,7 @@ index b95a23c..bb8f42f 100644
|
||||
if (!npd->qgic_map) {
|
||||
nss_info_always("%px: nss%d: ioremap() fail for qgic map\n", nss_ctx, nss_ctx->id);
|
||||
goto out;
|
||||
@@ -467,7 +467,7 @@ static int __nss_hal_common_reset(struct platform_device *nss_dev)
|
||||
@@ -467,7 +467,7 @@ static int __nss_hal_common_reset(struct
|
||||
}
|
||||
of_node_put(cmn);
|
||||
|
||||
@ -134,11 +126,9 @@ index b95a23c..bb8f42f 100644
|
||||
if (!nss_misc_reset) {
|
||||
pr_err("%px: ioremap fail for nss_misc_reset\n", nss_dev);
|
||||
return -EFAULT;
|
||||
diff --git a/nss_hal/nss_hal.c b/nss_hal/nss_hal.c
|
||||
index d58bb57..57974c1 100644
|
||||
--- a/nss_hal/nss_hal.c
|
||||
+++ b/nss_hal/nss_hal.c
|
||||
@@ -78,9 +78,9 @@ int nss_hal_firmware_load(struct nss_ctx_instance *nss_ctx, struct platform_devi
|
||||
@@ -78,9 +78,9 @@ int nss_hal_firmware_load(struct nss_ctx
|
||||
return rc;
|
||||
}
|
||||
|
||||
@ -150,11 +140,9 @@ index d58bb57..57974c1 100644
|
||||
release_firmware(nss_fw);
|
||||
return rc;
|
||||
}
|
||||
diff --git a/nss_meminfo.c b/nss_meminfo.c
|
||||
index e24e6be..2255eae 100644
|
||||
--- a/nss_meminfo.c
|
||||
+++ b/nss_meminfo.c
|
||||
@@ -728,7 +728,7 @@ bool nss_meminfo_init(struct nss_ctx_instance *nss_ctx)
|
||||
@@ -728,7 +728,7 @@ bool nss_meminfo_init(struct nss_ctx_ins
|
||||
/*
|
||||
* meminfo_start is the label where the start address of meminfo map is stored.
|
||||
*/
|
||||
@ -163,8 +151,6 @@ index e24e6be..2255eae 100644
|
||||
NSS_MEMINFO_RESERVE_AREA_SIZE);
|
||||
if (!meminfo_start) {
|
||||
nss_info_always("%px: cannot remap meminfo start\n", nss_ctx);
|
||||
diff --git a/nss_ppe.c b/nss_ppe.c
|
||||
index 46ce217..644fc98 100644
|
||||
--- a/nss_ppe.c
|
||||
+++ b/nss_ppe.c
|
||||
@@ -357,7 +357,7 @@ void nss_ppe_init(void)
|
||||
@ -176,6 +162,3 @@ index 46ce217..644fc98 100644
|
||||
if (!ppe_pvt.ppe_base) {
|
||||
nss_warning("DRV can't get PPE base address\n");
|
||||
return;
|
||||
--
|
||||
2.34.1
|
||||
|
||||
|
@ -1,573 +0,0 @@
|
||||
From 12cf63f66bfe509da6d845e5c716efd99dadf01e Mon Sep 17 00:00:00 2001
|
||||
From: Ansuel Smith <ansuelsmth@gmail.com>
|
||||
Date: Tue, 5 Apr 2022 15:38:18 +0200
|
||||
Subject: [PATCH 4/8] nss-drv: rework NSS_CORE_DMA_CACHE_MAINT ops
|
||||
|
||||
Rework NSS_CORE_DMA_CACHE_MAINT ops to use standard dma sync ops instead
|
||||
of using the direct arch function. This permit to skip any hack/patch
|
||||
needed for nss-drv to correctly compile on upstream kernel.
|
||||
|
||||
We drop any NSS_CORE_DMA_CACHE_MAINT use in nss_core and we correctly
|
||||
use the dma_sync_single_for_device we correctly dma addr using the new
|
||||
DMA helper.
|
||||
We drop sync for IOREMAP addr and we just leave a memory block.
|
||||
We hope the nss_profiler is correctly ported.
|
||||
We finally drop the NSS_CORE_DMA_CACHE_MAINT jus in case someone wants
|
||||
to use it.
|
||||
|
||||
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
|
||||
---
|
||||
nss_core.c | 136 +++++++++++++++++++++++++---------
|
||||
nss_core.h | 41 +++++-----
|
||||
nss_hal/ipq806x/nss_hal_pvt.c | 5 +-
|
||||
nss_hal/ipq807x/nss_hal_pvt.c | 5 +-
|
||||
nss_meminfo.c | 5 +-
|
||||
nss_profiler.c | 3 +-
|
||||
6 files changed, 127 insertions(+), 68 deletions(-)
|
||||
|
||||
diff --git a/nss_core.c b/nss_core.c
|
||||
index 23dc155..f9e6014 100644
|
||||
--- a/nss_core.c
|
||||
+++ b/nss_core.c
|
||||
@@ -1429,6 +1429,8 @@ static inline void nss_core_handle_empty_buffers(struct nss_ctx_instance *nss_ct
|
||||
uint32_t count, uint32_t hlos_index,
|
||||
uint16_t mask)
|
||||
{
|
||||
+ struct nss_meminfo_ctx *mem_ctx = &nss_ctx->meminfo_ctx;
|
||||
+
|
||||
while (count) {
|
||||
/*
|
||||
* Since we only return the primary skb, we have no way to unmap
|
||||
@@ -1482,7 +1484,9 @@ next:
|
||||
n2h_desc_ring->hlos_index = hlos_index;
|
||||
if_map->n2h_hlos_index[NSS_IF_N2H_EMPTY_BUFFER_RETURN_QUEUE] = hlos_index;
|
||||
|
||||
- NSS_CORE_DMA_CACHE_MAINT((void *)&if_map->n2h_hlos_index[NSS_IF_N2H_EMPTY_BUFFER_RETURN_QUEUE], sizeof(uint32_t), DMA_TO_DEVICE);
|
||||
+ dma_sync_single_for_device(nss_ctx->dev,
|
||||
+ n2h_hlos_index_to_dma(mem_ctx->if_map_dma, NSS_IF_N2H_EMPTY_BUFFER_RETURN_QUEUE),
|
||||
+ sizeof(uint32_t), DMA_TO_DEVICE);
|
||||
NSS_CORE_DSB();
|
||||
}
|
||||
|
||||
@@ -1504,6 +1508,7 @@ static int32_t nss_core_handle_cause_queue(struct int_ctx_instance *int_ctx, uin
|
||||
struct nss_ctx_instance *nss_ctx = int_ctx->nss_ctx;
|
||||
struct nss_meminfo_ctx *mem_ctx = &nss_ctx->meminfo_ctx;
|
||||
struct nss_if_mem_map *if_map = mem_ctx->if_map;
|
||||
+ int dma_size;
|
||||
|
||||
qid = nss_core_cause_to_queue(cause);
|
||||
|
||||
@@ -1515,7 +1520,8 @@ static int32_t nss_core_handle_cause_queue(struct int_ctx_instance *int_ctx, uin
|
||||
n2h_desc_ring = &nss_ctx->n2h_desc_ring[qid];
|
||||
desc_if = &n2h_desc_ring->desc_ring;
|
||||
desc_ring = desc_if->desc;
|
||||
- NSS_CORE_DMA_CACHE_MAINT((void *)&if_map->n2h_nss_index[qid], sizeof(uint32_t), DMA_FROM_DEVICE);
|
||||
+ dma_sync_single_for_device(nss_ctx->dev, n2h_nss_index_to_dma(mem_ctx->if_map_dma, qid),
|
||||
+ sizeof(uint32_t), DMA_FROM_DEVICE);
|
||||
NSS_CORE_DSB();
|
||||
nss_index = if_map->n2h_nss_index[qid];
|
||||
|
||||
@@ -1544,13 +1550,23 @@ static int32_t nss_core_handle_cause_queue(struct int_ctx_instance *int_ctx, uin
|
||||
start = hlos_index;
|
||||
end = (hlos_index + count) & mask;
|
||||
if (end > start) {
|
||||
- dmac_inv_range((void *)&desc_ring[start], (void *)&desc_ring[end] + sizeof(struct n2h_descriptor));
|
||||
+ dma_size = sizeof(struct n2h_descriptor) * (end - start + 1);
|
||||
+
|
||||
+ dma_sync_single_for_device(nss_ctx->dev, n2h_desc_index_to_dma(if_map, qid, start),
|
||||
+ dma_size, DMA_FROM_DEVICE);
|
||||
} else {
|
||||
/*
|
||||
* We have wrapped around
|
||||
*/
|
||||
- dmac_inv_range((void *)&desc_ring[start], (void *)&desc_ring[mask] + sizeof(struct n2h_descriptor));
|
||||
- dmac_inv_range((void *)&desc_ring[0], (void *)&desc_ring[end] + sizeof(struct n2h_descriptor));
|
||||
+ dma_size = sizeof(struct n2h_descriptor) * (mask - start + 1);
|
||||
+
|
||||
+ dma_sync_single_for_device(nss_ctx->dev, n2h_desc_index_to_dma(if_map, qid, start),
|
||||
+ dma_size, DMA_FROM_DEVICE);
|
||||
+
|
||||
+ dma_size = sizeof(struct n2h_descriptor) * (end + 1);
|
||||
+
|
||||
+ dma_sync_single_for_device(nss_ctx->dev, n2h_desc_index_to_dma(if_map, qid, 0), dma_size,
|
||||
+ DMA_FROM_DEVICE);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1679,7 +1695,8 @@ next:
|
||||
n2h_desc_ring->hlos_index = hlos_index;
|
||||
if_map->n2h_hlos_index[qid] = hlos_index;
|
||||
|
||||
- NSS_CORE_DMA_CACHE_MAINT((void *)&if_map->n2h_hlos_index[qid], sizeof(uint32_t), DMA_TO_DEVICE);
|
||||
+ dma_sync_single_for_device(nss_ctx->dev, n2h_hlos_index_to_dma(mem_ctx->if_map_dma, qid),
|
||||
+ sizeof(uint32_t), DMA_TO_DEVICE);
|
||||
NSS_CORE_DSB();
|
||||
|
||||
return count;
|
||||
@@ -1691,11 +1708,12 @@ next:
|
||||
*/
|
||||
static void nss_core_init_nss(struct nss_ctx_instance *nss_ctx, struct nss_if_mem_map *if_map)
|
||||
{
|
||||
+ struct nss_meminfo_ctx *mem_ctx = &nss_ctx->meminfo_ctx;
|
||||
struct nss_top_instance *nss_top;
|
||||
int ret;
|
||||
int i;
|
||||
|
||||
- NSS_CORE_DMA_CACHE_MAINT((void *)if_map, sizeof(*if_map), DMA_FROM_DEVICE);
|
||||
+ dma_sync_single_for_device(nss_ctx->dev, mem_ctx->if_map_dma, sizeof(*if_map), DMA_FROM_DEVICE);
|
||||
NSS_CORE_DSB();
|
||||
|
||||
/*
|
||||
@@ -1762,6 +1780,7 @@ static void nss_core_alloc_paged_buffers(struct nss_ctx_instance *nss_ctx, struc
|
||||
uint16_t count, int16_t mask, int32_t hlos_index, uint32_t alloc_fail_count,
|
||||
uint32_t buffer_type, uint32_t buffer_queue, uint32_t stats_index)
|
||||
{
|
||||
+ struct nss_meminfo_ctx *mem_ctx = &nss_ctx->meminfo_ctx;
|
||||
struct sk_buff *nbuf;
|
||||
struct page *npage;
|
||||
struct hlos_h2n_desc_rings *h2n_desc_ring = &nss_ctx->h2n_desc_rings[buffer_queue];
|
||||
@@ -1831,7 +1850,9 @@ static void nss_core_alloc_paged_buffers(struct nss_ctx_instance *nss_ctx, struc
|
||||
/*
|
||||
* Flush the descriptor
|
||||
*/
|
||||
- NSS_CORE_DMA_CACHE_MAINT((void *)desc, sizeof(*desc), DMA_TO_DEVICE);
|
||||
+ dma_sync_single_for_device(nss_ctx->dev,
|
||||
+ h2n_desc_index_to_dma(if_map, buffer_queue, hlos_index),
|
||||
+ sizeof(*desc), DMA_TO_DEVICE);
|
||||
|
||||
hlos_index = (hlos_index + 1) & (mask);
|
||||
count--;
|
||||
@@ -1845,7 +1866,8 @@ static void nss_core_alloc_paged_buffers(struct nss_ctx_instance *nss_ctx, struc
|
||||
h2n_desc_ring->hlos_index = hlos_index;
|
||||
if_map->h2n_hlos_index[buffer_queue] = hlos_index;
|
||||
|
||||
- NSS_CORE_DMA_CACHE_MAINT(&if_map->h2n_hlos_index[buffer_queue], sizeof(uint32_t), DMA_TO_DEVICE);
|
||||
+ dma_sync_single_for_device(nss_ctx->dev, h2n_hlos_index_to_dma(mem_ctx->if_map_dma, buffer_queue),
|
||||
+ sizeof(uint32_t), DMA_TO_DEVICE);
|
||||
NSS_CORE_DSB();
|
||||
|
||||
NSS_PKT_STATS_INC(&nss_top->stats_drv[stats_index]);
|
||||
@@ -1858,7 +1880,7 @@ static void nss_core_alloc_paged_buffers(struct nss_ctx_instance *nss_ctx, struc
|
||||
static void nss_core_alloc_jumbo_mru_buffers(struct nss_ctx_instance *nss_ctx, struct nss_if_mem_map *if_map,
|
||||
int jumbo_mru, uint16_t count, int16_t mask, int32_t hlos_index)
|
||||
{
|
||||
-
|
||||
+ struct nss_meminfo_ctx *mem_ctx = &nss_ctx->meminfo_ctx;
|
||||
struct sk_buff *nbuf;
|
||||
struct hlos_h2n_desc_rings *h2n_desc_ring = &nss_ctx->h2n_desc_rings[NSS_IF_H2N_EMPTY_BUFFER_QUEUE];
|
||||
struct h2n_desc_if_instance *desc_if = &h2n_desc_ring->desc_ring;
|
||||
@@ -1905,7 +1927,9 @@ static void nss_core_alloc_jumbo_mru_buffers(struct nss_ctx_instance *nss_ctx, s
|
||||
/*
|
||||
* Flush the descriptor
|
||||
*/
|
||||
- NSS_CORE_DMA_CACHE_MAINT((void *)desc, sizeof(*desc), DMA_TO_DEVICE);
|
||||
+ dma_sync_single_for_device(nss_ctx->dev,
|
||||
+ h2n_desc_index_to_dma(if_map, NSS_IF_H2N_EMPTY_BUFFER_QUEUE, hlos_index),
|
||||
+ sizeof(*desc), DMA_TO_DEVICE);
|
||||
|
||||
hlos_index = (hlos_index + 1) & (mask);
|
||||
count--;
|
||||
@@ -1919,7 +1943,8 @@ static void nss_core_alloc_jumbo_mru_buffers(struct nss_ctx_instance *nss_ctx, s
|
||||
h2n_desc_ring->hlos_index = hlos_index;
|
||||
if_map->h2n_hlos_index[NSS_IF_H2N_EMPTY_BUFFER_QUEUE] = hlos_index;
|
||||
|
||||
- NSS_CORE_DMA_CACHE_MAINT(&if_map->h2n_hlos_index[NSS_IF_H2N_EMPTY_BUFFER_QUEUE], sizeof(uint32_t), DMA_TO_DEVICE);
|
||||
+ dma_sync_single_for_device(nss_ctx->dev, h2n_hlos_index_to_dma(mem_ctx->if_map_dma, NSS_IF_H2N_EMPTY_BUFFER_QUEUE),
|
||||
+ sizeof(uint32_t), DMA_TO_DEVICE);
|
||||
NSS_CORE_DSB();
|
||||
|
||||
NSS_PKT_STATS_INC(&nss_top->stats_drv[NSS_DRV_STATS_TX_EMPTY]);
|
||||
@@ -1932,6 +1957,7 @@ static void nss_core_alloc_jumbo_mru_buffers(struct nss_ctx_instance *nss_ctx, s
|
||||
static void nss_core_alloc_max_avail_size_buffers(struct nss_ctx_instance *nss_ctx, struct nss_if_mem_map *if_map,
|
||||
uint16_t max_buf_size, uint16_t count, int16_t mask, int32_t hlos_index)
|
||||
{
|
||||
+ struct nss_meminfo_ctx *mem_ctx = &nss_ctx->meminfo_ctx;
|
||||
struct hlos_h2n_desc_rings *h2n_desc_ring = &nss_ctx->h2n_desc_rings[NSS_IF_H2N_EMPTY_BUFFER_QUEUE];
|
||||
struct h2n_desc_if_instance *desc_if = &h2n_desc_ring->desc_ring;
|
||||
struct h2n_descriptor *desc_ring = desc_if->desc;
|
||||
@@ -1939,6 +1965,7 @@ static void nss_core_alloc_max_avail_size_buffers(struct nss_ctx_instance *nss_c
|
||||
uint16_t payload_len = max_buf_size + NET_SKB_PAD;
|
||||
uint16_t start = hlos_index;
|
||||
uint16_t prev_hlos_index;
|
||||
+ int dma_size;
|
||||
|
||||
while (count) {
|
||||
dma_addr_t buffer;
|
||||
@@ -1991,13 +2018,26 @@ static void nss_core_alloc_max_avail_size_buffers(struct nss_ctx_instance *nss_c
|
||||
* Flush the descriptors, including the descriptor at prev_hlos_index.
|
||||
*/
|
||||
if (prev_hlos_index > start) {
|
||||
- dmac_clean_range((void *)&desc_ring[start], (void *)&desc_ring[prev_hlos_index] + sizeof(struct h2n_descriptor));
|
||||
+ dma_size = sizeof(struct h2n_descriptor) * (prev_hlos_index - start + 1);
|
||||
+
|
||||
+ dma_sync_single_for_device(nss_ctx->dev,
|
||||
+ h2n_desc_index_to_dma(if_map, NSS_IF_H2N_EMPTY_BUFFER_QUEUE, start),
|
||||
+ dma_size, DMA_TO_DEVICE);
|
||||
} else {
|
||||
/*
|
||||
* We have wrapped around
|
||||
*/
|
||||
- dmac_clean_range((void *)&desc_ring[start], (void *)&desc_ring[mask] + sizeof(struct h2n_descriptor));
|
||||
- dmac_clean_range((void *)&desc_ring[0], (void *)&desc_ring[prev_hlos_index] + sizeof(struct h2n_descriptor));
|
||||
+ dma_size = sizeof(struct h2n_descriptor) * (mask - start + 1);
|
||||
+
|
||||
+ dma_sync_single_for_device(nss_ctx->dev,
|
||||
+ h2n_desc_index_to_dma(if_map, NSS_IF_H2N_EMPTY_BUFFER_QUEUE, start),
|
||||
+ dma_size, DMA_TO_DEVICE);
|
||||
+
|
||||
+ dma_size = sizeof(struct h2n_descriptor) * (prev_hlos_index + 1);
|
||||
+
|
||||
+ dma_sync_single_for_device(nss_ctx->dev,
|
||||
+ h2n_desc_index_to_dma(if_map, NSS_IF_H2N_EMPTY_BUFFER_QUEUE, 0),
|
||||
+ dma_size, DMA_TO_DEVICE);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -2008,7 +2048,8 @@ static void nss_core_alloc_max_avail_size_buffers(struct nss_ctx_instance *nss_c
|
||||
h2n_desc_ring->hlos_index = hlos_index;
|
||||
if_map->h2n_hlos_index[NSS_IF_H2N_EMPTY_BUFFER_QUEUE] = hlos_index;
|
||||
|
||||
- NSS_CORE_DMA_CACHE_MAINT(&if_map->h2n_hlos_index[NSS_IF_H2N_EMPTY_BUFFER_QUEUE], sizeof(uint32_t), DMA_TO_DEVICE);
|
||||
+ dma_sync_single_for_device(nss_ctx->dev, h2n_hlos_index_to_dma(mem_ctx->if_map_dma, NSS_IF_H2N_EMPTY_BUFFER_QUEUE),
|
||||
+ sizeof(uint32_t), DMA_TO_DEVICE);
|
||||
NSS_CORE_DSB();
|
||||
|
||||
NSS_PKT_STATS_INC(&nss_top->stats_drv[NSS_DRV_STATS_TX_EMPTY]);
|
||||
@@ -2021,6 +2062,7 @@ static void nss_core_alloc_max_avail_size_buffers(struct nss_ctx_instance *nss_c
|
||||
static inline void nss_core_handle_empty_buffer_sos(struct nss_ctx_instance *nss_ctx,
|
||||
struct nss_if_mem_map *if_map, uint16_t max_buf_size)
|
||||
{
|
||||
+ struct nss_meminfo_ctx *mem_ctx = &nss_ctx->meminfo_ctx;
|
||||
uint16_t count, size, mask;
|
||||
int32_t nss_index, hlos_index;
|
||||
struct hlos_h2n_desc_rings *h2n_desc_ring = &nss_ctx->h2n_desc_rings[NSS_IF_H2N_EMPTY_BUFFER_QUEUE];
|
||||
@@ -2031,7 +2073,8 @@ static inline void nss_core_handle_empty_buffer_sos(struct nss_ctx_instance *nss
|
||||
/*
|
||||
* Check how many empty buffers could be filled in queue
|
||||
*/
|
||||
- NSS_CORE_DMA_CACHE_MAINT(&if_map->h2n_nss_index[NSS_IF_H2N_EMPTY_BUFFER_QUEUE], sizeof(uint32_t), DMA_FROM_DEVICE);
|
||||
+ dma_sync_single_for_device(nss_ctx->dev, h2n_nss_index_to_dma(mem_ctx->if_map_dma, NSS_IF_H2N_EMPTY_BUFFER_QUEUE),
|
||||
+ sizeof(uint32_t), DMA_FROM_DEVICE);
|
||||
NSS_CORE_DSB();
|
||||
nss_index = if_map->h2n_nss_index[NSS_IF_H2N_EMPTY_BUFFER_QUEUE];
|
||||
|
||||
@@ -2076,6 +2119,7 @@ static inline void nss_core_handle_empty_buffer_sos(struct nss_ctx_instance *nss
|
||||
static inline void nss_core_handle_paged_empty_buffer_sos(struct nss_ctx_instance *nss_ctx,
|
||||
struct nss_if_mem_map *if_map, uint16_t max_buf_size)
|
||||
{
|
||||
+ struct nss_meminfo_ctx *mem_ctx = &nss_ctx->meminfo_ctx;
|
||||
uint16_t count, size, mask;
|
||||
int32_t nss_index, hlos_index;
|
||||
struct hlos_h2n_desc_rings *h2n_desc_ring = &nss_ctx->h2n_desc_rings[NSS_IF_H2N_EMPTY_PAGED_BUFFER_QUEUE];
|
||||
@@ -2083,7 +2127,8 @@ static inline void nss_core_handle_paged_empty_buffer_sos(struct nss_ctx_instanc
|
||||
/*
|
||||
* Check how many empty buffers could be filled in queue
|
||||
*/
|
||||
- NSS_CORE_DMA_CACHE_MAINT((void *)&if_map->h2n_nss_index[NSS_IF_H2N_EMPTY_PAGED_BUFFER_QUEUE], sizeof(uint32_t), DMA_FROM_DEVICE);
|
||||
+ dma_sync_single_for_device(nss_ctx->dev, h2n_nss_index_to_dma(mem_ctx->if_map_dma, NSS_IF_H2N_EMPTY_PAGED_BUFFER_QUEUE),
|
||||
+ sizeof(uint32_t), DMA_FROM_DEVICE);
|
||||
NSS_CORE_DSB();
|
||||
nss_index = if_map->h2n_nss_index[NSS_IF_H2N_EMPTY_PAGED_BUFFER_QUEUE];
|
||||
|
||||
@@ -2651,9 +2696,11 @@ void nss_skb_reuse(struct sk_buff *nbuf)
|
||||
* Sends one skb to NSS FW
|
||||
*/
|
||||
static inline int32_t nss_core_send_buffer_simple_skb(struct nss_ctx_instance *nss_ctx,
|
||||
- struct h2n_desc_if_instance *desc_if, uint32_t if_num,
|
||||
- struct sk_buff *nbuf, uint16_t hlos_index, uint16_t flags, uint8_t buffer_type, uint16_t mss)
|
||||
+ struct h2n_desc_if_instance *desc_if, uint32_t if_num, struct sk_buff *nbuf,
|
||||
+ uint16_t qid, uint16_t hlos_index, uint16_t flags, uint8_t buffer_type, uint16_t mss)
|
||||
{
|
||||
+ struct nss_meminfo_ctx *mem_ctx = &nss_ctx->meminfo_ctx;
|
||||
+ struct nss_if_mem_map *if_map = mem_ctx->if_map;
|
||||
struct h2n_descriptor *desc_ring = desc_if->desc;
|
||||
struct h2n_descriptor *desc;
|
||||
uint16_t bit_flags;
|
||||
@@ -2707,7 +2754,8 @@ static inline int32_t nss_core_send_buffer_simple_skb(struct nss_ctx_instance *n
|
||||
(nss_ptr_t)nbuf, (uint16_t)(nbuf->data - nbuf->head), nbuf->len,
|
||||
sz, (uint32_t)nbuf->priority, mss, bit_flags);
|
||||
|
||||
- NSS_CORE_DMA_CACHE_MAINT((void *)desc, sizeof(*desc), DMA_TO_DEVICE);
|
||||
+ dma_sync_single_for_device(nss_ctx->dev, h2n_desc_index_to_dma(if_map, qid, hlos_index),
|
||||
+ sizeof(*desc), DMA_TO_DEVICE);
|
||||
|
||||
/*
|
||||
* We are done using the skb fields and can reuse it now
|
||||
@@ -2731,7 +2779,8 @@ no_reuse:
|
||||
(nss_ptr_t)nbuf, (uint16_t)(nbuf->data - nbuf->head), nbuf->len,
|
||||
(uint16_t)skb_end_offset(nbuf), (uint32_t)nbuf->priority, mss, bit_flags);
|
||||
|
||||
- NSS_CORE_DMA_CACHE_MAINT((void *)desc, sizeof(*desc), DMA_TO_DEVICE);
|
||||
+ dma_sync_single_for_device(nss_ctx->dev, h2n_desc_index_to_dma(if_map, qid, hlos_index),
|
||||
+ sizeof(*desc), DMA_TO_DEVICE);
|
||||
|
||||
NSS_PKT_STATS_INC(&nss_ctx->nss_top->stats_drv[NSS_DRV_STATS_TX_SIMPLE]);
|
||||
return 1;
|
||||
@@ -2745,9 +2794,11 @@ no_reuse:
|
||||
* Used to differentiate from FRAGLIST
|
||||
*/
|
||||
static inline int32_t nss_core_send_buffer_nr_frags(struct nss_ctx_instance *nss_ctx,
|
||||
- struct h2n_desc_if_instance *desc_if, uint32_t if_num,
|
||||
- struct sk_buff *nbuf, uint16_t hlos_index, uint16_t flags, uint8_t buffer_type, uint16_t mss)
|
||||
+ struct h2n_desc_if_instance *desc_if, uint32_t if_num, struct sk_buff *nbuf,
|
||||
+ uint16_t qid, uint16_t hlos_index, uint16_t flags, uint8_t buffer_type, uint16_t mss)
|
||||
{
|
||||
+ struct nss_meminfo_ctx *mem_ctx = &nss_ctx->meminfo_ctx;
|
||||
+ struct nss_if_mem_map *if_map = mem_ctx->if_map;
|
||||
struct h2n_descriptor *desc_ring = desc_if->desc;
|
||||
struct h2n_descriptor *desc;
|
||||
const skb_frag_t *frag;
|
||||
@@ -2787,7 +2838,8 @@ static inline int32_t nss_core_send_buffer_nr_frags(struct nss_ctx_instance *nss
|
||||
(nss_ptr_t)NULL, nbuf->data - nbuf->head, nbuf->len - nbuf->data_len,
|
||||
skb_end_offset(nbuf), (uint32_t)nbuf->priority, mss, bit_flags | H2N_BIT_FLAG_FIRST_SEGMENT);
|
||||
|
||||
- NSS_CORE_DMA_CACHE_MAINT((void *)desc, sizeof(*desc), DMA_TO_DEVICE);
|
||||
+ dma_sync_single_for_device(nss_ctx->dev, h2n_desc_index_to_dma(if_map, qid, hlos_index),
|
||||
+ sizeof(*desc), DMA_TO_DEVICE);
|
||||
|
||||
/*
|
||||
* Now handle rest of the fragments.
|
||||
@@ -2811,7 +2863,8 @@ static inline int32_t nss_core_send_buffer_nr_frags(struct nss_ctx_instance *nss
|
||||
(nss_ptr_t)NULL, 0, skb_frag_size(frag), skb_frag_size(frag),
|
||||
nbuf->priority, mss, bit_flags);
|
||||
|
||||
- NSS_CORE_DMA_CACHE_MAINT((void *)desc, sizeof(*desc), DMA_TO_DEVICE);
|
||||
+ dma_sync_single_for_device(nss_ctx->dev, h2n_desc_index_to_dma(if_map, qid, hlos_index),
|
||||
+ sizeof(*desc), DMA_TO_DEVICE);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -2827,7 +2880,8 @@ static inline int32_t nss_core_send_buffer_nr_frags(struct nss_ctx_instance *nss
|
||||
desc->bit_flags &= ~(H2N_BIT_FLAG_DISCARD);
|
||||
desc->opaque = (nss_ptr_t)nbuf;
|
||||
|
||||
- NSS_CORE_DMA_CACHE_MAINT((void *)desc, sizeof(*desc), DMA_TO_DEVICE);
|
||||
+ dma_sync_single_for_device(nss_ctx->dev, h2n_desc_index_to_dma(if_map, qid, hlos_index),
|
||||
+ sizeof(*desc), DMA_TO_DEVICE);
|
||||
|
||||
NSS_PKT_STATS_INC(&nss_ctx->nss_top->stats_drv[NSS_DRV_STATS_TX_NR_FRAGS]);
|
||||
return i+1;
|
||||
@@ -2841,9 +2895,11 @@ static inline int32_t nss_core_send_buffer_nr_frags(struct nss_ctx_instance *nss
|
||||
* Used to differentiate from FRAGS
|
||||
*/
|
||||
static inline int32_t nss_core_send_buffer_fraglist(struct nss_ctx_instance *nss_ctx,
|
||||
- struct h2n_desc_if_instance *desc_if, uint32_t if_num,
|
||||
- struct sk_buff *nbuf, uint16_t hlos_index, uint16_t flags, uint8_t buffer_type, uint16_t mss)
|
||||
+ struct h2n_desc_if_instance *desc_if, uint32_t if_num, struct sk_buff *nbuf,
|
||||
+ uint16_t qid, uint16_t hlos_index, uint16_t flags, uint8_t buffer_type, uint16_t mss)
|
||||
{
|
||||
+ struct nss_meminfo_ctx *mem_ctx = &nss_ctx->meminfo_ctx;
|
||||
+ struct nss_if_mem_map *if_map = mem_ctx->if_map;
|
||||
struct h2n_descriptor *desc_ring = desc_if->desc;
|
||||
struct h2n_descriptor *desc;
|
||||
dma_addr_t buffer;
|
||||
@@ -2882,7 +2938,8 @@ static inline int32_t nss_core_send_buffer_fraglist(struct nss_ctx_instance *nss
|
||||
(nss_ptr_t)nbuf, nbuf->data - nbuf->head, nbuf->len - nbuf->data_len,
|
||||
skb_end_offset(nbuf), (uint32_t)nbuf->priority, mss, bit_flags | H2N_BIT_FLAG_FIRST_SEGMENT);
|
||||
|
||||
- NSS_CORE_DMA_CACHE_MAINT((void *)desc, sizeof(*desc), DMA_TO_DEVICE);
|
||||
+ dma_sync_single_for_device(nss_ctx->dev, h2n_desc_index_to_dma(if_map, qid, hlos_index),
|
||||
+ sizeof(*desc), DMA_TO_DEVICE);
|
||||
|
||||
/*
|
||||
* Walk the frag_list in nbuf
|
||||
@@ -2935,7 +2992,8 @@ static inline int32_t nss_core_send_buffer_fraglist(struct nss_ctx_instance *nss
|
||||
(nss_ptr_t)iter, iter->data - iter->head, iter->len - iter->data_len,
|
||||
skb_end_offset(iter), iter->priority, mss, bit_flags);
|
||||
|
||||
- NSS_CORE_DMA_CACHE_MAINT((void *)desc, sizeof(*desc), DMA_TO_DEVICE);
|
||||
+ dma_sync_single_for_device(nss_ctx->dev, h2n_desc_index_to_dma(if_map, qid, hlos_index),
|
||||
+ sizeof(*desc), DMA_TO_DEVICE);
|
||||
|
||||
i++;
|
||||
}
|
||||
@@ -2954,7 +3012,8 @@ static inline int32_t nss_core_send_buffer_fraglist(struct nss_ctx_instance *nss
|
||||
* Update bit flag for last descriptor.
|
||||
*/
|
||||
desc->bit_flags |= H2N_BIT_FLAG_LAST_SEGMENT;
|
||||
- NSS_CORE_DMA_CACHE_MAINT((void *)desc, sizeof(*desc), DMA_TO_DEVICE);
|
||||
+ dma_sync_single_for_device(nss_ctx->dev, h2n_desc_index_to_dma(if_map, qid, hlos_index),
|
||||
+ sizeof(*desc), DMA_TO_DEVICE);
|
||||
|
||||
NSS_PKT_STATS_INC(&nss_ctx->nss_top->stats_drv[NSS_DRV_STATS_TX_FRAGLIST]);
|
||||
return i+1;
|
||||
@@ -3025,8 +3084,10 @@ int32_t nss_core_send_buffer(struct nss_ctx_instance *nss_ctx, uint32_t if_num,
|
||||
* We need to work out if there's sufficent space in our transmit descriptor
|
||||
* ring to place all the segments of a nbuf.
|
||||
*/
|
||||
- NSS_CORE_DMA_CACHE_MAINT((void *)&if_map->h2n_nss_index[qid], sizeof(uint32_t), DMA_FROM_DEVICE);
|
||||
+ dma_sync_single_for_device(nss_ctx->dev, h2n_nss_index_to_dma(mem_ctx->if_map_dma, qid),
|
||||
+ sizeof(uint32_t), DMA_FROM_DEVICE);
|
||||
NSS_CORE_DSB();
|
||||
+
|
||||
nss_index = if_map->h2n_nss_index[qid];
|
||||
h2n_desc_ring->nss_index_local = nss_index;
|
||||
count = ((nss_index - hlos_index - 1) + size) & (mask);
|
||||
@@ -3095,13 +3156,13 @@ int32_t nss_core_send_buffer(struct nss_ctx_instance *nss_ctx, uint32_t if_num,
|
||||
count = 0;
|
||||
if (likely((segments == 0) || is_bounce)) {
|
||||
count = nss_core_send_buffer_simple_skb(nss_ctx, desc_if, if_num,
|
||||
- nbuf, hlos_index, flags, buffer_type, mss);
|
||||
+ nbuf, qid, hlos_index, flags, buffer_type, mss);
|
||||
} else if (skb_has_frag_list(nbuf)) {
|
||||
count = nss_core_send_buffer_fraglist(nss_ctx, desc_if, if_num,
|
||||
- nbuf, hlos_index, flags, buffer_type, mss);
|
||||
+ nbuf, qid, hlos_index, flags, buffer_type, mss);
|
||||
} else {
|
||||
count = nss_core_send_buffer_nr_frags(nss_ctx, desc_if, if_num,
|
||||
- nbuf, hlos_index, flags, buffer_type, mss);
|
||||
+ nbuf, qid, hlos_index, flags, buffer_type, mss);
|
||||
}
|
||||
|
||||
if (unlikely(count <= 0)) {
|
||||
@@ -3125,7 +3186,8 @@ int32_t nss_core_send_buffer(struct nss_ctx_instance *nss_ctx, uint32_t if_num,
|
||||
h2n_desc_ring->hlos_index = hlos_index;
|
||||
if_map->h2n_hlos_index[qid] = hlos_index;
|
||||
|
||||
- NSS_CORE_DMA_CACHE_MAINT(&if_map->h2n_hlos_index[qid], sizeof(uint32_t), DMA_TO_DEVICE);
|
||||
+ dma_sync_single_for_device(nss_ctx->dev, h2n_hlos_index_to_dma(mem_ctx->if_map_dma, qid),
|
||||
+ sizeof(uint32_t), DMA_TO_DEVICE);
|
||||
NSS_CORE_DSB();
|
||||
|
||||
#ifdef CONFIG_DEBUG_KMEMLEAK
|
||||
diff --git a/nss_core.h b/nss_core.h
|
||||
index d7f62fe..7ddf6ce 100644
|
||||
--- a/nss_core.h
|
||||
+++ b/nss_core.h
|
||||
@@ -100,31 +100,30 @@
|
||||
#endif
|
||||
|
||||
/*
|
||||
- * Cache operation
|
||||
+ * DMA Offset helper
|
||||
*/
|
||||
-#define NSS_CORE_DSB() dsb(sy)
|
||||
-#define NSS_CORE_DMA_CACHE_MAINT(start, size, dir) nss_core_dma_cache_maint(start, size, dir)
|
||||
+#define n2h_desc_index_offset(_index) sizeof(struct n2h_descriptor) * (_index)
|
||||
+#define h2n_desc_index_offset(_index) sizeof(struct h2n_descriptor) * (_index)
|
||||
+
|
||||
+#define n2h_desc_index_to_dma(_if_map_addr, _qid, _index) (_if_map_addr)->n2h_desc_if[(_qid)].desc_addr + n2h_desc_index_offset(_index)
|
||||
+#define h2n_desc_index_to_dma(_if_map_addr, _qid, _index) (_if_map_addr)->h2n_desc_if[(_qid)].desc_addr + h2n_desc_index_offset(_index)
|
||||
+
|
||||
+#define h2n_nss_index_offset offsetof(struct nss_if_mem_map, h2n_nss_index)
|
||||
+#define n2h_nss_index_offset offsetof(struct nss_if_mem_map, n2h_nss_index)
|
||||
+#define h2n_hlos_index_offset offsetof(struct nss_if_mem_map, h2n_hlos_index)
|
||||
+#define n2h_hlos_index_offset offsetof(struct nss_if_mem_map, n2h_hlos_index)
|
||||
+
|
||||
+#define h2n_nss_index_to_dma(_if_map_addr, _index) (_if_map_addr) + h2n_nss_index_offset + (sizeof(uint32_t) * (_index))
|
||||
+#define n2h_nss_index_to_dma(_if_map_addr, _index) (_if_map_addr) + n2h_nss_index_offset + (sizeof(uint32_t) * (_index))
|
||||
+#define h2n_hlos_index_to_dma(_if_map_addr, _index) (_if_map_addr) + h2n_hlos_index_offset + (sizeof(uint32_t) * (_index))
|
||||
+#define n2h_hlos_index_to_dma(_if_map_addr, _index) (_if_map_addr) + n2h_hlos_index_offset + (sizeof(uint32_t) * (_index))
|
||||
|
||||
/*
|
||||
- * nss_core_dma_cache_maint()
|
||||
- * Perform the appropriate cache op based on direction
|
||||
+ * Cache operation
|
||||
*/
|
||||
-static inline void nss_core_dma_cache_maint(void *start, uint32_t size, int direction)
|
||||
-{
|
||||
- switch (direction) {
|
||||
- case DMA_FROM_DEVICE:/* invalidate only */
|
||||
- dmac_inv_range(start, start + size);
|
||||
- break;
|
||||
- case DMA_TO_DEVICE:/* writeback only */
|
||||
- dmac_clean_range(start, start + size);
|
||||
- break;
|
||||
- case DMA_BIDIRECTIONAL:/* writeback and invalidate */
|
||||
- dmac_flush_range(start, start + size);
|
||||
- break;
|
||||
- default:
|
||||
- BUG();
|
||||
- }
|
||||
-}
|
||||
+#define NSS_CORE_DSB() dsb(sy)
|
||||
+#define NSS_CORE_DMA_CACHE_MAINT(dev, start, size, dir) BUILD_BUG_ON_MSG(1, \
|
||||
+ "NSS_CORE_DMA_CACHE_MAINT is deprecated. Fix the code to use correct dma_sync_* API")
|
||||
|
||||
#define NSS_DEVICE_IF_START NSS_PHYSICAL_IF_START
|
||||
|
||||
diff --git a/nss_hal/ipq806x/nss_hal_pvt.c b/nss_hal/ipq806x/nss_hal_pvt.c
|
||||
index 52d63b0..5375087 100644
|
||||
--- a/nss_hal/ipq806x/nss_hal_pvt.c
|
||||
+++ b/nss_hal/ipq806x/nss_hal_pvt.c
|
||||
@@ -474,10 +474,9 @@ static struct nss_platform_data *__nss_hal_of_get_pdata(struct platform_device *
|
||||
/*
|
||||
* Clear TCM memory used by this core
|
||||
*/
|
||||
- for (i = 0; i < resource_size(&res_vphys) ; i += 4) {
|
||||
+ for (i = 0; i < resource_size(&res_vphys) ; i += 4)
|
||||
nss_write_32(npd->vmap, i, 0);
|
||||
- NSS_CORE_DMA_CACHE_MAINT((npd->vmap + i), 4, DMA_TO_DEVICE);
|
||||
- }
|
||||
+
|
||||
NSS_CORE_DSB();
|
||||
|
||||
/*
|
||||
diff --git a/nss_hal/ipq807x/nss_hal_pvt.c b/nss_hal/ipq807x/nss_hal_pvt.c
|
||||
index bb8f42f..733d7f1 100644
|
||||
--- a/nss_hal/ipq807x/nss_hal_pvt.c
|
||||
+++ b/nss_hal/ipq807x/nss_hal_pvt.c
|
||||
@@ -256,10 +256,9 @@ static struct nss_platform_data *__nss_hal_of_get_pdata(struct platform_device *
|
||||
/*
|
||||
* Clear TCM memory used by this core
|
||||
*/
|
||||
- for (i = 0; i < resource_size(&res_vphys) ; i += 4) {
|
||||
+ for (i = 0; i < resource_size(&res_vphys) ; i += 4)
|
||||
nss_write_32(npd->vmap, i, 0);
|
||||
- NSS_CORE_DMA_CACHE_MAINT((npd->vmap + i), 4, DMA_TO_DEVICE);
|
||||
- }
|
||||
+
|
||||
NSS_CORE_DSB();
|
||||
|
||||
/*
|
||||
diff --git a/nss_meminfo.c b/nss_meminfo.c
|
||||
index 2255eae..d804524 100644
|
||||
--- a/nss_meminfo.c
|
||||
+++ b/nss_meminfo.c
|
||||
@@ -414,7 +414,6 @@ static bool nss_meminfo_init_block_lists(struct nss_ctx_instance *nss_ctx)
|
||||
/*
|
||||
* Flush the updated meminfo request.
|
||||
*/
|
||||
- NSS_CORE_DMA_CACHE_MAINT(r, sizeof(struct nss_meminfo_request), DMA_TO_DEVICE);
|
||||
NSS_CORE_DSB();
|
||||
|
||||
/*
|
||||
@@ -538,7 +537,7 @@ static bool nss_meminfo_configure_n2h_h2n_rings(struct nss_ctx_instance *nss_ctx
|
||||
* Bring a fresh copy of if_map from memory in order to read it correctly.
|
||||
*/
|
||||
if_map = mem_ctx->if_map;
|
||||
- NSS_CORE_DMA_CACHE_MAINT((void *)if_map, sizeof(struct nss_if_mem_map), DMA_FROM_DEVICE);
|
||||
+ dma_sync_single_for_device(nss_ctx->dev, mem_ctx->if_map_dma, sizeof(struct nss_if_mem_map), DMA_FROM_DEVICE);
|
||||
NSS_CORE_DSB();
|
||||
|
||||
if_map->n2h_rings = NSS_N2H_RING_COUNT;
|
||||
@@ -576,7 +575,7 @@ static bool nss_meminfo_configure_n2h_h2n_rings(struct nss_ctx_instance *nss_ctx
|
||||
/*
|
||||
* Flush the updated nss_if_mem_map.
|
||||
*/
|
||||
- NSS_CORE_DMA_CACHE_MAINT((void *)if_map, sizeof(struct nss_if_mem_map), DMA_TO_DEVICE);
|
||||
+ dma_sync_single_for_device(nss_ctx->dev, mem_ctx->if_map_dma, sizeof(struct nss_if_mem_map), DMA_TO_DEVICE);
|
||||
NSS_CORE_DSB();
|
||||
|
||||
return true;
|
||||
diff --git a/nss_profiler.c b/nss_profiler.c
|
||||
index 5717ac3..aadc7c9 100755
|
||||
--- a/nss_profiler.c
|
||||
+++ b/nss_profiler.c
|
||||
@@ -199,11 +199,12 @@ EXPORT_SYMBOL(nss_profile_dma_deregister_cb);
|
||||
struct nss_profile_sdma_ctrl *nss_profile_dma_get_ctrl(struct nss_ctx_instance *nss_ctx)
|
||||
{
|
||||
struct nss_profile_sdma_ctrl *ctrl = nss_ctx->meminfo_ctx.sdma_ctrl;
|
||||
+ int size = offsetof(struct nss_profile_sdma_ctrl, cidx);
|
||||
if (!ctrl) {
|
||||
return ctrl;
|
||||
}
|
||||
|
||||
- dmac_inv_range(ctrl, &ctrl->cidx);
|
||||
+ dma_sync_single_for_device(nss_ctx->dev, (dma_addr_t) ctrl, size, DMA_FROM_DEVICE);
|
||||
dsb(sy);
|
||||
return ctrl;
|
||||
}
|
||||
--
|
||||
2.34.1
|
||||
|
@ -1,73 +0,0 @@
|
||||
From 6e65f6daecb09463688eaea0a234018a728196b8 Mon Sep 17 00:00:00 2001
|
||||
From: Ansuel Smith <ansuelsmth@gmail.com>
|
||||
Date: Tue, 5 Apr 2022 18:10:57 +0200
|
||||
Subject: [PATCH 5/8] nss-drv: add support for kernel 5.15
|
||||
|
||||
- Fix coredump panic notifier include change.
|
||||
- Fix skb ZEROCOPY flag.
|
||||
- Add skb reuse support for 5.15 kernel version.
|
||||
|
||||
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
|
||||
---
|
||||
nss_core.c | 5 +++--
|
||||
nss_coredump.c | 4 ++++
|
||||
nss_hal/nss_hal.c | 1 +
|
||||
3 files changed, 8 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/nss_core.c b/nss_core.c
|
||||
index f9e6014..8cd1d4b 100644
|
||||
--- a/nss_core.c
|
||||
+++ b/nss_core.c
|
||||
@@ -53,7 +53,8 @@
|
||||
(((LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0)))) || \
|
||||
(((LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0)))) || \
|
||||
(((LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(5, 5, 0)))) || \
|
||||
-(((LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0))))))
|
||||
+(((LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0)))) || \
|
||||
+(((LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0))))))
|
||||
#error "Check skb recycle code in this file to match Linux version"
|
||||
#endif
|
||||
|
||||
@@ -2623,7 +2624,11 @@ static inline bool nss_core_skb_can_reuse(struct nss_ctx_instance *nss_ctx,
|
||||
if (unlikely(irqs_disabled()))
|
||||
return false;
|
||||
|
||||
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 14, 0))
|
||||
if (unlikely(skb_shinfo(nbuf)->tx_flags & SKBTX_DEV_ZEROCOPY))
|
||||
+#else
|
||||
+ if (unlikely(skb_shinfo(nbuf)->flags & SKBFL_ZEROCOPY_ENABLE))
|
||||
+#endif
|
||||
return false;
|
||||
|
||||
if (unlikely(skb_is_nonlinear(nbuf)))
|
||||
diff --git a/nss_coredump.c b/nss_coredump.c
|
||||
index ecad659..3ecef7e 100644
|
||||
--- a/nss_coredump.c
|
||||
+++ b/nss_coredump.c
|
||||
@@ -23,7 +23,11 @@
|
||||
#include "nss_hal.h"
|
||||
#include "nss_log.h"
|
||||
#include <linux/kernel.h>
|
||||
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 14, 0))
|
||||
#include <linux/notifier.h> /* for panic_notifier_list */
|
||||
+#else
|
||||
+#include <linux/panic_notifier.h>
|
||||
+#endif
|
||||
#include <linux/jiffies.h> /* for time */
|
||||
#include "nss_tx_rx_common.h"
|
||||
|
||||
diff --git a/nss_hal/nss_hal.c b/nss_hal/nss_hal.c
|
||||
index 57974c1..d8c703b 100644
|
||||
--- a/nss_hal/nss_hal.c
|
||||
+++ b/nss_hal/nss_hal.c
|
||||
@@ -24,6 +24,7 @@
|
||||
#include <linux/firmware.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/irq.h>
|
||||
+#include <linux/ethtool.h>
|
||||
|
||||
#include "nss_hal.h"
|
||||
#include "nss_arch.h"
|
||||
--
|
||||
2.34.1
|
||||
|
@ -1,29 +0,0 @@
|
||||
From 4dd701916186803172a9f35e7e982a953613ad55 Mon Sep 17 00:00:00 2001
|
||||
From: Ansuel Smith <ansuelsmth@gmail.com>
|
||||
Date: Mon, 11 Apr 2022 21:32:41 +0200
|
||||
Subject: [PATCH 5/9] nss-drv: use standard skb_skip_tc_classify instead of
|
||||
custom api
|
||||
|
||||
Use skb_skip_tc_classify to skip classify for packet handled by nss
|
||||
instead of custom api.
|
||||
|
||||
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
|
||||
---
|
||||
nss_core.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/nss_core.c b/nss_core.c
|
||||
index f9e6014..6ab8038 100644
|
||||
--- a/nss_core.c
|
||||
+++ b/nss_core.c
|
||||
@@ -1075,7 +1075,7 @@ static inline void nss_core_set_skb_classify(struct sk_buff *nbuf)
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0))
|
||||
nbuf->tc_verd = SET_TC_NCLS_NSS(nbuf->tc_verd);
|
||||
#else
|
||||
- skb_set_tc_classify_offload(nbuf);
|
||||
+ skb_skip_tc_classify(nbuf);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
--
|
||||
2.34.1
|
@ -1,164 +0,0 @@
|
||||
From 895de8e4119afe3cbad2aa81566b1ebcb2b39dcd Mon Sep 17 00:00:00 2001
|
||||
From: Ansuel Smith <ansuelsmth@gmail.com>
|
||||
Date: Tue, 17 May 2022 20:23:19 +0200
|
||||
Subject: [PATCH] Makefile: modularize driver even more
|
||||
|
||||
Permit to disable even more module.
|
||||
|
||||
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
|
||||
---
|
||||
Makefile | 56 ++++++++++++++++++++++++++++++++---------------
|
||||
nss_hal/nss_hal.c | 6 +++++
|
||||
nss_init.c | 4 ++++
|
||||
3 files changed, 48 insertions(+), 18 deletions(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index f5c4b90..0194dbd 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -39,21 +39,44 @@ qca-nss-drv-objs := \
|
||||
nss_pm.o \
|
||||
nss_profiler.o \
|
||||
nss_project.o \
|
||||
- nss_pppoe.o \
|
||||
- nss_pppoe_log.o \
|
||||
- nss_pppoe_stats.o \
|
||||
- nss_pppoe_strings.o \
|
||||
nss_rps.o \
|
||||
nss_stats.o \
|
||||
nss_strings.o \
|
||||
nss_tx_msg_sync.o \
|
||||
nss_unaligned.o \
|
||||
nss_unaligned_log.o \
|
||||
- nss_unaligned_stats.o \
|
||||
- nss_virt_if.o \
|
||||
- nss_virt_if_stats.o \
|
||||
+ nss_unaligned_stats.o
|
||||
+
|
||||
+# Base NSS data plane/HAL support
|
||||
+qca-nss-drv-objs += nss_data_plane/nss_data_plane_common.o
|
||||
+qca-nss-drv-objs += nss_hal/nss_hal.o
|
||||
+
|
||||
+ifneq "$(NSS_DRV_PPPOE_ENABLE)" "n"
|
||||
+ccflags-y += -DNSS_DRV_PPPOE_ENABLE
|
||||
+qca-nss-drv-objs += \
|
||||
+ nss_pppoe.o \
|
||||
+ nss_pppoe_log.o \
|
||||
+ nss_pppoe_stats.o \
|
||||
+ nss_pppoe_strings.o
|
||||
+endif
|
||||
+
|
||||
+ifneq "$(NSS_DRV_VIRT_IF_ENABLE)" "n"
|
||||
+ccflags-y += -DNSS_DRV_VIRT_IF_ENABLE
|
||||
+qca-nss-drv-objs += \
|
||||
+ nss_virt_if.o \
|
||||
+ nss_virt_if_stats.o
|
||||
+endif
|
||||
+
|
||||
+ifneq "$(NSS_DRV_VLAN_ENABLE)" "n"
|
||||
+ccflags-y += -DNSS_DRV_VLAN_ENABLE
|
||||
+qca-nss-drv-objs += \
|
||||
nss_vlan.o \
|
||||
- nss_vlan_log.o \
|
||||
+ nss_vlan_log.o
|
||||
+endif
|
||||
+
|
||||
+ifneq "$(NSS_DRV_WIFI_ENABLE)" "n"
|
||||
+ccflags-y += -DNSS_DRV_WIFI_ENABLE
|
||||
+qca-nss-drv-objs += \
|
||||
nss_wifi.o \
|
||||
nss_wifi_log.o \
|
||||
nss_wifi_stats.o \
|
||||
@@ -63,10 +86,7 @@ qca-nss-drv-objs := \
|
||||
nss_wifili_stats.o \
|
||||
nss_wifili_strings.o \
|
||||
nss_wifi_mac_db.o
|
||||
-
|
||||
-# Base NSS data plane/HAL support
|
||||
-qca-nss-drv-objs += nss_data_plane/nss_data_plane_common.o
|
||||
-qca-nss-drv-objs += nss_hal/nss_hal.o
|
||||
+endif
|
||||
|
||||
ifneq "$(NSS_DRV_BRIDGE_ENABLE)" "n"
|
||||
ccflags-y += -DNSS_DRV_BRIDGE_ENABLE
|
||||
diff --git a/nss_hal/nss_hal.c b/nss_hal/nss_hal.c
|
||||
index 7e9a044..c0051e4 100644
|
||||
--- a/nss_hal/nss_hal.c
|
||||
+++ b/nss_hal/nss_hal.c
|
||||
--- nss_hal.c.orig 2022-07-21 16:52:43.562803700 +0300
|
||||
+++ nss_hal.c 2022-07-21 16:54:46.052803700 +0300
|
||||
@@ -460,10 +460,12 @@ int nss_hal_probe(struct platform_device
|
||||
}
|
||||
#endif
|
||||
|
||||
+#ifdef NSS_DRV_PPPOE_ENABLE
|
||||
if (npd->pppoe_enabled == NSS_FEATURE_ENABLED) {
|
||||
nss_top->pppoe_handler_id = nss_dev->id;
|
||||
nss_pppoe_register_handler();
|
||||
}
|
||||
+#endif
|
||||
|
||||
#ifdef NSS_DRV_PPE_ENABLE
|
||||
if (npd->ppe_enabled == NSS_FEATURE_ENABLED) {
|
||||
@@ -558,6 +560,7 @@ int nss_hal_probe(struct platform_device
|
||||
}
|
||||
#endif
|
||||
|
||||
+#ifdef NSS_DRV_WIFI_ENABLE
|
||||
if (npd->wifioffload_enabled == NSS_FEATURE_ENABLED) {
|
||||
nss_top->wifi_handler_id = nss_dev->id;
|
||||
nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_VAP] = nss_dev->id;
|
||||
@@ -585,6 +588,7 @@ int nss_hal_probe(struct platform_device
|
||||
*/
|
||||
nss_wifili_thread_scheme_db_init(nss_dev->id);
|
||||
}
|
||||
+#endif
|
||||
|
||||
#ifdef NSS_DRV_OAM_ENABLE
|
||||
if (npd->oam_enabled == NSS_FEATURE_ENABLED) {
|
||||
@@ -601,11 +605,13 @@ int nss_hal_probe(struct platform_device
|
||||
}
|
||||
#endif
|
||||
|
||||
+#ifdef NSS_DRV_VLAN_ENABLE
|
||||
if (npd->vlan_enabled == NSS_FEATURE_ENABLED) {
|
||||
nss_top->vlan_handler_id = nss_dev->id;
|
||||
nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_VLAN] = nss_dev->id;
|
||||
nss_vlan_register_handler();
|
||||
}
|
||||
+#endif
|
||||
|
||||
#ifdef NSS_DRV_QVPN_ENABLE
|
||||
#if defined(NSS_HAL_IPQ807x_SUPPORT) || defined(NSS_HAL_IPQ60XX_SUPPORT)
|
||||
diff --git a/nss_init.c b/nss_init.c
|
||||
index ebd2a12..40e9351 100644
|
||||
--- a/nss_init.c
|
||||
+++ b/nss_init.c
|
||||
@@ -775,10 +775,12 @@ static int __init nss_init(void)
|
||||
*/
|
||||
nss_project_register_sysctl();
|
||||
|
||||
+#ifdef NSS_DRV_PPPOE_ENABLE
|
||||
/*
|
||||
* Registering sysctl for pppoe specific config.
|
||||
*/
|
||||
nss_pppoe_register_sysctl();
|
||||
+#endif
|
||||
|
||||
/*
|
||||
* Setup Runtime Sample values
|
||||
@@ -913,10 +915,12 @@ static void __exit nss_cleanup(void)
|
||||
nss_c2c_tx_unregister_sysctl();
|
||||
#endif
|
||||
|
||||
+#ifdef NSS_DRV_PPPOE_ENABLE
|
||||
/*
|
||||
* Unregister pppoe specific sysctl
|
||||
*/
|
||||
nss_pppoe_unregister_sysctl();
|
||||
+#endif
|
||||
|
||||
/*
|
||||
* Unregister ipv4/6 specific sysctl and free allocated to connection tables
|
||||
--
|
||||
2.34.1
|
@ -0,0 +1,344 @@
|
||||
From d0bffc800a50305315a0d7cf37140291ef5b1b61 Mon Sep 17 00:00:00 2001
|
||||
From: Ansuel Smith <ansuelsmth@gmail.com>
|
||||
Date: Thu, 27 May 2021 03:52:47 +0200
|
||||
Subject: [PATCH] treewide: hack support for mismatched firmware
|
||||
|
||||
Make new qsdk feature configurable to support old half compatible
|
||||
firmware.
|
||||
|
||||
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
|
||||
---
|
||||
exports/nss_fw_version.h | 11 +++++++++++
|
||||
exports/nss_ipv4.h | 8 ++++++++
|
||||
exports/nss_ipv6.h | 7 +++++++
|
||||
exports/nss_wifi_vdev.h | 14 ++++++++++++++
|
||||
exports/nss_wifili_if.h | 8 ++++++++
|
||||
nss_ipv4_stats.c | 2 ++
|
||||
nss_ipv4_strings.c | 2 ++
|
||||
nss_ipv6_stats.c | 2 ++
|
||||
nss_ipv6_strings.c | 2 ++
|
||||
9 files changed, 56 insertions(+)
|
||||
create mode 100644 exports/nss_fw_version.h
|
||||
|
||||
diff --git a/exports/nss_fw_version.h b/exports/nss_fw_version.h
|
||||
new file mode 100644
|
||||
index 0000000..895d523
|
||||
--- /dev/null
|
||||
+++ b/exports/nss_fw_version.h
|
||||
@@ -0,0 +1,11 @@
|
||||
+#ifndef __NSS_FW_VERSION_H
|
||||
+#define __NSS_FW_VERSION_H
|
||||
+
|
||||
+#define NSS_FW_VERSION_MAJOR 11
|
||||
+#define NSS_FW_VERSION_MINOR 4
|
||||
+
|
||||
+#define NSS_FW_VERSION(a,b) (((a) << 8) + (b))
|
||||
+
|
||||
+#define NSS_FW_VERSION_CODE NSS_FW_VERSION(NSS_FW_VERSION_MAJOR, NSS_FW_VERSION_MINOR)
|
||||
+
|
||||
+#endif /* __NSS_FW_VERSION_H */
|
||||
\ No newline at end of file
|
||||
diff --git a/exports/nss_ipv4.h b/exports/nss_ipv4.h
|
||||
index ee3a552..25c4d82 100644
|
||||
--- a/exports/nss_ipv4.h
|
||||
+++ b/exports/nss_ipv4.h
|
||||
@@ -26,6 +26,8 @@
|
||||
#include "nss_stats_public.h"
|
||||
#endif
|
||||
|
||||
+#include "nss_fw_version.h"
|
||||
+
|
||||
/**
|
||||
* @addtogroup nss_ipv4_subsystem
|
||||
* @{
|
||||
@@ -216,12 +218,14 @@ enum nss_ipv4_stats_types {
|
||||
/**< Number of IPv4 multicast connection destroy requests that missed the cache. */
|
||||
NSS_IPV4_STATS_MC_CONNECTION_FLUSHES,
|
||||
/**< Number of IPv4 multicast connection flushes. */
|
||||
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,3))
|
||||
NSS_IPV4_STATS_CONNECTION_CREATE_INVALID_MIRROR_IFNUM,
|
||||
/**< Number of IPv4 mirror connection requests with an invalid interface number. */
|
||||
NSS_IPV4_STATS_CONNECTION_CREATE_INVALID_MIRROR_IFTYPE,
|
||||
/**< Number of IPv4 mirror connection requests with an invalid interface type. */
|
||||
NSS_IPV4_STATS_MIRROR_FAILURES,
|
||||
/**< Number of IPv4 mirror failures. */
|
||||
+#endif
|
||||
NSS_IPV4_STATS_MAX,
|
||||
/**< Maximum message type. */
|
||||
};
|
||||
@@ -609,8 +613,10 @@ struct nss_ipv4_rule_create_msg {
|
||||
/**< Ingress shaping related accleration parameters. */
|
||||
struct nss_ipv4_identifier_rule identifier;
|
||||
/**< Rule for adding identifier. */
|
||||
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,3))
|
||||
struct nss_ipv4_mirror_rule mirror_rule;
|
||||
/**< Mirror rule parameter. */
|
||||
+#endif
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -955,6 +961,7 @@ struct nss_ipv4_node_sync {
|
||||
uint32_t ipv4_mc_connection_flushes;
|
||||
/**< Number of multicast connection flushes. */
|
||||
|
||||
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,3))
|
||||
uint32_t ipv4_connection_create_invalid_mirror_ifnum;
|
||||
/**< Number of create request failed with an invalid mirror interface number. */
|
||||
|
||||
@@ -963,6 +970,7 @@ struct nss_ipv4_node_sync {
|
||||
|
||||
uint32_t ipv4_mirror_failures;
|
||||
/**< Mirror packet failed. */
|
||||
+#endif
|
||||
|
||||
uint32_t exception_events[NSS_IPV4_EXCEPTION_EVENT_MAX];
|
||||
/**< Number of exception events. */
|
||||
diff --git a/exports/nss_ipv6.h b/exports/nss_ipv6.h
|
||||
index 930e74c..a21f939 100644
|
||||
--- a/exports/nss_ipv6.h
|
||||
+++ b/exports/nss_ipv6.h
|
||||
@@ -195,6 +195,8 @@ enum nss_ipv6_stats_types {
|
||||
/**< Number of IPv6 multicast connection destroy requests that missed the cache. */
|
||||
NSS_IPV6_STATS_MC_CONNECTION_FLUSHES,
|
||||
/**< Number of IPv6 multicast connection flushes. */
|
||||
+
|
||||
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,3))
|
||||
NSS_IPV6_STATS_CONNECTION_CREATE_INVALID_MIRROR_IFNUM,
|
||||
/**< Number of IPv6 mirror connection requests with an invalid interface number. */
|
||||
NSS_IPV6_STATS_CONNECTION_CREATE_INVALID_MIRROR_IFTYPE,
|
||||
@@ -202,6 +204,7 @@ enum nss_ipv6_stats_types {
|
||||
|
||||
NSS_IPV6_STATS_MIRROR_FAILURES,
|
||||
/**< Number of IPv6 mirror failures. */
|
||||
+#endif
|
||||
|
||||
NSS_IPV6_STATS_MAX,
|
||||
/**< Maximum message type. */
|
||||
@@ -702,8 +705,10 @@ struct nss_ipv6_rule_create_msg {
|
||||
/**< Ingress shaping related accleration parameters. */
|
||||
struct nss_ipv6_identifier_rule identifier;
|
||||
/**< Rule for adding identifier. */
|
||||
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,3))
|
||||
struct nss_ipv6_mirror_rule mirror_rule;
|
||||
/**< Mirror rule parameter. */
|
||||
+#endif
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -950,6 +955,7 @@ struct nss_ipv6_node_sync {
|
||||
uint32_t ipv6_mc_connection_flushes;
|
||||
/**< Number of multicast connection flushes. */
|
||||
|
||||
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,3))
|
||||
uint32_t ipv6_connection_create_invalid_mirror_ifnum;
|
||||
/**< Number of create request failed with an invalid mirror interface number. */
|
||||
|
||||
@@ -958,6 +964,7 @@ struct nss_ipv6_node_sync {
|
||||
|
||||
uint32_t ipv6_mirror_failures;
|
||||
/**< Mirror packet failed. */
|
||||
+#endif
|
||||
|
||||
uint32_t exception_events[NSS_IPV6_EXCEPTION_EVENT_MAX];
|
||||
/**< Number of exception events. */
|
||||
diff --git a/exports/nss_wifi_vdev.h b/exports/nss_wifi_vdev.h
|
||||
index 1b52f66..da91b56 100644
|
||||
--- a/exports/nss_wifi_vdev.h
|
||||
+++ b/exports/nss_wifi_vdev.h
|
||||
@@ -74,8 +74,10 @@ enum nss_wifi_vdev_msg_types {
|
||||
NSS_WIFI_VDEV_INTERFACE_RECOVERY_RESET_MSG,
|
||||
NSS_WIFI_VDEV_INTERFACE_RECOVERY_RECONF_MSG,
|
||||
NSS_WIFI_VDEV_SET_GROUP_KEY,
|
||||
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,3))
|
||||
NSS_WIFI_VDEV_HMMC_MEMBER_ADD_MSG,
|
||||
NSS_WIFI_VDEV_HMMC_MEMBER_DEL_MSG,
|
||||
+#endif
|
||||
NSS_WIFI_VDEV_MAX_MSG
|
||||
};
|
||||
|
||||
@@ -130,6 +132,7 @@ enum nss_wifi_vdev_err_types {
|
||||
NSS_WIFI_VDEV_VLAN_MODE_CONFIG_FAIL,
|
||||
NSS_WIFI_VDEV_RECOVERY_RESET_FAIL,
|
||||
NSS_WIFI_VDEV_RECOVERY_RECONF_FAIL,
|
||||
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,3))
|
||||
NSS_WIFI_VDEV_CONFIG_GROUP_KEY_FAIL,
|
||||
NSS_WIFI_VDEV_MULTIPASS_NOT_ENABLED,
|
||||
NSS_WIFI_VDEV_ALLOC_VLAN_MAP_FAILED,
|
||||
@@ -139,6 +142,7 @@ enum nss_wifi_vdev_err_types {
|
||||
NSS_WIFI_VDEV_PPE_PORT_DESTROY_FAIL,
|
||||
NSS_WIFI_VDEV_PPE_VSI_ASSIGN_FAIL,
|
||||
NSS_WIFI_VDEV_PPE_VSI_UNASSIGN_FAIL,
|
||||
+#endif
|
||||
NSS_WIFI_VDEV_EINV_MAX_CFG
|
||||
};
|
||||
|
||||
@@ -161,11 +165,13 @@ enum nss_wifi_vdev_ext_data_pkt_type {
|
||||
NSS_WIFI_VDEV_EXT_TX_COMPL_PKT_TYPE = 11, /**< Tx completion. */
|
||||
NSS_WIFI_VDEV_EXT_DATA_PKT_TYPE_WDS_LEARN = 12, /**< WDS source port learning command. */
|
||||
NSS_WIFI_VDEV_EXT_DATA_PPDU_INFO = 13, /**< PPDU metadata information. */
|
||||
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,3))
|
||||
NSS_WIFI_VDEV_EXT_DATA_PKT_TYPE_MCBC_RX = 14, /**< Multicast/broadcast packet received. */
|
||||
NSS_WIFI_VDEV_MESH_EXT_DATA_PKT_TYPE_RX_SPL_PACKET = 15,
|
||||
/**< Mesh link VAP special packet. */
|
||||
NSS_WIFI_VDEV_MESH_EXT_DATA_PKT_TYPE_RX_MCAST_EXC = 16,
|
||||
/**< Mesh link VAP multicast packet. */
|
||||
+#endif
|
||||
NSS_WIFI_VDEV_EXT_DATA_PKT_TYPE_MAX
|
||||
};
|
||||
|
||||
@@ -201,9 +207,11 @@ enum nss_wifi_vdev_cmd {
|
||||
NSS_WIFI_VDEV_ENABLE_IGMP_ME_CMD, /**< Configuration to set IGMP multicast enhancement on VAP. */
|
||||
NSS_WIFI_VDEV_CFG_WDS_BACKHAUL_CMD,
|
||||
/**< Configuration to set WDS backhaul extension on VAP. */
|
||||
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,3))
|
||||
NSS_WIFI_VDEV_CFG_MCBC_EXC_TO_HOST_CMD, /**< Configuration to set multicast/broadcast exception to host on VAP. */
|
||||
NSS_WIFI_VDEV_CFG_PEER_AUTHORIZE_CMD,
|
||||
/**< Configuration to enable peer authorization on VAP. */
|
||||
+#endif
|
||||
NSS_WIFI_VDEV_MAX_CMD
|
||||
};
|
||||
|
||||
@@ -271,7 +279,9 @@ struct nss_wifi_vdev_config_msg {
|
||||
uint8_t is_nss_qwrap_en; /**< VAP is configured for NSS firmware QWRAP logic. */
|
||||
uint8_t tx_per_pkt_vdev_id_check; /**< Transmit per-packet virtual device ID check. */
|
||||
uint8_t align_pad; /**< Reserved field. */
|
||||
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,3))
|
||||
uint32_t vap_ext_mode; /**< Different VAP extended modes. */
|
||||
+#endif
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -1037,8 +1047,10 @@ struct nss_wifi_vdev_stats_sync_msg {
|
||||
uint32_t rx_mcast_bytes; /**< Receive multicast bytes count. */
|
||||
uint32_t rx_decrypt_err; /**< Receive decryption error */
|
||||
uint32_t rx_mic_err; /**< Receive MIC error */
|
||||
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,3))
|
||||
uint32_t mcbc_exc_host_fail_cnt;
|
||||
/**< Number of multicast/broadcast packets failed to send to host through exception path. */
|
||||
+#endif
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -1070,6 +1082,7 @@ struct nss_wifi_vdev_msg {
|
||||
/**< Updates a snooplist group member. */
|
||||
struct nss_wifi_vdev_me_snptbl_deny_grp_add_msg vdev_deny_member_add;
|
||||
/**< Add a snooplist member to the deny list. */
|
||||
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,3))
|
||||
struct nss_wifi_vdev_me_hmmc_add_msg vdev_hmmc_member_add;
|
||||
/**< Adds a new member into the HMMC list. */
|
||||
struct nss_wifi_vdev_me_hmmc_del_msg vdev_hmmc_member_del;
|
||||
@@ -1078,6 +1091,7 @@ struct nss_wifi_vdev_msg {
|
||||
/**< Adds a new member into the deny list. */
|
||||
struct nss_wifi_vdev_me_deny_ip_del_msg vdev_deny_list_member_del;
|
||||
/**< Delete a member from the deny list. */
|
||||
+#endif
|
||||
struct nss_wifi_vdev_txmsg vdev_txmsgext;
|
||||
/**< Transmits special data. */
|
||||
struct nss_wifi_vdev_vow_dbg_cfg_msg vdev_vow_dbg_cfg;
|
||||
diff --git a/exports/nss_wifili_if.h b/exports/nss_wifili_if.h
|
||||
index fce20fd..1f26d67 100644
|
||||
--- a/exports/nss_wifili_if.h
|
||||
+++ b/exports/nss_wifili_if.h
|
||||
@@ -62,8 +62,12 @@
|
||||
/**< Maximum number of bandwidth supported. */
|
||||
#define NSS_WIFILI_REPT_MU_MIMO 1
|
||||
#define NSS_WIFILI_REPT_MU_OFDMA_MIMO 3
|
||||
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,3))
|
||||
+#define NSS_WIFILI_MAX_RESERVED_TYPE 3
|
||||
+#else
|
||||
#define NSS_WIFILI_MAX_RESERVED_TYPE 2
|
||||
/**< Maximum reserved type. */
|
||||
+#endif
|
||||
#define NSS_WIFILI_SOC_PER_PACKET_METADATA_SIZE 60
|
||||
/**< Metadata area total size. */
|
||||
#define NSS_WIFILI_MEC_PEER_ID 0xDEAD
|
||||
@@ -1333,7 +1337,9 @@ struct nss_wifili_rx_err {
|
||||
struct nss_wifili_rx_ctrl_stats {
|
||||
struct nss_wifili_rx_err err; /**< Rx peer errors. */
|
||||
uint32_t multipass_rx_pkt_drop; /**< Total number of multipass packets without a VLAN header. */
|
||||
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,3))
|
||||
uint32_t peer_unauth_rx_pkt_drop; /**< Number of receive packets dropped due to an authorized peer. */
|
||||
+#endif
|
||||
uint32_t reserved_type[NSS_WIFILI_MAX_RESERVED_TYPE]; /**< Reserved type for future use. */
|
||||
uint32_t non_amsdu_cnt; /**< Number of MSDUs with no MSDU level aggregation. */
|
||||
uint32_t amsdu_cnt; /**< Number of MSDUs part of AMSDU. */
|
||||
@@ -1810,10 +1816,12 @@ struct nss_wifili_msg {
|
||||
/**< Peer four-address event message. */
|
||||
struct nss_wifili_dbdc_repeater_loop_detection_msg wdrldm;
|
||||
/**< Wifili DBDC repeater loop detection message. */
|
||||
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,3))
|
||||
struct nss_wifili_peer_update_auth_flag peer_auth;
|
||||
/**< Peer authentication flag message. */
|
||||
struct nss_wifili_mesh_capability_info cap_info;
|
||||
/**< Mesh capability flag. */
|
||||
+#endif
|
||||
} msg; /**< Message payload. */
|
||||
};
|
||||
|
||||
diff --git a/nss_ipv4_stats.c b/nss_ipv4_stats.c
|
||||
index 39b162c..c875a63 100644
|
||||
--- a/nss_ipv4_stats.c
|
||||
+++ b/nss_ipv4_stats.c
|
||||
@@ -177,9 +177,11 @@ void nss_ipv4_stats_node_sync(struct nss_ctx_instance *nss_ctx, struct nss_ipv4_
|
||||
nss_ipv4_stats[NSS_IPV4_STATS_MC_CONNECTION_DESTROY_REQUESTS] += nins->ipv4_mc_connection_destroy_requests;
|
||||
nss_ipv4_stats[NSS_IPV4_STATS_MC_CONNECTION_DESTROY_MISSES] += nins->ipv4_mc_connection_destroy_misses;
|
||||
nss_ipv4_stats[NSS_IPV4_STATS_MC_CONNECTION_FLUSHES] += nins->ipv4_mc_connection_flushes;
|
||||
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,3))
|
||||
nss_ipv4_stats[NSS_IPV4_STATS_CONNECTION_CREATE_INVALID_MIRROR_IFNUM] += nins->ipv4_connection_create_invalid_mirror_ifnum;
|
||||
nss_ipv4_stats[NSS_IPV4_STATS_CONNECTION_CREATE_INVALID_MIRROR_IFTYPE] += nins->ipv4_connection_create_invalid_mirror_iftype;
|
||||
nss_ipv4_stats[NSS_IPV4_STATS_MIRROR_FAILURES] += nins->ipv4_mirror_failures;
|
||||
+#endif
|
||||
|
||||
for (i = 0; i < NSS_IPV4_EXCEPTION_EVENT_MAX; i++) {
|
||||
nss_ipv4_exception_stats[i] += nins->exception_events[i];
|
||||
diff --git a/nss_ipv4_strings.c b/nss_ipv4_strings.c
|
||||
index 77ff352..ce4c249 100644
|
||||
--- a/nss_ipv4_strings.c
|
||||
+++ b/nss_ipv4_strings.c
|
||||
@@ -137,9 +137,11 @@ struct nss_stats_info nss_ipv4_strings_stats[NSS_IPV4_STATS_MAX] = {
|
||||
{"mc_destroy_requests" , NSS_STATS_TYPE_SPECIAL},
|
||||
{"mc_destroy_misses" , NSS_STATS_TYPE_SPECIAL},
|
||||
{"mc_flushes" , NSS_STATS_TYPE_SPECIAL},
|
||||
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,3))
|
||||
{"mirror_invalid_ifnum_conn_create_req" , NSS_STATS_TYPE_SPECIAL},
|
||||
{"mirror_invalid_iftype_conn_create_req" , NSS_STATS_TYPE_SPECIAL},
|
||||
{"mirror_failures" , NSS_STATS_TYPE_SPECIAL},
|
||||
+#endif
|
||||
};
|
||||
|
||||
/*
|
||||
diff --git a/nss_ipv6_stats.c b/nss_ipv6_stats.c
|
||||
index 617f55b..a492a6c 100644
|
||||
--- a/nss_ipv6_stats.c
|
||||
+++ b/nss_ipv6_stats.c
|
||||
@@ -180,9 +180,11 @@ void nss_ipv6_stats_node_sync(struct nss_ctx_instance *nss_ctx, struct nss_ipv6_
|
||||
nss_ipv6_stats[NSS_IPV6_STATS_MC_CONNECTION_DESTROY_REQUESTS] += nins->ipv6_mc_connection_destroy_requests;
|
||||
nss_ipv6_stats[NSS_IPV6_STATS_MC_CONNECTION_DESTROY_MISSES] += nins->ipv6_mc_connection_destroy_misses;
|
||||
nss_ipv6_stats[NSS_IPV6_STATS_MC_CONNECTION_FLUSHES] += nins->ipv6_mc_connection_flushes;
|
||||
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,3))
|
||||
nss_ipv6_stats[NSS_IPV6_STATS_CONNECTION_CREATE_INVALID_MIRROR_IFNUM] += nins->ipv6_connection_create_invalid_mirror_ifnum;
|
||||
nss_ipv6_stats[NSS_IPV6_STATS_CONNECTION_CREATE_INVALID_MIRROR_IFTYPE] += nins->ipv6_connection_create_invalid_mirror_iftype;
|
||||
nss_ipv6_stats[NSS_IPV6_STATS_MIRROR_FAILURES] += nins->ipv6_mirror_failures;
|
||||
+#endif
|
||||
|
||||
for (i = 0; i < NSS_IPV6_EXCEPTION_EVENT_MAX; i++) {
|
||||
nss_ipv6_exception_stats[i] += nins->exception_events[i];
|
||||
diff --git a/nss_ipv6_strings.c b/nss_ipv6_strings.c
|
||||
index 57b100f..29df9c9 100644
|
||||
--- a/nss_ipv6_strings.c
|
||||
+++ b/nss_ipv6_strings.c
|
||||
@@ -115,9 +115,11 @@ struct nss_stats_info nss_ipv6_strings_stats[NSS_IPV6_STATS_MAX] = {
|
||||
{"mc_destroy_requests" ,NSS_STATS_TYPE_SPECIAL},
|
||||
{"mc_destroy_misses" ,NSS_STATS_TYPE_SPECIAL},
|
||||
{"mc_flushes" ,NSS_STATS_TYPE_SPECIAL},
|
||||
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,3))
|
||||
{"mirror_invalid_ifnum_conn_create_req" ,NSS_STATS_TYPE_SPECIAL},
|
||||
{"mirror_invalid_iftype_conn_create_req" ,NSS_STATS_TYPE_SPECIAL},
|
||||
{"mirror_failures" ,NSS_STATS_TYPE_SPECIAL},
|
||||
+#endif
|
||||
};
|
||||
|
||||
/*
|
||||
--
|
||||
2.31.1
|
||||
|
@ -3,11 +3,11 @@ include $(TOPDIR)/rules.mk
|
||||
PKG_NAME:=qca-nss-ecm-64
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE_URL:=https://git.codelinaro.org/clo/qsdk/oss/lklm/qca-nss-ecm.git
|
||||
PKG_SOURCE_URL:=https://source.codeaurora.org/quic/cc-qrdk/oss/lklm/qca-nss-ecm
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_DATE:=2022-06-15
|
||||
PKG_SOURCE_VERSION:=a4854db8d70ed0367556d817faa45e43b533a164
|
||||
PKG_MIRROR_HASH:=073b347d6bc5fa224f7e6d5df8da3af9aa98cede0439f93ff4f2ec223580b0f6
|
||||
PKG_SOURCE_DATE:=2021-04-29
|
||||
PKG_SOURCE_VERSION:=c115aec34867b582e2e5ea79fc5315971e0e953c
|
||||
PKG_MIRROR_HASH:=962385b45daa2e552a15018bf2930c2df1f6f575d885375bf935a142b4255da5
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
@ -27,10 +27,10 @@ define KernelPackage/qca-nss-ecm-64
|
||||
+kmod-ppp \
|
||||
+kmod-pppoe
|
||||
TITLE:=QCA NSS Enhanced Connection Manager (ECM)
|
||||
FILES:=$(PKG_BUILD_DIR)/ecm.ko
|
||||
FILES:=$(PKG_BUILD_DIR)/*.ko
|
||||
KCONFIG:=CONFIG_BRIDGE_NETFILTER=y \
|
||||
CONFIG_NF_CONNTRACK_EVENTS=y \
|
||||
CONFIG_NF_CONNTRACK_CHAIN_EVENTS=n \
|
||||
CONFIG_NF_CONNTRACK_CHAIN_EVENTS=y \
|
||||
CONFIG_NF_CONNTRACK_DSCPREMARK_EXT=n
|
||||
endef
|
||||
|
||||
@ -47,7 +47,6 @@ define KernelPackage/qca-nss-ecm-64/install
|
||||
$(INSTALL_DATA) ./files/qca-nss-ecm.uci $(1)/etc/config/ecm
|
||||
$(INSTALL_DATA) ./files/qca-nss-ecm.defaults $(1)/etc/uci-defaults/99-qca-nss-ecm
|
||||
$(INSTALL_BIN) ./files/qca-nss-ecm.sysctl $(1)/etc/sysctl.d/qca-nss-ecm.conf
|
||||
echo 'net.netfilter.nf_conntrack_max=8192' >> $(1)/etc/sysctl.d/qca-nss-ecm.conf
|
||||
endef
|
||||
|
||||
EXTRA_CFLAGS+=-I$(STAGING_DIR)/usr/include/qca-nss-drv
|
||||
@ -69,7 +68,13 @@ ECM_MAKE_OPTS+= ECM_FRONT_END_NSS_ENABLE=y \
|
||||
ECM_CLASSIFIER_DSCP_ENABLE=n \
|
||||
ECM_CLASSIFIER_PCC_ENABLE=n \
|
||||
ECM_BAND_STEERING_ENABLE=n \
|
||||
ECM_INTERFACE_PPPOE_ENABLE=n
|
||||
ECM_INTERFACE_PPPOE_ENABLE=y
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_TARGET_BOARD), "ipq807x")
|
||||
SOC="ipq807x_64"
|
||||
else ifeq ($(CONFIG_TARGET_BOARD), "ipq60xx")
|
||||
SOC="ipq60xx_64"
|
||||
endif
|
||||
|
||||
define Build/InstallDev
|
||||
@ -82,7 +87,7 @@ define Build/Compile
|
||||
CROSS_COMPILE="$(TARGET_CROSS)" \
|
||||
ARCH="$(LINUX_KARCH)" \
|
||||
M="$(PKG_BUILD_DIR)" \
|
||||
EXTRA_CFLAGS="$(EXTRA_CFLAGS)" SoC=$(CONFIG_TARGET_BOARD) \
|
||||
EXTRA_CFLAGS="$(EXTRA_CFLAGS)" SoC=$(SOC) \
|
||||
$(KERNEL_MAKE_FLAGS) \
|
||||
$(PKG_JOBS) \
|
||||
modules
|
||||
|
@ -18,7 +18,7 @@
|
||||
# openwrt build scripts automatically enable this package starting
|
||||
# at boot.
|
||||
|
||||
START=99
|
||||
START=19
|
||||
|
||||
get_front_end_mode() {
|
||||
config_load "ecm"
|
||||
@ -57,6 +57,10 @@ load_sfe() {
|
||||
[ -d /sys/module/shortcut_fe_ipv6 ] || insmod shortcut-fe-ipv6
|
||||
}
|
||||
|
||||
[ -e "/lib/modules/$kernel_version/shortcut-fe-cm.ko" ] && {
|
||||
[ -d /sys/module/shortcut_fe_cm ] || insmod shortcut-fe-cm
|
||||
}
|
||||
|
||||
[ -e "/lib/modules/$kernel_version/shortcut-fe-drv.ko" ] && {
|
||||
[ -d /sys/module/shortcut_fe_drv ] || insmod shortcut-fe-drv
|
||||
}
|
||||
@ -65,14 +69,18 @@ load_sfe() {
|
||||
load_ecm() {
|
||||
[ -d /sys/module/ecm ] || {
|
||||
[ ! -e /proc/device-tree/MP_256 ] && load_sfe
|
||||
modprobe ecm front_end_selection=$(get_front_end_mode)
|
||||
insmod ecm front_end_selection=$(get_front_end_mode)
|
||||
}
|
||||
|
||||
support_bridge && {
|
||||
sysctl -w net.bridge.bridge-nf-call-ip6tables=1
|
||||
sysctl -w net.bridge.bridge-nf-call-iptables=1
|
||||
}
|
||||
}
|
||||
|
||||
unload_ecm() {
|
||||
sysctl -w net.bridge.bridge-nf-call-arptables=0
|
||||
sysctl -w net.bridge.bridge-nf-call-iptables=0
|
||||
sysctl -w net.bridge.bridge-nf-call-ip6tables=0
|
||||
sysctl -w net.bridge.bridge-nf-call-iptables=0
|
||||
|
||||
if [ -d /sys/module/ecm ]; then
|
||||
#
|
||||
@ -93,24 +101,14 @@ unload_ecm() {
|
||||
}
|
||||
|
||||
start() {
|
||||
# If SFE CM is loaded, return.
|
||||
if [ -d /sys/module/shortcut_fe_cm ]; then
|
||||
echo "shortcut_fe CM is loaded, unload it first"
|
||||
echo "cmd: /etc/init.d/shortcut_fe stop"
|
||||
return
|
||||
fi
|
||||
|
||||
load_ecm
|
||||
|
||||
# If the acceleration engine is NSS, enable wifi redirect.
|
||||
[ -d /sys/kernel/debug/ecm/ecm_nss_ipv4 ] && sysctl -w dev.nss.general.redirect=1
|
||||
|
||||
support_bridge && {
|
||||
if ([ -z "$(grep "net.bridge.bridge-nf-call-ip6tables=1" /etc/sysctl.d/qca-nss-ecm.conf)" ] && [ -z "$(grep "net.bridge.bridge-nf-call-iptables=1" /etc/sysctl.d/qca-nss-ecm.conf)" ]); then
|
||||
echo 'net.bridge.bridge-nf-call-ip6tables=1' >> /etc/sysctl.d/qca-nss-ecm.conf
|
||||
echo 'net.bridge.bridge-nf-call-iptables=1' >> /etc/sysctl.d/qca-nss-ecm.conf
|
||||
echo 'net.bridge.bridge-nf-call-arptables=1' >> /etc/sysctl.d/qca-nss-ecm.conf
|
||||
fi
|
||||
}
|
||||
|
||||
if [ -d /sys/module/qca_ovsmgr ]; then
|
||||
@ -128,9 +126,8 @@ stop() {
|
||||
# If the acceleration engine is NSS, disable wifi redirect.
|
||||
[ -d /sys/kernel/debug/ecm/ecm_nss_ipv4 ] && sysctl -w dev.nss.general.redirect=0
|
||||
|
||||
sed '/net.bridge.bridge-nf-call-arptables=1/d' -i /etc/sysctl.d/qca-nss-ecm.conf
|
||||
sed '/net.bridge.bridge-nf-call-iptables=1/d' -i /etc/sysctl.d/qca-nss-ecm.conf
|
||||
sed '/net.bridge.bridge-nf-call-ip6tables=1/d' -i /etc/sysctl.d/qca-nss-ecm.conf
|
||||
sed '/net.bridge.bridge-nf-call-iptables=1/d' -i /etc/sysctl.d/qca-nss-ecm.conf
|
||||
|
||||
if [ -d /sys/module/ecm_ovs ]; then
|
||||
rmmod ecm_ovs
|
||||
|
@ -1,120 +0,0 @@
|
||||
From c4036311d65872756cd50ad8125668c422a164d0 Mon Sep 17 00:00:00 2001
|
||||
From: Ansuel Smith <ansuelsmth@gmail.com>
|
||||
Date: Sat, 15 May 2021 03:51:14 +0200
|
||||
Subject: [PATCH 02/12] treewide: rework ipv6_dev_find_and_hold to internal API
|
||||
|
||||
ipv6_dev_find_and_hold is a downstream API not present in upstream
|
||||
kernel. Rework the function and reimplement it to an internal function
|
||||
of the kernel as it doesn't require special export.
|
||||
|
||||
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
|
||||
---
|
||||
ecm_interface.c | 32 ++++++++++++++++++++++++++++++--
|
||||
ecm_interface.h | 1 +
|
||||
frontends/ecm_front_end_common.c | 7 +++++--
|
||||
3 files changed, 36 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/ecm_interface.c b/ecm_interface.c
|
||||
index 2ca02bc..b461456 100644
|
||||
--- a/ecm_interface.c
|
||||
+++ b/ecm_interface.c
|
||||
@@ -334,7 +334,7 @@ static struct net_device *ecm_interface_dev_find_by_local_addr_ipv6(ip_addr_t ad
|
||||
struct net_device *dev;
|
||||
|
||||
ECM_IP_ADDR_TO_NIN6_ADDR(addr6, addr);
|
||||
- dev = (struct net_device *)ipv6_dev_find(&init_net, &addr6, 1);
|
||||
+ dev = (struct net_device *)ecm_interface_ipv6_dev_find_and_hold(&init_net, &addr6, 1);
|
||||
return dev;
|
||||
}
|
||||
#endif
|
||||
@@ -718,6 +718,34 @@ bool ecm_interface_mac_addr_get(ip_addr_t addr, uint8_t *mac_addr, bool *on_link
|
||||
EXPORT_SYMBOL(ecm_interface_mac_addr_get);
|
||||
|
||||
#ifdef ECM_IPV6_ENABLE
|
||||
+/* ecm_interface_ipv6_dev_find_and_hold()
|
||||
+ * Find (and hold) net device that has the given address.
|
||||
+ * Or NULL on failure.
|
||||
+ */
|
||||
+struct net_device *ecm_interface_ipv6_dev_find_and_hold(struct net *net, struct in6_addr *addr,
|
||||
+ int strict)
|
||||
+{
|
||||
+ struct inet6_ifaddr *ifp;
|
||||
+ struct net_device *dev;
|
||||
+
|
||||
+ ifp = ipv6_get_ifaddr(net, addr, NULL, strict);
|
||||
+ if (!ifp)
|
||||
+ return NULL;
|
||||
+
|
||||
+ if (!ifp->idev) {
|
||||
+ in6_ifa_put(ifp);
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
+ dev = ifp->idev->dev;
|
||||
+ if (dev)
|
||||
+ dev_hold(dev);
|
||||
+
|
||||
+ in6_ifa_put(ifp);
|
||||
+
|
||||
+ return dev;
|
||||
+}
|
||||
+
|
||||
/*
|
||||
* ecm_interface_mac_addr_get_ipv6_no_route()
|
||||
* Finds the mac address of a node from its ip address reachable via
|
||||
@@ -736,7 +764,7 @@ static bool ecm_interface_mac_addr_get_ipv6_no_route(struct net_device *dev, ip_
|
||||
* Get the MAC address that corresponds to IP address given.
|
||||
*/
|
||||
ECM_IP_ADDR_TO_NIN6_ADDR(daddr, addr);
|
||||
- local_dev = ipv6_dev_find(&init_net, &daddr, 1);
|
||||
+ local_dev = ecm_interface_ipv6_dev_find_and_hold(&init_net, &daddr, 1);
|
||||
if (local_dev) {
|
||||
DEBUG_TRACE("%pi6 is a local address\n", &daddr);
|
||||
memcpy(mac_addr, dev->dev_addr, ETH_ALEN);
|
||||
diff --git a/ecm_interface.h b/ecm_interface.h
|
||||
index 0172e8d..4c17fee 100644
|
||||
--- a/ecm_interface.h
|
||||
+++ b/ecm_interface.h
|
||||
@@ -58,6 +58,7 @@ bool ecm_interface_mac_addr_get(ip_addr_t addr, uint8_t *mac_addr, bool *on_link
|
||||
bool ecm_interface_find_route_by_addr(ip_addr_t addr, struct ecm_interface_route *ecm_rt);
|
||||
void ecm_interface_route_release(struct ecm_interface_route *rt);
|
||||
#ifdef ECM_IPV6_ENABLE
|
||||
+struct net_device *ecm_interfcae_ipv6_dev_find_and_hold(struct net *net, struct in6_addr *addr, int strict);
|
||||
struct neighbour *ecm_interface_ipv6_neigh_get(struct ecm_front_end_connection_instance *feci, ecm_db_obj_dir_t dir, ip_addr_t addr);
|
||||
void ecm_interface_send_neighbour_solicitation(struct net_device *dev, ip_addr_t addr);
|
||||
#endif
|
||||
diff --git a/frontends/ecm_front_end_common.c b/frontends/ecm_front_end_common.c
|
||||
index e21ca24..6054685 100644
|
||||
--- a/frontends/ecm_front_end_common.c
|
||||
+++ b/frontends/ecm_front_end_common.c
|
||||
@@ -56,6 +56,9 @@
|
||||
#include "ecm_db.h"
|
||||
#include "ecm_front_end_common.h"
|
||||
#include "ecm_interface.h"
|
||||
+#ifdef ECM_IPV6_ENABLE
|
||||
+#include "ecm_front_end_ipv6.h"
|
||||
+#endif
|
||||
|
||||
/*
|
||||
* Sysctl table header
|
||||
@@ -315,7 +318,7 @@ bool ecm_front_end_gre_proto_is_accel_allowed(struct net_device *indev,
|
||||
}
|
||||
} else {
|
||||
#ifdef ECM_IPV6_ENABLE
|
||||
- dev = ipv6_dev_find(&init_net, &(tuple->src.u3.in6), 1);
|
||||
+ dev = ecm_interface_ipv6_dev_find_and_hold(&init_net, &(tuple->src.u3.in6), 1);
|
||||
if (dev) {
|
||||
/*
|
||||
* Source IP address is local
|
||||
@@ -325,7 +328,7 @@ bool ecm_front_end_gre_proto_is_accel_allowed(struct net_device *indev,
|
||||
return false;
|
||||
}
|
||||
|
||||
- dev = ipv6_dev_find(&init_net, &(tuple->dst.u3.in6), 1);
|
||||
+ dev = ecm_interface_ipv6_dev_find_and_hold(&init_net, &(tuple->dst.u3.in6), 1);
|
||||
if (dev) {
|
||||
/*
|
||||
* Destination IP address is local
|
||||
--
|
||||
2.34.1
|
||||
|
@ -1,54 +0,0 @@
|
||||
From 5a91820d390b36dafd29075b55504827b0123e62 Mon Sep 17 00:00:00 2001
|
||||
From: Ansuel Smith <ansuelsmth@gmail.com>
|
||||
Date: Sun, 8 May 2022 17:51:16 +0200
|
||||
Subject: [PATCH 06/12] ecm_interface: switch to kernel_recvmsg api
|
||||
|
||||
set/get_fs() got dropped in 5.11+ kernel. Convert it to kernel_recvmsg
|
||||
while fixing this deprecation.
|
||||
|
||||
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
|
||||
---
|
||||
ecm_interface.c | 9 +++++++++
|
||||
1 file changed, 9 insertions(+)
|
||||
|
||||
diff --git a/ecm_interface.c b/ecm_interface.c
|
||||
index b461456..6be872a 100644
|
||||
--- a/ecm_interface.c
|
||||
+++ b/ecm_interface.c
|
||||
@@ -7617,9 +7617,13 @@ static int ecm_interface_wifi_event_hand
|
||||
static int ecm_interface_wifi_event_rx(struct socket *sock, struct sockaddr_nl *addr, unsigned char *buf, int len)
|
||||
{
|
||||
struct msghdr msg;
|
||||
- struct iovec iov;
|
||||
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0))
|
||||
+ struct iovec iov;
|
||||
mm_segment_t oldfs;
|
||||
int size;
|
||||
+#else
|
||||
+ struct kvec iov;
|
||||
+#endif
|
||||
|
||||
iov.iov_base = buf;
|
||||
iov.iov_len = len;
|
||||
@@ -7629,7 +7633,8 @@ static int ecm_interface_wifi_event_rx(s
|
||||
msg.msg_namelen = sizeof(struct sockaddr_nl);
|
||||
msg.msg_control = NULL;
|
||||
msg.msg_controllen = 0;
|
||||
- oldfs = get_fs();
|
||||
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0))
|
||||
+ oldfs = get_fs();
|
||||
set_fs(KERNEL_DS);
|
||||
iov_iter_init(&msg.msg_iter, READ, &iov, 1, len);
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 7, 0))
|
||||
@@ -7640,6 +7645,9 @@ static int ecm_interface_wifi_event_rx(s
|
||||
set_fs(oldfs);
|
||||
|
||||
return size;
|
||||
+#else
|
||||
+ return kernel_recvmsg(sock, &msg, &iov, 1, iov.iov_len, 0);
|
||||
+#endif
|
||||
}
|
||||
|
||||
/*
|
||||
--
|
||||
2.34.1
|
@ -1,72 +0,0 @@
|
||||
From e9073363a50a25bddd96e808f04bcf56c45da4ac Mon Sep 17 00:00:00 2001
|
||||
From: Ansuel Smith <ansuelsmth@gmail.com>
|
||||
Date: Sun, 8 May 2022 18:19:47 +0200
|
||||
Subject: [PATCH 07/12] treewide: rework notifier changes for 5.15
|
||||
|
||||
Rework notifier changes for 5.15 conntrack new implementation.
|
||||
|
||||
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
|
||||
---
|
||||
ecm_conntrack_notifier.c | 16 +++++++++++++++-
|
||||
1 file changed, 15 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/ecm_conntrack_notifier.c b/ecm_conntrack_notifier.c
|
||||
index 9c8a45e..9f2cdae 100644
|
||||
--- a/ecm_conntrack_notifier.c
|
||||
+++ b/ecm_conntrack_notifier.c
|
||||
@@ -322,7 +322,7 @@ EXPORT_SYMBOL(ecm_conntrack_ipv4_event);
|
||||
#ifdef CONFIG_NF_CONNTRACK_CHAIN_EVENTS
|
||||
static int ecm_conntrack_event(struct notifier_block *this, unsigned long events, void *ptr)
|
||||
#else
|
||||
-static int ecm_conntrack_event(unsigned int events, struct nf_ct_event *item)
|
||||
+static int ecm_conntrack_event(unsigned int events, const struct nf_ct_event *item)
|
||||
#endif
|
||||
{
|
||||
#ifdef CONFIG_NF_CONNTRACK_CHAIN_EVENTS
|
||||
@@ -388,7 +388,11 @@ static struct notifier_block ecm_conntrack_notifier = {
|
||||
* Netfilter conntrack event system to monitor connection tracking changes
|
||||
*/
|
||||
static struct nf_ct_event_notifier ecm_conntrack_notifier = {
|
||||
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0))
|
||||
.fcn = ecm_conntrack_event,
|
||||
+#else
|
||||
+ .ct_event = ecm_conntrack_event,
|
||||
+#endif
|
||||
};
|
||||
#endif
|
||||
#endif
|
||||
@@ -426,13 +430,19 @@ int ecm_conntrack_notifier_init(struct dentry *dentry)
|
||||
#ifdef CONFIG_NF_CONNTRACK_CHAIN_EVENTS
|
||||
result = nf_conntrack_register_chain_notifier(&init_net, &ecm_conntrack_notifier);
|
||||
#else
|
||||
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0))
|
||||
result = nf_conntrack_register_notifier(&init_net, &ecm_conntrack_notifier);
|
||||
+#else
|
||||
+ nf_conntrack_register_notifier(&init_net, &ecm_conntrack_notifier);
|
||||
+#endif
|
||||
#endif
|
||||
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0))
|
||||
if (result < 0) {
|
||||
DEBUG_ERROR("Can't register nf notifier hook.\n");
|
||||
debugfs_remove_recursive(ecm_conntrack_notifier_dentry);
|
||||
return result;
|
||||
}
|
||||
+#endif
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
@@ -448,7 +458,11 @@ void ecm_conntrack_notifier_exit(void)
|
||||
#ifdef CONFIG_NF_CONNTRACK_CHAIN_EVENTS
|
||||
nf_conntrack_unregister_chain_notifier(&init_net, &ecm_conntrack_notifier);
|
||||
#else
|
||||
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0))
|
||||
nf_conntrack_unregister_notifier(&init_net, &ecm_conntrack_notifier);
|
||||
+#else
|
||||
+ nf_conntrack_unregister_notifier(&init_net);
|
||||
+#endif
|
||||
#endif
|
||||
/*
|
||||
* Remove the debugfs files recursively.
|
||||
--
|
||||
2.34.1
|
||||
|
@ -1,156 +0,0 @@
|
||||
--- a/frontends/nss/ecm_nss_ported_ipv4.c
|
||||
+++ b/frontends/nss/ecm_nss_ported_ipv4.c
|
||||
@@ -125,6 +125,7 @@
|
||||
static int ecm_nss_ported_ipv4_accelerated_count[ECM_NSS_PORTED_IPV4_PROTO_MAX] = {0};
|
||||
/* Array of Number of TCP and UDP connections currently offloaded */
|
||||
|
||||
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 12, 0)
|
||||
/*
|
||||
* Expose what should be a static flag in the TCP connection tracker.
|
||||
*/
|
||||
@@ -132,6 +133,7 @@
|
||||
extern int nf_ct_tcp_no_window_check;
|
||||
#endif
|
||||
extern int nf_ct_tcp_be_liberal;
|
||||
+#endif
|
||||
|
||||
/*
|
||||
* ecm_nss_ported_ipv4_connection_callback()
|
||||
@@ -372,6 +374,10 @@
|
||||
uint8_t dest_mac_xlate[ETH_ALEN];
|
||||
ecm_db_direction_t ecm_dir;
|
||||
ecm_front_end_acceleration_mode_t result_mode;
|
||||
+#if LINUX_VERSION_CODE > KERNEL_VERSION(5, 12, 0)
|
||||
+ struct net *net = nf_ct_net(ct);
|
||||
+ struct nf_tcp_net *tn = nf_tcp_pernet(net);
|
||||
+#endif
|
||||
|
||||
DEBUG_CHECK_MAGIC(npci, ECM_NSS_PORTED_IPV4_CONNECTION_INSTANCE_MAGIC, "%px: magic failed", npci);
|
||||
|
||||
@@ -1236,9 +1242,17 @@
|
||||
nircm->tcp_rule.return_end = ct->proto.tcp.seen[return_dir].td_end;
|
||||
nircm->tcp_rule.return_max_end = ct->proto.tcp.seen[return_dir].td_maxend;
|
||||
#ifdef ECM_OPENWRT_SUPPORT
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 12, 0)
|
||||
if (nf_ct_tcp_be_liberal || nf_ct_tcp_no_window_check
|
||||
#else
|
||||
+ if (tn->tcp_be_liberal || tn->tcp_no_window_check
|
||||
+#endif
|
||||
+#else
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 12, 0)
|
||||
if (nf_ct_tcp_be_liberal
|
||||
+#else
|
||||
+ if (tn->tcp_be_liberal
|
||||
+#endif
|
||||
#endif
|
||||
|| (ct->proto.tcp.seen[flow_dir].flags & IP_CT_TCP_FLAG_BE_LIBERAL)
|
||||
|| (ct->proto.tcp.seen[return_dir].flags & IP_CT_TCP_FLAG_BE_LIBERAL)) {
|
||||
--- a/frontends/nss/ecm_nss_ported_ipv6.c
|
||||
+++ b/frontends/nss/ecm_nss_ported_ipv6.c
|
||||
@@ -125,6 +125,7 @@
|
||||
static int ecm_nss_ported_ipv6_accelerated_count[ECM_NSS_PORTED_IPV6_PROTO_MAX] = {0};
|
||||
/* Array of Number of TCP and UDP connections currently offloaded */
|
||||
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 12, 0)
|
||||
/*
|
||||
* Expose what should be a static flag in the TCP connection tracker.
|
||||
*/
|
||||
@@ -132,6 +133,7 @@
|
||||
extern int nf_ct_tcp_no_window_check;
|
||||
#endif
|
||||
extern int nf_ct_tcp_be_liberal;
|
||||
+#endif
|
||||
|
||||
/*
|
||||
* ecm_nss_ported_ipv6_connection_callback()
|
||||
@@ -376,6 +378,10 @@
|
||||
ip_addr_t src_ip;
|
||||
ip_addr_t dest_ip;
|
||||
ecm_front_end_acceleration_mode_t result_mode;
|
||||
+#if LINUX_VERSION_CODE > KERNEL_VERSION(5, 12, 0)
|
||||
+ struct net *net = nf_ct_net(ct);
|
||||
+ struct nf_tcp_net *tn = nf_tcp_pernet(net);
|
||||
+#endif
|
||||
|
||||
DEBUG_CHECK_MAGIC(npci, ECM_NSS_PORTED_IPV6_CONNECTION_INSTANCE_MAGIC, "%px: magic failed", npci);
|
||||
|
||||
@@ -1162,9 +1168,17 @@
|
||||
nircm->tcp_rule.return_end = ct->proto.tcp.seen[return_dir].td_end;
|
||||
nircm->tcp_rule.return_max_end = ct->proto.tcp.seen[return_dir].td_maxend;
|
||||
#ifdef ECM_OPENWRT_SUPPORT
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 12, 0)
|
||||
if (nf_ct_tcp_be_liberal || nf_ct_tcp_no_window_check
|
||||
#else
|
||||
+ if (tn->tcp_be_liberal || tn->tcp_no_window_check
|
||||
+#endif
|
||||
+#else
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 12, 0)
|
||||
if (nf_ct_tcp_be_liberal
|
||||
+#else
|
||||
+ if (tn->tcp_be_liberal
|
||||
+#endif
|
||||
#endif
|
||||
|| (ct->proto.tcp.seen[flow_dir].flags & IP_CT_TCP_FLAG_BE_LIBERAL)
|
||||
|| (ct->proto.tcp.seen[return_dir].flags & IP_CT_TCP_FLAG_BE_LIBERAL)) {
|
||||
--- a/frontends/sfe/ecm_sfe_ported_ipv4.c
|
||||
+++ b/frontends/sfe/ecm_sfe_ported_ipv4.c
|
||||
@@ -422,6 +422,10 @@
|
||||
ecm_db_direction_t ecm_dir;
|
||||
ecm_front_end_acceleration_mode_t result_mode;
|
||||
uint32_t l2_accel_bits = (ECM_SFE_COMMON_FLOW_L2_ACCEL_ALLOWED | ECM_SFE_COMMON_RETURN_L2_ACCEL_ALLOWED);
|
||||
+#if LINUX_VERSION_CODE > KERNEL_VERSION(5, 12, 0)
|
||||
+ struct net *net = nf_ct_net(ct);
|
||||
+ struct nf_tcp_net *tn = nf_tcp_pernet(net);
|
||||
+#endif
|
||||
ecm_sfe_common_l2_accel_check_callback_t l2_accel_check;
|
||||
|
||||
DEBUG_CHECK_MAGIC(npci, ECM_SFE_PORTED_IPV4_CONNECTION_INSTANCE_MAGIC, "%px: magic failed", npci);
|
||||
@@ -1333,9 +1337,17 @@
|
||||
nircm->tcp_rule.return_end = ct->proto.tcp.seen[return_dir].td_end;
|
||||
nircm->tcp_rule.return_max_end = ct->proto.tcp.seen[return_dir].td_maxend;
|
||||
#ifdef ECM_OPENWRT_SUPPORT
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 12, 0)
|
||||
if (nf_ct_tcp_be_liberal || nf_ct_tcp_no_window_check
|
||||
#else
|
||||
+ if (tn->tcp_be_liberal || tn->tcp_no_window_check)
|
||||
+#endif
|
||||
+#else
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 12, 0)
|
||||
if (nf_ct_tcp_be_liberal
|
||||
+#else
|
||||
+ if (tn->tcp_be_liberal)
|
||||
+#endif
|
||||
#endif
|
||||
|| (ct->proto.tcp.seen[flow_dir].flags & IP_CT_TCP_FLAG_BE_LIBERAL)
|
||||
|| (ct->proto.tcp.seen[return_dir].flags & IP_CT_TCP_FLAG_BE_LIBERAL)) {
|
||||
--- a/frontends/sfe/ecm_sfe_ported_ipv6.c
|
||||
+++ b/frontends/sfe/ecm_sfe_ported_ipv6.c
|
||||
@@ -426,6 +426,10 @@
|
||||
ip_addr_t src_ip;
|
||||
ip_addr_t dest_ip;
|
||||
ecm_front_end_acceleration_mode_t result_mode;
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 12, 0)
|
||||
+ struct net *net = nf_ct_net(ct);
|
||||
+ struct nf_tcp_net *tn = nf_tcp_pernet(net);
|
||||
+#endif
|
||||
uint32_t l2_accel_bits = (ECM_SFE_COMMON_FLOW_L2_ACCEL_ALLOWED | ECM_SFE_COMMON_RETURN_L2_ACCEL_ALLOWED);
|
||||
ecm_sfe_common_l2_accel_check_callback_t l2_accel_check;
|
||||
|
||||
@@ -1293,9 +1297,17 @@
|
||||
nircm->tcp_rule.return_end = ct->proto.tcp.seen[return_dir].td_end;
|
||||
nircm->tcp_rule.return_max_end = ct->proto.tcp.seen[return_dir].td_maxend;
|
||||
#ifdef ECM_OPENWRT_SUPPORT
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 12, 0)
|
||||
if (nf_ct_tcp_be_liberal || nf_ct_tcp_no_window_check
|
||||
#else
|
||||
+ if (tn->tcp_be_liberal || tn->tcp_no_window_check)
|
||||
+#endif
|
||||
+#else
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 12, 0)
|
||||
if (nf_ct_tcp_be_liberal
|
||||
+#else
|
||||
+ if (tn->tcp_be_liberal)
|
||||
+#endif
|
||||
#endif
|
||||
|| (ct->proto.tcp.seen[flow_dir].flags & IP_CT_TCP_FLAG_BE_LIBERAL)
|
||||
|| (ct->proto.tcp.seen[return_dir].flags & IP_CT_TCP_FLAG_BE_LIBERAL)) {
|
@ -1,55 +0,0 @@
|
||||
From 9827d8597545ecfee17eba7b08d48dbcdf55c614 Mon Sep 17 00:00:00 2001
|
||||
From: Ansuel Smith <ansuelsmth@gmail.com>
|
||||
Date: Sun, 8 May 2022 18:39:39 +0200
|
||||
Subject: [PATCH 09/12] ecm_tracker_datagram: drop static for EXPORT_SYMBOL
|
||||
|
||||
EXPORT_SYMBOL should NOT be static
|
||||
|
||||
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
|
||||
---
|
||||
ecm_tracker_datagram.c | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/ecm_tracker_datagram.c b/ecm_tracker_datagram.c
|
||||
index 9c04d73..ae14146 100644
|
||||
--- a/ecm_tracker_datagram.c
|
||||
+++ b/ecm_tracker_datagram.c
|
||||
@@ -203,7 +203,7 @@ static void ecm_tracker_datagram_datagram_discard(struct ecm_tracker_datagram_in
|
||||
* ecm_tracker_datagram_discard_all()
|
||||
* Discard all tracked data
|
||||
*/
|
||||
-static void ecm_tracker_datagram_discard_all(struct ecm_tracker_datagram_internal_instance *dtii)
|
||||
+void ecm_tracker_datagram_discard_all(struct ecm_tracker_datagram_internal_instance *dtii)
|
||||
{
|
||||
int32_t src_count;
|
||||
int32_t dest_count;
|
||||
@@ -364,7 +364,7 @@ static void ecm_tracker_datagram_datagram_discard_callback(struct ecm_tracker_in
|
||||
* ecm_tracker_datagram_datagram_size_get()
|
||||
* Return size in bytes of datagram at index i that was sent to the target
|
||||
*/
|
||||
-static int32_t ecm_tracker_datagram_datagram_size_get(struct ecm_tracker_datagram_instance *uti, ecm_tracker_sender_type_t sender, int32_t i)
|
||||
+int32_t ecm_tracker_datagram_datagram_size_get(struct ecm_tracker_datagram_instance *uti, ecm_tracker_sender_type_t sender, int32_t i)
|
||||
{
|
||||
struct ecm_tracker_datagram_internal_instance *dtii = (struct ecm_tracker_datagram_internal_instance *)uti;
|
||||
|
||||
@@ -412,7 +412,7 @@ static int32_t ecm_tracker_datagram_datagram_size_get_callback(struct ecm_tracke
|
||||
* ecm_tracker_datagram_datagram_read()
|
||||
* Read size bytes from datagram at index i into the buffer
|
||||
*/
|
||||
-static int ecm_tracker_datagram_datagram_read(struct ecm_tracker_datagram_instance *uti, ecm_tracker_sender_type_t sender, int32_t i, int32_t offset, int32_t size, void *buffer)
|
||||
+int ecm_tracker_datagram_datagram_read(struct ecm_tracker_datagram_instance *uti, ecm_tracker_sender_type_t sender, int32_t i, int32_t offset, int32_t size, void *buffer)
|
||||
{
|
||||
struct ecm_tracker_datagram_internal_instance *dtii = (struct ecm_tracker_datagram_internal_instance *)uti;
|
||||
int res;
|
||||
@@ -466,7 +466,7 @@ static int ecm_tracker_datagram_datagram_read_callback(struct ecm_tracker_instan
|
||||
* ecm_tracker_datagram_datagram_add()
|
||||
* Append the datagram onto the tracker queue for the given target
|
||||
*/
|
||||
-static bool ecm_tracker_datagram_datagram_add(struct ecm_tracker_datagram_instance *uti, ecm_tracker_sender_type_t sender, struct sk_buff *skb)
|
||||
+bool ecm_tracker_datagram_datagram_add(struct ecm_tracker_datagram_instance *uti, ecm_tracker_sender_type_t sender, struct sk_buff *skb)
|
||||
{
|
||||
struct ecm_tracker_datagram_internal_instance *dtii = (struct ecm_tracker_datagram_internal_instance *)uti;
|
||||
struct sk_buff *skbc;
|
||||
--
|
||||
2.34.1
|
||||
|
@ -1,7 +1,7 @@
|
||||
From 09980e54011e2d95a9db2d6134f635bc90e5a7f2 Mon Sep 17 00:00:00 2001
|
||||
From 73345c87b28a473b35b57e673f8de963c3d73da1 Mon Sep 17 00:00:00 2001
|
||||
From: Ansuel Smith <ansuelsmth@gmail.com>
|
||||
Date: Wed, 19 May 2021 02:38:53 +0200
|
||||
Subject: [PATCH 01/12] treewide: componentize the module even more
|
||||
Subject: [PATCH] treewide: componentize the module even more
|
||||
|
||||
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
|
||||
---
|
||||
@ -12,11 +12,9 @@ Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
|
||||
frontends/ecm_front_end_common.c | 7 ++++
|
||||
5 files changed, 72 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index a59cbce..f7e40f8 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -113,9 +113,17 @@ ccflags-$(ECM_INTERFACE_BOND_ENABLE) += -DECM_INTERFACE_BOND_ENABLE
|
||||
@@ -82,10 +82,18 @@ ccflags-$(ECM_INTERFACE_BOND_ENABLE) +=
|
||||
# Define ECM_INTERFACE_PPPOE_ENABLE=y in order
|
||||
# to enable support for PPPoE acceleration.
|
||||
# #############################################################################
|
||||
@ -26,29 +24,30 @@ index a59cbce..f7e40f8 100644
|
||||
+endif
|
||||
ccflags-$(ECM_INTERFACE_PPPOE_ENABLE) += -DECM_INTERFACE_PPPOE_ENABLE
|
||||
|
||||
+# #############################################################################
|
||||
# #############################################################################
|
||||
+# Define ECM_INTERFACE_L2TPV2_PPTP_ENABLE=y in order
|
||||
+# to enable support for l2tpv2 or PPTP detection.
|
||||
+# #############################################################################
|
||||
+ccflags-$(ECM_INTERFACE_L2TPV2_PPTP_ENABLE) += -DECM_INTERFACE_L2TPV2_PPTP_ENABLE
|
||||
+
|
||||
# #############################################################################
|
||||
+# #############################################################################
|
||||
# Define ECM_INTERFACE_L2TPV2_ENABLE=y in order
|
||||
# to enable support for l2tpv2 acceleration.
|
||||
@@ -142,6 +150,12 @@ endif
|
||||
endif
|
||||
ccflags-$(ECM_INTERFACE_PPP_ENABLE) += -DECM_INTERFACE_PPP_ENABLE
|
||||
# #############################################################################
|
||||
@@ -118,6 +126,12 @@ ccflags-$(ECM_INTERFACE_PPP_ENABLE) += -
|
||||
ccflags-$(ECM_INTERFACE_MAP_T_ENABLE) += -DECM_INTERFACE_MAP_T_ENABLE
|
||||
|
||||
+# #############################################################################
|
||||
# #############################################################################
|
||||
+# Define ECM_INTERFACE_GRE_ENABLE=y in order
|
||||
+# to enable support for GRE detection.
|
||||
+# #############################################################################
|
||||
+ccflags-$(ECM_INTERFACE_GRE_ENABLE) += -DECM_INTERFACE_GRE_ENABLE
|
||||
+
|
||||
# #############################################################################
|
||||
+# #############################################################################
|
||||
# Define ECM_INTERFACE_GRE_TAP_ENABLE=y in order
|
||||
# to enable support for GRE TAP interface.
|
||||
@@ -218,7 +232,9 @@ ccflags-$(ECM_INTERFACE_OVS_BRIDGE_ENABLE) += -DECM_INTERFACE_OVS_BRIDGE_ENABLE
|
||||
# #############################################################################
|
||||
@@ -186,7 +200,9 @@ ccflags-$(ECM_INTERFACE_OVS_BRIDGE_ENABL
|
||||
# #############################################################################
|
||||
# Define ECM_INTERFACE_VLAN_ENABLE=y in order to enable support for VLAN
|
||||
# #############################################################################
|
||||
@ -59,7 +58,7 @@ index a59cbce..f7e40f8 100644
|
||||
ccflags-$(ECM_INTERFACE_VLAN_ENABLE) += -DECM_INTERFACE_VLAN_ENABLE
|
||||
|
||||
# #############################################################################
|
||||
@@ -255,7 +271,9 @@ ccflags-$(ECM_CLASSIFIER_OVS_ENABLE) += -DECM_CLASSIFIER_OVS_ENABLE
|
||||
@@ -228,7 +244,9 @@ ccflags-$(ECM_CLASSIFIER_OVS_ENABLE) +=
|
||||
# #############################################################################
|
||||
# Define ECM_CLASSIFIER_MARK_ENABLE=y in order to enable mark classifier.
|
||||
# #############################################################################
|
||||
@ -70,7 +69,7 @@ index a59cbce..f7e40f8 100644
|
||||
ecm-$(ECM_CLASSIFIER_MARK_ENABLE) += ecm_classifier_mark.o
|
||||
ccflags-$(ECM_CLASSIFIER_MARK_ENABLE) += -DECM_CLASSIFIER_MARK_ENABLE
|
||||
|
||||
@@ -274,7 +292,9 @@ ccflags-$(ECM_CLASSIFIER_NL_ENABLE) += -DECM_CLASSIFIER_NL_ENABLE
|
||||
@@ -247,7 +265,9 @@ ccflags-$(ECM_CLASSIFIER_NL_ENABLE) += -
|
||||
# #############################################################################
|
||||
# Define ECM_CLASSIFIER_DSCP_ENABLE=y in order to enable DSCP classifier.
|
||||
# #############################################################################
|
||||
@ -81,7 +80,7 @@ index a59cbce..f7e40f8 100644
|
||||
ecm-$(ECM_CLASSIFIER_DSCP_ENABLE) += ecm_classifier_dscp.o
|
||||
ccflags-$(ECM_CLASSIFIER_DSCP_ENABLE) += -DECM_CLASSIFIER_DSCP_ENABLE
|
||||
ccflags-$(ECM_CLASSIFIER_DSCP_IGS) += -DECM_CLASSIFIER_DSCP_IGS
|
||||
@@ -293,7 +313,9 @@ ccflags-$(ECM_CLASSIFIER_HYFI_ENABLE) += -DECM_CLASSIFIER_HYFI_ENABLE
|
||||
@@ -274,7 +294,9 @@ endif
|
||||
# the Parental Controls subsystem classifier in ECM. Currently disabled until
|
||||
# customers require it / if they need to integrate their Parental Controls with it.
|
||||
# #############################################################################
|
||||
@ -92,7 +91,7 @@ index a59cbce..f7e40f8 100644
|
||||
ecm-$(ECM_CLASSIFIER_PCC_ENABLE) += ecm_classifier_pcc.o
|
||||
ccflags-$(ECM_CLASSIFIER_PCC_ENABLE) += -DECM_CLASSIFIER_PCC_ENABLE
|
||||
|
||||
@@ -327,28 +349,36 @@ ccflags-$(ECM_NON_PORTED_SUPPORT_ENABLE) += -DECM_NON_PORTED_SUPPORT_ENABLE
|
||||
@@ -301,28 +323,36 @@ ccflags-$(ECM_NON_PORTED_SUPPORT_ENABLE)
|
||||
# #############################################################################
|
||||
# Define ECM_STATE_OUTPUT_ENABLE=y to support XML state output
|
||||
# #############################################################################
|
||||
@ -133,7 +132,7 @@ index a59cbce..f7e40f8 100644
|
||||
ccflags-$(ECM_TRACKER_DPI_SUPPORT_ENABLE) += -DECM_TRACKER_DPI_SUPPORT_ENABLE
|
||||
|
||||
# #############################################################################
|
||||
@@ -356,14 +386,18 @@ ccflags-$(ECM_TRACKER_DPI_SUPPORT_ENABLE) += -DECM_TRACKER_DPI_SUPPORT_ENABLE
|
||||
@@ -330,14 +360,18 @@ ccflags-$(ECM_TRACKER_DPI_SUPPORT_ENABLE
|
||||
# support for the database keeping lists of connections that are assigned
|
||||
# on a per TYPE of classifier basis.
|
||||
# #############################################################################
|
||||
@ -154,11 +153,9 @@ index a59cbce..f7e40f8 100644
|
||||
ccflags-$(ECM_BAND_STEERING_ENABLE) += -DECM_BAND_STEERING_ENABLE
|
||||
|
||||
# #############################################################################
|
||||
diff --git a/ecm_db/ecm_db_connection.c b/ecm_db/ecm_db_connection.c
|
||||
index 6d0bff4..77e5f3f 100644
|
||||
--- a/ecm_db/ecm_db_connection.c
|
||||
+++ b/ecm_db/ecm_db_connection.c
|
||||
@@ -454,7 +454,9 @@ EXPORT_SYMBOL(ecm_db_connection_make_defunct);
|
||||
@@ -430,7 +430,9 @@ EXPORT_SYMBOL(ecm_db_connection_make_def
|
||||
*/
|
||||
void ecm_db_connection_data_totals_update(struct ecm_db_connection_instance *ci, bool is_from, uint64_t size, uint64_t packets)
|
||||
{
|
||||
@ -168,7 +165,7 @@ index 6d0bff4..77e5f3f 100644
|
||||
|
||||
DEBUG_CHECK_MAGIC(ci, ECM_DB_CONNECTION_INSTANCE_MAGIC, "%px: magic failed\n", ci);
|
||||
|
||||
@@ -553,7 +555,9 @@ EXPORT_SYMBOL(ecm_db_connection_data_totals_update);
|
||||
@@ -529,7 +531,9 @@ EXPORT_SYMBOL(ecm_db_connection_data_tot
|
||||
*/
|
||||
void ecm_db_connection_data_totals_update_dropped(struct ecm_db_connection_instance *ci, bool is_from, uint64_t size, uint64_t packets)
|
||||
{
|
||||
@ -178,7 +175,7 @@ index 6d0bff4..77e5f3f 100644
|
||||
|
||||
DEBUG_CHECK_MAGIC(ci, ECM_DB_CONNECTION_INSTANCE_MAGIC, "%px: magic failed\n", ci);
|
||||
|
||||
@@ -1532,6 +1536,7 @@ void ecm_db_connection_defunct_all(void)
|
||||
@@ -1508,6 +1512,7 @@ void ecm_db_connection_defunct_all(void)
|
||||
}
|
||||
EXPORT_SYMBOL(ecm_db_connection_defunct_all);
|
||||
|
||||
@ -186,7 +183,7 @@ index 6d0bff4..77e5f3f 100644
|
||||
/*
|
||||
* ecm_db_connection_defunct_by_classifier()
|
||||
* Make defunct based on masked fields
|
||||
@@ -1698,6 +1703,7 @@ next_ci:
|
||||
@@ -1667,6 +1672,7 @@ next_ci:
|
||||
ECM_IP_ADDR_TO_OCTAL(dest_addr_mask), dest_port_mask, proto_mask, cnt);
|
||||
}
|
||||
}
|
||||
@ -194,7 +191,7 @@ index 6d0bff4..77e5f3f 100644
|
||||
|
||||
/*
|
||||
* ecm_db_connection_defunct_by_port()
|
||||
@@ -1987,6 +1993,7 @@ struct ecm_db_node_instance *ecm_db_connection_node_get_and_ref(struct ecm_db_co
|
||||
@@ -1956,6 +1962,7 @@ struct ecm_db_node_instance *ecm_db_conn
|
||||
}
|
||||
EXPORT_SYMBOL(ecm_db_connection_node_get_and_ref);
|
||||
|
||||
@ -202,7 +199,7 @@ index 6d0bff4..77e5f3f 100644
|
||||
/*
|
||||
* ecm_db_connection_mapping_get_and_ref_next()
|
||||
* Return reference to next connection in the mapping chain in the specified direction.
|
||||
@@ -2028,6 +2035,7 @@ struct ecm_db_connection_instance *ecm_db_connection_iface_get_and_ref_next(stru
|
||||
@@ -1997,6 +2004,7 @@ struct ecm_db_connection_instance *ecm_d
|
||||
return nci;
|
||||
}
|
||||
EXPORT_SYMBOL(ecm_db_connection_iface_get_and_ref_next);
|
||||
@ -210,37 +207,35 @@ index 6d0bff4..77e5f3f 100644
|
||||
|
||||
/*
|
||||
* ecm_db_connection_mapping_get_and_ref()
|
||||
diff --git a/ecm_db/ecm_db_node.c b/ecm_db/ecm_db_node.c
|
||||
index c3d70be..89b386f 100644
|
||||
--- a/ecm_db/ecm_db_node.c
|
||||
+++ b/ecm_db/ecm_db_node.c
|
||||
@@ -224,8 +224,10 @@ EXPORT_SYMBOL(ecm_db_node_get_and_ref_next);
|
||||
@@ -224,9 +224,11 @@ EXPORT_SYMBOL(ecm_db_node_get_and_ref_ne
|
||||
*/
|
||||
int ecm_db_node_deref(struct ecm_db_node_instance *ni)
|
||||
{
|
||||
+#ifdef ECM_DB_XREF_ENABLE
|
||||
#if (DEBUG_LEVEL >= 1)
|
||||
int dir;
|
||||
+#endif
|
||||
#endif
|
||||
+#endif
|
||||
DEBUG_CHECK_MAGIC(ni, ECM_DB_NODE_INSTANCE_MAGIC, "%px: magic failed\n", ni);
|
||||
|
||||
@@ -486,8 +488,10 @@ EXPORT_SYMBOL(ecm_db_node_iface_get_and_ref);
|
||||
spin_lock_bh(&ecm_db_lock);
|
||||
@@ -486,9 +488,11 @@ EXPORT_SYMBOL(ecm_db_node_iface_get_and_
|
||||
void ecm_db_node_add(struct ecm_db_node_instance *ni, struct ecm_db_iface_instance *ii, uint8_t *address,
|
||||
ecm_db_node_final_callback_t final, void *arg)
|
||||
{
|
||||
+#ifdef ECM_DB_XREF_ENABLE
|
||||
#if (DEBUG_LEVEL >= 1)
|
||||
int dir;
|
||||
+#endif
|
||||
#endif
|
||||
+#endif
|
||||
ecm_db_node_hash_t hash_index;
|
||||
struct ecm_db_listener_instance *li;
|
||||
diff --git a/ecm_interface.c b/ecm_interface.c
|
||||
index d7ca169..2ca02bc 100644
|
||||
|
||||
--- a/ecm_interface.c
|
||||
+++ b/ecm_interface.c
|
||||
@@ -1355,6 +1355,7 @@ struct neighbour *ecm_interface_ipv6_neigh_get(struct ecm_front_end_connection_i
|
||||
@@ -1343,6 +1343,7 @@ struct neighbour *ecm_interface_ipv6_nei
|
||||
*/
|
||||
bool ecm_interface_is_pptp(struct sk_buff *skb, const struct net_device *out)
|
||||
{
|
||||
@ -248,7 +243,7 @@ index d7ca169..2ca02bc 100644
|
||||
struct net_device *in;
|
||||
|
||||
/*
|
||||
@@ -1379,6 +1380,7 @@ bool ecm_interface_is_pptp(struct sk_buff *skb, const struct net_device *out)
|
||||
@@ -1367,6 +1368,7 @@ bool ecm_interface_is_pptp(struct sk_buf
|
||||
}
|
||||
|
||||
dev_put(in);
|
||||
@ -256,7 +251,7 @@ index d7ca169..2ca02bc 100644
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1391,6 +1393,7 @@ bool ecm_interface_is_pptp(struct sk_buff *skb, const struct net_device *out)
|
||||
@@ -1379,6 +1381,7 @@ bool ecm_interface_is_pptp(struct sk_buf
|
||||
*/
|
||||
bool ecm_interface_is_l2tp_packet_by_version(struct sk_buff *skb, const struct net_device *out, int ver)
|
||||
{
|
||||
@ -264,7 +259,7 @@ index d7ca169..2ca02bc 100644
|
||||
uint32_t flag = 0;
|
||||
struct net_device *in;
|
||||
|
||||
@@ -1423,6 +1426,7 @@ bool ecm_interface_is_l2tp_packet_by_version(struct sk_buff *skb, const struct n
|
||||
@@ -1411,6 +1414,7 @@ bool ecm_interface_is_l2tp_packet_by_ver
|
||||
}
|
||||
|
||||
dev_put(in);
|
||||
@ -272,7 +267,7 @@ index d7ca169..2ca02bc 100644
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1435,6 +1439,7 @@ bool ecm_interface_is_l2tp_packet_by_version(struct sk_buff *skb, const struct n
|
||||
@@ -1423,6 +1427,7 @@ bool ecm_interface_is_l2tp_packet_by_ver
|
||||
*/
|
||||
bool ecm_interface_is_l2tp_pptp(struct sk_buff *skb, const struct net_device *out)
|
||||
{
|
||||
@ -280,7 +275,7 @@ index d7ca169..2ca02bc 100644
|
||||
struct net_device *in;
|
||||
|
||||
/*
|
||||
@@ -1457,6 +1462,7 @@ bool ecm_interface_is_l2tp_pptp(struct sk_buff *skb, const struct net_device *ou
|
||||
@@ -1445,6 +1450,7 @@ bool ecm_interface_is_l2tp_pptp(struct s
|
||||
}
|
||||
|
||||
dev_put(in);
|
||||
@ -288,7 +283,7 @@ index d7ca169..2ca02bc 100644
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -6770,6 +6776,7 @@ static void ecm_interface_regenerate_connections(struct ecm_db_iface_instance *i
|
||||
@@ -6630,6 +6636,7 @@ static void ecm_interface_regenerate_con
|
||||
return;
|
||||
}
|
||||
|
||||
@ -296,7 +291,7 @@ index d7ca169..2ca02bc 100644
|
||||
for (dir = 0; dir < ECM_DB_OBJ_DIR_MAX; dir++) {
|
||||
/*
|
||||
* Re-generate all connections associated with this interface
|
||||
@@ -6785,6 +6792,7 @@ static void ecm_interface_regenerate_connections(struct ecm_db_iface_instance *i
|
||||
@@ -6645,6 +6652,7 @@ static void ecm_interface_regenerate_con
|
||||
ci[dir] = cin;
|
||||
}
|
||||
}
|
||||
@ -304,11 +299,9 @@ index d7ca169..2ca02bc 100644
|
||||
|
||||
#ifdef ECM_MULTICAST_ENABLE
|
||||
/*
|
||||
diff --git a/frontends/ecm_front_end_common.c b/frontends/ecm_front_end_common.c
|
||||
index 3b33c41..e21ca24 100644
|
||||
--- a/frontends/ecm_front_end_common.c
|
||||
+++ b/frontends/ecm_front_end_common.c
|
||||
@@ -228,6 +228,7 @@ bool ecm_front_end_gre_proto_is_accel_allowed(struct net_device *indev,
|
||||
@@ -106,6 +106,7 @@ bool ecm_front_end_gre_proto_is_accel_al
|
||||
struct nf_conntrack_tuple *tuple,
|
||||
int ip_version)
|
||||
{
|
||||
@ -316,7 +309,7 @@ index 3b33c41..e21ca24 100644
|
||||
struct net_device *dev;
|
||||
struct gre_base_hdr *greh;
|
||||
|
||||
@@ -239,10 +240,12 @@ bool ecm_front_end_gre_proto_is_accel_allowed(struct net_device *indev,
|
||||
@@ -117,10 +118,12 @@ bool ecm_front_end_gre_proto_is_accel_al
|
||||
/*
|
||||
* Case 1: PPTP locally terminated
|
||||
*/
|
||||
@ -329,7 +322,7 @@ index 3b33c41..e21ca24 100644
|
||||
|
||||
/*
|
||||
* Case 2: PPTP pass through
|
||||
@@ -350,6 +353,10 @@ bool ecm_front_end_gre_proto_is_accel_allowed(struct net_device *indev,
|
||||
@@ -223,6 +226,10 @@ bool ecm_front_end_gre_proto_is_accel_al
|
||||
*/
|
||||
DEBUG_TRACE("%px: GRE IPv%d pass through - allow acceleration\n", skb, ip_version);
|
||||
return true;
|
||||
@ -340,6 +333,3 @@ index 3b33c41..e21ca24 100644
|
||||
}
|
||||
|
||||
#ifdef ECM_CLASSIFIER_DSCP_ENABLE
|
||||
--
|
||||
2.34.1
|
||||
|
@ -1,74 +0,0 @@
|
||||
From ef638a84405c9f6556a9d7c257ccbba74efd228e Mon Sep 17 00:00:00 2001
|
||||
From: Ansuel Smith <ansuelsmth@gmail.com>
|
||||
Date: Sat, 14 May 2022 20:15:10 +0200
|
||||
Subject: [PATCH 10/12] frontends: drop udp_get_timeouts and use standard
|
||||
upstream api
|
||||
|
||||
Drop udp_get_timeouts and use nf_udp_pernet and ->timeoutrs
|
||||
instead or relying on a downstream api not present upstream.
|
||||
---
|
||||
frontends/nss/ecm_nss_ipv4.c | 3 ++-
|
||||
frontends/nss/ecm_nss_ipv6.c | 3 ++-
|
||||
frontends/sfe/ecm_sfe_ipv4.c | 3 ++-
|
||||
frontends/sfe/ecm_sfe_ipv6.c | 3 ++-
|
||||
4 files changed, 8 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/frontends/nss/ecm_nss_ipv4.c b/frontends/nss/ecm_nss_ipv4.c
|
||||
index 719a747..558819a 100644
|
||||
--- a/frontends/nss/ecm_nss_ipv4.c
|
||||
+++ b/frontends/nss/ecm_nss_ipv4.c
|
||||
@@ -607,7 +607,8 @@ sync_conntrack:
|
||||
#else
|
||||
timeouts = nf_ct_timeout_lookup(ct);
|
||||
if (!timeouts) {
|
||||
- timeouts = udp_get_timeouts(nf_ct_net(ct));
|
||||
+ struct nf_udp_net *un = nf_udp_pernet(nf_ct_net(ct));
|
||||
+ timeouts = un->timeouts;
|
||||
}
|
||||
|
||||
spin_lock_bh(&ct->lock);
|
||||
diff --git a/frontends/nss/ecm_nss_ipv6.c b/frontends/nss/ecm_nss_ipv6.c
|
||||
index 67ee364..51eb069 100644
|
||||
--- a/frontends/nss/ecm_nss_ipv6.c
|
||||
+++ b/frontends/nss/ecm_nss_ipv6.c
|
||||
@@ -586,7 +586,8 @@ sync_conntrack:
|
||||
#else
|
||||
timeouts = nf_ct_timeout_lookup(ct);
|
||||
if (!timeouts) {
|
||||
- timeouts = udp_get_timeouts(nf_ct_net(ct));
|
||||
+ struct nf_udp_net *un = nf_udp_pernet(nf_ct_net(ct));
|
||||
+ timeouts = un->timeouts;
|
||||
}
|
||||
|
||||
spin_lock_bh(&ct->lock);
|
||||
diff --git a/frontends/sfe/ecm_sfe_ipv4.c b/frontends/sfe/ecm_sfe_ipv4.c
|
||||
index 3f30821..931af5d 100644
|
||||
--- a/frontends/sfe/ecm_sfe_ipv4.c
|
||||
+++ b/frontends/sfe/ecm_sfe_ipv4.c
|
||||
@@ -527,7 +527,8 @@ sync_conntrack:
|
||||
#else
|
||||
timeouts = nf_ct_timeout_lookup(ct);
|
||||
if (!timeouts) {
|
||||
- timeouts = udp_get_timeouts(nf_ct_net(ct));
|
||||
+ struct nf_udp_net *un = nf_udp_pernet(nf_ct_net(ct));
|
||||
+ timeouts = un->timeouts;
|
||||
}
|
||||
|
||||
spin_lock_bh(&ct->lock);
|
||||
diff --git a/frontends/sfe/ecm_sfe_ipv6.c b/frontends/sfe/ecm_sfe_ipv6.c
|
||||
index 54fdbf3..63d8888 100644
|
||||
--- a/frontends/sfe/ecm_sfe_ipv6.c
|
||||
+++ b/frontends/sfe/ecm_sfe_ipv6.c
|
||||
@@ -516,7 +516,8 @@ sync_conntrack:
|
||||
#else
|
||||
timeouts = nf_ct_timeout_lookup(ct);
|
||||
if (!timeouts) {
|
||||
- timeouts = udp_get_timeouts(nf_ct_net(ct));
|
||||
+ struct nf_udp_net *un = nf_udp_pernet(nf_ct_net(ct));
|
||||
+ timeouts = un->timeouts;
|
||||
}
|
||||
|
||||
spin_lock_bh(&ct->lock);
|
||||
--
|
||||
2.34.1
|
||||
|
@ -1,63 +0,0 @@
|
||||
From 3ae9322a469d2c59449cdcb40a0e21b47a2fced9 Mon Sep 17 00:00:00 2001
|
||||
From: Ansuel Smith <ansuelsmth@gmail.com>
|
||||
Date: Sat, 14 May 2022 21:11:08 +0200
|
||||
Subject: [PATCH 11/12] ecm_interface: rework vlan API to internal function
|
||||
|
||||
vlan_real_dev and update_accel_stats API can be reimplemented without
|
||||
referring to kernel changes. Everything is already exported by the
|
||||
kernel. Rework these 2 function to use standard function instead.
|
||||
|
||||
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
|
||||
---
|
||||
ecm_interface.c | 27 +++++++++++++++++++++++++--
|
||||
1 file changed, 25 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/ecm_interface.c b/ecm_interface.c
|
||||
index 6be872a..9a17cc7 100644
|
||||
--- a/ecm_interface.c
|
||||
+++ b/ecm_interface.c
|
||||
@@ -306,8 +306,31 @@ EXPORT_SYMBOL(ecm_interface_get_and_hold_dev_master);
|
||||
*/
|
||||
static inline struct net_device *ecm_interface_vlan_real_dev(struct net_device *vlan_dev)
|
||||
{
|
||||
- return vlan_dev_next_dev(vlan_dev);
|
||||
+ struct vlan_dev_priv *vlan = vlan_dev_priv(vlan_dev);
|
||||
+
|
||||
+ return vlan->real_dev;
|
||||
+}
|
||||
+
|
||||
+#ifdef ECM_INTERFACE_VLAN_ENABLE
|
||||
+static void ecm_interface_vlan_dev_update_accel_stats(struct net_device *dev,
|
||||
+ struct rtnl_link_stats64 *nlstats)
|
||||
+{
|
||||
+ struct vlan_dev_priv *vlan = vlan_dev_priv(dev);
|
||||
+ struct vlan_pcpu_stats *stats;
|
||||
+
|
||||
+ if (!is_vlan_dev(dev))
|
||||
+ return;
|
||||
+
|
||||
+ stats = per_cpu_ptr(vlan->vlan_pcpu_stats, 0);
|
||||
+
|
||||
+ u64_stats_update_begin(&stats->syncp);
|
||||
+ stats->rx_packets += nlstats->rx_packets;
|
||||
+ stats->rx_bytes += nlstats->rx_bytes;
|
||||
+ stats->tx_packets += nlstats->tx_packets;
|
||||
+ stats->tx_bytes += nlstats->tx_bytes;
|
||||
+ u64_stats_update_end(&stats->syncp);
|
||||
}
|
||||
+#endif
|
||||
|
||||
/*
|
||||
* ecm_interface_dev_find_by_local_addr_ipv4()
|
||||
@@ -6593,7 +6616,7 @@ skip_bridge_refresh:
|
||||
stats.rx_bytes = rx_bytes;
|
||||
stats.tx_packets = tx_packets;
|
||||
stats.tx_bytes = tx_bytes;
|
||||
- __vlan_dev_update_accel_stats(dev, &stats);
|
||||
+ ecm_interface_vlan_dev_update_accel_stats(dev, &stats);
|
||||
dev_put(dev);
|
||||
continue;
|
||||
#endif
|
||||
--
|
||||
2.34.1
|
||||
|
@ -1,56 +0,0 @@
|
||||
From 7c4788726ee1b0bb333319b806ddb662a8572a37 Mon Sep 17 00:00:00 2001
|
||||
From: Ansuel Smith <ansuelsmth@gmail.com>
|
||||
Date: Sat, 14 May 2022 21:26:59 +0200
|
||||
Subject: [PATCH 12/12] ecm_interface: rework br_dev_update_stats to internal
|
||||
function
|
||||
|
||||
Rework br_dev_update_stats to an internal function instead of adding a
|
||||
symbol in the kernel.
|
||||
|
||||
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
|
||||
---
|
||||
ecm_interface.c | 21 ++++++++++++++++++++-
|
||||
1 file changed, 20 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/ecm_interface.c b/ecm_interface.c
|
||||
index 9a17cc7..5111d17 100644
|
||||
--- a/ecm_interface.c
|
||||
+++ b/ecm_interface.c
|
||||
@@ -740,6 +740,25 @@ bool ecm_interface_mac_addr_get(ip_addr_t addr, uint8_t *mac_addr, bool *on_link
|
||||
}
|
||||
EXPORT_SYMBOL(ecm_interface_mac_addr_get);
|
||||
|
||||
+static void ecm_interface_br_dev_update_stats(struct net_device *dev,
|
||||
+ struct rtnl_link_stats64 *nlstats)
|
||||
+{
|
||||
+ struct pcpu_sw_netstats *tstats;
|
||||
+
|
||||
+ /* Is this a bridge? */
|
||||
+ if (!(dev->priv_flags & IFF_EBRIDGE))
|
||||
+ return;
|
||||
+
|
||||
+ tstats = this_cpu_ptr(dev->tstats);
|
||||
+
|
||||
+ u64_stats_update_begin(&tstats->syncp);
|
||||
+ tstats->rx_packets += nlstats->rx_packets;
|
||||
+ tstats->rx_bytes += nlstats->rx_bytes;
|
||||
+ tstats->tx_packets += nlstats->tx_packets;
|
||||
+ tstats->tx_bytes += nlstats->tx_bytes;
|
||||
+ u64_stats_update_end(&tstats->syncp);
|
||||
+}
|
||||
+
|
||||
#ifdef ECM_IPV6_ENABLE
|
||||
/* ecm_interface_ipv6_dev_find_and_hold()
|
||||
* Find (and hold) net device that has the given address.
|
||||
@@ -6581,7 +6600,7 @@ skip_bridge_refresh:
|
||||
stats.rx_bytes = rx_bytes;
|
||||
stats.tx_packets = tx_packets;
|
||||
stats.tx_bytes = tx_bytes;
|
||||
- br_dev_update_stats(dev, &stats);
|
||||
+ ecm_interface_br_dev_update_stats(dev, &stats);
|
||||
dev_put(dev);
|
||||
continue;
|
||||
|
||||
--
|
||||
2.34.1
|
||||
|
@ -1,67 +0,0 @@
|
||||
From 1958e34c4c1b8b4fb62eba693fbd7693536947b9 Mon Sep 17 00:00:00 2001
|
||||
From: flebourse <francis.lebourse@sfr.fr>
|
||||
Date: Thu, 23 Dec 2021 16:11:06 +0100
|
||||
Subject: [PATCH] qca-nss-ecm: fix a memcpy overflow in ecm_db
|
||||
|
||||
Calls to ipv6_addr_prefix() trigger a memcpy overflow if the prefix len
|
||||
argument is greater than 128, cap it at this value.
|
||||
|
||||
stack bactrace:
|
||||
detected buffer overflow in memcpy
|
||||
Kernel BUG at fortify_panic+0x20/0x24
|
||||
Internal error: Oops - BUG: 0 [#1] SMP
|
||||
CPU: 2 PID: 2592 Comm: netifd Not tainted 5.10.80 #0
|
||||
Hardware name: Xiaomi AX9000 (DT)
|
||||
Call trace:
|
||||
fortify_panic+0x20/0x24
|
||||
ecm_db_exit+0x42c/0x49c [ecm]
|
||||
ecm_db_exit+0x464/0x49c [ecm]
|
||||
atomic_notifier_call_chain+0x5c/0x90
|
||||
ip6_route_add+0x13c/0x1a4
|
||||
inet6_rtm_newroute+0x98/0xa0
|
||||
rtnetlink_rcv_msg+0x10c/0x34c
|
||||
netlink_rcv_skb+0x5c/0x130
|
||||
rtnetlink_rcv+0x1c/0x2c
|
||||
netlink_unicast+0x1ec/0x2e0
|
||||
netlink_sendmsg+0x1a4/0x394
|
||||
____sys_sendmsg+0x270/0x2b4
|
||||
___sys_sendmsg+0x7c/0xc0
|
||||
__sys_sendmsg+0x5c/0xb0
|
||||
__arm64_sys_sendmsg+0x28/0x34
|
||||
el0_svc_common.constprop.0+0x88/0x190
|
||||
do_el0_svc+0x74/0x94
|
||||
el0_svc+0x14/0x20
|
||||
el0_sync_handler+0xa8/0x130
|
||||
el0_sync+0x184/0x1c0
|
||||
Code: aa0003e1 912b4040 910003fd 97fff56c (d4210000)
|
||||
|
||||
Signed-off-By: Francis Le Bourse <francis.lebourse@sfr.fr>
|
||||
---
|
||||
ecm_db/ecm_db.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/ecm_db/ecm_db.c b/ecm_db/ecm_db.c
|
||||
index c6f408d..df04afd 100644
|
||||
--- a/ecm_db/ecm_db.c
|
||||
+++ b/ecm_db/ecm_db.c
|
||||
@@ -298,7 +298,7 @@ static int ecm_db_ipv6_route_table_update_event(struct notifier_block *nb,
|
||||
* Compute ECM connection's prefix destination address by masking it with the
|
||||
* route config's destination address prefix length.
|
||||
*/
|
||||
- ipv6_addr_prefix(&prefix_addr, &ecm_in6, cfg->fc_dst_len);
|
||||
+ ipv6_addr_prefix(&prefix_addr, &ecm_in6, min(128, cfg->fc_dst_len));
|
||||
|
||||
DEBUG_TRACE("dest addr prefix: %pI6 prefix_len: %d ecm_in6: %pI6\n", &prefix_addr, cfg->fc_dst_len, &ecm_in6);
|
||||
|
||||
@@ -326,7 +326,7 @@ static int ecm_db_ipv6_route_table_update_event(struct notifier_block *nb,
|
||||
* Compute ECM connection's prefix source address by masking it with the
|
||||
* route config's destination address prefix length.
|
||||
*/
|
||||
- ipv6_addr_prefix(&prefix_addr, &ecm_in6, cfg->fc_dst_len);
|
||||
+ ipv6_addr_prefix(&prefix_addr, &ecm_in6, min(128, cfg->fc_dst_len));
|
||||
|
||||
DEBUG_TRACE("src addr prefix: %pI6 prefix_len: %d ecm_in6: %pI6\n", &prefix_addr, cfg->fc_dst_len, &ecm_in6);
|
||||
|
||||
--
|
||||
2.1.4
|
||||
|
@ -1,13 +1,13 @@
|
||||
From ff08fc9f9f2f0afca5e87601d10833cbbe6ac719 Mon Sep 17 00:00:00 2001
|
||||
From e8b642c23af9146c973e828a7f4e0fb56cfc8d0b Mon Sep 17 00:00:00 2001
|
||||
From: Ansuel Smith <ansuelsmth@gmail.com>
|
||||
Date: Sat, 15 May 2021 03:51:14 +0200
|
||||
Subject: [PATCH 03/12] treewide: rework debugfs api to new implementation
|
||||
Subject: [PATCH] add support for kernel 5.10
|
||||
|
||||
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
|
||||
---
|
||||
ecm_classifier_default.c | 24 +++---------
|
||||
ecm_classifier_dscp.c | 8 +---
|
||||
ecm_classifier_emesh.c | 24 +++---------
|
||||
ecm_classifier_emesh.c | 16 ++------
|
||||
ecm_classifier_hyfi.c | 7 +---
|
||||
ecm_classifier_mark.c | 8 +---
|
||||
ecm_classifier_ovs.c | 8 +---
|
||||
@ -18,31 +18,31 @@ Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
|
||||
ecm_db/ecm_db_iface.c | 7 +---
|
||||
ecm_db/ecm_db_mapping.c | 7 +---
|
||||
ecm_db/ecm_db_node.c | 7 +---
|
||||
ecm_interface.c | 4 +-
|
||||
ecm_state.c | 14 ++-----
|
||||
frontends/cmn/ecm_bond_notifier.c | 8 +---
|
||||
frontends/ecm_front_end_common.c | 4 +-
|
||||
frontends/ecm_front_end_ipv4.c | 7 +---
|
||||
frontends/ecm_front_end_ipv6.c | 7 +---
|
||||
frontends/nss/ecm_nss_bond_notifier.c | 8 +---
|
||||
frontends/nss/ecm_nss_ipv4.c | 49 +++++++------------------
|
||||
frontends/nss/ecm_nss_ipv6.c | 49 +++++++------------------
|
||||
frontends/nss/ecm_nss_multicast_ipv4.c | 7 +---
|
||||
frontends/nss/ecm_nss_multicast_ipv6.c | 7 +---
|
||||
frontends/nss/ecm_nss_non_ported_ipv4.c | 7 +---
|
||||
frontends/nss/ecm_nss_non_ported_ipv6.c | 7 +---
|
||||
frontends/nss/ecm_nss_ported_ipv4.c | 16 ++------
|
||||
frontends/nss/ecm_nss_ported_ipv6.c | 16 ++------
|
||||
frontends/nss/ecm_nss_ported_ipv4.c | 8 +---
|
||||
frontends/nss/ecm_nss_ported_ipv6.c | 8 +---
|
||||
frontends/sfe/ecm_sfe_ipv4.c | 49 +++++++------------------
|
||||
frontends/sfe/ecm_sfe_ipv6.c | 49 +++++++------------------
|
||||
frontends/sfe/ecm_sfe_non_ported_ipv4.c | 7 +---
|
||||
frontends/sfe/ecm_sfe_non_ported_ipv6.c | 7 +---
|
||||
frontends/sfe/ecm_sfe_ported_ipv4.c | 8 +---
|
||||
frontends/sfe/ecm_sfe_ported_ipv6.c | 8 +---
|
||||
31 files changed, 122 insertions(+), 330 deletions(-)
|
||||
33 files changed, 122 insertions(+), 314 deletions(-)
|
||||
|
||||
diff --git a/ecm_classifier_default.c b/ecm_classifier_default.c
|
||||
index 39315a9..1dad277 100644
|
||||
--- a/ecm_classifier_default.c
|
||||
+++ b/ecm_classifier_default.c
|
||||
@@ -757,26 +757,14 @@ int ecm_classifier_default_init(struct dentry *dentry)
|
||||
@@ -776,26 +776,14 @@ int ecm_classifier_default_init(struct d
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -75,11 +75,9 @@ index 39315a9..1dad277 100644
|
||||
|
||||
return 0;
|
||||
}
|
||||
diff --git a/ecm_classifier_dscp.c b/ecm_classifier_dscp.c
|
||||
index 4f0caeb..6c9401e 100644
|
||||
--- a/ecm_classifier_dscp.c
|
||||
+++ b/ecm_classifier_dscp.c
|
||||
@@ -763,12 +763,8 @@ int ecm_classifier_dscp_init(struct dentry *dentry)
|
||||
@@ -747,12 +747,8 @@ int ecm_classifier_dscp_init(struct dent
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -94,45 +92,32 @@ index 4f0caeb..6c9401e 100644
|
||||
|
||||
return 0;
|
||||
}
|
||||
diff --git a/ecm_classifier_emesh.c b/ecm_classifier_emesh.c
|
||||
index 72cf2e1..f8aecec 100644
|
||||
--- a/ecm_classifier_emesh.c
|
||||
+++ b/ecm_classifier_emesh.c
|
||||
@@ -1320,26 +1320,14 @@ int ecm_classifier_emesh_sawf_init(struct dentry *dentry)
|
||||
@@ -977,19 +977,11 @@ int ecm_classifier_emesh_init(struct den
|
||||
return -1;
|
||||
}
|
||||
|
||||
- if (!debugfs_create_u32("enabled", S_IRUGO | S_IWUSR, ecm_classifier_emesh_sawf_dentry,
|
||||
- if (!debugfs_create_u32("enabled", S_IRUGO | S_IWUSR, ecm_classifier_emesh_dentry,
|
||||
- (u32 *)&ecm_classifier_emesh_enabled)) {
|
||||
- DEBUG_ERROR("Failed to create ecm emesh classifier enabled file in debugfs\n");
|
||||
- debugfs_remove_recursive(ecm_classifier_emesh_sawf_dentry);
|
||||
- debugfs_remove_recursive(ecm_classifier_emesh_dentry);
|
||||
- return -1;
|
||||
- }
|
||||
+ debugfs_create_u32("enabled", S_IRUGO | S_IWUSR, ecm_classifier_emesh_sawf_dentry,
|
||||
+ debugfs_create_u32("enabled", S_IRUGO | S_IWUSR, ecm_classifier_emesh_dentry,
|
||||
+ (u32 *)&ecm_classifier_emesh_enabled);
|
||||
|
||||
- if (!debugfs_create_u32("latency_config_enabled", S_IRUGO | S_IWUSR, ecm_classifier_emesh_sawf_dentry,
|
||||
- if (!debugfs_create_u32("latency_config_enabled", S_IRUGO | S_IWUSR, ecm_classifier_emesh_dentry,
|
||||
- (u32 *)&ecm_classifier_emesh_latency_config_enabled)) {
|
||||
- DEBUG_ERROR("Failed to create ecm emesh classifier latency config enabled file in debugfs\n");
|
||||
- debugfs_remove_recursive(ecm_classifier_emesh_sawf_dentry);
|
||||
- debugfs_remove_recursive(ecm_classifier_emesh_dentry);
|
||||
- return -1;
|
||||
- }
|
||||
+ debugfs_create_u32("latency_config_enabled", S_IRUGO | S_IWUSR, ecm_classifier_emesh_sawf_dentry,
|
||||
+ debugfs_create_u32("latency_config_enabled", S_IRUGO | S_IWUSR, ecm_classifier_emesh_dentry,
|
||||
+ (u32 *)&ecm_classifier_emesh_latency_config_enabled);
|
||||
|
||||
- if (!debugfs_create_u32("sawf_enabled", S_IRUGO | S_IWUSR, ecm_classifier_emesh_sawf_dentry,
|
||||
- (u32 *)&ecm_classifier_sawf_enabled)) {
|
||||
- DEBUG_ERROR("Failed to create ecm sawf classifier enabled file in debugfs\n");
|
||||
- debugfs_remove_recursive(ecm_classifier_emesh_sawf_dentry);
|
||||
- return -1;
|
||||
- }
|
||||
+ debugfs_create_u32("sawf_enabled", S_IRUGO | S_IWUSR, ecm_classifier_emesh_sawf_dentry,
|
||||
+ (u32 *)&ecm_classifier_sawf_enabled);
|
||||
/*
|
||||
* Register for service prioritization notification update.
|
||||
*/
|
||||
diff --git a/ecm_classifier_hyfi.c b/ecm_classifier_hyfi.c
|
||||
index a57a13e..fad7209 100644
|
||||
--- a/ecm_classifier_hyfi.c
|
||||
+++ b/ecm_classifier_hyfi.c
|
||||
@@ -1099,11 +1099,8 @@ int ecm_classifier_hyfi_rules_init(struc
|
||||
@ -149,8 +134,6 @@ index a57a13e..fad7209 100644
|
||||
|
||||
if (!debugfs_create_file("cmd", S_IWUSR, ecm_classifier_hyfi_dentry,
|
||||
NULL, &ecm_classifier_hyfi_cmd_fops)) {
|
||||
diff --git a/ecm_classifier_mark.c b/ecm_classifier_mark.c
|
||||
index d054d8e..65dd1e1 100644
|
||||
--- a/ecm_classifier_mark.c
|
||||
+++ b/ecm_classifier_mark.c
|
||||
@@ -753,12 +753,8 @@ int ecm_classifier_mark_init(struct dent
|
||||
@ -168,11 +151,9 @@ index d054d8e..65dd1e1 100644
|
||||
|
||||
return 0;
|
||||
}
|
||||
diff --git a/ecm_classifier_ovs.c b/ecm_classifier_ovs.c
|
||||
index b9d98d4..16a2ea9 100644
|
||||
--- a/ecm_classifier_ovs.c
|
||||
+++ b/ecm_classifier_ovs.c
|
||||
@@ -2265,12 +2265,8 @@ int ecm_classifier_ovs_init(struct dentry *dentry)
|
||||
@@ -2200,12 +2200,8 @@ int ecm_classifier_ovs_init(struct dentr
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -187,11 +168,9 @@ index b9d98d4..16a2ea9 100644
|
||||
|
||||
return 0;
|
||||
}
|
||||
diff --git a/ecm_classifier_pcc.c b/ecm_classifier_pcc.c
|
||||
index 6c6fcd4..af13357 100644
|
||||
--- a/ecm_classifier_pcc.c
|
||||
+++ b/ecm_classifier_pcc.c
|
||||
@@ -1232,12 +1232,8 @@ int ecm_classifier_pcc_init(struct dentry *dentry)
|
||||
@@ -1308,12 +1308,8 @@ int ecm_classifier_pcc_init(struct dentr
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -206,11 +185,9 @@ index 6c6fcd4..af13357 100644
|
||||
|
||||
return 0;
|
||||
}
|
||||
diff --git a/ecm_conntrack_notifier.c b/ecm_conntrack_notifier.c
|
||||
index f4f2c60..7b20132 100644
|
||||
--- a/ecm_conntrack_notifier.c
|
||||
+++ b/ecm_conntrack_notifier.c
|
||||
@@ -416,12 +416,8 @@ int ecm_conntrack_notifier_init(struct dentry *dentry)
|
||||
@@ -414,12 +414,8 @@ int ecm_conntrack_notifier_init(struct d
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -225,11 +202,9 @@ index f4f2c60..7b20132 100644
|
||||
|
||||
#ifdef CONFIG_NF_CONNTRACK_EVENTS
|
||||
/*
|
||||
diff --git a/ecm_db/ecm_db_connection.c b/ecm_db/ecm_db_connection.c
|
||||
index 77e5f3f..4bd47c3 100644
|
||||
--- a/ecm_db/ecm_db_connection.c
|
||||
+++ b/ecm_db/ecm_db_connection.c
|
||||
@@ -3784,11 +3784,8 @@ static struct file_operations ecm_db_connection_count_simple_fops = {
|
||||
@@ -3642,11 +3642,8 @@ static struct file_operations ecm_db_con
|
||||
*/
|
||||
bool ecm_db_connection_init(struct dentry *dentry)
|
||||
{
|
||||
@ -243,11 +218,9 @@ index 77e5f3f..4bd47c3 100644
|
||||
|
||||
if (!debugfs_create_file("connection_count_simple", S_IRUGO, dentry,
|
||||
NULL, &ecm_db_connection_count_simple_fops)) {
|
||||
diff --git a/ecm_db/ecm_db_host.c b/ecm_db/ecm_db_host.c
|
||||
index 8820576..38a21b4 100644
|
||||
--- a/ecm_db/ecm_db_host.c
|
||||
+++ b/ecm_db/ecm_db_host.c
|
||||
@@ -771,11 +771,8 @@ EXPORT_SYMBOL(ecm_db_host_alloc);
|
||||
@@ -770,11 +770,8 @@ EXPORT_SYMBOL(ecm_db_host_alloc);
|
||||
bool ecm_db_host_init(struct dentry *dentry)
|
||||
{
|
||||
|
||||
@ -261,11 +234,9 @@ index 8820576..38a21b4 100644
|
||||
|
||||
ecm_db_host_table = vzalloc(sizeof(struct ecm_db_host_instance *) * ECM_DB_HOST_HASH_SLOTS);
|
||||
if (!ecm_db_host_table) {
|
||||
diff --git a/ecm_db/ecm_db_iface.c b/ecm_db/ecm_db_iface.c
|
||||
index 53c254c..f9ad269 100644
|
||||
--- a/ecm_db/ecm_db_iface.c
|
||||
+++ b/ecm_db/ecm_db_iface.c
|
||||
@@ -3688,11 +3688,8 @@ EXPORT_SYMBOL(ecm_db_iface_alloc);
|
||||
@@ -3670,11 +3670,8 @@ EXPORT_SYMBOL(ecm_db_iface_alloc);
|
||||
*/
|
||||
bool ecm_db_iface_init(struct dentry *dentry)
|
||||
{
|
||||
@ -279,11 +250,9 @@ index 53c254c..f9ad269 100644
|
||||
|
||||
return true;
|
||||
}
|
||||
diff --git a/ecm_db/ecm_db_mapping.c b/ecm_db/ecm_db_mapping.c
|
||||
index 1d06ef4..8574d20 100644
|
||||
--- a/ecm_db/ecm_db_mapping.c
|
||||
+++ b/ecm_db/ecm_db_mapping.c
|
||||
@@ -807,11 +807,8 @@ EXPORT_SYMBOL(ecm_db_mapping_alloc);
|
||||
@@ -806,11 +806,8 @@ EXPORT_SYMBOL(ecm_db_mapping_alloc);
|
||||
*/
|
||||
bool ecm_db_mapping_init(struct dentry *dentry)
|
||||
{
|
||||
@ -297,11 +266,9 @@ index 1d06ef4..8574d20 100644
|
||||
|
||||
ecm_db_mapping_table = vzalloc(sizeof(struct ecm_db_mapping_instance *) * ECM_DB_MAPPING_HASH_SLOTS);
|
||||
if (!ecm_db_mapping_table) {
|
||||
diff --git a/ecm_db/ecm_db_node.c b/ecm_db/ecm_db_node.c
|
||||
index 89b386f..513fb84 100644
|
||||
--- a/ecm_db/ecm_db_node.c
|
||||
+++ b/ecm_db/ecm_db_node.c
|
||||
@@ -1188,11 +1188,8 @@ keep_sni_conn:
|
||||
@@ -1187,11 +1187,8 @@ keep_sni_conn:
|
||||
*/
|
||||
bool ecm_db_node_init(struct dentry *dentry)
|
||||
{
|
||||
@ -315,11 +282,29 @@ index 89b386f..513fb84 100644
|
||||
|
||||
ecm_db_node_table = vzalloc(sizeof(struct ecm_db_node_instance *) * ECM_DB_NODE_HASH_SLOTS);
|
||||
if (!ecm_db_node_table) {
|
||||
diff --git a/ecm_state.c b/ecm_state.c
|
||||
index b4348a8..2424b58 100644
|
||||
--- a/ecm_interface.c
|
||||
+++ b/ecm_interface.c
|
||||
@@ -332,7 +332,7 @@ static struct net_device *ecm_interface_
|
||||
struct net_device *dev;
|
||||
|
||||
ECM_IP_ADDR_TO_NIN6_ADDR(addr6, addr);
|
||||
- dev = (struct net_device *)ipv6_dev_find(&init_net, &addr6, 1);
|
||||
+ dev = (struct net_device *)ipv6_dev_find_and_hold(&init_net, &addr6, 1);
|
||||
return dev;
|
||||
}
|
||||
#endif
|
||||
@@ -734,7 +734,7 @@ static bool ecm_interface_mac_addr_get_i
|
||||
* Get the MAC address that corresponds to IP address given.
|
||||
*/
|
||||
ECM_IP_ADDR_TO_NIN6_ADDR(daddr, addr);
|
||||
- local_dev = ipv6_dev_find(&init_net, &daddr, 1);
|
||||
+ local_dev = ipv6_dev_find_and_hold(&init_net, &daddr, 1);
|
||||
if (local_dev) {
|
||||
DEBUG_TRACE("%pi6 is a local address\n", &daddr);
|
||||
memcpy(mac_addr, dev->dev_addr, ETH_ALEN);
|
||||
--- a/ecm_state.c
|
||||
+++ b/ecm_state.c
|
||||
@@ -894,17 +894,11 @@ int ecm_state_init(struct dentry *dentry)
|
||||
@@ -899,17 +899,11 @@ int ecm_state_init(struct dentry *dentry
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -341,30 +326,29 @@ index b4348a8..2424b58 100644
|
||||
|
||||
/*
|
||||
* Register a char device that we will use to provide a dump of our state
|
||||
diff --git a/frontends/cmn/ecm_bond_notifier.c b/frontends/cmn/ecm_bond_notifier.c
|
||||
index ca7fb45..f7e75e7 100644
|
||||
--- a/frontends/cmn/ecm_bond_notifier.c
|
||||
+++ b/frontends/cmn/ecm_bond_notifier.c
|
||||
@@ -241,12 +241,8 @@ int ecm_bond_notifier_init(struct dentry *dentry)
|
||||
return -1;
|
||||
--- a/frontends/ecm_front_end_common.c
|
||||
+++ b/frontends/ecm_front_end_common.c
|
||||
@@ -192,7 +192,7 @@ bool ecm_front_end_gre_proto_is_accel_al
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
- dev = ipv6_dev_find(&init_net, &(tuple->src.u3.in6), 1);
|
||||
+ dev = ipv6_dev_find_and_hold(&init_net, &(tuple->src.u3.in6), 1);
|
||||
if (dev) {
|
||||
/*
|
||||
* Source IP address is local
|
||||
@@ -202,7 +202,7 @@ bool ecm_front_end_gre_proto_is_accel_al
|
||||
return false;
|
||||
}
|
||||
|
||||
- if (!debugfs_create_u32("stop", S_IRUGO | S_IWUSR, ecm_bond_notifier_dentry,
|
||||
- (u32 *)&ecm_bond_notifier_stopped)) {
|
||||
- DEBUG_ERROR("Failed to create ecm bond notifier stopped file in debugfs\n");
|
||||
- debugfs_remove_recursive(ecm_bond_notifier_dentry);
|
||||
- return -1;
|
||||
- }
|
||||
+ debugfs_create_u32("stop", S_IRUGO | S_IWUSR, ecm_bond_notifier_dentry,
|
||||
+ (u32 *)&ecm_nss_bond_notifier_stopped);
|
||||
|
||||
- dev = ipv6_dev_find(&init_net, &(tuple->dst.u3.in6), 1);
|
||||
+ dev = ipv6_dev_find_and_hold(&init_net, &(tuple->dst.u3.in6), 1);
|
||||
if (dev) {
|
||||
/*
|
||||
* Register Link Aggregation callbacks with the bonding driver
|
||||
diff --git a/frontends/ecm_front_end_ipv4.c b/frontends/ecm_front_end_ipv4.c
|
||||
index 8bf040b..3b060f1 100644
|
||||
* Destination IP address is local
|
||||
--- a/frontends/ecm_front_end_ipv4.c
|
||||
+++ b/frontends/ecm_front_end_ipv4.c
|
||||
@@ -383,11 +383,8 @@ void ecm_front_end_ipv4_stop(int num)
|
||||
@@ -376,11 +376,8 @@ void ecm_front_end_ipv4_stop(int num)
|
||||
*/
|
||||
int ecm_front_end_ipv4_init(struct dentry *dentry)
|
||||
{
|
||||
@ -376,13 +360,11 @@ index 8bf040b..3b060f1 100644
|
||||
+ debugfs_create_u32("front_end_ipv4_stop", S_IRUGO | S_IWUSR, dentry,
|
||||
+ (u32 *)&ecm_front_end_ipv4_stopped);
|
||||
|
||||
return ecm_ipv4_init(dentry);
|
||||
}
|
||||
diff --git a/frontends/ecm_front_end_ipv6.c b/frontends/ecm_front_end_ipv6.c
|
||||
index c6f09a8..2450346 100644
|
||||
switch (ecm_front_end_type_get()) {
|
||||
case ECM_FRONT_END_TYPE_NSS:
|
||||
--- a/frontends/ecm_front_end_ipv6.c
|
||||
+++ b/frontends/ecm_front_end_ipv6.c
|
||||
@@ -262,11 +262,8 @@ void ecm_front_end_ipv6_stop(int num)
|
||||
@@ -255,11 +255,8 @@ void ecm_front_end_ipv6_stop(int num)
|
||||
*/
|
||||
int ecm_front_end_ipv6_init(struct dentry *dentry)
|
||||
{
|
||||
@ -394,13 +376,28 @@ index c6f09a8..2450346 100644
|
||||
+ debugfs_create_u32("front_end_ipv6_stop", S_IRUGO | S_IWUSR, dentry,
|
||||
+ (u32 *)&ecm_front_end_ipv6_stopped);
|
||||
|
||||
return ecm_ipv6_init(dentry);
|
||||
switch (ecm_front_end_type_get()) {
|
||||
case ECM_FRONT_END_TYPE_NSS:
|
||||
--- a/frontends/nss/ecm_nss_bond_notifier.c
|
||||
+++ b/frontends/nss/ecm_nss_bond_notifier.c
|
||||
@@ -240,12 +240,8 @@ int ecm_nss_bond_notifier_init(struct de
|
||||
return -1;
|
||||
}
|
||||
diff --git a/frontends/nss/ecm_nss_ipv4.c b/frontends/nss/ecm_nss_ipv4.c
|
||||
index 0fee3e8..5b0ce29 100644
|
||||
|
||||
- if (!debugfs_create_u32("stop", S_IRUGO | S_IWUSR, ecm_nss_bond_notifier_dentry,
|
||||
- (u32 *)&ecm_nss_bond_notifier_stopped)) {
|
||||
- DEBUG_ERROR("Failed to create ecm bond notifier stopped file in debugfs\n");
|
||||
- debugfs_remove_recursive(ecm_nss_bond_notifier_dentry);
|
||||
- return -1;
|
||||
- }
|
||||
+ debugfs_create_u32("stop", S_IRUGO | S_IWUSR, ecm_nss_bond_notifier_dentry,
|
||||
+ (u32 *)&ecm_nss_bond_notifier_stopped);
|
||||
|
||||
/*
|
||||
* Register Link Aggregation callbacks with the bonding driver
|
||||
--- a/frontends/nss/ecm_nss_ipv4.c
|
||||
+++ b/frontends/nss/ecm_nss_ipv4.c
|
||||
@@ -1006,41 +1006,23 @@ int ecm_nss_ipv4_init(struct dentry *dentry)
|
||||
@@ -2802,41 +2802,23 @@ int ecm_nss_ipv4_init(struct dentry *den
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -454,7 +451,7 @@ index 0fee3e8..5b0ce29 100644
|
||||
|
||||
if (!debugfs_create_file("accel_limit_mode", S_IRUGO | S_IWUSR, ecm_nss_ipv4_dentry,
|
||||
NULL, &ecm_nss_ipv4_accel_limit_mode_fops)) {
|
||||
@@ -1071,11 +1053,8 @@ int ecm_nss_ipv4_init(struct dentry *dentry)
|
||||
@@ -2867,11 +2849,8 @@ int ecm_nss_ipv4_init(struct dentry *den
|
||||
goto task_cleanup;
|
||||
}
|
||||
|
||||
@ -468,11 +465,9 @@ index 0fee3e8..5b0ce29 100644
|
||||
|
||||
#ifdef ECM_NON_PORTED_SUPPORT_ENABLE
|
||||
if (!ecm_nss_non_ported_ipv4_debugfs_init(ecm_nss_ipv4_dentry)) {
|
||||
diff --git a/frontends/nss/ecm_nss_ipv6.c b/frontends/nss/ecm_nss_ipv6.c
|
||||
index ee6b434..8d13f68 100644
|
||||
--- a/frontends/nss/ecm_nss_ipv6.c
|
||||
+++ b/frontends/nss/ecm_nss_ipv6.c
|
||||
@@ -985,41 +985,23 @@ int ecm_nss_ipv6_init(struct dentry *dentry)
|
||||
@@ -2542,41 +2542,23 @@ int ecm_nss_ipv6_init(struct dentry *den
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -526,7 +521,7 @@ index ee6b434..8d13f68 100644
|
||||
|
||||
if (!debugfs_create_file("accel_limit_mode", S_IRUGO | S_IWUSR, ecm_nss_ipv6_dentry,
|
||||
NULL, &ecm_nss_ipv6_accel_limit_mode_fops)) {
|
||||
@@ -1050,11 +1032,8 @@ int ecm_nss_ipv6_init(struct dentry *dentry)
|
||||
@@ -2607,11 +2589,8 @@ int ecm_nss_ipv6_init(struct dentry *den
|
||||
goto task_cleanup;
|
||||
}
|
||||
|
||||
@ -540,11 +535,9 @@ index ee6b434..8d13f68 100644
|
||||
|
||||
#ifdef ECM_NON_PORTED_SUPPORT_ENABLE
|
||||
if (!ecm_nss_non_ported_ipv6_debugfs_init(ecm_nss_ipv6_dentry)) {
|
||||
diff --git a/frontends/nss/ecm_nss_multicast_ipv4.c b/frontends/nss/ecm_nss_multicast_ipv4.c
|
||||
index a3dcb79..c9e92de 100644
|
||||
--- a/frontends/nss/ecm_nss_multicast_ipv4.c
|
||||
+++ b/frontends/nss/ecm_nss_multicast_ipv4.c
|
||||
@@ -2762,11 +2762,8 @@ void ecm_nss_multicast_ipv4_stop(int num)
|
||||
@@ -4139,11 +4139,8 @@ void ecm_nss_multicast_ipv4_stop(int num
|
||||
*/
|
||||
int ecm_nss_multicast_ipv4_init(struct dentry *dentry)
|
||||
{
|
||||
@ -558,11 +551,9 @@ index a3dcb79..c9e92de 100644
|
||||
|
||||
/*
|
||||
* Register multicast update callback to MCS snooper
|
||||
diff --git a/frontends/nss/ecm_nss_multicast_ipv6.c b/frontends/nss/ecm_nss_multicast_ipv6.c
|
||||
index 7c027f3..2492799 100644
|
||||
--- a/frontends/nss/ecm_nss_multicast_ipv6.c
|
||||
+++ b/frontends/nss/ecm_nss_multicast_ipv6.c
|
||||
@@ -2698,11 +2698,8 @@ void ecm_nss_multicast_ipv6_stop(int num)
|
||||
@@ -3939,11 +3939,8 @@ void ecm_nss_multicast_ipv6_stop(int num
|
||||
*/
|
||||
int ecm_nss_multicast_ipv6_init(struct dentry *dentry)
|
||||
{
|
||||
@ -576,11 +567,9 @@ index 7c027f3..2492799 100644
|
||||
|
||||
/*
|
||||
* Register multicast update callback to MCS snooper
|
||||
diff --git a/frontends/nss/ecm_nss_non_ported_ipv4.c b/frontends/nss/ecm_nss_non_ported_ipv4.c
|
||||
index ec4f365..77de341 100644
|
||||
--- a/frontends/nss/ecm_nss_non_ported_ipv4.c
|
||||
+++ b/frontends/nss/ecm_nss_non_ported_ipv4.c
|
||||
@@ -1940,11 +1940,8 @@ struct ecm_nss_non_ported_ipv4_connection_instance *ecm_nss_non_ported_ipv4_conn
|
||||
@@ -2615,11 +2615,8 @@ done:
|
||||
*/
|
||||
bool ecm_nss_non_ported_ipv4_debugfs_init(struct dentry *dentry)
|
||||
{
|
||||
@ -594,11 +583,9 @@ index ec4f365..77de341 100644
|
||||
|
||||
return true;
|
||||
}
|
||||
diff --git a/frontends/nss/ecm_nss_non_ported_ipv6.c b/frontends/nss/ecm_nss_non_ported_ipv6.c
|
||||
index 13e0cc5..91ad7aa 100644
|
||||
--- a/frontends/nss/ecm_nss_non_ported_ipv6.c
|
||||
+++ b/frontends/nss/ecm_nss_non_ported_ipv6.c
|
||||
@@ -1768,11 +1768,8 @@ struct ecm_nss_non_ported_ipv6_connection_instance *ecm_nss_non_ported_ipv6_conn
|
||||
@@ -2329,11 +2329,8 @@ done:
|
||||
*/
|
||||
bool ecm_nss_non_ported_ipv6_debugfs_init(struct dentry *dentry)
|
||||
{
|
||||
@ -612,23 +599,11 @@ index 13e0cc5..91ad7aa 100644
|
||||
|
||||
return true;
|
||||
}
|
||||
diff --git a/frontends/nss/ecm_nss_ported_ipv4.c b/frontends/nss/ecm_nss_ported_ipv4.c
|
||||
index 6375b6b..ea997e3 100644
|
||||
--- a/frontends/nss/ecm_nss_ported_ipv4.c
|
||||
+++ b/frontends/nss/ecm_nss_ported_ipv4.c
|
||||
@@ -2010,21 +2010,11 @@ struct ecm_nss_ported_ipv4_connection_instance *ecm_nss_ported_ipv4_connection_i
|
||||
*/
|
||||
bool ecm_nss_ported_ipv4_debugfs_init(struct dentry *dentry)
|
||||
{
|
||||
- struct dentry *udp_dentry;
|
||||
-
|
||||
- udp_dentry = debugfs_create_u32("udp_accelerated_count", S_IRUGO, dentry,
|
||||
+ debugfs_create_u32("udp_accelerated_count", S_IRUGO, dentry,
|
||||
&ecm_nss_ported_ipv4_accelerated_count[ECM_NSS_PORTED_IPV4_PROTO_UDP]);
|
||||
- if (!udp_dentry) {
|
||||
- DEBUG_ERROR("Failed to create ecm nss ipv4 udp_accelerated_count file in debugfs\n");
|
||||
- return false;
|
||||
- }
|
||||
@@ -2944,12 +2944,8 @@ bool ecm_nss_ported_ipv4_debugfs_init(st
|
||||
return false;
|
||||
}
|
||||
|
||||
- if (!debugfs_create_u32("tcp_accelerated_count", S_IRUGO, dentry,
|
||||
- &ecm_nss_ported_ipv4_accelerated_count[ECM_NSS_PORTED_IPV4_PROTO_TCP])) {
|
||||
@ -641,23 +616,11 @@ index 6375b6b..ea997e3 100644
|
||||
|
||||
return true;
|
||||
}
|
||||
diff --git a/frontends/nss/ecm_nss_ported_ipv6.c b/frontends/nss/ecm_nss_ported_ipv6.c
|
||||
index 1be8a58..451a557 100644
|
||||
--- a/frontends/nss/ecm_nss_ported_ipv6.c
|
||||
+++ b/frontends/nss/ecm_nss_ported_ipv6.c
|
||||
@@ -1925,21 +1925,11 @@ struct ecm_nss_ported_ipv6_connection_instance *ecm_nss_ported_ipv6_connection_i
|
||||
*/
|
||||
bool ecm_nss_ported_ipv6_debugfs_init(struct dentry *dentry)
|
||||
{
|
||||
- struct dentry *udp_dentry;
|
||||
-
|
||||
- udp_dentry = debugfs_create_u32("udp_accelerated_count", S_IRUGO, dentry,
|
||||
+ debugfs_create_u32("udp_accelerated_count", S_IRUGO, dentry,
|
||||
&ecm_nss_ported_ipv6_accelerated_count[ECM_NSS_PORTED_IPV6_PROTO_UDP]);
|
||||
- if (!udp_dentry) {
|
||||
- DEBUG_ERROR("Failed to create ecm nss ipv6 udp_accelerated_count file in debugfs\n");
|
||||
- return false;
|
||||
- }
|
||||
@@ -2732,12 +2732,8 @@ bool ecm_nss_ported_ipv6_debugfs_init(st
|
||||
return false;
|
||||
}
|
||||
|
||||
- if (!debugfs_create_u32("tcp_accelerated_count", S_IRUGO, dentry,
|
||||
- &ecm_nss_ported_ipv6_accelerated_count[ECM_NSS_PORTED_IPV6_PROTO_TCP])) {
|
||||
@ -670,11 +633,9 @@ index 1be8a58..451a557 100644
|
||||
|
||||
return true;
|
||||
}
|
||||
diff --git a/frontends/sfe/ecm_sfe_ipv4.c b/frontends/sfe/ecm_sfe_ipv4.c
|
||||
index 2076bad..3f30821 100644
|
||||
--- a/frontends/sfe/ecm_sfe_ipv4.c
|
||||
+++ b/frontends/sfe/ecm_sfe_ipv4.c
|
||||
@@ -914,48 +914,27 @@ int ecm_sfe_ipv4_init(struct dentry *dentry)
|
||||
@@ -1808,48 +1808,27 @@ int ecm_sfe_ipv4_init(struct dentry *den
|
||||
}
|
||||
|
||||
#ifdef CONFIG_XFRM
|
||||
@ -737,11 +698,9 @@ index 2076bad..3f30821 100644
|
||||
|
||||
if (!debugfs_create_file("accel_limit_mode", S_IRUGO | S_IWUSR, ecm_sfe_ipv4_dentry,
|
||||
NULL, &ecm_sfe_ipv4_accel_limit_mode_fops)) {
|
||||
diff --git a/frontends/sfe/ecm_sfe_ipv6.c b/frontends/sfe/ecm_sfe_ipv6.c
|
||||
index e8981ee..54fdbf3 100644
|
||||
--- a/frontends/sfe/ecm_sfe_ipv6.c
|
||||
+++ b/frontends/sfe/ecm_sfe_ipv6.c
|
||||
@@ -906,48 +906,27 @@ int ecm_sfe_ipv6_init(struct dentry *dentry)
|
||||
@@ -1532,48 +1532,27 @@ int ecm_sfe_ipv6_init(struct dentry *den
|
||||
}
|
||||
|
||||
#ifdef CONFIG_XFRM
|
||||
@ -804,11 +763,9 @@ index e8981ee..54fdbf3 100644
|
||||
|
||||
if (!debugfs_create_file("accel_limit_mode", S_IRUGO | S_IWUSR, ecm_sfe_ipv6_dentry,
|
||||
NULL, &ecm_sfe_ipv6_accel_limit_mode_fops)) {
|
||||
diff --git a/frontends/sfe/ecm_sfe_non_ported_ipv4.c b/frontends/sfe/ecm_sfe_non_ported_ipv4.c
|
||||
index d7cad2a..696bd13 100644
|
||||
--- a/frontends/sfe/ecm_sfe_non_ported_ipv4.c
|
||||
+++ b/frontends/sfe/ecm_sfe_non_ported_ipv4.c
|
||||
@@ -1930,11 +1930,8 @@ struct ecm_sfe_non_ported_ipv4_connection_instance *ecm_sfe_non_ported_ipv4_conn
|
||||
@@ -2284,11 +2284,8 @@ done:
|
||||
*/
|
||||
bool ecm_sfe_non_ported_ipv4_debugfs_init(struct dentry *dentry)
|
||||
{
|
||||
@ -822,11 +779,9 @@ index d7cad2a..696bd13 100644
|
||||
|
||||
return true;
|
||||
}
|
||||
diff --git a/frontends/sfe/ecm_sfe_non_ported_ipv6.c b/frontends/sfe/ecm_sfe_non_ported_ipv6.c
|
||||
index a9fb637..fe06de4 100644
|
||||
--- a/frontends/sfe/ecm_sfe_non_ported_ipv6.c
|
||||
+++ b/frontends/sfe/ecm_sfe_non_ported_ipv6.c
|
||||
@@ -1777,11 +1777,8 @@ struct ecm_sfe_non_ported_ipv6_connection_instance *ecm_sfe_non_ported_ipv6_conn
|
||||
@@ -2083,11 +2083,8 @@ done:
|
||||
*/
|
||||
bool ecm_sfe_non_ported_ipv6_debugfs_init(struct dentry *dentry)
|
||||
{
|
||||
@ -840,11 +795,9 @@ index a9fb637..fe06de4 100644
|
||||
|
||||
return true;
|
||||
}
|
||||
diff --git a/frontends/sfe/ecm_sfe_ported_ipv4.c b/frontends/sfe/ecm_sfe_ported_ipv4.c
|
||||
index fc2c4ba..53f5b07 100644
|
||||
--- a/frontends/sfe/ecm_sfe_ported_ipv4.c
|
||||
+++ b/frontends/sfe/ecm_sfe_ported_ipv4.c
|
||||
@@ -2062,12 +2062,8 @@ bool ecm_sfe_ported_ipv4_debugfs_init(struct dentry *dentry)
|
||||
@@ -2528,12 +2528,8 @@ bool ecm_sfe_ported_ipv4_debugfs_init(st
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -859,11 +812,9 @@ index fc2c4ba..53f5b07 100644
|
||||
|
||||
return true;
|
||||
}
|
||||
diff --git a/frontends/sfe/ecm_sfe_ported_ipv6.c b/frontends/sfe/ecm_sfe_ported_ipv6.c
|
||||
index 90d642d..ae04cb4 100644
|
||||
--- a/frontends/sfe/ecm_sfe_ported_ipv6.c
|
||||
+++ b/frontends/sfe/ecm_sfe_ported_ipv6.c
|
||||
@@ -2007,12 +2007,8 @@ bool ecm_sfe_ported_ipv6_debugfs_init(struct dentry *dentry)
|
||||
@@ -2374,12 +2374,8 @@ bool ecm_sfe_ported_ipv6_debugfs_init(st
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -878,5 +829,3 @@ index 90d642d..ae04cb4 100644
|
||||
|
||||
return true;
|
||||
}
|
||||
--
|
||||
2.34.1
|
@ -1,18 +1,6 @@
|
||||
From 33a2f57d6852035730b353a14912ce2c588f3017 Mon Sep 17 00:00:00 2001
|
||||
From: Ansuel Smith <ansuelsmth@gmail.com>
|
||||
Date: Sat, 15 May 2021 03:51:14 +0200
|
||||
Subject: [PATCH 04/12] treewide: fix wrong chain events flag
|
||||
|
||||
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
|
||||
---
|
||||
ecm_conntrack_notifier.c | 8 +++++++-
|
||||
1 file changed, 7 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/ecm_conntrack_notifier.c b/ecm_conntrack_notifier.c
|
||||
index 7b20132..9c8a45e 100644
|
||||
--- a/ecm_conntrack_notifier.c
|
||||
+++ b/ecm_conntrack_notifier.c
|
||||
@@ -423,7 +423,11 @@ int ecm_conntrack_notifier_init(struct dentry *dentry)
|
||||
@@ -421,7 +421,11 @@ int ecm_conntrack_notifier_init(struct d
|
||||
/*
|
||||
* Eventing subsystem is available so we register a notifier hook to get fast notifications of expired connections
|
||||
*/
|
||||
@ -24,7 +12,7 @@ index 7b20132..9c8a45e 100644
|
||||
if (result < 0) {
|
||||
DEBUG_ERROR("Can't register nf notifier hook.\n");
|
||||
debugfs_remove_recursive(ecm_conntrack_notifier_dentry);
|
||||
@@ -441,7 +445,9 @@ EXPORT_SYMBOL(ecm_conntrack_notifier_init);
|
||||
@@ -439,7 +443,9 @@ EXPORT_SYMBOL(ecm_conntrack_notifier_ini
|
||||
void ecm_conntrack_notifier_exit(void)
|
||||
{
|
||||
DEBUG_INFO("ECM Conntrack Notifier exit\n");
|
||||
@ -35,6 +23,3 @@ index 7b20132..9c8a45e 100644
|
||||
nf_conntrack_unregister_notifier(&init_net, &ecm_conntrack_notifier);
|
||||
#endif
|
||||
/*
|
||||
--
|
||||
2.34.1
|
||||
|
@ -0,0 +1,58 @@
|
||||
From e6d701c0d454d841366c556b2ef07a5203ffb35d Mon Sep 17 00:00:00 2001
|
||||
From: Robert Marko <robimarko@gmail.com>
|
||||
Date: Fri, 21 May 2021 21:41:31 +0200
|
||||
Subject: [PATCH] More compile fixes
|
||||
|
||||
More runtime compile fixes.
|
||||
|
||||
Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
---
|
||||
frontends/nss/ecm_nss_ported_ipv4.c | 12 +++---------
|
||||
frontends/nss/ecm_nss_ported_ipv6.c | 12 +++---------
|
||||
2 files changed, 6 insertions(+), 18 deletions(-)
|
||||
|
||||
diff --git a/frontends/nss/ecm_nss_ported_ipv4.c b/frontends/nss/ecm_nss_ported_ipv4.c
|
||||
index 3522f0f..7f5fcd1 100644
|
||||
--- a/frontends/nss/ecm_nss_ported_ipv4.c
|
||||
+++ b/frontends/nss/ecm_nss_ported_ipv4.c
|
||||
@@ -2935,14 +2935,8 @@ done:
|
||||
*/
|
||||
bool ecm_nss_ported_ipv4_debugfs_init(struct dentry *dentry)
|
||||
{
|
||||
- struct dentry *udp_dentry;
|
||||
-
|
||||
- udp_dentry = debugfs_create_u32("udp_accelerated_count", S_IRUGO, dentry,
|
||||
+ debugfs_create_u32("udp_accelerated_count", S_IRUGO, dentry,
|
||||
&ecm_nss_ported_ipv4_accelerated_count[ECM_NSS_PORTED_IPV4_PROTO_UDP]);
|
||||
- if (!udp_dentry) {
|
||||
- DEBUG_ERROR("Failed to create ecm nss ipv4 udp_accelerated_count file in debugfs\n");
|
||||
- return false;
|
||||
- }
|
||||
|
||||
debugfs_create_u32("tcp_accelerated_count", S_IRUGO, dentry,
|
||||
&ecm_nss_ported_ipv4_accelerated_count[ECM_NSS_PORTED_IPV4_PROTO_TCP]);
|
||||
diff --git a/frontends/nss/ecm_nss_ported_ipv6.c b/frontends/nss/ecm_nss_ported_ipv6.c
|
||||
index f43ac95..e0f779c 100644
|
||||
--- a/frontends/nss/ecm_nss_ported_ipv6.c
|
||||
+++ b/frontends/nss/ecm_nss_ported_ipv6.c
|
||||
/*
|
||||
* ecm_nss_ported_ipv6_connection_callback()
|
||||
@@ -2723,14 +2723,8 @@ done:
|
||||
*/
|
||||
bool ecm_nss_ported_ipv6_debugfs_init(struct dentry *dentry)
|
||||
{
|
||||
- struct dentry *udp_dentry;
|
||||
-
|
||||
- udp_dentry = debugfs_create_u32("udp_accelerated_count", S_IRUGO, dentry,
|
||||
+ debugfs_create_u32("udp_accelerated_count", S_IRUGO, dentry,
|
||||
&ecm_nss_ported_ipv6_accelerated_count[ECM_NSS_PORTED_IPV6_PROTO_UDP]);
|
||||
- if (!udp_dentry) {
|
||||
- DEBUG_ERROR("Failed to create ecm nss ipv6 udp_accelerated_count file in debugfs\n");
|
||||
- return false;
|
||||
- }
|
||||
|
||||
debugfs_create_u32("tcp_accelerated_count", S_IRUGO, dentry,
|
||||
&ecm_nss_ported_ipv6_accelerated_count[ECM_NSS_PORTED_IPV6_PROTO_TCP]);
|
||||
--
|
||||
2.31.1
|
||||
|
@ -1,7 +1,7 @@
|
||||
From 65aa71f33891bcf0b75995219e31abaf674c6199 Mon Sep 17 00:00:00 2001
|
||||
From 6924b71ed809b37fffd74d6428a8ca83e5919746 Mon Sep 17 00:00:00 2001
|
||||
From: Dirk Buchwalder <buchwalder@posteo.de>
|
||||
Date: Sun, 27 Jun 2021 16:52:39 +0200
|
||||
Subject: [PATCH 05/12] qca-nss-ecm: resolve the cpu high load regarding ecm
|
||||
Subject: [PATCH] qca-nss-ecm: resolve the cpu high load regarding ecm
|
||||
|
||||
If using ECM, cpu load goes up (around 1.0) and stucks there.
|
||||
This is due to using uninterruptible sleep function,
|
||||
@ -14,10 +14,10 @@ Signed-off-by: Dirk Buchwalder buchwalder@posteo.de
|
||||
2 files changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/frontends/nss/ecm_nss_ipv4.c b/frontends/nss/ecm_nss_ipv4.c
|
||||
index 5b0ce29..719a747 100644
|
||||
index e00553c..94b39cd 100644
|
||||
--- a/frontends/nss/ecm_nss_ipv4.c
|
||||
+++ b/frontends/nss/ecm_nss_ipv4.c
|
||||
@@ -697,7 +697,7 @@ static void ecm_nss_ipv4_stats_sync_req_work(struct work_struct *work)
|
||||
@@ -2471,7 +2471,7 @@ static void ecm_nss_ipv4_stats_sync_req_work(struct work_struct *work)
|
||||
}
|
||||
spin_unlock_bh(&ecm_nss_ipv4_lock);
|
||||
|
||||
@ -26,7 +26,7 @@ index 5b0ce29..719a747 100644
|
||||
|
||||
/*
|
||||
* If index is 0, we are starting a new round, but if we still have time remain
|
||||
@@ -711,7 +711,7 @@ static void ecm_nss_ipv4_stats_sync_req_work(struct work_struct *work)
|
||||
@@ -2485,7 +2485,7 @@ static void ecm_nss_ipv4_stats_sync_req_work(struct work_struct *work)
|
||||
}
|
||||
|
||||
if (time_after(ecm_nss_ipv4_next_req_time, current_jiffies)) {
|
||||
@ -36,10 +36,10 @@ index 5b0ce29..719a747 100644
|
||||
ecm_nss_ipv4_roll_check_jiffies = jiffies;
|
||||
ecm_nss_ipv4_next_req_time = ecm_nss_ipv4_roll_check_jiffies + ECM_NSS_IPV4_STATS_SYNC_PERIOD;
|
||||
diff --git a/frontends/nss/ecm_nss_ipv6.c b/frontends/nss/ecm_nss_ipv6.c
|
||||
index 8d13f68..67ee364 100644
|
||||
index 82e739f..30af050 100644
|
||||
--- a/frontends/nss/ecm_nss_ipv6.c
|
||||
+++ b/frontends/nss/ecm_nss_ipv6.c
|
||||
@@ -675,7 +675,7 @@ static void ecm_nss_ipv6_stats_sync_req_work(struct work_struct *work)
|
||||
@@ -2210,7 +2210,7 @@ static void ecm_nss_ipv6_stats_sync_req_work(struct work_struct *work)
|
||||
}
|
||||
spin_unlock_bh(&ecm_nss_ipv6_lock);
|
||||
|
||||
@ -48,7 +48,7 @@ index 8d13f68..67ee364 100644
|
||||
|
||||
/*
|
||||
* If index is 0, we are starting a new round, but if we still have time remain
|
||||
@@ -689,7 +689,7 @@ static void ecm_nss_ipv6_stats_sync_req_work(struct work_struct *work)
|
||||
@@ -2224,7 +2224,7 @@ static void ecm_nss_ipv6_stats_sync_req_work(struct work_struct *work)
|
||||
}
|
||||
|
||||
if (time_after(ecm_nss_ipv6_next_req_time, current_jiffies)) {
|
||||
@ -58,4 +58,4 @@ index 8d13f68..67ee364 100644
|
||||
ecm_nss_ipv6_roll_check_jiffies = jiffies;
|
||||
ecm_nss_ipv6_next_req_time = ecm_nss_ipv6_roll_check_jiffies + ECM_NSS_IPV6_STATS_SYNC_PERIOD;
|
||||
--
|
||||
2.34.1
|
||||
2.31.1
|
@ -1,32 +1,50 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=qca-ssdk
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_URL:=https://git.codelinaro.org/clo/qsdk/oss/lklm/qca-ssdk.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_DATE:=2022-06-15
|
||||
PKG_SOURCE_VERSION:=3b28aac762c4d6af0e3ca29b0057755937e412b6
|
||||
PKG_MIRROR_HASH:=7ba48088db28ef89559d1993a1ef91bdd0fcf14a12c7d9c9ad7c57eaabd552d7
|
||||
PKG_SOURCE_URL:=https://source.codeaurora.org/quic/qsdk/oss/lklm/qca-ssdk
|
||||
PKG_SOURCE_DATE:=2021-04-28
|
||||
PKG_SOURCE_VERSION:=c9bc3bc34eaaac78083573524097356e2dcc1b66
|
||||
PKG_MIRROR_HASH:=29db78529be32427b8b96fcbfec22a016a243676781ec96d9d65b810944fa405
|
||||
|
||||
LOCAL_VARIANT=$(patsubst qca-ssdk-%,%,$(patsubst qca-ssdk-%,%,$(BUILD_VARIANT)))
|
||||
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define KernelPackage/qca-ssdk-nohnat
|
||||
define KernelPackage/qca-ssdk/default-nohnat
|
||||
SECTION:=kernel
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
TITLE:=Kernel driver for QCA SSDK
|
||||
DEPENDS:=@(TARGET_ipq806x||TARGET_ipq807x||TARGET_ipq60xx)
|
||||
FILES:=$(PKG_BUILD_DIR)/build/bin/qca-ssdk.ko
|
||||
AUTOLOAD:=$(call AutoLoad,30,qca-ssdk)
|
||||
PROVIDES:=qca-ssdk
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-ssdk-nohnat
|
||||
$(call KernelPackage/qca-ssdk/default-nohnat)
|
||||
DEPENDS:=@(TARGET_ipq806x||TARGET_ipq807x)
|
||||
VARIANT:=nohnat
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-ssdk-nohnat/Description
|
||||
This package contains a qca-ssdk driver for QCA chipset
|
||||
endef
|
||||
|
||||
GCC_VERSION=$(shell echo "$(CONFIG_GCC_VERSION)" | sed 's/[^0-9.]*\([0-9.]*\).*/\1/')
|
||||
define KernelPackage/qca-ssdk-hnat
|
||||
$(call KernelPackage/qca-ssdk/default-nohnat)
|
||||
DEPENDS:=@TARGET_ipq40xx +kmod-ipt-extra +kmod-ipt-filter \
|
||||
+kmod-ppp +TARGET_ipq40xx:kmod-qca-rfs
|
||||
TITLE+= (hnat)
|
||||
VARIANT:=hnat
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-ssdk-hnat/Description
|
||||
This package contains a qca-ssdk-hnat driver for QCA chipset
|
||||
endef
|
||||
|
||||
ifdef CONFIG_TOOLCHAIN_BIN_PATH
|
||||
TOOLCHAIN_BIN_PATH=$(CONFIG_TOOLCHAIN_BIN_PATH)
|
||||
@ -34,28 +52,39 @@ else
|
||||
TOOLCHAIN_BIN_PATH=$(TOOLCHAIN_DIR)/bin
|
||||
endif
|
||||
|
||||
MAKE_FLAGS+= \
|
||||
TARGET_NAME=$(CONFIG_TARGET_NAME) \
|
||||
TOOL_PATH=$(TOOLCHAIN_BIN_PATH) \
|
||||
SYS_PATH=$(LINUX_DIR) \
|
||||
TOOLPREFIX=$(TARGET_CROSS) \
|
||||
QCASSDK_CONFIG_OPTS+= \
|
||||
$(KERNEL_MAKE_FLAGS) \
|
||||
KVER=$(LINUX_VERSION) \
|
||||
ARCH=$(LINUX_KARCH) \
|
||||
TARGET_SUFFIX=$(CONFIG_TARGET_SUFFIX) \
|
||||
SYS_PATH=$(LINUX_DIR) \
|
||||
GCC_VERSION=$(GCC_VERSION) \
|
||||
EXTRA_CFLAGS='-Wno-error -fno-PIC -fno-stack-protector -I$(STAGING_DIR)/usr/include' \
|
||||
$(KERNEL_MAKE_FLAGS)
|
||||
TOOLPREFIX=$(TARGET_CROSS) \
|
||||
TOOL_PATH=$(TOOLCHAIN_BIN_PATH) \
|
||||
TARGET_SUFFIX=$(CONFIG_TARGET_SUFFIX) \
|
||||
EXTRA_CFLAGS=-fno-stack-protector -I$(STAGING_DIR)/usr/include
|
||||
|
||||
ifneq (, $(findstring $(CONFIG_TARGET_BOARD), "ipq60xx" "ipq807x"))
|
||||
MAKE_FLAGS+= PTP_FEATURE=disable SWCONFIG_FEATURE=disable
|
||||
ifeq ($(LOCAL_VARIANT),hnat)
|
||||
QCASSDK_CONFIG_OPTS+= HNAT_FEATURE=enable
|
||||
ifeq ($(BOARD),ipq40xx)
|
||||
QCASSDK_CONFIG_OPTS+= RFS_FEATURE=enable
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_TARGET_BOARD), "ipq807x")
|
||||
MAKE_FLAGS+= CHIP_TYPE=HPPE
|
||||
else ifeq ($(CONFIG_TARGET_BOARD), "ipq60xx")
|
||||
MAKE_FLAGS+= CHIP_TYPE=CPPE
|
||||
ifeq ($(BOARD),ipq60xx)
|
||||
QCASSDK_CONFIG_OPTS+= CHIP_TYPE=CPPE
|
||||
else ifeq ($(BOARD),ipq807x)
|
||||
QCASSDK_CONFIG_OPTS+= CHIP_TYPE=HPPE
|
||||
else
|
||||
QCASSDK_CONFIG_OPTS+= HK_CHIP=enable
|
||||
endif
|
||||
|
||||
ifneq (, $(findstring $(BOARD), ipq60xx ipq807x))
|
||||
QCASSDK_CONFIG_OPTS+= PTP_FEATURE=disable SWCONFIG_FEATURE=disable
|
||||
endif
|
||||
|
||||
define Build/Compile
|
||||
$(MAKE) -C $(PKG_BUILD_DIR) $(strip $(QCASSDK_CONFIG_OPTS))
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include/qca-ssdk
|
||||
$(INSTALL_DIR) $(1)/usr/include/qca-ssdk/api
|
||||
@ -80,7 +109,6 @@ define Build/InstallDev
|
||||
$(CP) -rf $(PKG_BUILD_DIR)/include/common/*.h $(1)/usr/include/qca-ssdk
|
||||
$(CP) -rf $(PKG_BUILD_DIR)/include/sal/os/linux/*.h $(1)/usr/include/qca-ssdk
|
||||
$(CP) -rf $(PKG_BUILD_DIR)/include/sal/os/*.h $(1)/usr/include/qca-ssdk
|
||||
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-ssdk-nohnat/install
|
||||
@ -88,4 +116,10 @@ define KernelPackage/qca-ssdk-nohnat/install
|
||||
$(INSTALL_BIN) ./files/qca-ssdk $(1)/etc/init.d/qca-ssdk
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-ssdk-hnat/install
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/qca-ssdk $(1)/etc/init.d/qca-ssdk
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,qca-ssdk-nohnat))
|
||||
$(eval $(call KernelPackage,qca-ssdk-hnat))
|
||||
|
@ -14,13 +14,17 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
|
||||
--- a/config
|
||||
+++ b/config
|
||||
@@ -22,6 +22,10 @@ ifeq ($(KVER),$(filter 5.4%,$(KVER)))
|
||||
@@ -22,6 +22,14 @@ ifeq ($(KVER),$(filter 5.4%,$(KVER)))
|
||||
OS_VER=5_4
|
||||
endif
|
||||
|
||||
+ifeq ($(KVER),$(filter 5.10%,$(KVER)))
|
||||
+OS_VER=5_10
|
||||
+endif
|
||||
+
|
||||
+ifeq ($(KVER),$(filter 5.15%,$(KVER)))
|
||||
+OS_VER=5_15
|
||||
+endif
|
||||
+
|
||||
ifeq ($(KVER), 3.4.0)
|
||||
OS_VER=3_4
|
||||
@ -30,7 +34,7 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
|
||||
ifeq ($(ARCH), arm64)
|
||||
-ifeq ($(KVER),$(filter 4.1% 4.4% 4.9% 5.4%,$(KVER)))
|
||||
+ ifeq ($(KVER),$(filter 4.1% 4.4% 4.9% 5.4% 5.10%,$(KVER)))
|
||||
+ifeq ($(KVER),$(filter 4.1% 4.4% 4.9% 5.4% 5.10% 5.15%,$(KVER)))
|
||||
CPU_CFLAG= -DMODULE -Os -pipe -march=armv8-a -mcpu=cortex-a53+crypto -fno-caller-saves -fno-strict-aliasing -Werror -fno-common -Wno-format-security -Wno-pointer-sign -Wno-unused-but-set-variable -Wno-error=unused-result -mcmodel=large
|
||||
endif
|
||||
endif
|
||||
@ -41,7 +45,7 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
endif
|
||||
|
||||
- ifeq (5_4, $(OS_VER))
|
||||
+ ifeq ($(OS_VER),$(filter 5_4 5_10, $(OS_VER)))
|
||||
+ ifeq ($(OS_VER),$(filter 5_4 5_10 5_15, $(OS_VER)))
|
||||
ifeq ($(ARCH), arm64)
|
||||
KASAN_OPTION += -DKASAN_SHADOW_SCALE_SHIFT=$(KASAN_SHADOW_SCALE_SHIFT)
|
||||
endif
|
||||
@ -50,7 +54,7 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
endif
|
||||
|
||||
- ifeq ($(OS_VER),$(filter 4_4 5_4, $(OS_VER)))
|
||||
+ ifeq ($(OS_VER),$(filter 4_4 5_4 5_10, $(OS_VER)))
|
||||
+ ifeq ($(OS_VER),$(filter 4_4 5_4 5_10 5_15, $(OS_VER)))
|
||||
MODULE_CFLAG += -DKVER34
|
||||
MODULE_CFLAG += -DKVER32
|
||||
MODULE_CFLAG += -DLNX26_22
|
@ -16,17 +16,15 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
|
||||
--- a/src/init/ssdk_plat.c
|
||||
+++ b/src/init/ssdk_plat.c
|
||||
--- ssdk_plat.c.orig 2022-07-21 14:17:55.010803700 +0300
|
||||
+++ ssdk_plat.c 2022-07-21 14:30:42.884803700 +0300
|
||||
@@ -734,7 +734,6 @@ static int miibus_get(a_uint32_t dev_id)
|
||||
@@ -551,7 +551,6 @@ static int miibus_get(a_uint32_t dev_id)
|
||||
struct device_node *mdio_node = NULL;
|
||||
struct device_node *switch_node = NULL;
|
||||
struct platform_device *mdio_plat = NULL;
|
||||
- struct qca_mdio_data *mdio_data = NULL;
|
||||
- struct ipq40xx_mdio_data *mdio_data = NULL;
|
||||
struct qca_phy_priv *priv;
|
||||
hsl_reg_mode reg_mode = HSL_REG_LOCAL_BUS;
|
||||
priv = qca_phy_priv_global[dev_id];
|
||||
@@ -769,13 +768,8 @@ static int miibus_get(a_uint32_t dev_id)
|
||||
@@ -584,12 +583,7 @@ static int miibus_get(a_uint32_t dev_id)
|
||||
|
||||
if(reg_mode == HSL_REG_LOCAL_BUS)
|
||||
{
|
||||
@ -36,38 +34,7 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
- return 1;
|
||||
- }
|
||||
- priv->miibus = mdio_data->mii_bus;
|
||||
- }
|
||||
+ priv->miibus = of_mdio_find_bus(mdio_node);
|
||||
+ }
|
||||
}
|
||||
else
|
||||
priv->miibus = dev_get_drvdata(&mdio_plat->dev);
|
||||
|
||||
@@ -813,7 +807,6 @@ static int miibus_get(a_uint32_t dev_id)
|
||||
#else
|
||||
static int miibus_get(a_uint32_t dev_id)
|
||||
{
|
||||
- struct ag71xx_mdio *am;
|
||||
struct qca_phy_priv *priv = qca_phy_priv_global[dev_id];
|
||||
#if defined(CONFIG_OF) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
|
||||
struct device_node *mdio_node = NULL;
|
||||
@@ -829,17 +822,12 @@ static int miibus_get(a_uint32_t dev_id)
|
||||
SSDK_ERROR("cannot find platform device from mdio node\n");
|
||||
return 1;
|
||||
}
|
||||
- am = dev_get_drvdata(&mdio_plat->dev);
|
||||
- if (!am) {
|
||||
- SSDK_ERROR("cannot get mdio_data reference from device data\n");
|
||||
- return 1;
|
||||
- }
|
||||
- priv->miibus = am->mii_bus;
|
||||
-
|
||||
+ priv->miibus = of_mdio_find_bus(mdio_node);
|
||||
switch_chip_id_adjuest(dev_id);
|
||||
#else
|
||||
struct device *miidev;
|
||||
- char busid[MII_BUS_ID_SIZE];
|
||||
+ struct ag71xx_mdio *am;
|
||||
+ char busid[MII_BUS_ID_SIZE];
|
||||
|
||||
snprintf(busid, MII_BUS_ID_SIZE, "%s.%d",
|
||||
PLATFORM_MDIO_BUS_NAME, PLATFORM_MDIO_BUS_NUM);
|
@ -1,56 +0,0 @@
|
||||
From 599f19551dc8db3cb396e4c139a73bd72300ebf5 Mon Sep 17 00:00:00 2001
|
||||
From: Robert Marko <robimarko@gmail.com>
|
||||
Date: Fri, 24 Dec 2021 19:39:02 +0100
|
||||
Subject: [PATCH] SSDK: config: add kernel 5.15
|
||||
|
||||
This is purely to identify it and be able to set
|
||||
flags correctly.
|
||||
|
||||
Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
---
|
||||
config | 6 +++++-
|
||||
make/linux_opt.mk | 4 ++--
|
||||
2 files changed, 7 insertions(+), 3 deletions(-)
|
||||
|
||||
--- a/config
|
||||
+++ b/config
|
||||
@@ -26,6 +26,10 @@ ifeq ($(KVER),$(filter 5.10%,$(KVER)))
|
||||
OS_VER=5_10
|
||||
endif
|
||||
|
||||
+ifeq ($(KVER),$(filter 5.15%,$(KVER)))
|
||||
+OS_VER=5_15
|
||||
+endif
|
||||
+
|
||||
ifeq ($(KVER), 3.4.0)
|
||||
OS_VER=3_4
|
||||
endif
|
||||
@@ -127,7 +131,7 @@ endif
|
||||
endif
|
||||
|
||||
ifeq ($(ARCH), arm64)
|
||||
- ifeq ($(KVER),$(filter 4.1% 4.4% 4.9% 5.4% 5.10%,$(KVER)))
|
||||
+ ifeq ($(KVER),$(filter 4.1% 4.4% 4.9% 5.4% 5.10% 5.15%,$(KVER)))
|
||||
CPU_CFLAG= -DMODULE -Os -pipe -march=armv8-a -mcpu=cortex-a53+crypto -fno-caller-saves -fno-strict-aliasing -Werror -fno-common -Wno-format-security -Wno-pointer-sign -Wno-unused-but-set-variable -Wno-error=unused-result -mcmodel=large
|
||||
endif
|
||||
endif
|
||||
--- a/make/linux_opt.mk
|
||||
+++ b/make/linux_opt.mk
|
||||
@@ -388,7 +388,7 @@ ifeq (KSLIB, $(MODULE_TYPE))
|
||||
KASAN_SHADOW_SCALE_SHIFT := 3
|
||||
endif
|
||||
|
||||
- ifeq ($(OS_VER),$(filter 5_4 5_10, $(OS_VER)))
|
||||
+ ifeq ($(OS_VER),$(filter 5_4 5_10 5_15, $(OS_VER)))
|
||||
ifeq ($(ARCH), arm64)
|
||||
KASAN_OPTION += -DKASAN_SHADOW_SCALE_SHIFT=$(KASAN_SHADOW_SCALE_SHIFT)
|
||||
endif
|
||||
@@ -419,7 +419,7 @@ ifeq (KSLIB, $(MODULE_TYPE))
|
||||
|
||||
endif
|
||||
|
||||
- ifeq ($(OS_VER),$(filter 4_4 5_4 5_10, $(OS_VER)))
|
||||
+ ifeq ($(OS_VER),$(filter 4_4 5_4 5_10 5_15, $(OS_VER)))
|
||||
MODULE_CFLAG += -DKVER34
|
||||
MODULE_CFLAG += -DKVER32
|
||||
MODULE_CFLAG += -DLNX26_22
|
@ -1,9 +1,9 @@
|
||||
--- a/src/init/ssdk_plat.c
|
||||
+++ b/src/init/ssdk_plat.c
|
||||
@@ -568,7 +568,7 @@ static int miibus_get(a_uint32_t dev_id)
|
||||
if (!mdio_node)
|
||||
mdio_node = of_find_compatible_node(NULL, NULL, "qcom,qca-mdio");
|
||||
} else
|
||||
if(reg_mode == HSL_REG_LOCAL_BUS)
|
||||
mdio_node = of_find_compatible_node(NULL, NULL, "qcom,ipq40xx-mdio");
|
||||
else
|
||||
- mdio_node = of_find_compatible_node(NULL, NULL, "virtual,mdio-gpio");
|
||||
+ mdio_node = of_find_compatible_node(NULL, NULL, "qcom,ipq8064-mdio");
|
||||
|
@ -0,0 +1,37 @@
|
||||
From 440ab349813e5aa9dbeddab4d82ab64ff5347c5f Mon Sep 17 00:00:00 2001
|
||||
From: Dirk Buchwalder <buchwalder@posteo.de>
|
||||
Date: Sat, 30 Oct 2021 19:51:06 +0200
|
||||
Subject: [PATCH] add aquantia phy id 113CB0 / 0x31c31C12
|
||||
|
||||
This adds support for the AQR113C with the id
|
||||
"113CB0 / 0x31c31C12" to the ssdk.
|
||||
|
||||
This is used in the QNAP 301w
|
||||
|
||||
Signed-off-by: Dirk Buchwalder <buchwalder@posteo.de>
|
||||
|
||||
---
|
||||
include/hsl/phy/hsl_phy.h | 1 +
|
||||
src/hsl/phy/hsl_phy.c | 1 +
|
||||
2 files changed, 2 insertions(+)
|
||||
|
||||
--- a/include/hsl/phy/hsl_phy.h
|
||||
+++ b/include/hsl/phy/hsl_phy.h
|
||||
@@ -579,6 +579,7 @@ typedef struct {
|
||||
#define AQUANTIA_PHY_112 0x03a1b660
|
||||
#define AQUANTIA_PHY_113C_A0 0x31c31C10
|
||||
#define AQUANTIA_PHY_113C_A1 0x31c31C11
|
||||
+#define AQUANTIA_PHY_113C_B0 0x31c31C12
|
||||
#define AQUANTIA_PHY_112C 0x03a1b792
|
||||
|
||||
#define PHY_805XV2 0x004DD082
|
||||
--- a/src/hsl/phy/hsl_phy.c
|
||||
+++ b/src/hsl/phy/hsl_phy.c
|
||||
@@ -235,6 +235,7 @@ phy_type_t hsl_phytype_get_by_phyid(a_ui
|
||||
case AQUANTIA_PHY_112:
|
||||
case AQUANTIA_PHY_113C_A0:
|
||||
case AQUANTIA_PHY_113C_A1:
|
||||
+ case AQUANTIA_PHY_113C_B0:
|
||||
case AQUANTIA_PHY_112C:
|
||||
phytype = AQUANTIA_PHY_CHIP;
|
||||
break;
|
@ -1,74 +0,0 @@
|
||||
From 86624624c2b593c57999780a3838e6a9fe40b30c Mon Sep 17 00:00:00 2001
|
||||
From: Robert Marko <robimarko@gmail.com>
|
||||
Date: Tue, 11 Jan 2022 00:28:42 +0100
|
||||
Subject: [PATCH] qca807x: add a LED quirk for Xiaomi AX9000
|
||||
|
||||
Xiaomi AX9000 has a single LED for each of 4 gigabit ethernet ports that
|
||||
are connected to QCA8075, and that LED is connected to the 100M LED pin.
|
||||
|
||||
So, by default it will only work when in 10 or 100Mbit mode, this is quite
|
||||
annoying and makes no sense(If they have connected it to the 1000Mbit LED
|
||||
pin then it would have worked for 10/100 by default as well).
|
||||
|
||||
So, to solve this add a check for system compatible as we cant parse if
|
||||
from DTS in any other way and set the 100M LED to blink on 1000Base-T
|
||||
as well.
|
||||
|
||||
Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
---
|
||||
include/hsl/phy/malibu_phy.h | 2 ++
|
||||
src/hsl/phy/malibu_phy.c | 11 +++++++++++
|
||||
2 files changed, 13 insertions(+)
|
||||
|
||||
diff --git a/include/hsl/phy/malibu_phy.h b/include/hsl/phy/malibu_phy.h
|
||||
index b7354041..ec7a0621 100755
|
||||
--- a/include/hsl/phy/malibu_phy.h
|
||||
+++ b/include/hsl/phy/malibu_phy.h
|
||||
@@ -94,6 +94,7 @@ extern "C"
|
||||
#define MALIBU_DAC_CTRL_MASK 0x380
|
||||
#define MALIBU_DAC_CTRL_VALUE 0x280
|
||||
#define MALIBU_LED_1000_CTRL1_100_10_MASK 0x30
|
||||
+#define MALIBU_LED_100_CTRL1_1000_MASK 0x40
|
||||
|
||||
#define MALIBU_PHY_EEE_ADV_100M 0x0002
|
||||
#define MALIBU_PHY_EEE_ADV_1000M 0x0004
|
||||
@@ -118,6 +119,7 @@ extern "C"
|
||||
#define MALIBU_PHY_MMD7_EGRESS_COUNTER_HIGH 0x802d
|
||||
#define MALIBU_PHY_MMD7_EGRESS_COUNTER_LOW 0x802e
|
||||
#define MALIBU_PHY_MMD7_EGRESS_ERROR_COUNTER 0x802f
|
||||
+#define MALIBU_PHY_MMD7_LED_100_CTRL1 0x8074
|
||||
#define MALIBU_PHY_MMD7_LED_1000_CTRL1 0x8076
|
||||
|
||||
|
||||
diff --git a/src/hsl/phy/malibu_phy.c b/src/hsl/phy/malibu_phy.c
|
||||
index 1f4dba15..2bef9fa3 100644
|
||||
--- a/src/hsl/phy/malibu_phy.c
|
||||
+++ b/src/hsl/phy/malibu_phy.c
|
||||
@@ -12,6 +12,8 @@
|
||||
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
+#include <linux/of.h>
|
||||
+
|
||||
#include "sw.h"
|
||||
#include "fal_port_ctrl.h"
|
||||
#include "hsl_api.h"
|
||||
@@ -2726,6 +2728,15 @@ malibu_phy_hw_init(a_uint32_t dev_id, a_uint32_t port_bmp)
|
||||
led_status |= MALIBU_LED_1000_CTRL1_100_10_MASK;
|
||||
malibu_phy_mmd_write(dev_id, phy_addr, MALIBU_PHY_MMD7_NUM,
|
||||
MALIBU_PHY_MMD7_LED_1000_CTRL1, led_status);
|
||||
+ if (of_machine_is_compatible("xiaomi,ax9000")) {
|
||||
+ /* add 1000M link LED behavior for Xiaomi AX9000 */
|
||||
+ led_status = malibu_phy_mmd_read(dev_id, phy_addr, MALIBU_PHY_MMD7_NUM,
|
||||
+ MALIBU_PHY_MMD7_LED_100_CTRL1);
|
||||
+ led_status &= ~MALIBU_LED_100_CTRL1_1000_MASK;
|
||||
+ led_status |= MALIBU_LED_100_CTRL1_1000_MASK;
|
||||
+ malibu_phy_mmd_write(dev_id, phy_addr, MALIBU_PHY_MMD7_NUM,
|
||||
+ MALIBU_PHY_MMD7_LED_100_CTRL1, led_status);
|
||||
+ }
|
||||
/*disable Extended next page*/
|
||||
phy_data = malibu_phy_reg_read(dev_id, phy_addr, MALIBU_AUTONEG_ADVERT);
|
||||
phy_data &= ~MALIBU_EXTENDED_NEXT_PAGE_EN;
|
||||
--
|
||||
2.34.1
|
||||
|
@ -1,29 +0,0 @@
|
||||
From 913514b9177e77836f2c8d61fc498b54f54c6775 Mon Sep 17 00:00:00 2001
|
||||
From: Robert Marko <robimarko@gmail.com>
|
||||
Date: Wed, 26 Jan 2022 14:47:33 +0100
|
||||
Subject: [PATCH] qca807x: add a LED quirk for Xiaomi AX3600
|
||||
|
||||
AX3600 requires the same LED quirk so that PHY LED-s will blink even
|
||||
once Linux resets the PHY.
|
||||
|
||||
So, just check for its compatible.
|
||||
|
||||
Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
---
|
||||
src/hsl/phy/malibu_phy.c | 5 +++--
|
||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/src/hsl/phy/malibu_phy.c
|
||||
+++ b/src/hsl/phy/malibu_phy.c
|
||||
@@ -2728,8 +2728,9 @@ malibu_phy_hw_init(a_uint32_t dev_id, a_
|
||||
led_status |= MALIBU_LED_1000_CTRL1_100_10_MASK;
|
||||
malibu_phy_mmd_write(dev_id, phy_addr, MALIBU_PHY_MMD7_NUM,
|
||||
MALIBU_PHY_MMD7_LED_1000_CTRL1, led_status);
|
||||
- if (of_machine_is_compatible("xiaomi,ax9000")) {
|
||||
- /* add 1000M link LED behavior for Xiaomi AX9000 */
|
||||
+ /* add 1000M link LED behavior for Xiaomi boards */
|
||||
+ if (of_machine_is_compatible("xiaomi,ax9000") ||
|
||||
+ of_machine_is_compatible("xiaomi,ax3600")) {
|
||||
led_status = malibu_phy_mmd_read(dev_id, phy_addr, MALIBU_PHY_MMD7_NUM,
|
||||
MALIBU_PHY_MMD7_LED_100_CTRL1);
|
||||
led_status &= ~MALIBU_LED_100_CTRL1_1000_MASK;
|
@ -15,7 +15,6 @@ DEFAULT_PACKAGES += \
|
||||
kmod-usb3 kmod-usb-dwc3 kmod-usb-dwc3-qcom \
|
||||
kmod-leds-gpio kmod-gpio-button-hotplug \
|
||||
kmod-ath11k-ahb wpad-openssl uboot-envtools \
|
||||
kmod-qca-nss-dp nss-firmware-ipq6018 kmod-qca-nss-drv-64 \
|
||||
kmod-qca-nss-drv-pppoe-64 kmod-qca-nss-ecm-64
|
||||
kmod-qca-nss-dp nss-firmware-ipq6018
|
||||
|
||||
$(eval $(call BuildTarget))
|
||||
|
Loading…
Reference in New Issue
Block a user