Add more feautues for ENETC v4 - round 2
Subsystems (5)
Wei Fang
maintainerv3 cover Add more feautues for ENETC v4 - round 2
This patch set adds the following features.
1. Compared with ENETC v1, the formats of tables and command BD of ENETC v4 have changed significantly, and the two are not compatible. Therefore, in order to support the NETC Table Management Protocol (NTMP) v2.0, we introduced the netc-lib driver and added support for MAC address filter table and RSS table.
2. Add MAC filter and VLAN filter support for i.MX95 ENETC PF.
3. Add RSS support for i.MX95 ENETC PF.
4. Add loopback support for i.MX95 ENETC PF.
---
v1 Link: https://lore.kernel.org/imx/[email protected]/
v2 changes
1. Change NTMP_FILL_CRD() and NTMP_FILL_CRD_EID to functions
2. Fix the compile warning in enetc4_pf.c
v2 Link: https://lore.kernel.org/imx/[email protected]/
v3 changes
1. Rename ntmp_formats.h to ntmp_private.h, becuase in addition to defining some table formats, some macros and function declarations will be added to this header file in the future
2. Add struct ntmp_dma_buf, so refactor ntmp_alloc_data_mem() and ntmp_free_data_mem() accordingly
3. Add the setting for cache attributes of command BD Ring in enetc4_setup_cbdr()
4. Remove __free() and scoped_guard() from patch "net: enetc: add MAC filter for i.MX95 ENETC PF", as these cleanup APIs are discouraged within networking drivers.
5. Remove patch "net: enetc: make enetc_set_rxfh() and enetc_get_rxfh() reusable" in v2, and add enetc_set_rss_key() and enetc_get_rss_key() instead of adding .set_rss_key() and .get_rss_key() to enetc_pf_ops
6. Separate patch " net: enetc: check if the RSS hfunc is toeplitz" from patch "net: enetc: add RSS support for i.MX95 ENETC PF"
---
Wei Fang (13):
net: enetc: add initial netc-lib driver to support NTMP
net: enetc: add command BD ring support for i.MX95 ENETC
net: enetc: move generic MAC filterng interfaces to enetc-core
net: enetc: add MAC filter for i.MX95 ENETC PF
net: enetc: add debugfs interface to dump MAC filter
net: enetc: add RSS support for i.MX95 ENETC PF
net: enetc: check if the RSS hfunc is toeplitz
net: enetc: enable RSS feature by default
net: enetc: move generic VLAN filter interfaces to enetc-core
net: enetc: move generic VLAN hash filter functions to
enetc_pf_common.c
net: enetc: add VLAN filtering support for i.MX95 ENETC PF
net: enetc: add loopback support for i.MX95 ENETC PF
MAINTAINERS: add new file ntmp.h to ENETC driver
MAINTAINERS | 1 + drivers/net/ethernet/freescale/enetc/Kconfig | 11 + drivers/net/ethernet/freescale/enetc/Makefile | 4 + drivers/net/ethernet/freescale/enetc/enetc.c | 103 +++- drivers/net/ethernet/freescale/enetc/enetc.h | 59 +- .../ethernet/freescale/enetc/enetc4_debugfs.c | 93 +++ .../ethernet/freescale/enetc/enetc4_debugfs.h | 20 + .../net/ethernet/freescale/enetc/enetc4_hw.h | 12 + .../net/ethernet/freescale/enetc/enetc4_pf.c | 529 +++++++++++++++++- .../net/ethernet/freescale/enetc/enetc_cbdr.c | 69 ++- .../ethernet/freescale/enetc/enetc_ethtool.c | 76 ++- .../net/ethernet/freescale/enetc/enetc_hw.h | 6 + .../net/ethernet/freescale/enetc/enetc_pf.c | 124 +--- .../net/ethernet/freescale/enetc/enetc_pf.h | 30 +- .../freescale/enetc/enetc_pf_common.c | 46 +- .../freescale/enetc/enetc_pf_common.h | 2 + .../net/ethernet/freescale/enetc/enetc_vf.c | 19 +- drivers/net/ethernet/freescale/enetc/ntmp.c | 458 +++++++++++++++ .../ethernet/freescale/enetc/ntmp_private.h | 67 +++ include/linux/fsl/ntmp.h | 178 ++++++ 20 files changed, 1716 insertions(+), 191 deletions(-) create mode 100644 drivers/net/ethernet/freescale/enetc/enetc4_debugfs.c create mode 100644 drivers/net/ethernet/freescale/enetc/enetc4_debugfs.h create mode 100644 drivers/net/ethernet/freescale/enetc/ntmp.c create mode 100644 drivers/net/ethernet/freescale/enetc/ntmp_private.h create mode 100644 include/linux/fsl/ntmp.h
Signature · 1 line
2.34.1
Wei Fang
maintainerPATCH v3 1/13 net: enetc: add initial netc-lib driver to support NTMP
Some NETC functionality is controlled using control messages sent to the hardware using BD ring interface with 32B descriptor similar to transmit BD ring used on ENETC. This BD ring interface is referred to as command BD ring. It is used to configure functionality where the underlying resources may be shared between different entities or being too large to configure using direct registers. Therefore, a messaging protocol called NETC Table Management Protocol (NTMP) is provided for exchanging configuration and management information between the software and the hardware using the command BD ring interface.
For i.MX95, NTMP has been upgraded to version 2.0, which is incompatible with LS1028A, because the message formats have been changed. Therefore, add the netc-lib driver to support NTMP 2.0 to operate various tables. Note that, only MAC address filter table and RSS table are supported at the moment. More tables will be supported in subsequent patches.
It is worth mentioning that the purpose of the netc-lib driver is to provide some NTMP-based generic interfaces for ENETC and NETC Switch drivers. Currently, it only supports the configurations of some tables. Interfaces such as tc flower and debugfs will be added in the future.
--- drivers/net/ethernet/freescale/enetc/Kconfig | 11 + drivers/net/ethernet/freescale/enetc/Makefile | 3 + drivers/net/ethernet/freescale/enetc/ntmp.c | 458 ++++++++++++++++++ .../ethernet/freescale/enetc/ntmp_private.h | 67 +++ include/linux/fsl/ntmp.h | 178 +++++++ 5 files changed, 717 insertions(+) create mode 100644 drivers/net/ethernet/freescale/enetc/ntmp.c create mode 100644 drivers/net/ethernet/freescale/enetc/ntmp_private.h create mode 100644 include/linux/fsl/ntmp.h
drivers/net/ethernet/freescale/enetc/Kconfig +11 -0
@@ -15,6 +15,16 @@ config NXP_ENETC_PF_COMMON If compiled as module (M), the module name is nxp-enetc-pf-common. +config NXP_NETC_LIB + tristate "NETC Library" + help + This module provides common functionalities for both ENETC and NETC + Switch, such as NETC Table Management Protocol (NTMP) 2.0, common tc + flower and debugfs interfaces and so on. + + If compiled as module (M), the module name is nxp-netc-lib. + + config FSL_ENETC tristate "ENETC PF driver" depends on PCI_MSI
@@ -40,6 +50,7 @@ config NXP_ENETC4 select FSL_ENETC_CORE select FSL_ENETC_MDIO select NXP_ENETC_PF_COMMON + select NXP_NETC_LIB select PHYLINK select DIMLIB help
drivers/net/ethernet/freescale/enetc/Makefile +3 -0
@@ -6,6 +6,9 @@ fsl-enetc-core-y := enetc.o enetc_cbdr.o enetc_ethtool.o obj-$(CONFIG_NXP_ENETC_PF_COMMON) += nxp-enetc-pf-common.o nxp-enetc-pf-common-y := enetc_pf_common.o +obj-$(CONFIG_NXP_NETC_LIB) += nxp-netc-lib.o +nxp-netc-lib-y := ntmp.o + obj-$(CONFIG_FSL_ENETC) += fsl-enetc.o fsl-enetc-y := enetc_pf.o fsl-enetc-$(CONFIG_PCI_IOV) += enetc_msg.o
drivers/net/ethernet/freescale/enetc/ntmp.c new file +458 -0
458 lines not on this page · raw message
drivers/net/ethernet/freescale/enetc/ntmp_private.h new file +67 -0
67 lines not on this page · raw message
include/linux/fsl/ntmp.h new file +178 -0
178 lines not on this page · raw message
Signature · 1 line
2.34.1
Jakub Kicinski
maintainerRe: [PATCH v3 net-next 01/13] net: enetc: add initial netc-lib driver to support NTMP
drivers/net/ethernet/freescale/enetc/Kconfig config NXP_ENETC_PF_COMMON · line 19
Quoted 2 lines · On Tue, 4 Mar 2025 15:21:49 +0800 Wei Fang wrote:
drivers/net/ethernet/freescale/enetc/Kconfig +2
-0+config NXP_NETC_LIB + tristate "NETC Library"
Remove the string after "tristate", the user should not be prompted to make a choice for this, since the consumers "select" this config directly.
drivers/net/ethernet/freescale/enetc/Kconfig config NXP_ENETC_PF_COMMON · line 25
Quoted 6 lines
drivers/net/ethernet/freescale/enetc/Kconfig +6
-0+ help + This module provides common functionalities for both ENETC and NETC + Switch, such as NETC Table Management Protocol (NTMP) 2.0, common tc + flower and debugfs interfaces and so on. + + If compiled as module (M), the module name is nxp-netc-lib.
Not sure if the help makes sense for an invisible symbol either.
drivers/net/ethernet/freescale/enetc/Kconfig config NXP_ENETC4
Quoted 13 lines
config
FSL_ENETCdrivers/net/ethernet/freescale/enetc/Kconfig +2
-0tristate "ENETC PF driver" depends on PCI_MSI@@ -40,6 +50,7 @@ config NXP_ENETC4 select FSL_ENETC_CORE select FSL_ENETC_MDIO select NXP_ENETC_PF_COMMON + select NXP_NETC_LIB select PHYLINK select DIMLIB help +#pragma pack(1)
please don't blindly pack all structs, only if they are misaligned or will otherwise have holes.
Quoted 1 line
+#if
IS_ENABLED(CONFIG_NXP_NETC_LIB)
why the ifdef, all callers select the config option
Wei Fang
maintainerRE: [PATCH v3 net-next 01/13] net: enetc: add initial netc-lib driver to support NTMP
Quoted 8 lines · On Tue, 4 Mar 2025 15:21:49 +0800 Wei Fang wrote:
drivers/net/ethernet/freescale/enetc/Kconfig config NXP_ENETC_PF_COMMON · line 19
Quoted 2 lines
drivers/net/ethernet/freescale/enetc/Kconfig +2
-0+config NXP_NETC_LIB + tristate "NETC Library"Remove the string after "tristate", the user should not be prompted to make a choice for this, since the consumers "select" this config directly.
Okay, I will remove it.
Quoted 9 lines
drivers/net/ethernet/freescale/enetc/Kconfig config NXP_ENETC_PF_COMMON
Quoted 3 lines
drivers/net/ethernet/freescale/enetc/Kconfig +3
-0+ help + This module provides common functionalities for both ENETC and NETC + Switch, such as NETC Table Management Protocol (NTMP) 2.0, commontc
drivers/net/ethernet/freescale/enetc/Kconfig config NXP_ENETC_PF_COMMON · line 25
Quoted 3 lines
drivers/net/ethernet/freescale/enetc/Kconfig +3
-0+ flower and debugfs interfaces and so on. + + If compiled as module (M), the module name is nxp-netc-lib.Not sure if the help makes sense for an invisible symbol either.
Yes, I think it can also be removed. Thanks.
Quoted 13 lines
Quoted 12 lines
config
FSL_ENETCdrivers/net/ethernet/freescale/enetc/Kconfig +1
-0tristate "ENETC PF driver" depends on PCI_MSI@@ -40,6 +50,7 @@ config NXP_ENETC4 select FSL_ENETC_CORE select FSL_ENETC_MDIO select NXP_ENETC_PF_COMMON + select NXP_NETC_LIB select PHYLINK select DIMLIB help
Quoted 4 lines
Quoted 1 line
+#pragma pack(1)
please don't blindly pack all structs, only if they are misaligned or will otherwise have holes.
Because these structures are in hardware buffer format and need to be aligned, so for convenience, I simply used pack(1). You are right, I should use pack() for structures with holes. Thanks.
Quoted 4 lines
Quoted 2 lines
+#if
IS_ENABLED(CONFIG_NXP_NETC_LIB)why the ifdef, all callers select the config option
hm..., there are some interfaces of netc-lib are used in common .c files in downstream, so I used "ifdef" in downstream. Now for the upstream, I'm going to separate them from the common .c files. So yes, we can remove it now.
Wei Fang
maintainerRE: [PATCH v3 net-next 01/13] net: enetc: add initial netc-lib driver to support NTMP
Quoted 45 lines
Quoted 8 lines · On Tue, 4 Mar 2025 15:21:49 +0800 Wei Fang wrote:
drivers/net/ethernet/freescale/enetc/Kconfig config NXP_ENETC_PF_COMMON · line 19
Quoted 2 lines
drivers/net/ethernet/freescale/enetc/Kconfig +2
-0+config NXP_NETC_LIB + tristate "NETC Library"Remove the string after "tristate", the user should not be prompted to make a choice for this, since the consumers "select" this config directly.
Okay, I will remove it.
Quoted 3 lines
drivers/net/ethernet/freescale/enetc/Kconfig config NXP_ENETC_PF_COMMON
Quoted 3 lines
drivers/net/ethernet/freescale/enetc/Kconfig +3
-0+ help + This module provides common functionalities for both ENETC and NETC + Switch, such as NETC Table Management Protocol (NTMP) 2.0,common
Quoted 6 lines
tc
drivers/net/ethernet/freescale/enetc/Kconfig config NXP_ENETC_PF_COMMON · line 25
Quoted 3 lines
drivers/net/ethernet/freescale/enetc/Kconfig +3
-0+ flower and debugfs interfaces and so on. + + If compiled as module (M), the module name is nxp-netc-lib.Not sure if the help makes sense for an invisible symbol either.
Yes, I think it can also be removed. Thanks.
Quoted 13 lines
Quoted 12 lines
config
FSL_ENETCdrivers/net/ethernet/freescale/enetc/Kconfig +1
-0tristate "ENETC PF driver" depends on PCI_MSI@@ -40,6 +50,7 @@ config NXP_ENETC4 select FSL_ENETC_CORE select FSL_ENETC_MDIO select NXP_ENETC_PF_COMMON + select NXP_NETC_LIB select PHYLINK select DIMLIB helpQuoted 4 lines
Quoted 1 line
+#pragma pack(1)
please don't blindly pack all structs, only if they are misaligned or will otherwise have holes.
Because these structures are in hardware buffer format and need to be aligned, so for convenience, I simply used pack(1). You are right, I should use
pack()for structures with holes. Thanks.Quoted 1 line
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
+#if
IS_ENABLED(CONFIG_NXP_NETC_LIB)why the ifdef, all callers select the config option
hm..., there are some interfaces of netc-lib are used in common .c files in downstream, so I used "ifdef" in downstream. Now for the upstream, I'm going to separate them from the common .c files. So yes, we can remove it now.
Sorry, I misread the header file. The ifdef in ntmp.h is needed because the interfaces in this header file will be used by the enetc-core and enetc-vf drivers. For the ENETC v1 (LS1028A platform), it will not select NXP_NETC_LIB.
Jakub Kicinski
maintainerRe: [PATCH v3 net-next 01/13] net: enetc: add initial netc-lib driver to support NTMP
Quoted 10 lines · On Sat, 8 Mar 2025 02:05:35 +0000 Wei Fang wrote:
Quoted 5 lines
Quoted 1 line · On Tue, 4 Mar 2025 15:21:49 +0800 Wei Fang wrote:
hm..., there are some interfaces of netc-lib are used in common .c files in downstream, so I used "ifdef" in downstream. Now for the upstream, I'm going to separate them from the common .c files. So yes, we can remove it now.
Sorry, I misread the header file. The ifdef in
ntmp.his needed because the interfaces in this header file will be used by the enetc-core and enetc-vf drivers. For the ENETC v1 (LS1028A platform), it will not selectNXP_NETC_LIB.
Meaning FSL_ENETC ? And the calls are in FSL_ENETC_CORE ?
Wei Fang
maintainerRE: [PATCH v3 net-next 01/13] net: enetc: add initial netc-lib driver to support NTMP
Quoted 7 lines · On Sat, 8 Mar 2025 02:05:35 +0000 Wei Fang wrote:
Quoted 6 lines
Quoted 5 lines
Quoted 1 line · On Tue, 4 Mar 2025 15:21:49 +0800 Wei Fang wrote:
hm..., there are some interfaces of netc-lib are used in common .c files in downstream, so I used "ifdef" in downstream. Now for the upstream, I'm going to separate them from the common .c files. So yes, we can remove it now.
Quoted 6 lines
Quoted 4 lines
Sorry, I misread the header file. The ifdef in
ntmp.his needed because the interfaces in this header file will be used by the enetc-core and enetc-vf drivers. For the ENETC v1 (LS1028A platform), it will not selectNXP_NETC_LIB.Meaning
FSL_ENETC? And the calls are inFSL_ENETC_CORE?
Yes, ENETC v1 uses FSL_ENETC, and some of the functions in ntmp.h are called in FSL_ENETC_CORE, enetc-core is common driver which provides interfaces to ENETC (v1 and v4) PF and VF drivers.
Wei Fang
maintainerPATCH v3 2/13 net: enetc: add command BD ring support for i.MX95 ENETC
In reply to Wei FangThe command BD ring is used to configure functionality where the underlying resources may be shared between different entities or being too large to configure using direct registers (such as lookup tables).
Because the command BD and table formats of i.MX95 and LS1028A are very different, the software processing logic is also different. In order to ensure driver compatibility, struct enetc_si_ops is introduced. This structure defines some hooks shared by VSI and PSI. Different hardware driver will register different hooks, For example, setup_cbdr() is used to initialize the command BD ring, and teardown_cbdr() is used to free the command BD ring.
--- drivers/net/ethernet/freescale/enetc/enetc.h | 27 +++++++-- .../net/ethernet/freescale/enetc/enetc4_pf.c | 47 +++++++++++++++- .../net/ethernet/freescale/enetc/enetc_cbdr.c | 55 +++++++++++++++++-- .../net/ethernet/freescale/enetc/enetc_pf.c | 13 +++-- .../net/ethernet/freescale/enetc/enetc_vf.c | 13 +++-- 5 files changed, 136 insertions(+), 19 deletions(-)
drivers/net/ethernet/freescale/enetc/enetc.h +23 -4
@@ -8,6 +8,7 @@#include <linux/dma-mapping.h> #include <linux/skbuff.h> #include <linux/ethtool.h> +#include <linux/fsl/ntmp.h> #include <linux/if_vlan.h> #include <linux/phylink.h> #include <linux/dim.h>
@@ -266,6 +267,19 @@ struct enetc_platform_info {const struct enetc_drvdata *data; }; +struct enetc_si ; + +/* +* This structure defines the some common hooks for ENETC PSI and VSI. +* In addition, since VSI only uses the struct enetc_si as its private +* driver data, so this structure also define some hooks specifically +* for VSI. For VSI-specific hooks, the format is ‘vf_*()’. +*/ +struct enetc_si_ops { +int (*setup_cbdr)(struct enetc_si *si); +void (*teardown_cbdr)(struct enetc_si *si); +}; +/* PCI IEP device data */ struct enetc_si {struct pci_dev *pdev;
@@ -274,7 +288,10 @@ struct enetc_si {struct net_device *ndev;/* back ref. */ -struct enetc_cbdr cbd_ring; +union { +struct enetc_cbdr cbd_ring;/* Only ENETC 1.0 */ +struct ntmp_priv ntmp;/* ENETC 4.1 and later */ + };int num_rx_rings;/* how many rings are available in the SI */ int num_tx_rings;
@@ -284,6 +301,7 @@ struct enetc_si {u16 revision;int hw_features;const struct enetc_drvdata *drvdata; +const struct enetc_si_ops *ops; };#define ENETC_SI_ALIGN 32
@@ -490,9 +508,10 @@ void enetc_mm_link_state_update(struct enetc_ndev_priv *priv, bool link);void enetc_mm_commit_preemptible_tcs (struct enetc_ndev_priv *priv);/* control buffer descriptor ring (CBDR) */ -int enetc_setup_cbdr (struct device *dev,struct enetc_hw *hw,int bd_count, -struct enetc_cbdr *cbdr); -void enetc_teardown_cbdr (struct enetc_cbdr *cbdr); +int enetc_setup_cbdr (struct enetc_si *si); +void enetc_teardown_cbdr (struct enetc_si *si); +int enetc4_setup_cbdr (struct enetc_si *si); +void enetc4_teardown_cbdr (struct enetc_si *si);int enetc_set_mac_flt_entry (struct enetc_si *si,int index,char *mac_addr,int si_map);int enetc_clear_mac_flt_entry (struct enetc_si *si,int index);
drivers/net/ethernet/freescale/enetc/enetc4_pf.c +46 -1
89 lines not on this page · raw message
drivers/net/ethernet/freescale/enetc/enetc_cbdr.c +49 -6
85 lines not on this page · raw message
drivers/net/ethernet/freescale/enetc/enetc_pf.c +9 -4
@@ -939,6 +939,11 @@ static int enetc_pf_register_with_ierb(struct pci_dev *pdev)return enetc_ierb_register_pf (ierb_pdev, pdev); } +static const struct enetc_si_ops enetc_psi_ops = { + .setup_cbdr = enetc_setup_cbdr, + .teardown_cbdr = enetc_teardown_cbdr, +}; +static struct enetc_si *enetc_psi_create (struct pci_dev *pdev) {struct enetc_si *si;
@@ -957,6 +962,7 @@ static struct enetc_si *enetc_psi_create(struct pci_dev *pdev) goto out_pci_remove; } + si->ops = &enetc_psi_ops; si->revision =enetc_get_ip_revision (&si->hw); err =enetc_get_driver_data (si);if (err) {
@@ -964,8 +970,7 @@ static struct enetc_si *enetc_psi_create(struct pci_dev *pdev) goto out_pci_remove; } - err =enetc_setup_cbdr (&pdev->dev, &si->hw,ENETC_CBDR_DEFAULT_SIZE , - &si->cbd_ring); + err = si->ops->setup_cbdr (si);if (err) goto out_pci_remove;
@@ -984,7 +989,7 @@ static struct enetc_si *enetc_psi_create(struct pci_dev *pdev)return si; out_teardown_cbdr: -enetc_teardown_cbdr (&si->cbd_ring); + si->ops->teardown_cbdr (si); out_pci_remove:enetc_pci_remove (pdev); out:
@@ -995,7 +1000,7 @@ static void enetc_psi_destroy(struct pci_dev *pdev) {struct enetc_si *si =pci_get_drvdata (pdev); -enetc_teardown_cbdr (&si->cbd_ring); + si->ops->teardown_cbdr (si);enetc_pci_remove (pdev); }
drivers/net/ethernet/freescale/enetc/enetc_vf.c +9 -4
@@ -162,6 +162,11 @@ static void enetc_vf_netdev_setup(struct enetc_si *si, struct net_device *ndev,enetc_load_primary_mac_addr (&si->hw, ndev); } +static const struct enetc_si_ops enetc_vsi_ops = { + .setup_cbdr = enetc_setup_cbdr, + .teardown_cbdr = enetc_teardown_cbdr, +}; +static int enetc_vf_probe (struct pci_dev *pdev,const struct pci_device_id *ent) {
@@ -176,6 +181,7 @@ static int enetc_vf_probe(struct pci_dev *pdev, si =pci_get_drvdata (pdev); si->revision =ENETC_REV_1_0 ; + si->ops = &enetc_vsi_ops; err =enetc_get_driver_data (si);if (err) { dev_err_probe(&pdev->dev, err,
@@ -198,8 +204,7 @@ static int enetc_vf_probe(struct pci_dev *pdev,enetc_init_si_rings_params (priv); - err =enetc_setup_cbdr (priv->dev, &si->hw,ENETC_CBDR_DEFAULT_SIZE , - &si->cbd_ring); + err = si->ops->setup_cbdr (si);if (err) goto err_setup_cbdr;
@@ -235,7 +240,7 @@ static int enetc_vf_probe(struct pci_dev *pdev, err_alloc_msix:enetc_free_si_resources (priv); err_alloc_si_res: -enetc_teardown_cbdr (&si->cbd_ring); + si->ops->teardown_cbdr (si); err_setup_cbdr: si->ndev =NULL ;free_netdev (ndev);
@@ -256,7 +261,7 @@ static void enetc_vf_remove(struct pci_dev *pdev)enetc_free_msix (priv);enetc_free_si_resources (priv); -enetc_teardown_cbdr (&si->cbd_ring); + si->ops->teardown_cbdr (si);free_netdev (si->ndev);
Signature · 1 line
2.34.1
Wei Fang
maintainerPATCH v3 3/13 net: enetc: move generic MAC filterng interfaces to enetc-core
In reply to Wei FangAlthough only ENETC PF can access the MAC address filter table, the table entries can specify MAC address filtering for one or more SIs based on SI_BITMAP, which means that the table also supports MAC address filtering for VFs.
Currently, only the ENETC v1 PF driver supports MAC address filtering. In order to add the MAC address filtering support for the ENETC v4 PF driver and VF driver in the future, the relevant generic interfaces are moved to the enetc-core driver. At the same time, the struct enetc_mac_filter is moved from enetc_pf to enetc_si, because enetc_si is a structure shared by PF and VFs. This lays the basis for i.MX95 ENETC PF and VFs to support MAC address filtering.
--- drivers/net/ethernet/freescale/enetc/enetc.c | 36 ++++++++++++++ drivers/net/ethernet/freescale/enetc/enetc.h | 17 +++++++ .../net/ethernet/freescale/enetc/enetc_pf.c | 49 +++---------------- .../net/ethernet/freescale/enetc/enetc_pf.h | 14 ------ 4 files changed, 60 insertions(+), 56 deletions(-)
drivers/net/ethernet/freescale/enetc/enetc.c +36 -0
@@ -36,6 +36,42 @@ static void enetc_change_preemptible_tcs(struct enetc_ndev_priv *priv,enetc_mm_commit_preemptible_tcs (priv); } +static int enetc_mac_addr_hash_idx (const u8 *addr) +{ +u64 fold =__swab64 (ether_addr_to_u64 (addr)) >>16 ; +u64 mask =0 ; +int res =0 ; +int i; + +for (i =0 ; i <8 ; i++) + mask |=BIT_ULL (i *6 ); + +for (i =0 ; i <6 ; i++) + res |= (hweight64 (fold & (mask << i)) &0x1 ) << i; + +return res; +} + +void enetc_add_mac_addr_ht_filter (struct enetc_mac_filter *filter, +const unsigned char *addr) +{ +int idx =enetc_mac_addr_hash_idx (addr); + +/* add hash table entry */ +__set_bit (idx, filter->mac_hash_table); + filter->mac_addr_cnt++; +} +EXPORT_SYMBOL_GPL (enetc_add_mac_addr_ht_filter); + +void enetc_reset_mac_addr_filter (struct enetc_mac_filter *filter) +{ + filter->mac_addr_cnt =0 ; + +bitmap_zero (filter->mac_hash_table, +ENETC_MADDR_HASH_TBL_SZ ); +} +EXPORT_SYMBOL_GPL (enetc_reset_mac_addr_filter); +static int enetc_num_stack_tx_queues (struct enetc_ndev_priv *priv) {int num_tx_rings = priv->num_tx_rings;
drivers/net/ethernet/freescale/enetc/enetc.h +17 -0
@@ -23,6 +23,18 @@#define ENETC_CBD_DATA_MEM_ALIGN 64 +#define ENETC_MADDR_HASH_TBL_SZ 64 + +enum enetc_mac_addr_type {UC ,MC ,MADDR_TYPE }; + +struct enetc_mac_filter { +union { +char mac_addr[ETH_ALEN ]; + DECLARE_BITMAP(mac_hash_table, ENETC_MADDR_HASH_TBL_SZ); + }; +int mac_addr_cnt; +}; + struct enetc_tx_swbd { union { struct sk_buff *skb;
@@ -302,6 +314,8 @@ struct enetc_si {int hw_features;const struct enetc_drvdata *drvdata;const struct enetc_si_ops *ops; + +struct enetc_mac_filter mac_filter[MADDR_TYPE ]; };#define ENETC_SI_ALIGN 32
@@ -484,6 +498,9 @@ int enetc_alloc_si_resources(struct enetc_ndev_priv *priv);void enetc_free_si_resources (struct enetc_ndev_priv *priv);int enetc_configure_si (struct enetc_ndev_priv *priv);int enetc_get_driver_data (struct enetc_si *si); +void enetc_add_mac_addr_ht_filter (struct enetc_mac_filter *filter, +const unsigned char *addr); +void enetc_reset_mac_addr_filter (struct enetc_mac_filter *filter);int enetc_open (struct net_device *ndev);int enetc_close (struct net_device *ndev);
drivers/net/ethernet/freescale/enetc/enetc_pf.c +7 -42
94 lines not on this page · raw message
drivers/net/ethernet/freescale/enetc/enetc_pf.h +0 -14
@@ -6,18 +6,6 @@#define ENETC_PF_NUM_RINGS 8 -enum enetc_mac_addr_type {UC ,MC ,MADDR_TYPE }; -#define ENETC_MAX_NUM_MAC_FLT ((ENETC_MAX_NUM_VFS + 1) * MADDR_TYPE) - -#define ENETC_MADDR_HASH_TBL_SZ 64 -struct enetc_mac_filter { -union { -char mac_addr[ETH_ALEN ]; - DECLARE_BITMAP(mac_hash_table, ENETC_MADDR_HASH_TBL_SZ); - }; -int mac_addr_cnt; -}; -#define ENETC_VLAN_HT_SIZE 64enum enetc_vf_flags {
@@ -52,8 +40,6 @@ struct enetc_pf {int total_vfs;/* max number of VFs, set for PF at probe */ struct enetc_vf_state *vf_state; -struct enetc_mac_filter mac_filter[ENETC_MAX_NUM_MAC_FLT ]; -struct enetc_msg_swbd rxmsg[ENETC_MAX_NUM_VFS ];struct work_struct msg_task;char msg_int_name[ENETC_INT_NAME_MAX ];
Signature · 1 line
2.34.1
Wei Fang
maintainerPATCH v3 4/13 net: enetc: add MAC filter for i.MX95 ENETC PF
In reply to Wei FangThe i.MX95 ENETC supports both MAC hash filter and MAC exact filter. MAC hash filter is implenented through a 64-bits hash table to match against the hashed addresses, PF and VFs each have two MAC hash tables, one is for unicast and the other one is for multicast. But MAC exact filter is shared between SIs (PF and VFs), each table entry contains a MAC address that may be unicast or multicast and the entry also contains an SI bitmap field that indicates for which SIs the entry is valid.
For i.MX95 ENETC, MAC exact filter only has 4 entries. According to the observation of the system default network configuration, the MAC filter will be configured with multiple multicast addresses, so MAC exact filter does not have enough entries to implement multicast filtering. Therefore, the current MAC exact filter is only used for unicast filtering. If the number of unicast addresses exceeds 4, then MAC hash filter is used.
Note that both MAC hash filter and MAC exact filter can only be accessed by PF, VFs can notify PF to set its corresponding MAC filter through the mailbox mechanism of ENETC. But currently MAC filter is only added for i.MX95 ENETC PF. The MAC filter support of ENETC VFs will be supported in subsequent patches.
--- drivers/net/ethernet/freescale/enetc/enetc.h | 2 + .../net/ethernet/freescale/enetc/enetc4_hw.h | 8 + .../net/ethernet/freescale/enetc/enetc4_pf.c | 418 +++++++++++++++++- .../net/ethernet/freescale/enetc/enetc_hw.h | 6 + .../net/ethernet/freescale/enetc/enetc_pf.h | 11 + 5 files changed, 444 insertions(+), 1 deletion(-)
drivers/net/ethernet/freescale/enetc/enetc.h +2 -0
@@ -316,6 +316,8 @@ struct enetc_si {const struct enetc_si_ops *ops;struct enetc_mac_filter mac_filter[MADDR_TYPE ]; +struct workqueue_struct *workqueue; +struct work_struct rx_mode_task; };#define ENETC_SI_ALIGN 32
drivers/net/ethernet/freescale/enetc/enetc4_hw.h +8 -0
@@ -99,6 +99,14 @@#define ENETC4_PSICFGR2 (a) ((a) * 0x80 + 0x2018)#define PSICFGR2_NUM_MSIX GENMASK(5, 0) +/* Port station interface a unicast MAC hash filter register 0/1 */ +#define ENETC4_PSIUMHFR0 (a) ((a) * 0x80 + 0x2050) +#define ENETC4_PSIUMHFR1 (a) ((a) * 0x80 + 0x2054) + +/* Port station interface a multicast MAC hash filter register 0/1 */ +#define ENETC4_PSIMMHFR0 (a) ((a) * 0x80 + 0x2058) +#define ENETC4_PSIMMHFR1 (a) ((a) * 0x80 + 0x205c) +#define ENETC4_PMCAPR 0x4004#define PMCAPR_HD BIT(8)#define PMCAPR_FP GENMASK(10, 9)
drivers/net/ethernet/freescale/enetc/enetc4_pf.c +417 -1
483 lines not on this page · raw message
drivers/net/ethernet/freescale/enetc/enetc_hw.h +6 -0
@@ -712,6 +712,12 @@ static inline void enetc_load_primary_mac_addr(struct enetc_hw *hw,eth_hw_addr_set (ndev, addr); } +static inline void enetc_get_primary_mac_addr (struct enetc_hw *hw,u8 *addr) +{ + *(u32 *)addr =__raw_readl (hw->reg +ENETC_SIPMAR0 ); + *(u16 *)(addr +4 ) =__raw_readw (hw->reg +ENETC_SIPMAR1 ); +} +#define ENETC_SI_INT_IDX 0/* base index for Rx/Tx interrupts */ #define ENETC_BDR_INT_BASE_IDX 1
drivers/net/ethernet/freescale/enetc/enetc_pf.h +11 -0
@@ -22,6 +22,13 @@ struct enetc_port_caps {int num_msix;int num_rx_bdr;int num_tx_bdr; +int mac_filter_num; +}; + +struct enetc_mac_list_entry { +u8 mac[ETH_ALEN ]; +u16 si_bitmap; +struct hlist_node node; };struct enetc_pf ;
@@ -57,6 +64,10 @@ struct enetc_pf {struct enetc_port_caps caps;const struct enetc_pf_ops *ops; + +struct hlist_head mac_list;/* MAC address filter table */ +struct mutex mac_list_lock;/* mac_list lock */ +int num_mfe;/* number of mac address filter table entries */ };#define phylink_to_enetc_pf (config) \
Signature · 1 line
2.34.1
Paolo Abeni
maintainerRe: [PATCH v3 net-next 04/13] net: enetc: add MAC filter for i.MX95 ENETC PF
drivers/net/ethernet/freescale/enetc/enetc4_pf.c static void enetc4_pf_get_si_primary_mac(struct enetc_hw *hw, int si, · line 165
Quoted 12 lines · Wei Fang
drivers/net/ethernet/freescale/enetc/enetc4_pf.c +12
-0+static void enetc_mac_list_del_matched_entries (struct enetc_pf *pf,u16 si_bit, +struct enetc_mac_addr *mac, +int mac_cnt) +{ +struct enetc_mac_list_entry *entry; +int i; + +for (i =0 ; i < mac_cnt; i++) { + entry =enetc_mac_list_lookup_entry (pf, mac[i].addr); +if (entry) { + entry->si_bitmap &= ~si_bit; +if (!entry->si_bitmap) {
Minor nit: here and elsewhere you could reduce the level of indentation restructoring the code as:
if (!entry) continue; entry->si_bitmap &= ~si_bit; if (entry->si_bitmap) continue;
/P
Wei Fang
maintainerRE: [PATCH v3 net-next 04/13] net: enetc: add MAC filter for i.MX95 ENETC PF
Quoted 18 lines · Wei Fang
Quoted 1 line
+static void enetc_mac_list_del_matched_entries(struct
enetc_pf*pf, u16
si_bit,drivers/net/ethernet/freescale/enetc/enetc4_pf.c static void enetc4_pf_get_si_primary_mac(struct enetc_hw *hw, int si, · line 165
Quoted 11 lines
drivers/net/ethernet/freescale/enetc/enetc4_pf.c +11
-0+ struct enetc_mac_addr *mac, + int mac_cnt) +{ +struct enetc_mac_list_entry *entry; +int i; + +for (i =0 ; i < mac_cnt; i++) { + entry =enetc_mac_list_lookup_entry (pf, mac[i].addr); +if (entry) { + entry->si_bitmap &= ~si_bit; +if (!entry->si_bitmap) {Minor nit: here and elsewhere you could reduce the level of indentation restructoring the code as:
Okay, I will improve it, thanks.
Quoted 8 lines
if (!entry) continue; entry->si_bitmap &= ~si_bit; if (entry->si_bitmap) continue;/P
Wei Fang
maintainerPATCH v3 5/13 net: enetc: add debugfs interface to dump MAC filter
In reply to Wei FangENETC's MAC filter consists of hash MAC filter and exact MAC filter. Hash MAC filter is a 64-entry hash table consisting of two 32-bit registers. Exact MAC filter is implemented by configuring MAC address filter table through command BD ring. The table is stored in ENETC's internal memory and needs to be read through command BD ring. In order to facilitate debugging, added a debugfs interface to get the relevant information about MAC filter.
--- drivers/net/ethernet/freescale/enetc/Makefile | 1 + drivers/net/ethernet/freescale/enetc/enetc.h | 1 + .../ethernet/freescale/enetc/enetc4_debugfs.c | 93 +++++++++++++++++++ .../ethernet/freescale/enetc/enetc4_debugfs.h | 20 ++++ .../net/ethernet/freescale/enetc/enetc4_pf.c | 4 + 5 files changed, 119 insertions(+) create mode 100644 drivers/net/ethernet/freescale/enetc/enetc4_debugfs.c create mode 100644 drivers/net/ethernet/freescale/enetc/enetc4_debugfs.h
drivers/net/ethernet/freescale/enetc/Makefile +1 -0
@@ -16,6 +16,7 @@ fsl-enetc-$(CONFIG_FSL_ENETC_QOS) += enetc_qos.o obj-$(CONFIG_NXP_ENETC4) += nxp-enetc4.o nxp-enetc4-y := enetc4_pf.o +nxp-enetc4-$(CONFIG_DEBUG_FS) += enetc4_debugfs.o obj-$(CONFIG_FSL_ENETC_VF) += fsl-enetc-vf.o fsl-enetc-vf-y := enetc_vf.o
drivers/net/ethernet/freescale/enetc/enetc.h +1 -0
@@ -318,6 +318,7 @@ struct enetc_si {struct enetc_mac_filter mac_filter[MADDR_TYPE ];struct workqueue_struct *workqueue;struct work_struct rx_mode_task; +struct dentry *debugfs_root; };#define ENETC_SI_ALIGN 32
drivers/net/ethernet/freescale/enetc/enetc4_debugfs.c new file +93 -0
93 lines not on this page · raw message
drivers/net/ethernet/freescale/enetc/enetc4_debugfs.h new file +20 -0
@@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */ +/* Copyright 2025 NXP */ + +#ifndef __ENETC4_DEBUGFS_H +#define __ENETC4_DEBUGFS_H + +#if IS_ENABLED (CONFIG_DEBUG_FS ) +void enetc_create_debugfs (struct enetc_si *si); +void enetc_remove_debugfs (struct enetc_si *si); +#else +static inline void enetc_create_debugfs (struct enetc_si *si) +{ +} + +static inline void enetc_remove_debugfs (struct enetc_si *si) +{ +} +#endif + +#endif
drivers/net/ethernet/freescale/enetc/enetc4_pf.c +4 -0
@@ -8,6 +8,7 @@#include <linux/unaligned.h> #include "enetc_pf_common.h" +#include "enetc4_debugfs.h" #define ENETC_SI_MAX_RING_NUM 8
@@ -1176,6 +1177,8 @@ static int enetc4_pf_probe(struct pci_dev *pdev,if (err) goto err_netdev_create; +enetc_create_debugfs (si); +return 0 ; err_netdev_create:
@@ -1193,6 +1196,7 @@ static void enetc4_pf_remove(struct pci_dev *pdev)struct enetc_si *si =pci_get_drvdata (pdev);struct enetc_pf *pf =enetc_si_priv (si); +enetc_remove_debugfs (si);enetc4_pf_netdev_destroy (si);enetc4_pf_free (pf);destroy_workqueue (si->workqueue);
Signature · 1 line
2.34.1
Wei Fang
maintainerPATCH v3 6/13 net: enetc: add RSS support for i.MX95 ENETC PF
In reply to Wei FangAdd Receive side scaling (RSS) support for i.MX95 ENETC PF to improve the network performance and balance the CPU loading. The main changes are as follows.
1. Since i.MX95 ENETC (v4) use NTMP 2.0 to manage the RSS table, which is different from LS1028A ENETC (v1). In order to reuse some functions related to the RSS table, so add .get_rss_table() and .set_rss_table() hooks to enetc_si_ops.
2. Since the offset of the RSS key registers of i.MX95 ENETC is also different from that of LS1028A, so add enetc_get_rss_key_base() to get the base offset for the different chips, so that enetc_set_rss_key() and enetc_get_rss_key() can be reused for this trivial.
--- drivers/net/ethernet/freescale/enetc/enetc.c | 7 +- drivers/net/ethernet/freescale/enetc/enetc.h | 6 +- .../net/ethernet/freescale/enetc/enetc4_pf.c | 22 +++--- .../net/ethernet/freescale/enetc/enetc_cbdr.c | 14 ++++ .../ethernet/freescale/enetc/enetc_ethtool.c | 69 +++++++++++++++---- .../net/ethernet/freescale/enetc/enetc_pf.c | 4 +- .../freescale/enetc/enetc_pf_common.c | 6 +- .../net/ethernet/freescale/enetc/enetc_vf.c | 2 + 8 files changed, 95 insertions(+), 35 deletions(-)
drivers/net/ethernet/freescale/enetc/enetc.c +2 -5
@@ -2405,7 +2405,7 @@ static int enetc_setup_default_rss_table(struct enetc_si *si, int num_groups)for (i =0 ; i < si->num_rss; i++) rss_table[i] = i % num_groups; -enetc_set_rss_table (si, rss_table, si->num_rss); + si->ops->set_rss_table (si, rss_table, si->num_rss);kfree (rss_table);
@@ -2436,10 +2436,7 @@ int enetc_configure_si(struct enetc_ndev_priv *priv)if (si->hw_features &ENETC_SI_F_LSO )enetc_set_lso_flags_mask (hw); -/* TODO: RSS support for i.MX95 will be supported later, and the -* is_enetc_rev1() condition will be removed -*/ -if (si->num_rss &&is_enetc_rev1 (si)) { +if (si->num_rss) { err =enetc_setup_default_rss_table (si, priv->num_rx_rings);if (err)return err;
drivers/net/ethernet/freescale/enetc/enetc.h +5 -1
@@ -290,6 +290,8 @@ struct enetc_si;struct enetc_si_ops {int (*setup_cbdr)(struct enetc_si *si);void (*teardown_cbdr)(struct enetc_si *si); +int (*get_rss_table)(struct enetc_si *si,u32 *table,int count); +int (*set_rss_table)(struct enetc_si *si,const u32 *table,int count); };/* PCI IEP device data */
@@ -537,10 +539,12 @@ int enetc_set_mac_flt_entry(struct enetc_si *si, int index,int enetc_clear_mac_flt_entry (struct enetc_si *si,int index);int enetc_set_fs_entry (struct enetc_si *si,struct enetc_cmd_rfse *rfse,int index); -void enetc_set_rss_key (struct enetc_hw *hw,const u8 *bytes); +void enetc_set_rss_key (struct enetc_si *si,const u8 *bytes);int enetc_get_rss_table (struct enetc_si *si,u32 *table,int count);int enetc_set_rss_table (struct enetc_si *si,const u32 *table,int count);int enetc_send_cmd (struct enetc_si *si,struct enetc_cbd *cbd); +int enetc4_get_rss_table (struct enetc_si *si,u32 *table,int count); +int enetc4_set_rss_table (struct enetc_si *si,const u32 *table,int count); static inline void *enetc_cbd_alloc_data_mem(struct enetc_si *si, struct enetc_cbd *cbd,
drivers/net/ethernet/freescale/enetc/enetc4_pf.c +12 -10
@@ -579,22 +579,13 @@ static void enetc4_set_trx_frame_size(struct enetc_pf *pf)enetc4_pf_reset_tc_msdu (&si->hw); } -static void enetc4_set_rss_key (struct enetc_hw *hw,const u8 *bytes) -{ -int i; - -for (i =0 ; i <ENETC_RSSHASH_KEY_SIZE /4 ; i++) -enetc_port_wr (hw,ENETC4_PRSSKR (i), ((u32 *)bytes)[i]); -} -static void enetc4_set_default_rss_key (struct enetc_pf *pf) {u8 hash_key[ENETC_RSSHASH_KEY_SIZE ] = {0 }; -struct enetc_hw *hw = &pf->si->hw;/* set up hash key */ get_random_bytes (hash_key,ENETC_RSSHASH_KEY_SIZE ); -enetc4_set_rss_key (hw, hash_key); +enetc_set_rss_key (pf->si, hash_key); }static void enetc4_enable_trx (struct enetc_pf *pf)
@@ -698,6 +689,14 @@ static void enetc4_pf_set_rx_mode(struct net_device *ndev)queue_work (si->workqueue, &si->rx_mode_task); } +static int enetc4_pf_set_features (struct net_device *ndev, +netdev_features_t features) +{ +enetc_set_features (ndev, features); + +return 0 ; +} +static const struct net_device_ops enetc4_ndev_ops = { .ndo_open = enetc_open, .ndo_stop = enetc_close,
@@ -705,6 +704,7 @@ static const struct net_device_ops enetc4_ndev_ops = { .ndo_get_stats = enetc_get_stats, .ndo_set_mac_address = enetc_pf_set_mac_addr, .ndo_set_rx_mode = enetc4_pf_set_rx_mode, + .ndo_set_features = enetc4_pf_set_features, }; static struct phylink_pcs *
@@ -1113,6 +1113,8 @@ static void enetc4_pf_netdev_destroy(struct enetc_si *si)static const struct enetc_si_ops enetc4_psi_ops = { .setup_cbdr = enetc4_setup_cbdr, .teardown_cbdr = enetc4_teardown_cbdr, + .get_rss_table = enetc4_get_rss_table, + .set_rss_table = enetc4_set_rss_table, };static int enetc4_pf_wq_task_init (struct enetc_si *si)
drivers/net/ethernet/freescale/enetc/enetc_cbdr.c +14 -0
@@ -299,3 +299,17 @@ int enetc_set_rss_table(struct enetc_si *si, const u32 *table, int count)return enetc_cmd_rss_table (si, (u32 *)table, count, false); }EXPORT_SYMBOL_GPL (enetc_set_rss_table); + +int enetc4_get_rss_table (struct enetc_si *si,u32 *table,int count) +{ +return ntmp_rsst_query_or_update_entry (&si->ntmp.cbdrs, + table, count, true); +} +EXPORT_SYMBOL_GPL (enetc4_get_rss_table); + +int enetc4_set_rss_table (struct enetc_si *si,const u32 *table,int count) +{ +return ntmp_rsst_query_or_update_entry (&si->ntmp.cbdrs, + (u32 *)table, count, false); +} +EXPORT_SYMBOL_GPL (enetc4_set_rss_table);
drivers/net/ethernet/freescale/enetc/enetc_ethtool.c +54 -15
119 lines not on this page · raw message
drivers/net/ethernet/freescale/enetc/enetc_pf.c +3 -1
@@ -523,7 +523,7 @@ static void enetc_configure_port(struct enetc_pf *pf)/* set up hash key */ get_random_bytes (hash_key,ENETC_RSSHASH_KEY_SIZE ); -enetc_set_rss_key (hw, hash_key); +enetc_set_rss_key (pf->si, hash_key);/* split up RFS entries */ enetc_port_assign_rfs_entries (pf->si);
@@ -907,6 +907,8 @@ static int enetc_pf_register_with_ierb(struct pci_dev *pdev)static const struct enetc_si_ops enetc_psi_ops = { .setup_cbdr = enetc_setup_cbdr, .teardown_cbdr = enetc_teardown_cbdr, + .get_rss_table = enetc_get_rss_table, + .set_rss_table = enetc_set_rss_table, };static struct enetc_si *enetc_psi_create (struct pci_dev *pdev)
drivers/net/ethernet/freescale/enetc/enetc_pf_common.c +3 -3
@@ -128,15 +128,15 @@ void enetc_pf_netdev_setup(struct enetc_si *si, struct net_device *ndev,if (si->hw_features &ENETC_SI_F_LSO ) priv->active_offloads |=ENETC_F_LSO ; +if (si->num_rss) + ndev->hw_features |=NETIF_F_RXHASH ; +/* TODO: currently, i.MX95 ENETC driver does not support advanced features */ if (!is_enetc_rev1 (si)) { ndev->hw_features &= ~(NETIF_F_HW_VLAN_CTAG_FILTER |NETIF_F_LOOPBACK ); goto end; } -if (si->num_rss) - ndev->hw_features |=NETIF_F_RXHASH ; - ndev->xdp_features =NETDEV_XDP_ACT_BASIC |NETDEV_XDP_ACT_REDIRECT |NETDEV_XDP_ACT_NDO_XMIT |NETDEV_XDP_ACT_RX_SG |NETDEV_XDP_ACT_NDO_XMIT_SG ;
drivers/net/ethernet/freescale/enetc/enetc_vf.c +2 -0
@@ -165,6 +165,8 @@ static void enetc_vf_netdev_setup(struct enetc_si *si, struct net_device *ndev,static const struct enetc_si_ops enetc_vsi_ops = { .setup_cbdr = enetc_setup_cbdr, .teardown_cbdr = enetc_teardown_cbdr, + .get_rss_table = enetc_get_rss_table, + .set_rss_table = enetc_set_rss_table, }; static int enetc_vf_probe(struct pci_dev *pdev,
Signature · 1 line
2.34.1
Jakub Kicinski
maintainerRe: [PATCH v3 net-next 06/13] net: enetc: add RSS support for i.MX95 ENETC PF
Quoted 9 lines · On Tue, 4 Mar 2025 15:21:54 +0800 Wei Fang wrote:
Add Receive side scaling (RSS) support for i.MX95 ENETC PF to improve the network performance and balance the CPU loading. The main changes are as follows.
1. Since i.MX95 ENETC (v4) use NTMP 2.0 to manage the RSS table, which is different from LS1028A ENETC (v1). In order to reuse some functions related to the RSS table, so add .get_rss_table() and .set_rss_table() hooks to
enetc_si_ops.
Quoted 4 lines
2. Since the offset of the RSS key registers of i.MX95 ENETC is also different from that of LS1028A, so add
enetc_get_rss_key_base()to get the base offset for the different chips, so thatenetc_set_rss_key()andenetc_get_rss_key()can be reused for this trivial.
Please split this patch into refactoring of existing code and new additions.
Wei Fang
maintainerPATCH v3 7/13 net: enetc: check if the RSS hfunc is toeplitz
In reply to Wei FangBoth ENETC v1 and ENETC v4 only support the toeplitz algorithm for RSS, so add a check for RSS hfunc.
--- drivers/net/ethernet/freescale/enetc/enetc_ethtool.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/net/ethernet/freescale/enetc/enetc_ethtool.c +7 -0
@@ -753,6 +753,13 @@ static int enetc_set_rxfh(struct net_device *ndev,struct enetc_si *si = priv->si;int err =0 ; +if (rxfh->hfunc !=ETH_RSS_HASH_NO_CHANGE && + rxfh->hfunc !=ETH_RSS_HASH_TOP ) { +netdev_err (ndev,"Only toeplitz hash function is supported\n" ); + +return -EOPNOTSUPP ; + } +/* set hash key, if PF */ if (rxfh->key &&enetc_si_is_pf (si))enetc_set_rss_key (si, rxfh->key);
Signature · 1 line
2.34.1
Jakub Kicinski
maintainerRe: [PATCH v3 net-next 07/13] net: enetc: check if the RSS hfunc is toeplitz
Quoted 2 lines · On Tue, 4 Mar 2025 15:21:55 +0800 Wei Fang wrote:
Both ENETC v1 and ENETC v4 only support the toeplitz algorithm for RSS, so add a check for RSS hfunc.
Rejecting unsupported configurations is considered a fix, please send it to net with a Fixes tag.
Signature · 1 line
pw-bot: cr
Wei Fang
maintainerPATCH v3 8/13 net: enetc: enable RSS feature by default
In reply to Wei FangReceive side scaling (RSS) is a network driver technology that enables the efficient distribution of network receive processing across multiple CPUs in multiprocessor systems. Therefore, it is better to enable RSS by default so that the CPU load can be balanced and network performance can be improved when then network is enabled.
--- drivers/net/ethernet/freescale/enetc/enetc.c | 35 ++++++++++--------- .../freescale/enetc/enetc_pf_common.c | 4 ++- .../net/ethernet/freescale/enetc/enetc_vf.c | 4 ++- 3 files changed, 25 insertions(+), 18 deletions(-)
drivers/net/ethernet/freescale/enetc/enetc.c +19 -16
@@ -2420,6 +2420,22 @@ static void enetc_set_lso_flags_mask(struct enetc_hw *hw)enetc_wr (hw,ENETC4_SILSOSFMR1 ,0 ); } +static int enetc_set_rss (struct net_device *ndev,int en) +{ +struct enetc_ndev_priv *priv =netdev_priv (ndev); +struct enetc_hw *hw = &priv->si->hw; +u32 reg; + +enetc_wr (hw,ENETC_SIRBGCR , priv->num_rx_rings); + + reg =enetc_rd (hw,ENETC_SIMR ); + reg &= ~ENETC_SIMR_RSSE ; + reg |= (en) ?ENETC_SIMR_RSSE :0 ; +enetc_wr (hw,ENETC_SIMR , reg); + +return 0 ; +} +int enetc_configure_si (struct enetc_ndev_priv *priv) {struct enetc_si *si = priv->si;
@@ -2440,6 +2456,9 @@ int enetc_configure_si(struct enetc_ndev_priv *priv) err =enetc_setup_default_rss_table (si, priv->num_rx_rings);if (err)return err; + +if (priv->ndev->features &NETIF_F_RXHASH ) +enetc_set_rss (priv->ndev, true); }return 0 ;
@@ -3232,22 +3251,6 @@ struct net_device_stats *enetc_get_stats(struct net_device *ndev) }EXPORT_SYMBOL_GPL (enetc_get_stats); -static int enetc_set_rss (struct net_device *ndev,int en) -{ -struct enetc_ndev_priv *priv =netdev_priv (ndev); -struct enetc_hw *hw = &priv->si->hw; -u32 reg; - -enetc_wr (hw,ENETC_SIRBGCR , priv->num_rx_rings); - - reg =enetc_rd (hw,ENETC_SIMR ); - reg &= ~ENETC_SIMR_RSSE ; - reg |= (en) ?ENETC_SIMR_RSSE :0 ; -enetc_wr (hw,ENETC_SIMR , reg); - -return 0 ; -} -static void enetc_enable_rxvlan (struct net_device *ndev,bool en) {struct enetc_ndev_priv *priv =netdev_priv (ndev);
drivers/net/ethernet/freescale/enetc/enetc_pf_common.c +3 -1
@@ -128,8 +128,10 @@ void enetc_pf_netdev_setup(struct enetc_si *si, struct net_device *ndev,if (si->hw_features &ENETC_SI_F_LSO ) priv->active_offloads |=ENETC_F_LSO ; -if (si->num_rss) +if (si->num_rss) { ndev->hw_features |=NETIF_F_RXHASH ; + ndev->features |=NETIF_F_RXHASH ; + }/* TODO: currently, i.MX95 ENETC driver does not support advanced features */ if (!is_enetc_rev1 (si)) {
drivers/net/ethernet/freescale/enetc/enetc_vf.c +3 -1
@@ -155,8 +155,10 @@ static void enetc_vf_netdev_setup(struct enetc_si *si, struct net_device *ndev, ndev->vlan_features =NETIF_F_SG |NETIF_F_HW_CSUM |NETIF_F_TSO |NETIF_F_TSO6 ; -if (si->num_rss) +if (si->num_rss) { ndev->hw_features |=NETIF_F_RXHASH ; + ndev->features |=NETIF_F_RXHASH ; + }/* pick up primary MAC address from SI */ enetc_load_primary_mac_addr (&si->hw, ndev);
Signature · 1 line
2.34.1
Wei Fang
maintainerPATCH v3 9/13 net: enetc: move generic VLAN filter interfaces to enetc-core
In reply to Wei FangFor ENETC, each SI has a corresponding VLAN hash table. That is to say, both PF and VFs can support VLAN filter. However, currently only ENETC v1 PF driver supports VLAN filter. In order to make i.MX95 ENETC (v4) PF and VF drivers also support VLAN filter, some related macros are moved from enetc_pf.h to enetc.h, and the related structure variables are moved from enetc_pf to enetc_si.
Besides, enetc_vid_hash_idx() as a generic function is moved to enetc.c. Extract enetc_refresh_vlan_ht_filter() from enetc_sync_vlan_ht_filter() so that it can be shared by PF and VF drivers. This will make it easier to add VLAN filter support for i.MX95 ENETC later.
--- drivers/net/ethernet/freescale/enetc/enetc.c | 25 ++++++++++ drivers/net/ethernet/freescale/enetc/enetc.h | 6 +++ .../net/ethernet/freescale/enetc/enetc_pf.c | 46 +++++-------------- .../net/ethernet/freescale/enetc/enetc_pf.h | 4 -- 4 files changed, 42 insertions(+), 39 deletions(-)
drivers/net/ethernet/freescale/enetc/enetc.c +25 -0
@@ -72,6 +72,31 @@ void enetc_reset_mac_addr_filter(struct enetc_mac_filter *filter) }EXPORT_SYMBOL_GPL (enetc_reset_mac_addr_filter); +int enetc_vid_hash_idx (unsigned int vid) +{ +int res =0 ; +int i; + +for (i =0 ; i <6 ; i++) + res |= (hweight8 (vid & (BIT (i) |BIT (i +6 ))) &0x1 ) << i; + +return res; +} +EXPORT_SYMBOL_GPL (enetc_vid_hash_idx); + +void enetc_refresh_vlan_ht_filter (struct enetc_si *si) +{ +int i; + +bitmap_zero (si->vlan_ht_filter,ENETC_VLAN_HT_SIZE ); +for_each_set_bit (i, si->active_vlans,VLAN_N_VID ) { +int hidx =enetc_vid_hash_idx (i); + +__set_bit (hidx, si->vlan_ht_filter); + } +} +EXPORT_SYMBOL_GPL (enetc_refresh_vlan_ht_filter); +static int enetc_num_stack_tx_queues (struct enetc_ndev_priv *priv) {int num_tx_rings = priv->num_tx_rings;
drivers/net/ethernet/freescale/enetc/enetc.h +6 -0
@@ -24,6 +24,7 @@#define ENETC_CBD_DATA_MEM_ALIGN 64#define ENETC_MADDR_HASH_TBL_SZ 64 +#define ENETC_VLAN_HT_SIZE 64enum enetc_mac_addr_type {UC ,MC ,MADDR_TYPE };
@@ -321,6 +322,9 @@ struct enetc_si {struct workqueue_struct *workqueue;struct work_struct rx_mode_task;struct dentry *debugfs_root; + +DECLARE_BITMAP (vlan_ht_filter,ENETC_VLAN_HT_SIZE ); +DECLARE_BITMAP (active_vlans,VLAN_N_VID ); };#define ENETC_SI_ALIGN 32
@@ -506,6 +510,8 @@ int enetc_get_driver_data(struct enetc_si *si);void enetc_add_mac_addr_ht_filter (struct enetc_mac_filter *filter,const unsigned char *addr);void enetc_reset_mac_addr_filter (struct enetc_mac_filter *filter); +int enetc_vid_hash_idx (unsigned int vid); +void enetc_refresh_vlan_ht_filter (struct enetc_si *si);int enetc_open (struct net_device *ndev);int enetc_close (struct net_device *ndev);
drivers/net/ethernet/freescale/enetc/enetc_pf.c +11 -35
66 lines not on this page · raw message
drivers/net/ethernet/freescale/enetc/enetc_pf.h +0 -4
@@ -6,8 +6,6 @@#define ENETC_PF_NUM_RINGS 8 -#define ENETC_VLAN_HT_SIZE 64 -enum enetc_vf_flags {ENETC_VF_FLAG_PF_SET_MAC =BIT (0 ), };
@@ -52,8 +50,6 @@ struct enetc_pf {char msg_int_name[ENETC_INT_NAME_MAX ];char vlan_promisc_simap;/* bitmap of SIs in VLAN promisc mode */ -DECLARE_BITMAP (vlan_ht_filter,ENETC_VLAN_HT_SIZE ); -DECLARE_BITMAP (active_vlans,VLAN_N_VID );struct mii_bus *mdio;/* saved for cleanup */ struct mii_bus *imdio;
Signature · 1 line
2.34.1
Wei Fang
maintainerPATCH v3 10/13 net: enetc: move generic VLAN hash filter functions to enetc_pf_common.c
In reply to Wei FangSince the VLAN hash filter of ENETC v1 and v4 is the basically same, the only difference is the offset of the VLAN hash filter registers. So, the .set_si_vlan_hash_filter() hook is added to struct enetc_pf_ops to set the registers of the corresponding platform. In addition, the common VLAN hash filter functions enetc_vlan_rx_add_vid() and enetc_vlan_rx_del_vid() are moved to enetc_pf_common.c.
--- .../net/ethernet/freescale/enetc/enetc_pf.c | 34 ++----------------- .../net/ethernet/freescale/enetc/enetc_pf.h | 1 + .../freescale/enetc/enetc_pf_common.c | 34 +++++++++++++++++++ .../freescale/enetc/enetc_pf_common.h | 2 ++ 4 files changed, 39 insertions(+), 32 deletions(-)
drivers/net/ethernet/freescale/enetc/enetc_pf.c +2 -32
@@ -215,43 +215,12 @@ static void enetc_pf_set_rx_mode(struct net_device *ndev)enetc_port_wr (hw,ENETC_PSIPMR , psipmr); } -static void enetc_set_vlan_ht_filter (struct enetc_hw *hw,int si_idx, -unsigned long hash) +static void enetc_set_vlan_ht_filter (struct enetc_hw *hw,int si_idx,u64 hash) {enetc_port_wr (hw,ENETC_PSIVHFR0 (si_idx),lower_32_bits (hash));enetc_port_wr (hw,ENETC_PSIVHFR1 (si_idx),upper_32_bits (hash)); } -static int enetc_vlan_rx_add_vid (struct net_device *ndev,__be16 prot,u16 vid) -{ -struct enetc_ndev_priv *priv =netdev_priv (ndev); -struct enetc_si *si = priv->si; -struct enetc_hw *hw = &si->hw; -int idx; - -__set_bit (vid, si->active_vlans); - - idx =enetc_vid_hash_idx (vid); -if (!__test_and_set_bit (idx, si->vlan_ht_filter)) -enetc_set_vlan_ht_filter (hw,0 , *si->vlan_ht_filter); - -return 0 ; -} - -static int enetc_vlan_rx_del_vid (struct net_device *ndev,__be16 prot,u16 vid) -{ -struct enetc_ndev_priv *priv =netdev_priv (ndev); -struct enetc_si *si = priv->si; -struct enetc_hw *hw = &si->hw; - -if (__test_and_clear_bit (vid, si->active_vlans)) { -enetc_refresh_vlan_ht_filter (si); -enetc_set_vlan_ht_filter (hw,0 , *si->vlan_ht_filter); - } - -return 0 ; -} -static void enetc_set_loopback (struct net_device *ndev,bool en) {struct enetc_ndev_priv *priv =netdev_priv (ndev);
@@ -953,6 +922,7 @@ static const struct enetc_pf_ops enetc_pf_ops = { .create_pcs = enetc_pf_create_pcs, .destroy_pcs = enetc_pf_destroy_pcs, .enable_psfp = enetc_psfp_enable, + .set_si_vlan_hash_filter = enetc_set_vlan_ht_filter, }; static int enetc_pf_probe(struct pci_dev *pdev,
drivers/net/ethernet/freescale/enetc/enetc_pf.h +1 -0
@@ -37,6 +37,7 @@ struct enetc_pf_ops {struct phylink_pcs *(*create_pcs)(struct enetc_pf *pf,struct mii_bus *bus);void (*destroy_pcs)(struct phylink_pcs *pcs);int (*enable_psfp)(struct enetc_ndev_priv *priv); +void (*set_si_vlan_hash_filter)(struct enetc_hw *hw,int si,u64 hash); };struct enetc_pf {
drivers/net/ethernet/freescale/enetc/enetc_pf_common.c +34 -0
@@ -343,5 +343,39 @@ void enetc_phylink_destroy(struct enetc_ndev_priv *priv) }EXPORT_SYMBOL_GPL (enetc_phylink_destroy); +int enetc_vlan_rx_add_vid (struct net_device *ndev,__be16 prot,u16 vid) +{ +struct enetc_ndev_priv *priv =netdev_priv (ndev); +struct enetc_pf *pf =enetc_si_priv (priv->si); +struct enetc_si *si = priv->si; +struct enetc_hw *hw = &si->hw; +int idx; + +__set_bit (vid, si->active_vlans); + + idx =enetc_vid_hash_idx (vid); +if (!__test_and_set_bit (idx, si->vlan_ht_filter)) + pf->ops->set_si_vlan_hash_filter (hw,0 , *si->vlan_ht_filter); + +return 0 ; +} +EXPORT_SYMBOL_GPL (enetc_vlan_rx_add_vid); + +int enetc_vlan_rx_del_vid (struct net_device *ndev,__be16 prot,u16 vid) +{ +struct enetc_ndev_priv *priv =netdev_priv (ndev); +struct enetc_pf *pf =enetc_si_priv (priv->si); +struct enetc_si *si = priv->si; +struct enetc_hw *hw = &si->hw; + +if (__test_and_clear_bit (vid, si->active_vlans)) { +enetc_refresh_vlan_ht_filter (si); + pf->ops->set_si_vlan_hash_filter (hw,0 , *si->vlan_ht_filter); + } + +return 0 ; +} +EXPORT_SYMBOL_GPL (enetc_vlan_rx_del_vid); +MODULE_DESCRIPTION ("NXP ENETC PF common functionality driver" );MODULE_LICENSE ("Dual BSD/GPL" );
drivers/net/ethernet/freescale/enetc/enetc_pf_common.h +2 -0
@@ -12,6 +12,8 @@ void enetc_mdiobus_destroy(struct enetc_pf *pf);int enetc_phylink_create (struct enetc_ndev_priv *priv,struct device_node *node,const struct phylink_mac_ops *ops);void enetc_phylink_destroy (struct enetc_ndev_priv *priv); +int enetc_vlan_rx_add_vid (struct net_device *ndev,__be16 prot,u16 vid); +int enetc_vlan_rx_del_vid (struct net_device *ndev,__be16 prot,u16 vid);static inline u16 enetc_get_ip_revision (struct enetc_hw *hw) {
Signature · 1 line
2.34.1
Wei Fang
maintainerPATCH v3 11/13 net: enetc: add VLAN filtering support for i.MX95 ENETC PF
In reply to Wei FangAdd VLAN hash filter support for i.MX95 ENETC PF. If VLAN filtering is disabled, then VLAN promiscuous mode will be enabled, which means that PF qualifies for reception of all VLAN tags.
--- .../net/ethernet/freescale/enetc/enetc4_hw.h | 4 ++++ .../net/ethernet/freescale/enetc/enetc4_pf.c | 20 +++++++++++++++++++ .../freescale/enetc/enetc_pf_common.c | 2 +- 3 files changed, 25 insertions(+), 1 deletion(-)
drivers/net/ethernet/freescale/enetc/enetc4_hw.h +4 -0
@@ -107,6 +107,10 @@#define ENETC4_PSIMMHFR0 (a) ((a) * 0x80 + 0x2058)#define ENETC4_PSIMMHFR1 (a) ((a) * 0x80 + 0x205c) +/* Port station interface a VLAN hash filter register 0/1 */ +#define ENETC4_PSIVHFR0 (a) ((a) * 0x80 + 0x2060) +#define ENETC4_PSIVHFR1 (a) ((a) * 0x80 + 0x2064) +#define ENETC4_PMCAPR 0x4004#define PMCAPR_HD BIT(8)#define PMCAPR_FP GENMASK(10, 9)
drivers/net/ethernet/freescale/enetc/enetc4_pf.c +20 -0
@@ -101,6 +101,13 @@ static void enetc4_pf_set_si_mac_hash_filter(struct enetc_hw *hw, int si, } } +static void enetc4_pf_set_si_vlan_hash_filter (struct enetc_hw *hw, +int si,u64 hash) +{ +enetc_port_wr (hw,ENETC4_PSIVHFR0 (si),lower_32_bits (hash)); +enetc_port_wr (hw,ENETC4_PSIVHFR1 (si),upper_32_bits (hash)); +} +static void enetc4_pf_destroy_mac_list (struct enetc_pf *pf) {struct enetc_mac_list_entry *entry;
@@ -403,6 +410,7 @@ static void enetc4_pf_set_mac_filter(struct enetc_pf *pf, int type)static const struct enetc_pf_ops enetc4_pf_ops = { .set_si_primary_mac = enetc4_pf_set_si_primary_mac, .get_si_primary_mac = enetc4_pf_get_si_primary_mac, + .set_si_vlan_hash_filter = enetc4_pf_set_si_vlan_hash_filter, };static int enetc4_pf_struct_init (struct enetc_si *si)
@@ -692,6 +700,16 @@ static void enetc4_pf_set_rx_mode(struct net_device *ndev)static int enetc4_pf_set_features (struct net_device *ndev,netdev_features_t features) { +netdev_features_t changed = ndev->features ^ features; +struct enetc_ndev_priv *priv =netdev_priv (ndev); +struct enetc_hw *hw = &priv->si->hw; + +if (changed &NETIF_F_HW_VLAN_CTAG_FILTER ) { +bool promisc_en = !(features &NETIF_F_HW_VLAN_CTAG_FILTER ); + +enetc4_pf_set_si_vlan_promisc (hw,0 , promisc_en); + } +enetc_set_features (ndev, features);return 0 ;
@@ -705,6 +723,8 @@ static const struct net_device_ops enetc4_ndev_ops = { .ndo_set_mac_address = enetc_pf_set_mac_addr, .ndo_set_rx_mode = enetc4_pf_set_rx_mode, .ndo_set_features = enetc4_pf_set_features, + .ndo_vlan_rx_add_vid = enetc_vlan_rx_add_vid, + .ndo_vlan_rx_kill_vid = enetc_vlan_rx_del_vid, }; static struct phylink_pcs *
drivers/net/ethernet/freescale/enetc/enetc_pf_common.c +1 -1
@@ -135,7 +135,7 @@ void enetc_pf_netdev_setup(struct enetc_si *si, struct net_device *ndev,/* TODO: currently, i.MX95 ENETC driver does not support advanced features */ if (!is_enetc_rev1 (si)) { - ndev->hw_features &= ~(NETIF_F_HW_VLAN_CTAG_FILTER |NETIF_F_LOOPBACK ); + ndev->hw_features &= ~NETIF_F_LOOPBACK ; goto end; }
Signature · 1 line
2.34.1
Wei Fang
maintainerPATCH v3 12/13 net: enetc: add loopback support for i.MX95 ENETC PF
In reply to Wei FangAdd internal loopback support for i.MX95 ENETC PF, the default loopback mode is MAC level loopback, the MAC Tx data is looped back onto the Rx. The MAC interface runs at a fixed 1:8 ratio of NETC clock in MAC-level loopback mode, with no dependency on Tx clock.
--- .../net/ethernet/freescale/enetc/enetc4_pf.c | 18 ++++++++++++++++++ .../ethernet/freescale/enetc/enetc_pf_common.c | 4 +--- 2 files changed, 19 insertions(+), 3 deletions(-)
drivers/net/ethernet/freescale/enetc/enetc4_pf.c +18 -0
@@ -108,6 +108,21 @@ static void enetc4_pf_set_si_vlan_hash_filter(struct enetc_hw *hw,enetc_port_wr (hw,ENETC4_PSIVHFR1 (si),upper_32_bits (hash)); } +static void enetc4_pf_set_loopback (struct net_device *ndev,bool en) +{ +struct enetc_ndev_priv *priv =netdev_priv (ndev); +struct enetc_si *si = priv->si; +u32 val; + + val =enetc_port_mac_rd (si,ENETC4_PM_CMD_CFG (0 )); + val =u32_replace_bits (val, en ?1 :0 ,PM_CMD_CFG_LOOP_EN ); +/* Default to select MAC level loopback mode if loopback is enabled. */ + val =u32_replace_bits (val, en ?LPBCK_MODE_MAC_LEVEL :0 , +PM_CMD_CFG_LPBK_MODE ); + +enetc_port_mac_wr (si,ENETC4_PM_CMD_CFG (0 ), val); +} +static void enetc4_pf_destroy_mac_list (struct enetc_pf *pf) {struct enetc_mac_list_entry *entry;
@@ -710,6 +725,9 @@ static int enetc4_pf_set_features(struct net_device *ndev,enetc4_pf_set_si_vlan_promisc (hw,0 , promisc_en); } +if (changed &NETIF_F_LOOPBACK ) +enetc4_pf_set_loopback (ndev, !!(features &NETIF_F_LOOPBACK )); +enetc_set_features (ndev, features);return 0 ;
drivers/net/ethernet/freescale/enetc/enetc_pf_common.c +1 -3
@@ -134,10 +134,8 @@ void enetc_pf_netdev_setup(struct enetc_si *si, struct net_device *ndev, }/* TODO: currently, i.MX95 ENETC driver does not support advanced features */ -if (!is_enetc_rev1 (si)) { - ndev->hw_features &= ~NETIF_F_LOOPBACK ; +if (!is_enetc_rev1 (si)) goto end; - } ndev->xdp_features =NETDEV_XDP_ACT_BASIC |NETDEV_XDP_ACT_REDIRECT | NETDEV_XDP_ACT_NDO_XMIT | NETDEV_XDP_ACT_RX_SG |
Signature · 1 line
2.34.1
Wei Fang
maintainerPATCH v3 13/13 MAINTAINERS: add new file ntmp.h to ENETC driver
In reply to Wei FangAdd new file ntmp.h. to ENETC driver.
--- MAINTAINERS | 1 + 1 file changed, 1 insertion(+)
MAINTAINERS +1 -0
@@ -9174,6 +9174,7 @@ F: Documentation/devicetree/bindings/net/nxp,netc-blk-ctrl.yaml F: drivers/net/ethernet/freescale/enetc/ F: include/linux/fsl/enetc_mdio.h F: include/linux/fsl/netc_global.h +F: include/linux/fsl/ntmp.h FREESCALE eTSEC ETHERNET DRIVER (GIANFAR) M: Claudiu Manoil <[email protected]>
Signature · 1 line
2.34.1