Message ID | 20211230163909.160269-9-dmichail@fungible.com (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | new Fungible Ethernet driver | expand |
On Thu, 30 Dec 2021 08:39:09 -0800 Dimitris Michailidis wrote: > Hook up the new driver to configuration and build. > > Signed-off-by: Dimitris Michailidis <dmichail@fungible.com> New drivers must build cleanly with W=1 C=1. This one doesn't build at all: drivers/net/ethernet/fungible/funeth/funeth.h:10:10: fatal error: fun_dev.h: No such file or directory 10 | #include "fun_dev.h" | ^~~~~~~~~~~
On Thu, Dec 30, 2021 at 9:43 AM Jakub Kicinski <kuba@kernel.org> wrote: > > On Thu, 30 Dec 2021 08:39:09 -0800 Dimitris Michailidis wrote: > > Hook up the new driver to configuration and build. > > > > Signed-off-by: Dimitris Michailidis <dmichail@fungible.com> > > New drivers must build cleanly with W=1 C=1. This one doesn't build at all: > > drivers/net/ethernet/fungible/funeth/funeth.h:10:10: fatal error: fun_dev.h: No such file or directory > 10 | #include "fun_dev.h" > | ^~~~~~~~~~~ Hmm, I don't get this error. What I run is make W=1 C=1 drivers/net/ethernet/fungible/ and it goes through. Tried it also on net-next as of a few minutes ago. Any ideas what may be different? I do get a number of warnings because there are constants in one of the headers defined as 'static const' and they get flagged when a .c doesn't use them. This looks like a tool shortcoming to me. Do you want me to try to redo them as defines or enum?
On Thu, Dec 30, 2021 at 12:54 PM Dimitris Michailidis <d.michailidis@fungible.com> wrote: > > On Thu, Dec 30, 2021 at 9:43 AM Jakub Kicinski <kuba@kernel.org> wrote: > > > > On Thu, 30 Dec 2021 08:39:09 -0800 Dimitris Michailidis wrote: > > > Hook up the new driver to configuration and build. > > > > > > Signed-off-by: Dimitris Michailidis <dmichail@fungible.com> > > > > New drivers must build cleanly with W=1 C=1. This one doesn't build at all: > > > > drivers/net/ethernet/fungible/funeth/funeth.h:10:10: fatal error: fun_dev.h: No such file or directory > > 10 | #include "fun_dev.h" > > | ^~~~~~~~~~~ > > Hmm, I don't get this error. What I run is > > make W=1 C=1 drivers/net/ethernet/fungible/ > > and it goes through. Tried it also on net-next as of a few minutes ago. > Any ideas what may be different? Never mind, I see what happened. One of the patches is bad and is not adding the paths correctly. Do let me know if I should address the header 'static const' warnings from -Wunused-const-variable. > > I do get a number of warnings because there are constants in one of > the headers defined > as 'static const' and they get flagged when a .c doesn't use them. > This looks like a tool > shortcoming to me. Do you want me to try to redo them as defines or enum?
On Thu, 30 Dec 2021 13:16:16 -0800 Dimitris Michailidis wrote: > > and it goes through. Tried it also on net-next as of a few minutes ago. > > Any ideas what may be different? > > Never mind, I see what happened. One of the patches is bad and is not > adding the paths correctly. > > Do let me know if I should address the header 'static const' warnings > from -Wunused-const-variable. Yes, please - enum seems most appropriate for the values.
On Thu, Dec 30, 2021 at 12:54:07PM -0800, Dimitris Michailidis wrote: > On Thu, Dec 30, 2021 at 9:43 AM Jakub Kicinski <kuba@kernel.org> wrote: > > > > On Thu, 30 Dec 2021 08:39:09 -0800 Dimitris Michailidis wrote: > > > Hook up the new driver to configuration and build. > > > > > > Signed-off-by: Dimitris Michailidis <dmichail@fungible.com> > > > > New drivers must build cleanly with W=1 C=1. This one doesn't build at all: > > > > drivers/net/ethernet/fungible/funeth/funeth.h:10:10: fatal error: fun_dev.h: No such file or directory > > 10 | #include "fun_dev.h" > > | ^~~~~~~~~~~ > > Hmm, I don't get this error. What I run is > > make W=1 C=1 drivers/net/ethernet/fungible/ C=1 implies you need sparse installed. Do you? Andrew
On Thu, Dec 30, 2021 at 2:27 PM Andrew Lunn <andrew@lunn.ch> wrote: > > On Thu, Dec 30, 2021 at 12:54:07PM -0800, Dimitris Michailidis wrote: > > On Thu, Dec 30, 2021 at 9:43 AM Jakub Kicinski <kuba@kernel.org> wrote: > > > > > > On Thu, 30 Dec 2021 08:39:09 -0800 Dimitris Michailidis wrote: > > > > Hook up the new driver to configuration and build. > > > > > > > > Signed-off-by: Dimitris Michailidis <dmichail@fungible.com> > > > > > > New drivers must build cleanly with W=1 C=1. This one doesn't build at all: > > > > > > drivers/net/ethernet/fungible/funeth/funeth.h:10:10: fatal error: fun_dev.h: No such file or directory > > > 10 | #include "fun_dev.h" > > > | ^~~~~~~~~~~ > > > > Hmm, I don't get this error. What I run is > > > > make W=1 C=1 drivers/net/ethernet/fungible/ > > C=1 implies you need sparse installed. Do you? I have sparse. Here's an example of what W=1 C=1 V=1 says is running: sparse -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise -Wno-return-void -Wno-unknown-attribute -D__x86_64__ --arch=x86 -mlittle-endian -m64 -Wp,-MMD,drivers/net/ethernet/fungible/funcore/.fun_dev.o.d -nostdinc -I./arch/x86/include -I./arch/x86/include/generated -I./include -I./arch/x86/include/uapi -I./arch/x86/include/generated/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/compiler-version.h -include ./include/linux/kconfig.h -include ./include/linux/compiler_types.h -D__KERNEL__ -fmacro-prefix-map=./= -DKBUILD_EXTRA_WARN1 -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE -Werror=implicit-function-declaration -Werror=implicit-int -Werror=return-type -Wno-format-security -std=gnu89 -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -fcf-protection=none -m64 -falign-jumps=1 -falign-loops=1 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mskip-rax-setup -mtune=generic -mno-red-zone -mcmodel=kernel -DCONFIG_X86_X32_ABI -Wno-sign-compare -fno-asynchronous-unwind-tables -mindirect-branch=thunk-extern -mindirect-branch-register -fno-jump-tables -fno-delete-null-pointer-checks -Wno-frame-address -Wno-format-truncation -Wno-format-overflow -Wno-address-of-packed-member -O2 --param=allow-store-data-races=0 -Wframe-larger-than=1024 -fstack-protector-strong -Wimplicit-fallthrough=5 -Wno-main -Wno-unused-but-set-variable -Wno-unused-const-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-stack-clash-protection -pg -mrecord-mcount -mfentry -DCC_USING_FENTRY -Wdeclaration-after-statement -Wvla -Wno-pointer-sign -Wno-stringop-truncation -Wno-array-bounds -Wno-stringop-overflow -Wno-restrict -Wno-maybe-uninitialized -Wno-alloc-size-larger-than -fno-strict-overflow -fno-stack-check -fconserve-stack -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -Wno-packed-not-aligned -Wextra -Wunused -Wno-unused-parameter -Wmissing-declarations -Wmissing-format-attribute -Wmissing-prototypes -Wold-style-definition -Wmissing-include-dirs -Wunused-but-set-variable -Wunused-const-variable -Wpacked-not-aligned -Wstringop-truncation -Wno-missing-field-initializers -Wno-sign-compare -Wno-type-limits -g -gdwarf-4 -DMODULE -DKBUILD_BASENAME='"fun_dev"' -DKBUILD_MODNAME='"funcore"' -D__KBUILD_MODNAME=kmod_funcore drivers/net/ethernet/fungible/funcore/fun_dev.c $ sparse --version v0.6.4 > > Andrew
diff --git a/MAINTAINERS b/MAINTAINERS index 4d479b554361..400979e47a1e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -7853,6 +7853,12 @@ L: platform-driver-x86@vger.kernel.org S: Maintained F: drivers/platform/x86/fujitsu-tablet.c +FUNGIBLE ETHERNET DRIVERS +M: Dimitris Michailidis <dmichail@fungible.com> +L: netdev@vger.kernel.org +S: Supported +F: drivers/net/ethernet/fungible/ + FUSE: FILESYSTEM IN USERSPACE M: Miklos Szeredi <miklos@szeredi.hu> L: linux-fsdevel@vger.kernel.org diff --git a/drivers/net/ethernet/Kconfig b/drivers/net/ethernet/Kconfig index db3ec4768159..bd4cb9d7c35d 100644 --- a/drivers/net/ethernet/Kconfig +++ b/drivers/net/ethernet/Kconfig @@ -78,6 +78,7 @@ source "drivers/net/ethernet/ezchip/Kconfig" source "drivers/net/ethernet/faraday/Kconfig" source "drivers/net/ethernet/freescale/Kconfig" source "drivers/net/ethernet/fujitsu/Kconfig" +source "drivers/net/ethernet/fungible/Kconfig" source "drivers/net/ethernet/google/Kconfig" source "drivers/net/ethernet/hisilicon/Kconfig" source "drivers/net/ethernet/huawei/Kconfig" diff --git a/drivers/net/ethernet/Makefile b/drivers/net/ethernet/Makefile index 8a87c1083d1d..8ef43e0c33c0 100644 --- a/drivers/net/ethernet/Makefile +++ b/drivers/net/ethernet/Makefile @@ -41,6 +41,7 @@ obj-$(CONFIG_NET_VENDOR_EZCHIP) += ezchip/ obj-$(CONFIG_NET_VENDOR_FARADAY) += faraday/ obj-$(CONFIG_NET_VENDOR_FREESCALE) += freescale/ obj-$(CONFIG_NET_VENDOR_FUJITSU) += fujitsu/ +obj-$(CONFIG_NET_VENDOR_FUNGIBLE) += fungible/ obj-$(CONFIG_NET_VENDOR_GOOGLE) += google/ obj-$(CONFIG_NET_VENDOR_HISILICON) += hisilicon/ obj-$(CONFIG_NET_VENDOR_HUAWEI) += huawei/ diff --git a/drivers/net/ethernet/fungible/Kconfig b/drivers/net/ethernet/fungible/Kconfig new file mode 100644 index 000000000000..2ff5138d0448 --- /dev/null +++ b/drivers/net/ethernet/fungible/Kconfig @@ -0,0 +1,27 @@ +# SPDX-License-Identifier: GPL-2.0-only +# +# Fungible network driver configuration +# + +config NET_VENDOR_FUNGIBLE + bool "Fungible devices" + default y + help + If you have a Fungible network device, say Y. + + Note that the answer to this question doesn't directly affect the + kernel: saying N will just cause the configurator to skip all + the questions about Fungible cards. If you say Y, you will be asked + for your specific card in the following questions. + +if NET_VENDOR_FUNGIBLE + +config FUN_CORE + tristate + help + A service module offering basic common services to Fungible + device drivers. + +source "drivers/net/ethernet/fungible/funeth/Kconfig" + +endif # NET_VENDOR_FUNGIBLE diff --git a/drivers/net/ethernet/fungible/Makefile b/drivers/net/ethernet/fungible/Makefile new file mode 100644 index 000000000000..df759f1585a1 --- /dev/null +++ b/drivers/net/ethernet/fungible/Makefile @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) +# +# Makefile for the Fungible network device drivers. +# + +obj-$(CONFIG_FUN_CORE) += funcore/ +obj-$(CONFIG_FUN_ETH) += funeth/ diff --git a/drivers/net/ethernet/fungible/funeth/Kconfig b/drivers/net/ethernet/fungible/funeth/Kconfig new file mode 100644 index 000000000000..c72ad9386400 --- /dev/null +++ b/drivers/net/ethernet/fungible/funeth/Kconfig @@ -0,0 +1,17 @@ +# SPDX-License-Identifier: GPL-2.0-only +# +# Fungible Ethernet driver configuration +# + +config FUN_ETH + tristate "Fungible Ethernet device driver" + depends on PCI && PCI_MSI + depends on TLS && TLS_DEVICE || TLS_DEVICE=n + select NET_DEVLINK + select FUN_CORE + help + This driver supports the Ethernet functionality of Fungible adapters. + It works with both physical and virtual functions. + + To compile this driver as a module, choose M here. The module + will be called funeth. diff --git a/drivers/net/ethernet/fungible/funeth/Makefile b/drivers/net/ethernet/fungible/funeth/Makefile new file mode 100644 index 000000000000..132945164da9 --- /dev/null +++ b/drivers/net/ethernet/fungible/funeth/Makefile @@ -0,0 +1,10 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) + +subdir-ccflags-y += -I$(src)/../funcore -I$(src) + +obj-$(CONFIG_FUN_ETH) += funeth.o + +funeth-y := funeth_main.o funeth_rx.o funeth_tx.o funeth_devlink.o \ + funeth_ethtool.o + +funeth-$(CONFIG_TLS_DEVICE) += funeth_ktls.o
Hook up the new driver to configuration and build. Signed-off-by: Dimitris Michailidis <dmichail@fungible.com> --- MAINTAINERS | 6 +++++ drivers/net/ethernet/Kconfig | 1 + drivers/net/ethernet/Makefile | 1 + drivers/net/ethernet/fungible/Kconfig | 27 +++++++++++++++++++ drivers/net/ethernet/fungible/Makefile | 7 +++++ drivers/net/ethernet/fungible/funeth/Kconfig | 17 ++++++++++++ drivers/net/ethernet/fungible/funeth/Makefile | 10 +++++++ 7 files changed, 69 insertions(+) create mode 100644 drivers/net/ethernet/fungible/Kconfig create mode 100644 drivers/net/ethernet/fungible/Makefile create mode 100644 drivers/net/ethernet/fungible/funeth/Kconfig create mode 100644 drivers/net/ethernet/fungible/funeth/Makefile