Skip to content

Commit d4fd040

Browse files
claudiu-mdavem330
authored andcommitted
enetc: Introduce basic PF and VF ENETC ethernet drivers
ENETC is a multi-port virtualized Ethernet controller supporting GbE designs and Time-Sensitive Networking (TSN) functionality. ENETC is operating as an SR-IOV multi-PF capable Root Complex Integrated Endpoint (RCIE). As such, it contains multiple physical (PF) and virtual (VF) PCIe functions, discoverable by standard PCI Express. Introduce basic PF and VF ENETC ethernet drivers. The PF has access to the ENETC Port registers and resources and makes the required privileged configurations for the underlying VF devices. Common functionality is controlled through so called System Interface (SI) register blocks, PFs and VFs own a SI each. Though SI register blocks are almost identical, there are a few privileged SI level controls that are accessible only to PFs, and so the distinction is made between PF SIs (PSI) and VF SIs (VSI). As such, the bulk of the code, including datapath processing, basic h/w offload support and generic pci related configuration, is shared between the 2 drivers and is factored out in common source files (i.e. enetc.c). Major functionalities included (for both drivers): MSI-X support for Rx and Tx processing, assignment of Rx/Tx BD ring pairs to MSI-X entries, multi-queue support, Rx S/G (Rx frame fragmentation) and jumbo frame (up to 9600B) support, Rx paged allocation and reuse, Tx S/G support (NETIF_F_SG), Rx and Tx checksum offload, PF MAC filtering and initial control ring support, VLAN extraction/ insertion, PF Rx VLAN CTAG filtering, VF mac address config support, VF VLAN isolation support, etc. Signed-off-by: Claudiu Manoil <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 5e5b9f6 commit d4fd040

File tree

13 files changed

+3390
-0
lines changed

13 files changed

+3390
-0
lines changed

MAINTAINERS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6023,6 +6023,12 @@ L: [email protected]
60236023
S: Maintained
60246024
F: drivers/dma/fsldma.*
60256025

6026+
FREESCALE ENETC ETHERNET DRIVERS
6027+
M: Claudiu Manoil <[email protected]>
6028+
6029+
S: Maintained
6030+
F: drivers/net/ethernet/freescale/enetc/
6031+
60266032
FREESCALE eTSEC ETHERNET DRIVER (GIANFAR)
60276033
M: Claudiu Manoil <[email protected]>
60286034

drivers/net/ethernet/freescale/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,5 +97,6 @@ config GIANFAR
9797

9898
source "drivers/net/ethernet/freescale/dpaa/Kconfig"
9999
source "drivers/net/ethernet/freescale/dpaa2/Kconfig"
100+
source "drivers/net/ethernet/freescale/enetc/Kconfig"
100101

101102
endif # NET_VENDOR_FREESCALE

drivers/net/ethernet/freescale/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,6 @@ obj-$(CONFIG_FSL_FMAN) += fman/
2323
obj-$(CONFIG_FSL_DPAA_ETH) += dpaa/
2424

2525
obj-$(CONFIG_FSL_DPAA2_ETH) += dpaa2/
26+
27+
obj-$(CONFIG_FSL_ENETC) += enetc/
28+
obj-$(CONFIG_FSL_ENETC_VF) += enetc/
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# SPDX-License-Identifier: GPL-2.0
2+
config FSL_ENETC
3+
tristate "ENETC PF driver"
4+
depends on PCI && PCI_MSI && (ARCH_LAYERSCAPE || COMPILE_TEST)
5+
help
6+
This driver supports NXP ENETC gigabit ethernet controller PCIe
7+
physical function (PF) devices, managing ENETC Ports at a privileged
8+
level.
9+
10+
If compiled as module (M), the module name is fsl-enetc.
11+
12+
config FSL_ENETC_VF
13+
tristate "ENETC VF driver"
14+
depends on PCI && PCI_MSI && (ARCH_LAYERSCAPE || COMPILE_TEST)
15+
help
16+
This driver supports NXP ENETC gigabit ethernet controller PCIe
17+
virtual function (VF) devices enabled by the ENETC PF driver.
18+
19+
If compiled as module (M), the module name is fsl-enetc-vf.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# SPDX-License-Identifier: GPL-2.0
2+
obj-$(CONFIG_FSL_ENETC) += fsl-enetc.o
3+
fsl-enetc-$(CONFIG_FSL_ENETC) += enetc.o enetc_cbdr.o enetc_ethtool.o
4+
fsl-enetc-objs := enetc_pf.o $(fsl-enetc-y)
5+
6+
obj-$(CONFIG_FSL_ENETC_VF) += fsl-enetc-vf.o
7+
8+
ifeq ($(CONFIG_FSL_ENETC)$(CONFIG_FSL_ENETC_VF), yy)
9+
fsl-enetc-vf-objs := enetc_vf.o
10+
else
11+
fsl-enetc-vf-$(CONFIG_FSL_ENETC_VF) += enetc.o enetc_cbdr.o \
12+
enetc_ethtool.o
13+
fsl-enetc-vf-objs := enetc_vf.o $(fsl-enetc-vf-y)
14+
endif

0 commit comments

Comments
 (0)