diff options
author | andrew-elder <aelder@audioscience.com> | 2015-09-25 20:26:45 -0400 |
---|---|---|
committer | andrew-elder <aelder@audioscience.com> | 2015-09-25 20:26:45 -0400 |
commit | 7e00feaf8333e36f97aad0783357f98e20ed0d2c (patch) | |
tree | e7302a60ab3d682ea1dbadbfab0b9d455e0158cf | |
parent | 7e665b9ad198be8844572d3b88ffd2e8410e9ae2 (diff) | |
parent | 6094b59c64b0fcb49493d02d56a29626e7167f58 (diff) | |
download | Open-AVB-7e00feaf8333e36f97aad0783357f98e20ed0d2c.tar.gz |
Merge pull request #296 from htfujina/open-avb-next
Open avb next
-rw-r--r-- | daemons/gptp/linux/build/Makefile | 2 | ||||
-rw-r--r-- | kmod/igb/Makefile | 16 | ||||
-rw-r--r-- | kmod/igb/igb.h | 1 | ||||
-rw-r--r-- | kmod/igb/igb_main.c | 14 | ||||
-rw-r--r-- | kmod/igb/kcompat.h | 92 | ||||
-rw-r--r-- | lib/igb/LICENSE | 2 | ||||
-rw-r--r-- | lib/igb/Makefile | 13 | ||||
-rw-r--r-- | lib/igb/e1000_82575.h | 40 | ||||
-rw-r--r-- | lib/igb/e1000_defines.h | 40 | ||||
-rw-r--r-- | lib/igb/e1000_hw.h | 45 | ||||
-rw-r--r-- | lib/igb/e1000_osdep.h | 40 | ||||
-rw-r--r-- | lib/igb/e1000_regs.h | 40 | ||||
-rw-r--r-- | lib/igb/igb.c | 120 | ||||
-rw-r--r-- | lib/igb/igb.h | 40 | ||||
-rw-r--r-- | lib/igb/igb_internal.h | 40 |
15 files changed, 308 insertions, 237 deletions
diff --git a/daemons/gptp/linux/build/Makefile b/daemons/gptp/linux/build/Makefile index 5b2de34f..a3e1d2b7 100644 --- a/daemons/gptp/linux/build/Makefile +++ b/daemons/gptp/linux/build/Makefile @@ -125,5 +125,5 @@ $(OBJ_DIR)/avbts_osnet.o: $(COMMON_DIR)/avbts_osnet.cpp $(HEADER_FILES) $(CXX) $(CFLAGS) $(CXXFLAGS) -c $(COMMON_DIR)/avbts_osnet.cpp -o $(OBJ_DIR)/avbts_osnet.o clean: - /bin/rm -f *~ $(OBJ_DIR)/*.o $(OBJ_DIR)/daemon_cl + $(RM) *~ $(OBJ_DIR)/*.o $(OBJ_DIR)/daemon_cl diff --git a/kmod/igb/Makefile b/kmod/igb/Makefile index 2265f7b2..69086786 100644 --- a/kmod/igb/Makefile +++ b/kmod/igb/Makefile @@ -117,12 +117,14 @@ ifeq (,$(wildcard $(CONFIG_FILE))) $(error Linux kernel source not configured - missing autoconf.h) endif +ifeq (, $(CC)) # pick a compiler ifneq (,$(findstring egcs-2.91.66, $(shell cat /proc/version))) CC := kgcc gcc cc else CC := gcc cc endif +endif test_cc = $(shell $(cc) --version > /dev/null 2>&1 && echo $(cc)) CC := $(foreach cc, $(CC), $(test_cc)) CC := $(firstword $(CC)) @@ -132,7 +134,9 @@ endif # we need to know what platform the driver is being built on # some additional features are only built on Intel platforms -ARCH := $(shell uname -m | sed 's/i.86/i386/') +ifeq (,$(ARCH)) + ARCH := $(shell uname -m | sed 's/i.86/i386/') +endif ifeq ($(ARCH),alpha) EXTRA_CFLAGS += -ffixed-8 -mno-fp-regs endif @@ -321,8 +325,8 @@ $(MANFILE).gz: $(MANFILE) install: default $(MANFILE).gz # remove all old versions of the driver - find $(INSTALL_MOD_PATH)/lib/modules/$(KVER) -name $(TARGET) -exec rm -f {} \; || true - find $(INSTALL_MOD_PATH)/lib/modules/$(KVER) -name $(TARGET).gz -exec rm -f {} \; || true + find $(INSTALL_MOD_PATH)/lib/modules/$(KVER) -name $(TARGET) -exec $(RM) {} \; || true + find $(INSTALL_MOD_PATH)/lib/modules/$(KVER) -name $(TARGET).gz -exec $(RM) {} \; || true install -D -m 644 $(TARGET) $(INSTALL_MOD_PATH)$(INSTDIR)/$(TARGET) ifeq (,$(INSTALL_MOD_PATH)) /sbin/depmod -a || true @@ -338,15 +342,15 @@ endif uninstall: if [ -e $(INSTDIR)/$(TARGET) ] ; then \ - rm -f $(INSTDIR)/$(TARGET) ; \ + $(RM) $(INSTDIR)/$(TARGET) ; \ fi /sbin/depmod -a if [ -e $(MANDIR)/man$(MANSECTION)/$(MANFILE).gz ] ; then \ - rm -f $(MANDIR)/man$(MANSECTION)/$(MANFILE).gz ; \ + $(RM) $(MANDIR)/man$(MANSECTION)/$(MANFILE).gz ; \ fi .PHONY: clean install clean: - rm -rf $(TARGET) $(TARGET:.ko=.o) $(TARGET:.ko=.mod.c) $(TARGET:.ko=.mod.o) $(CFILES:.c=.o) \ + $(RM) -r $(TARGET) $(TARGET:.ko=.o) $(TARGET:.ko=.mod.c) $(TARGET:.ko=.mod.o) $(CFILES:.c=.o) \ $(MANFILE).gz .*cmd .tmp_versions Module.markers Module.symvers modules.order diff --git a/kmod/igb/igb.h b/kmod/igb/igb.h index dc79d3f4..3e6a96b2 100644 --- a/kmod/igb/igb.h +++ b/kmod/igb/igb.h @@ -788,7 +788,6 @@ extern int igb_up(struct igb_adapter *); extern void igb_down(struct igb_adapter *); extern void igb_reinit_locked(struct igb_adapter *); extern void igb_reset(struct igb_adapter *); -extern int igb_reinit_queues(struct igb_adapter *); #ifdef ETHTOOL_SRXFHINDIR extern void igb_write_rss_indir_tbl(struct igb_adapter *); #endif diff --git a/kmod/igb/igb_main.c b/kmod/igb/igb_main.c index f938e3d0..5ebe137c 100644 --- a/kmod/igb/igb_main.c +++ b/kmod/igb/igb_main.c @@ -1140,7 +1140,7 @@ static int igb_alloc_q_vector(struct igb_adapter *adapter, if (!q_vector) q_vector = kzalloc(size, GFP_KERNEL); else - q_vector = kzalloc(size, GFP_KERNEL); + memset(q_vector, 0, size); if (!q_vector) return -ENOMEM; @@ -2291,14 +2291,16 @@ static int igb_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq, mode = BRIDGE_MODE_VEB; else mode = BRIDGE_MODE_VEPA; - -#ifdef HAVE_NDO_BRIDGE_GETLINK_NLFLAGS +#ifdef HAVE_NDO_DFLT_BRIDGE_GETLINK_VLAN_SUPPORT + return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode, 0, 0, nlflags, + filter_mask, NULL); +#elif defined(HAVE_NDO_BRIDGE_GETLINK_NLFLAGS) return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode, 0, 0, nlflags); -#elif defined(HAVE_NDO_FDB_ADD_VID) +#elif defined(NDO_BRIDGE_GETLINK_HAS_FILTER_MASK_PARAM) return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode, 0, 0); #else return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode); -#endif /* HAVE_NDO_FDB_ADD_VID */ +#endif /* NDO_BRIDGE_GETLINK_HAS_FILTER_MASK_PARAM */ } #endif /* HAVE_BRIDGE_ATTRIBS */ #endif /* HAVE_FDB_OPS */ @@ -7079,7 +7081,7 @@ static bool igb_clean_tx_irq(struct igb_q_vector *q_vector) if (test_bit(__IGB_DOWN, &adapter->state)) return true; - /* dont service user (AVB) queues */ + /* don't service user (AVB) queues */ if (tx_ring->queue_index < 2) return true; diff --git a/kmod/igb/kcompat.h b/kmod/igb/kcompat.h index 9b4728fd..2f33d471 100644 --- a/kmod/igb/kcompat.h +++ b/kmod/igb/kcompat.h @@ -691,6 +691,13 @@ struct _kc_ethtool_pauseparam { #define ETHTOOL_BUSINFO_LEN 32 #endif +#ifndef SPEED_2500 +#define SPEED_2500 2500 +#endif +#ifndef SPEED_5000 +#define SPEED_5000 5000 +#endif + #ifndef RHEL_RELEASE_VERSION #define RHEL_RELEASE_VERSION(a,b) (((a) << 8) + (b)) #endif @@ -794,8 +801,8 @@ struct _kc_ethtool_pauseparam { * the idea is to order from newest to oldest and just catch all * of them using the >= */ -#elif ((LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,45))) -/* SLES12 SP1 is 3.12.45 based */ +#elif ((LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,47))) +/* SLES12 SP1 is 3.12.47-based */ #define SLE_VERSION_CODE SLE_VERSION(12,1,0) #endif /* LINUX_VERSION_CODE == KERNEL_VERSION(x,y,z) */ #endif /* CONFIG_SUSE_KERNEL */ @@ -2291,6 +2298,10 @@ extern struct i2c_client * _kc_i2c_new_device(struct i2c_adapter *adap, struct i2c_board_info const *info); #endif /* HAVE_I2C_SUPPORT */ +#ifndef ETH_P_PAUSE +#define ETH_P_PAUSE 0x8808 +#endif + #else /* 2.6.22 */ #define ETH_TYPE_TRANS_SETS_DEV #define HAVE_NETDEV_STATS_IN_NETDEV @@ -2900,10 +2911,16 @@ static inline int _kc_pm_runtime_get_sync(struct device __always_unused *dev) #endif #else /* < 2.6.32 */ #if (RHEL_RELEASE_CODE && \ - (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(6,1)) && \ + (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(6,2)) && \ (RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(7,0))) #define HAVE_RHEL6_NET_DEVICE_EXTENDED -#endif /* RHEL >= 6.1 && RHEL < 7.0 */ +#endif /* RHEL >= 6.2 && RHEL < 7.0 */ +#if (RHEL_RELEASE_CODE && \ + (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(6,6)) && \ + (RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(7,0))) +#define HAVE_RHEL6_NET_DEVICE_OPS_EXT +#define HAVE_NDO_SET_FEATURES +#endif /* RHEL >= 6.6 && RHEL < 7.0 */ #ifdef CONFIG_DCB #ifndef HAVE_DCBNL_OPS_GETAPP #define HAVE_DCBNL_OPS_GETAPP @@ -4192,6 +4209,12 @@ extern int __kc_dma_set_mask_and_coherent(struct device *dev, u64 mask); #ifndef BIT_ULL #define BIT_ULL(n) (1ULL << (n)) #endif + +#if (SLE_VERSION_CODE && SLE_VERSION_CODE >= SLE_VERSION(12,1,0)) +#undef HAVE_STRUCT_PAGE_PFMEMALLOC +#define HAVE_DCBNL_OPS_SETAPP_RETURN_INT +#endif + #else /* >= 3.13.0 */ #define HAVE_VXLAN_CHECKS #if (UBUNTU_VERSION_CODE && UBUNTU_VERSION_CODE >= UBUNTU_VERSION(3,13,0,24)) @@ -4288,7 +4311,8 @@ static inline void __kc_ether_addr_copy(u8 *dst, const u8 *src) /*****************************************************************************/ #if ( LINUX_VERSION_CODE < KERNEL_VERSION(3,15,0) ) -#if (!( UBUNTU_VERSION_CODE && UBUNTU_VERSION_CODE >= UBUNTU_VERSION(3,13,0,30))) +#if (!(RHEL_RELEASE_CODE && RHEL_RELEASE_CODE > RHEL_RELEASE_VERSION(7,1)) && \ + !(UBUNTU_VERSION_CODE && UBUNTU_VERSION_CODE >= UBUNTU_VERSION(3,13,0,30))) #define u64_stats_fetch_begin_irq u64_stats_fetch_begin_bh #define u64_stats_fetch_retry_irq u64_stats_fetch_retry_bh #endif @@ -4383,11 +4407,17 @@ static inline void __kc_dev_mc_unsync(struct net_device __maybe_unused *dev, } #define __dev_mc_unsync __kc_dev_mc_unsync #endif /* __dev_uc_sync */ + +#if RHEL_RELEASE_CODE && (RHEL_RELEASE_CODE > RHEL_RELEASE_VERSION(7,1)) +#define HAVE_NDO_SET_VF_MIN_MAX_TX_RATE +#endif + #else #define HAVE_NDO_SET_VF_MIN_MAX_TX_RATE #endif /* 3.16.0 */ #if ( LINUX_VERSION_CODE < KERNEL_VERSION(3,17,0) ) +#ifndef timespec64 #define timespec64 timespec static inline struct timespec64 timespec_to_timespec64(const struct timespec ts) { @@ -4409,6 +4439,7 @@ static inline struct timespec timespec64_to_timespec(const struct timespec64 ts6 #define ns_to_timespec64 ns_to_timespec #define ktime_to_timespec64 ktime_to_timespec #define timespec64_add_ns timespec_add_ns +#endif /* timespec64 */ #define hlist_add_behind(_a, _b) hlist_add_after(_b, _a) #else #define HAVE_DCBNL_OPS_SETAPP_RETURN_INT @@ -4463,15 +4494,9 @@ extern void __kc_netdev_rss_key_fill(void *buffer, size_t len); #ifndef dev_alloc_page #define dev_alloc_page() dev_alloc_pages(0) #endif -#if ( !(RHEL_RELEASE_CODE && \ - (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(6,7) && \ - (RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(7,0)))) && \ - !(SLE_VERSION_CODE && \ - (SLE_VERSION_CODE >= SLE_VERSION(11,4,0)) && \ - (SLE_VERSION_CODE != SLE_VERSION(12,0,0)) ) ) - +#if !defined(eth_skb_pad) && !defined(skb_put_padto) /** - * skb_put_padto - increase size and pad an skbuff up to a minimal size + * __kc_skb_put_padto - increase size and pad an skbuff up to a minimal size * @skb: buffer to pad * @len: minimal length * @@ -4480,7 +4505,7 @@ extern void __kc_netdev_rss_key_fill(void *buffer, size_t len); * is untouched. Otherwise it is extended. Returns zero on * success. The skb is freed on error. */ -static inline int skb_put_padto(struct sk_buff *skb, unsigned int len) +static inline int __kc_skb_put_padto(struct sk_buff *skb, unsigned int len) { unsigned int size = skb->len; @@ -4492,11 +4517,15 @@ static inline int skb_put_padto(struct sk_buff *skb, unsigned int len) } return 0; } -static inline int eth_skb_pad(struct sk_buff *skb) +#define skb_put_padto(skb, len) __kc_skb_put_padto(skb, len) + +static inline int __kc_eth_skb_pad(struct sk_buff *skb) { - return skb_put_padto(skb, ETH_ZLEN); + return __kc_skb_put_padto(skb, ETH_ZLEN); } -#endif /* RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(6,7)) */ +#define eth_skb_pad(skb) __kc_eth_skb_pad(skb) +#endif /* eth_skb_pad && skb_put_padto */ + #ifndef napi_alloc_skb static inline struct sk_buff *__kc_napi_alloc_skb(struct napi_struct *napi, unsigned int length) { @@ -4505,16 +4534,26 @@ static inline struct sk_buff *__kc_napi_alloc_skb(struct napi_struct *napi, unsi #define napi_alloc_skb(napi,len) __kc_napi_alloc_skb(napi,len) #endif /* napi_alloc_skb */ #define HAVE_CONFIG_PM_RUNTIME +#if RHEL_RELEASE_CODE && (RHEL_RELEASE_CODE > RHEL_RELEASE_VERSION(7,1)) +#define NDO_BRIDGE_GETLINK_HAS_FILTER_MASK_PARAM +#define HAVE_RXFH_HASHFUNC +#endif /* RHEL_RELEASE_CODE */ #else /* 3.19.0 */ #define HAVE_NDO_FDB_ADD_VID -/* ethtool get/set_rxfh function got a new argument */ #define HAVE_RXFH_HASHFUNC #endif /* 3.19.0 */ #if ( LINUX_VERSION_CODE < KERNEL_VERSION(3,20,0) ) /* vlan_tx_xx functions got renamed to skb_vlan */ +#ifndef skb_vlan_tag_get #define skb_vlan_tag_get vlan_tx_tag_get +#endif +#ifndef skb_vlan_tag_present #define skb_vlan_tag_present vlan_tx_tag_present +#endif +#if RHEL_RELEASE_CODE && (RHEL_RELEASE_CODE > RHEL_RELEASE_VERSION(7,1)) +#define HAVE_INCLUDE_LINUX_TIMECOUNTER_H +#endif #else #define HAVE_INCLUDE_LINUX_TIMECOUNTER_H #define HAVE_NDO_BRIDGE_SET_DEL_LINK_FLAGS @@ -4538,7 +4577,22 @@ static inline void __kc_timecounter_adjtime(struct timecounter *tc, s64 delta) #define HAVE_NDO_BRIDGE_GETLINK_NLFLAGS #endif /* 4,1,0 */ -#if ( LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0) ) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,1,9)) +#if (!(SLE_VERSION_CODE && SLE_VERSION_CODE >= SLE_VERSION(12,1,0))) +static inline bool page_is_pfmemalloc(struct page __maybe_unused *page) +{ +#ifdef HAVE_STRUCT_PAGE_PFMEMALLOC + return page->pfmemalloc; +#else + return false; +#endif +} +#endif /* !SLES12sp1 */ +#else +#undef HAVE_STRUCT_PAGE_PFMEMALLOC +#endif /* 4.1.9 */ + +#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0)) #else #define HAVE_NDO_DFLT_BRIDGE_GETLINK_VLAN_SUPPORT #endif /* 4.2.0 */ diff --git a/lib/igb/LICENSE b/lib/igb/LICENSE index 01da1684..d4256c47 100644 --- a/lib/igb/LICENSE +++ b/lib/igb/LICENSE @@ -1,4 +1,4 @@ - Copyright (c) 2012, Intel Corporation + Copyright (c) 2012-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/lib/igb/Makefile b/lib/igb/Makefile index 3174e212..8a0c4151 100644 --- a/lib/igb/Makefile +++ b/lib/igb/Makefile @@ -3,17 +3,20 @@ INCL=e1000_82575.h e1000_defines.h e1000_hw.h e1000_osdep.h e1000_regs.h igb.h AVBLIB=libigb.a #CFLAGS=-ggdb +CC?=gcc +RANLIB?=ranlib + all: $(AVBLIB) $(AVBLIB): $(addsuffix .o,$(OBJS)) - rm -f $@ - ar rcs $@ $^ - ranlib $@ + $(RM) $@ + $(AR) rcs $@ $^ + $(RANLIB) $@ igb.o: igb.c $(INCL) - gcc -c $(INCFLAGS) $(CFLAGS) igb.c + $(CC) -c $(INCFLAGS) $(CFLAGS) igb.c clean: - rm -f `find . -name "*~" -o -name "*.[oa]" -o -name "\#*\#" -o -name TAGS -o -name core -o -name "*.orig"` + $(RM) `find . -name "*~" -o -name "*.[oa]" -o -name "\#*\#" -o -name TAGS -o -name core -o -name "*.orig"` diff --git a/lib/igb/e1000_82575.h b/lib/igb/e1000_82575.h index 06be3861..bac114ea 100644 --- a/lib/igb/e1000_82575.h +++ b/lib/igb/e1000_82575.h @@ -1,31 +1,31 @@ /****************************************************************************** - Copyright (c) 2001-2012, Intel Corporation + Copyright (c) 2001-2012, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 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 + + 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) + 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. diff --git a/lib/igb/e1000_defines.h b/lib/igb/e1000_defines.h index 005b6c95..f13f0bb3 100644 --- a/lib/igb/e1000_defines.h +++ b/lib/igb/e1000_defines.h @@ -1,31 +1,31 @@ /****************************************************************************** - Copyright (c) 2001-2012, Intel Corporation + Copyright (c) 2001-2012, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 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 + + 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) + 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. diff --git a/lib/igb/e1000_hw.h b/lib/igb/e1000_hw.h index dd138713..1a3c46c7 100644 --- a/lib/igb/e1000_hw.h +++ b/lib/igb/e1000_hw.h @@ -1,31 +1,31 @@ /****************************************************************************** - Copyright (c) 2001-2012, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 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 + + 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) + 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. @@ -71,11 +71,14 @@ struct e1000_hw; #define E1000_DEV_ID_I210_FIBER 0x1536 #define E1000_DEV_ID_I210_SERDES 0x1537 #define E1000_DEV_ID_I210_SGMII 0x1538 +#define E1000_DEV_ID_I210_COPPER_FLASHLESS 0x157B +#define E1000_DEV_ID_I210_SERDES_FLASHLESS 0x157C #define E1000_DEV_ID_I211_COPPER 0x1539 #define E1000_DEV_ID_DH89XXCC_SGMII 0x0438 #define E1000_DEV_ID_DH89XXCC_SERDES 0x043A #define E1000_DEV_ID_DH89XXCC_BACKPLANE 0x043C #define E1000_DEV_ID_DH89XXCC_SFP 0x0440 + #define E1000_REVISION_0 0 #define E1000_REVISION_1 1 #define E1000_REVISION_2 2 @@ -254,7 +257,9 @@ struct e1000_mac_info { struct e1000_hw { void *back; + u8 *hw_addr; + struct e1000_mac_info mac; u16 device_id; u16 subsystem_vendor_id; diff --git a/lib/igb/e1000_osdep.h b/lib/igb/e1000_osdep.h index b23a4f99..53a8cee1 100644 --- a/lib/igb/e1000_osdep.h +++ b/lib/igb/e1000_osdep.h @@ -1,31 +1,31 @@ /****************************************************************************** - Copyright (c) 2001-2012, Intel Corporation + Copyright (c) 2001-2012, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 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 + + 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) + 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. diff --git a/lib/igb/e1000_regs.h b/lib/igb/e1000_regs.h index 94172b38..ab171165 100644 --- a/lib/igb/e1000_regs.h +++ b/lib/igb/e1000_regs.h @@ -1,31 +1,31 @@ /****************************************************************************** - Copyright (c) 2001-2012, Intel Corporation + Copyright (c) 2001-2012, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 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 + + 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) + 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. diff --git a/lib/igb/igb.c b/lib/igb/igb.c index 7b8b5c32..106dc6f5 100644 --- a/lib/igb/igb.c +++ b/lib/igb/igb.c @@ -1,31 +1,31 @@ /****************************************************************************** - Copyright (c) 2001-2012, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 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 + + 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) + 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. @@ -66,11 +66,15 @@ static igb_vendor_info_t igb_vendor_info_array[] = { { 0x8086, E1000_DEV_ID_I210_COPPER, PCI_ANY_ID, PCI_ANY_ID, 0}, + { 0x8086, E1000_DEV_ID_I210_COPPER_FLASHLESS, + PCI_ANY_ID, PCI_ANY_ID, 0}, { 0x8086, E1000_DEV_ID_I210_COPPER_IT, PCI_ANY_ID, PCI_ANY_ID, 0}, { 0x8086, E1000_DEV_ID_I210_COPPER_OEM1, PCI_ANY_ID, PCI_ANY_ID, 0}, { 0x8086, E1000_DEV_ID_I210_FIBER, PCI_ANY_ID, PCI_ANY_ID, 0}, { 0x8086, E1000_DEV_ID_I210_SERDES, PCI_ANY_ID, PCI_ANY_ID, 0}, + { 0x8086, E1000_DEV_ID_I210_SERDES_FLASHLESS, + PCI_ANY_ID, PCI_ANY_ID, 0}, { 0x8086, E1000_DEV_ID_I210_SGMII, PCI_ANY_ID, PCI_ANY_ID, 0}, /* required last entry */ { 0, 0, 0, 0, 0} @@ -156,7 +160,7 @@ igb_attach(char *dev_path, device_t *pdev) goto err_prebind; } - /* + /* * dev_path should look something "0000:01:00.0" */ @@ -399,7 +403,7 @@ igb_init(device_t *dev) return(0); } -static void +static void igb_reset(struct adapter *adapter) { struct tx_ring *txr = adapter->tx_rings; @@ -468,7 +472,7 @@ igb_allocate_pci_resources(struct adapter *adapter) adapter->csr.mmap_size, \ PROT_READ | PROT_WRITE, \ MAP_SHARED, \ - dev, + dev, 0); if (MAP_FAILED == adapter->hw.hw_addr) @@ -538,7 +542,7 @@ igb_dma_free_page(device_t *dev, struct igb_dma_alloc *dma) adapter = (struct adapter *)dev->private_data; if (NULL == adapter) return; - munmap( dma->dma_vaddr, + munmap( dma->dma_vaddr, dma->mmap_size); ubuf.physaddr = dma->dma_paddr; @@ -792,13 +796,13 @@ igb_tx_ctx_setup(struct tx_ring *txr, struct igb_packet *packet) /********************************************************************* * * This routine maps a single buffer to an Advanced TX descriptor. - * returns ENOSPC if we run low on tx descriptors and the app needs to + * returns ENOSPC if we run low on tx descriptors and the app needs to * cleanup descriptors. * * this is a simplified routine which doesn't do LSO, checksum offloads, * multiple fragments, etc. The provided buffers are assumed to have * been previously mapped with the provided dma_malloc_page routines. - * + * **********************************************************************/ int @@ -859,13 +863,13 @@ igb_xmit(device_t *dev, unsigned int queue_index, struct igb_packet *packet) goto unlock; } - /* + /* * Set up the context descriptor to specify * launchtimes for the packet. */ igb_tx_ctx_setup(txr, packet); - /* + /* * for performance monitoring, report the DMA time of the tx desc wb */ olinfo_status |= E1000_TXD_DMA_TXDWB; @@ -927,7 +931,7 @@ unlock: } void -igb_trigger(device_t *dev, u_int32_t data) +igb_trigger(device_t *dev, u_int32_t data) { struct adapter *adapter; @@ -948,7 +952,7 @@ igb_trigger(device_t *dev, u_int32_t data) } void -igb_writereg(device_t *dev, u_int32_t reg, u_int32_t data) +igb_writereg(device_t *dev, u_int32_t reg, u_int32_t data) { struct adapter *adapter; @@ -960,7 +964,7 @@ igb_writereg(device_t *dev, u_int32_t reg, u_int32_t data) } void -igb_readreg(device_t *dev, u_int32_t reg, u_int32_t *data) +igb_readreg(device_t *dev, u_int32_t reg, u_int32_t *data) { struct adapter *adapter; @@ -997,7 +1001,7 @@ int igb_unlock( device_t *dev ) { /********************************************************************** * * Examine each tx_buffer in the used queue. If the hardware is done - * processing the packet then return the linked list of associated resources. + * processing the packet then return the linked list of associated resources. * **********************************************************************/ void @@ -1030,24 +1034,24 @@ igb_clean(device_t *dev, struct igb_packet **cleaned_packets) txr->queue_status = IGB_QUEUE_IDLE; continue; } - + processed = 0; first = txr->next_to_clean; tx_desc = &txr->tx_base[first]; tx_buffer = &txr->tx_buffers[first]; last = tx_buffer->next_eop; eop_desc = &txr->tx_base[last]; - + /* * What this does is get the index of the - * first descriptor AFTER the EOP of the + * first descriptor AFTER the EOP of the * first packet, that way we can do the * simple comparison on the inner while loop. */ if (++last == adapter->num_tx_desc) last = 0; done = last; - + while (eop_desc->upper.fields.status & E1000_TXD_STAT_DD) { /* We clean the range of the packet */ while (first != done) { @@ -1056,12 +1060,12 @@ igb_clean(device_t *dev, struct igb_packet **cleaned_packets) /* tx_buffer->packet->dmatime += (tx_desc->buffer_addr >> 32) * 1000000000; */ txr->bytes += tx_buffer->packet->len; - if (*cleaned_packets == NULL) + if (*cleaned_packets == NULL) *cleaned_packets = tx_buffer->packet; - else + else last_reclaimed->next = tx_buffer->packet; last_reclaimed = tx_buffer->packet; - + tx_buffer->packet = NULL; } tx_buffer->next_eop = -1; @@ -1070,11 +1074,11 @@ igb_clean(device_t *dev, struct igb_packet **cleaned_packets) tx_desc->buffer_addr = 0; ++txr->tx_avail; ++processed; - - + + if (++first == adapter->num_tx_desc) first = 0; - + tx_buffer = &txr->tx_buffers[first]; tx_desc = &txr->tx_base[first]; } @@ -1088,12 +1092,12 @@ igb_clean(device_t *dev, struct igb_packet **cleaned_packets) } else break; } - + txr->next_to_clean = first; - - if (txr->tx_avail >= IGB_QUEUE_THRESHOLD) + + if (txr->tx_avail >= IGB_QUEUE_THRESHOLD) txr->queue_status &= ~IGB_QUEUE_DEPLETED; - } + } unlock: if( sem_post( adapter->memlock ) != 0 ) { @@ -1180,7 +1184,7 @@ igb_get_wallclock(device_t *dev, u_int64_t *curtime, u_int64_t *rdtsc) err: return error; -} +} struct timespec timespec_subtract( struct timespec *a, struct timespec *b ) { @@ -1272,12 +1276,12 @@ igb_gettime(device_t *dev, clockid_t clk_id, u_int64_t *curtime, return error; } -int -igb_set_class_bandwidth(device_t *dev, +int +igb_set_class_bandwidth(device_t *dev, u_int32_t class_a, u_int32_t class_b, u_int32_t tpktsz_a, - u_int32_t tpktsz_b) + u_int32_t tpktsz_b) { u_int32_t tqavctrl; u_int32_t tqavcc0, tqavcc1; @@ -1309,13 +1313,13 @@ igb_set_class_bandwidth(device_t *dev, if (link.duplex != FULL_DUPLEX ) return EINVAL; - if (tpktsz_a < 64) + if (tpktsz_a < 64) tpktsz_a = 64; /* minimum ethernet frame size */ if (tpktsz_a > 1500) return EINVAL; - if (tpktsz_b < 64) + if (tpktsz_b < 64) tpktsz_b = 64; /* minimum ethernet frame size */ if (tpktsz_b > 1500) @@ -1336,10 +1340,10 @@ igb_set_class_bandwidth(device_t *dev, tqavcc0 = E1000_TQAVCC_QUEUEMODE; tqavcc1 = E1000_TQAVCC_QUEUEMODE; - + linkrate = E1000_TQAVCC_LINKRATE; - /* + /* * class_a and class_b are the packets-per-(respective)observation * interval (125 usec for class A, 250 usec for class B) * these parameters are also used when establishing the MSRP @@ -1359,12 +1363,12 @@ igb_set_class_bandwidth(device_t *dev, if (link.speed == 100) { class_a_percent /= (100000000.0 / 8); /* bytes-per-sec @ 100Mbps */ - class_b_percent /= (100000000.0 / 8); + class_b_percent /= (100000000.0 / 8); class_a_idle = (u_int32_t)(class_a_percent * 0.2 * (float)linkrate + 0.5); class_b_idle = (u_int32_t)(class_b_percent * 0.2 * (float)linkrate + 0.5); } else { class_a_percent /= (1000000000.0 / 8); /* bytes-per-sec @ 1Gbps */ - class_b_percent /= (1000000000.0 / 8); + class_b_percent /= (1000000000.0 / 8); class_a_idle = (u_int32_t)(class_a_percent * 2.0 * (float)linkrate + 0.5); class_b_idle = (u_int32_t)(class_b_percent * 2.0 * (float)linkrate + 0.5); } @@ -1376,7 +1380,7 @@ igb_set_class_bandwidth(device_t *dev, tqavcc0 |= class_a_idle; tqavcc1 |= class_b_idle; - /* + /* * hiCredit is the number of idleslope credits accumulated due to delay T * * we assume the maxInterferenceSize is 18 + 4 + 1500 (1522). @@ -1385,7 +1389,7 @@ igb_set_class_bandwidth(device_t *dev, */ tqavhc0 = 0x80000000 + (class_a_idle * 1522 / linkrate ); /* L.10 */ - /* + /* * Class B high credit is is the same, except the delay * is the MaxBurstSize of Class A + maxInterferenceSize of non-SR traffic * diff --git a/lib/igb/igb.h b/lib/igb/igb.h index c25a16a1..beddfc67 100644 --- a/lib/igb/igb.h +++ b/lib/igb/igb.h @@ -1,31 +1,31 @@ /****************************************************************************** - Copyright (c) 2001-2012, Intel Corporation + Copyright (c) 2001-2012, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 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 + + 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) + 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. diff --git a/lib/igb/igb_internal.h b/lib/igb/igb_internal.h index 9fea690a..72c3dfc4 100644 --- a/lib/igb/igb_internal.h +++ b/lib/igb/igb_internal.h @@ -1,31 +1,31 @@ /****************************************************************************** - Copyright (c) 2001-2012, Intel Corporation + Copyright (c) 2001-2012, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 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 + + 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) + 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. |