Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First commit for Broadcom Netmap driver #913

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

skotur-brcm
Copy link

No description provided.

bnxt_en_ver := 1.10.2

define bnxt_driver
$(1)@fetch := test -e @SRCDIR@/../bnxt_en-$(bnxt_en_ver)-$(2).tar.gz && cp @SRCDIR@/../bnxt_en-$(bnxt_en_ver)-$(2).tar.gz -P @SRCDIR@/ext-drivers
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If these sources cannot be downloaded automatically, I think we can just let the fetch fail with a message that points the user to the proper url, i.e., something like

$(1)fetch := false && please download bnxt_en-$(bnxt_en_ver)-$(2).tar.gz from https://whatever

The configure message already tells the user to put the file in @SRCDIR@/ext-drivers.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm working with my management to figure out a way of getting a downloadable URL

endef

# need to sub version string on the line below
$(eval $(call default,bnxt,226.0.85.0))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use the syntax already used for mellanox? I.e., remove bnxt_en_ver and put the sub-version here:

$(eval $(call default,bnxt,226.0.85.0-1.10.2))

then you can use bnxt@pv instead of bnxt_en_ver. In this way the user can use --select-version to set both versions.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry i did not get this, could you please elaborate or give what you think the final snippet should look like so i can try on my local setup?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is a patch (I have put the pv extraction in a common function):

diff --git a/LINUX/default-config.mak.in_ b/LINUX/default-config.mak.in_
index ea21e1057..1dd9e52c8 100644
--- a/LINUX/default-config.mak.in_
+++ b/LINUX/default-config.mak.in_
@@ -74,6 +74,8 @@ define default
 $(1)@v := $(if $($(1)@v),$($(1)@v),$(2))
 endef
 
+getpv = $(firstword $(subst -, ,$(1)))
+
 # set all the default versions (can be overridden by --select-version=)
 $(eval $(call default,ixgbe,5.15.2))
 $(eval $(call default,ixgbevf,4.15.1))
@@ -105,19 +107,19 @@ e1000e@fetch := test -e @SRCDIR@/ext-drivers/e1000e-$(e1000e@v).tar.gz || wget h
 endif
 
 define mellanox_driver
+$(1)@pv		:= $(call getpv,$(2))
 $(1)@fetch	:= test -e @SRCDIR@/ext-drivers/mlnx-en-$(2)-ubuntu18.04-x86_64.tgz || wget http://content.mellanox.com/ofed/MLNX_EN-$(2)/mlnx-en-$(2)-ubuntu18.04-x86_64.tgz -P @SRCDIR@/ext-drivers
-$(1)@src	:= tar xf @SRCDIR@/ext-drivers/mlnx-en-$(2)-ubuntu18.04-x86_64.tgz && tar xf mlnx-en-$(2)-ubuntu18.04-x86_64/src/MLNX_EN_SRC-$(2).tgz && tar xf MLNX_EN_SRC-$(2)/SOURCES/mlnx-en_$($(1)@pv).orig.tar.gz && ln -s mlnx-en-$($(1)@pv) $(1)
-$(1)@patch	:= patches/mellanox--$(1)--$($(1)@pv)
+$(1)@src	:= tar xf @SRCDIR@/ext-drivers/mlnx-en-$(2)-ubuntu18.04-x86_64.tgz && tar xf mlnx-en-$(2)-ubuntu18.04-x86_64/src/MLNX_EN_SRC-$(2).tgz && tar xf MLNX_EN_SRC-$(2)/SOURCES/mlnx-en_$$($(1)@pv).orig.tar.gz && ln -s mlnx-en-$$($(1)@pv) $(1)
+$(1)@patch	:= patches/mellanox--$(1)--$$($(1)@pv)
 $(1)@prepare	:= @SRCDIR@/mlx5-prepare.sh @KSRC@
 $(1)@build	:= make -C $(1) NETMAP_DRIVER_SUFFIX=@DRVSUFFIX@ EXTRA_CFLAGS="$$($(1)@cflags) $(EXTRA_CFLAGS)"
 $(1)@install	:= make -C $(1) install_modules INSTALL_MOD_PATH=@MODPATH@ NETMAP_DRIVER_SUFFIX=@DRVSUFFIX@
 $(1)@clean	:= if [ -d $(1) ]; then make -C $(1) clean; fi NETMAP_DRIVER_SUFFIX=@DRVSUFFIX@
-$(1)@distclean  := rm -rf mlnx-en-$($(1)@pv) mlnx-en-$(2)
+$(1)@distclean  := rm -rf mlnx-en-$$($(1)@pv) mlnx-en-$(2)
 $(1)@force	:= 1
 endef
 
 $(eval $(call default,mlx5,5.3-1.0.0.1))
-mlx5@pv		= $(firstword $(subst -, ,$(mlx5@v)))
 mlx5@conf	= CONFIG_MLX5_CORE_EN
 mlx5@cflags	= -Wframe-larger-than=2000
 
@@ -137,22 +139,19 @@ endef
 
 $(foreach d,$(filter virtio_net.c,$(E_DRIVERS)),$(eval $(call virtio_net)))
 
-# need to sub release string on the line here
-bnxt_en_ver := 1.10.2
-
 define bnxt_driver
-$(1)@fetch	:= test -e @SRCDIR@/../bnxt_en-$(bnxt_en_ver)-$(2).tar.gz && cp @SRCDIR@/../bnxt_en-$(bnxt_en_ver)-$(2).tar.gz -P @SRCDIR@/ext-drivers
-$(1)@src	:= tar xf @SRCDIR@/ext-drivers/bnxt_en-$(bnxt_en_ver)-$(2).tar.gz && ln -s bnxt_en-$(bnxt_en_ver)-$(2) $(1)
+$(1)@pv		:= $(call getpv,$(2))
+$(1)@fetch	:= test -e @SRCDIR@/../bnxt_en-$(2).tar.gz && cp @SRCDIR@/../bnxt_en-$(2).tar.gz -P @SRCDIR@/ext-drivers
+$(1)@src	:= tar xf @SRCDIR@/ext-drivers/bnxt_en-$(2).tar.gz && ln -s bnxt_en-$(2) $(1)
 $(1)@build	:= [ -z "$(EXTRA_CFLAGS)" ] || make EXTRA_CFLAGS="$(EXTRA_CFLAGS)" -C $(1) @KOPTS@ KDIR=@KSRC@
 $(1)@install	:= make -C $(1) EXTRA_CFLAGS="$(EXTRA_CFLAGS)" install INSTALL_MOD_PATH=@MODPATH@ NETMAP_DRIVER_SUFFIX=@DRVSUFFIX@
 $(1)@clean	:= if [ -d $(1) ]; then make -C $(1) clean; fi NETMAP_DRIVER_SUFFIX=@DRVSUFFIX@
-$(1)@distclean  := rm -rf bnxt_en-$($(2)@pv) bnxt_en-$(bnxt_en_ver)-$(2)
+$(1)@distclean  := rm -rf bnxt_en-$$($(1)@pv) bnxt_en-$(2)
 $(1)@force	:= 1
 endef
 
 # need to sub version string on the line below
-$(eval $(call default,bnxt,226.0.85.0))
-bnxt@pv		= $(firstword $(subst -, ,$(bnxt@v)))
+$(eval $(call default,bnxt,1.10.2-226.0.85.0))
 bnxt@conf	= CONFIG_BNXT_EN
 
 $(foreach d,$(filter bnxt,$(E_DRIVERS)),$(eval $(call bnxt_driver,$d,$($(d)@v))))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants