From f6c7ab0ddd22b0e21f7adb7668654bdd92260bb6 Mon Sep 17 00:00:00 2001 From: erj Date: Thu, 28 May 2015 20:56:11 +0000 Subject: [PATCH] Fix build issue and incompatibilites introduced by r283620. - Re-introduce "device ixgbe" option for kernel configs. This allows users to continue using existing kernel configurations, while still letting if_ix and if_ixv exist to allow ifconfig magic to work. Though the amd64 GENERIC config has "device ix" and "device ixv" instead of "device ixgbe". This is achieved by making the if_ixgbe module a stub that depends on if_ix and if_ixv. - Replace if_baudrate assignment with if_initbaudrate() call. Thanks to jhb@ for the stub module suggestion and pointing out the if_baudrate error. Approved by: jfv (mentor) git-svn-id: svn://svn.freebsd.org/base/stable/10@283668 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sys/conf/files | 32 ++++++++++++------------ sys/dev/ixgbe/if_ix.c | 11 +-------- sys/dev/ixgbe/ixgbe.c | 50 ++++++++++++++++++++++++++++++++++++++ sys/modules/Makefile | 7 +++++- sys/modules/ix/Makefile | 2 +- sys/modules/ixgbe/Makefile | 21 +--------------- sys/modules/ixv/Makefile | 2 +- 7 files changed, 77 insertions(+), 48 deletions(-) create mode 100644 sys/dev/ixgbe/ixgbe.c diff --git a/sys/conf/files b/sys/conf/files index 4d19c767c..53f683104 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -1716,35 +1716,37 @@ iwn6050.fw optional iwn6050fw | iwnfw \ dev/ixgb/if_ixgb.c optional ixgb dev/ixgb/ixgb_ee.c optional ixgb dev/ixgb/ixgb_hw.c optional ixgb -dev/ixgbe/if_ix.c optional ix inet \ +dev/ixgbe/ixgbe.c optional ixgbe inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe -DSMP" -dev/ixgbe/if_ixv.c optional ixv inet \ +dev/ixgbe/if_ix.c optional ix inet | ixgbe inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe -DSMP" -dev/ixgbe/ix_txrx.c optional ixv inet \ +dev/ixgbe/if_ixv.c optional ixv inet | ixgbe inet \ + compile-with "${NORMAL_C} -I$S/dev/ixgbe -DSMP" +dev/ixgbe/ix_txrx.c optional ix inet | ixv inet | ixgbe inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" -dev/ixgbe/ixgbe_phy.c optional ix ixv inet \ +dev/ixgbe/ixgbe_phy.c optional ix inet | ixv inet | ixgbe inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" -dev/ixgbe/ixgbe_api.c optional ix ixv inet \ +dev/ixgbe/ixgbe_api.c optional ix inet | ixv inet | ixgbe inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" -dev/ixgbe/ixgbe_common.c optional ix ixv inet \ +dev/ixgbe/ixgbe_common.c optional ix inet | ixv inet | ixgbe inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" -dev/ixgbe/ixgbe_mbx.c optional ix ixv inet \ +dev/ixgbe/ixgbe_mbx.c optional ix inet | ixv inet | ixgbe inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" -dev/ixgbe/ixgbe_vf.c optional ix ixv inet \ +dev/ixgbe/ixgbe_vf.c optional ix inet | ixv inet | ixgbe inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" -dev/ixgbe/ixgbe_82598.c optional ix ixv inet \ +dev/ixgbe/ixgbe_82598.c optional ix inet | ixv inet | ixgbe inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" -dev/ixgbe/ixgbe_82599.c optional ix ixv inet \ +dev/ixgbe/ixgbe_82599.c optional ix inet | ixv inet | ixgbe inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" -dev/ixgbe/ixgbe_x540.c optional ix ixv inet \ +dev/ixgbe/ixgbe_x540.c optional ix inet | ixv inet | ixgbe inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" -dev/ixgbe/ixgbe_x550.c optional ix ixv inet \ +dev/ixgbe/ixgbe_x550.c optional ix inet | ixv inet | ixgbe inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" -dev/ixgbe/ixgbe_dcb.c optional ix ixv inet \ +dev/ixgbe/ixgbe_dcb.c optional ix inet | ixv inet | ixgbe inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" -dev/ixgbe/ixgbe_dcb_82598.c optional ix ixv inet \ +dev/ixgbe/ixgbe_dcb_82598.c optional ix inet | ixv inet | ixgbe inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" -dev/ixgbe/ixgbe_dcb_82599.c optional ix ixv inet \ +dev/ixgbe/ixgbe_dcb_82599.c optional ix inet | ixv inet | ixgbe inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" dev/ixl/if_ixl.c optional ixl inet \ compile-with "${NORMAL_C} -I$S/dev/ixl" diff --git a/sys/dev/ixgbe/if_ix.c b/sys/dev/ixgbe/if_ix.c index 2f119bcf0..9473d916f 100644 --- a/sys/dev/ixgbe/if_ix.c +++ b/sys/dev/ixgbe/if_ix.c @@ -2491,20 +2491,11 @@ ixgbe_setup_interface(device_t dev, struct adapter *adapter) return (-1); } if_initname(ifp, device_get_name(dev), device_get_unit(dev)); - ifp->if_baudrate = IF_Gbps(10); + if_initbaudrate(ifp, IF_Gbps(10)); ifp->if_init = ixgbe_init; ifp->if_softc = adapter; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = ixgbe_ioctl; -#if __FreeBSD_version >= 1100036 - if_setgetcounterfn(ifp, ixgbe_get_counter); -#endif -#if __FreeBSD_version >= 1100045 - /* TSO parameters */ - ifp->if_hw_tsomax = 65518; - ifp->if_hw_tsomaxsegcount = IXGBE_82599_SCATTER; - ifp->if_hw_tsomaxsegsize = 2048; -#endif #ifndef IXGBE_LEGACY_TX ifp->if_transmit = ixgbe_mq_start; ifp->if_qflush = ixgbe_qflush; diff --git a/sys/dev/ixgbe/ixgbe.c b/sys/dev/ixgbe/ixgbe.c new file mode 100644 index 000000000..a85fc323a --- /dev/null +++ b/sys/dev/ixgbe/ixgbe.c @@ -0,0 +1,50 @@ +/****************************************************************************** + + Copyright (c) 2001-2015, Intel Corporation + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +******************************************************************************/ +/*$FreeBSD$*/ + +#include +#include +#include +#include + +static int +mod_event(module_t mod, int cmd, void *arg) +{ + return (0); +} + +static moduledata_t ixgbe_mod = {"if_ixgbe", mod_event}; +DECLARE_MODULE(ixgbe, ixgbe_mod, SI_SUB_EXEC, SI_ORDER_ANY); +MODULE_DEPEND(ixgbe, ix, 1, 1, 1); +MODULE_DEPEND(ixgbe, ixv, 1, 1, 1); + diff --git a/sys/modules/Makefile b/sys/modules/Makefile index 80b44f747..1260ff101 100644 --- a/sys/modules/Makefile +++ b/sys/modules/Makefile @@ -171,9 +171,10 @@ SUBDIR= \ ${_iwifw} \ ${_iwn} \ ${_iwnfw} \ - ${_ixgb} \ ${_ix} \ ${_ixv} \ + ${_ixgb} \ + ${_ixgbe} \ ${_ixl} \ ${_ixlv} \ jme \ @@ -616,6 +617,8 @@ _iwn= iwn .if ${MK_SOURCELESS_UCODE} != "no" _iwnfw= iwnfw .endif +_ix= ix +_ixv= ixv _ixgb= ixgb _ixgbe= ixgbe _mly= mly @@ -722,6 +725,8 @@ _iwn= iwn .if ${MK_SOURCELESS_UCODE} != "no" _iwnfw= iwnfw .endif +_ix= ix +_ixv= ixv _ixgb= ixgb _ixgbe= ixgbe _ixl= ixl diff --git a/sys/modules/ix/Makefile b/sys/modules/ix/Makefile index 1f30cb079..4b5737964 100644 --- a/sys/modules/ix/Makefile +++ b/sys/modules/ix/Makefile @@ -4,7 +4,7 @@ KMOD = if_ix SRCS = device_if.h bus_if.h pci_if.h -SRCS += opt_inet.h opt_inet6.h opt_rss.h +SRCS += opt_inet.h opt_inet6.h SRCS += if_ix.c ix_txrx.c # Shared source SRCS += ixgbe_common.c ixgbe_api.c ixgbe_phy.c ixgbe_mbx.c ixgbe_vf.c diff --git a/sys/modules/ixgbe/Makefile b/sys/modules/ixgbe/Makefile index 22aadb5d0..3a0526b55 100644 --- a/sys/modules/ixgbe/Makefile +++ b/sys/modules/ixgbe/Makefile @@ -1,29 +1,10 @@ #$FreeBSD$ -.include - .PATH: ${.CURDIR}/../../dev/ixgbe KMOD = if_ixgbe SRCS = device_if.h bus_if.h pci_if.h -SRCS += opt_inet.h opt_inet6.h -SRCS += ixgbe.c ixv.c -# Shared source -SRCS += ixgbe_common.c ixgbe_api.c ixgbe_phy.c ixgbe_mbx.c ixgbe_vf.c -SRCS += ixgbe_dcb.c ixgbe_dcb_82598.c ixgbe_dcb_82599.c -SRCS += ixgbe_82599.c ixgbe_82598.c ixgbe_x540.c +SRCS += ixgbe.c CFLAGS+= -I${.CURDIR}/../../dev/ixgbe -DSMP -.if !defined(KERNBUILDDIR) -.if ${MK_INET_SUPPORT} != "no" -opt_inet.h: - @echo "#define INET 1" > ${.TARGET} -.endif - -.if ${MK_INET6_SUPPORT} != "no" -opt_inet6.h: - @echo "#define INET6 1" > ${.TARGET} -.endif -.endif - .include diff --git a/sys/modules/ixv/Makefile b/sys/modules/ixv/Makefile index f8ce347d3..fd428a008 100644 --- a/sys/modules/ixv/Makefile +++ b/sys/modules/ixv/Makefile @@ -4,7 +4,7 @@ KMOD = if_ixv SRCS = device_if.h bus_if.h pci_if.h -SRCS += opt_inet.h opt_inet6.h opt_rss.h +SRCS += opt_inet.h opt_inet6.h SRCS += if_ixv.c ix_txrx.c # Shared source SRCS += ixgbe_common.c ixgbe_api.c ixgbe_phy.c ixgbe_mbx.c ixgbe_vf.c -- 2.45.0