From 5c0999b72b34541a3734a9138c43d5c024a42d47 Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Mon, 19 Jan 2009 15:20:57 -0800 Subject: igb: Replace LRO with GRO This patch makes igb invoke the GRO hooks instead of LRO. As GRO has a compatible external interface to LRO this is a very straightforward replacement. Three things of note: 1) I've kept the LRO Kconfig option until we decide to enable GRO across the board at which point it can also be killed. 2) The poll_controller stuff is broken in igb as it tries to do the same work as the normal poll routine. Since poll_controller can be called in the middle of a poll, this can't be good. I noticed this because poll_controller can invoke the GRO hooks without flushing held GRO packets. However, this should be harmless (assuming the poll_controller bug above doesn't kill you first :) since the next ->poll will clear the backlog. The only time when we'll have a problem is if we're already executing the GRO code on the same ring, but that's no worse than what happens now. 3) I kept the ip_summed check before calling GRO so that we're on par with previous behaviour. Signed-off-by: Herbert Xu Signed-off-by: David S. Miller --- drivers/net/igb/igb.h | 16 ---------------- 1 file changed, 16 deletions(-) (limited to 'drivers/net/igb/igb.h') diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h index 5a27825cc48..7d8c8873915 100644 --- a/drivers/net/igb/igb.h +++ b/drivers/net/igb/igb.h @@ -36,12 +36,6 @@ struct igb_adapter; -#ifdef CONFIG_IGB_LRO -#include -#define MAX_LRO_AGGR 32 -#define MAX_LRO_DESCRIPTORS 8 -#endif - /* Interrupt defines */ #define IGB_MIN_DYN_ITR 3000 #define IGB_MAX_DYN_ITR 96000 @@ -176,10 +170,6 @@ struct igb_ring { struct napi_struct napi; int set_itr; struct igb_ring *buddy; -#ifdef CONFIG_IGB_LRO - struct net_lro_mgr lro_mgr; - bool lro_used; -#endif }; }; @@ -288,12 +278,6 @@ struct igb_adapter { int need_ioport; struct igb_ring *multi_tx_table[IGB_MAX_TX_QUEUES]; -#ifdef CONFIG_IGB_LRO - unsigned int lro_max_aggr; - unsigned int lro_aggregated; - unsigned int lro_flushed; - unsigned int lro_no_desc; -#endif unsigned int tx_ring_count; unsigned int rx_ring_count; }; -- cgit v1.2.3 From aed5dec370e294233d647251ce1e5f74d70b09c9 Mon Sep 17 00:00:00 2001 From: Alexander Duyck Date: Fri, 6 Feb 2009 23:16:04 +0000 Subject: igb: remove check for needing an io port Since igb supports only pci-e nics and there is no plan to support any legacy pci parts in the driver there isn't really much need for checking to see if an io port is needed. In the unlikely event that we do begin supporting legacy pci parts then we can see about adding this code back to the driver. Signed-off-by: Alexander Duyck Signed-off-by: Jeff Kirsher Signed-off-by: David S. Miller --- drivers/net/igb/igb.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'drivers/net/igb/igb.h') diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h index 30657ddf484..530d7aa4cb8 100644 --- a/drivers/net/igb/igb.h +++ b/drivers/net/igb/igb.h @@ -273,10 +273,6 @@ struct igb_adapter { unsigned int flags; u32 eeprom_wol; - /* for ioport free */ - int bars; - int need_ioport; - struct igb_ring *multi_tx_table[IGB_MAX_TX_QUEUES]; unsigned int tx_ring_count; unsigned int rx_ring_count; -- cgit v1.2.3 From a8d2a0c27f84bdbf54b7e1c1a52ef7b8b7196dbc Mon Sep 17 00:00:00 2001 From: Alexander Duyck Date: Fri, 6 Feb 2009 23:17:26 +0000 Subject: igb: rename phy ops This patch renames write_phy_reg to write_reg and read_phy_reg to read_reg. It seems redundant to call out phy in an operation that is part of the phy_ops struct. Signed-off-by: Alexander Duyck Signed-off-by: Jeff Kirsher Signed-off-by: David S. Miller --- drivers/net/igb/igb.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'drivers/net/igb/igb.h') diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h index 530d7aa4cb8..a2a812deb6b 100644 --- a/drivers/net/igb/igb.h +++ b/drivers/net/igb/igb.h @@ -313,24 +313,24 @@ extern void igb_set_ethtool_ops(struct net_device *); static inline s32 igb_reset_phy(struct e1000_hw *hw) { - if (hw->phy.ops.reset_phy) - return hw->phy.ops.reset_phy(hw); + if (hw->phy.ops.reset) + return hw->phy.ops.reset(hw); return 0; } static inline s32 igb_read_phy_reg(struct e1000_hw *hw, u32 offset, u16 *data) { - if (hw->phy.ops.read_phy_reg) - return hw->phy.ops.read_phy_reg(hw, offset, data); + if (hw->phy.ops.read_reg) + return hw->phy.ops.read_reg(hw, offset, data); return 0; } static inline s32 igb_write_phy_reg(struct e1000_hw *hw, u32 offset, u16 data) { - if (hw->phy.ops.write_phy_reg) - return hw->phy.ops.write_phy_reg(hw, offset, data); + if (hw->phy.ops.write_reg) + return hw->phy.ops.write_reg(hw, offset, data); return 0; } -- cgit v1.2.3 From 0fbe67af3ee1928f7eae273133b7112d1665d4d3 Mon Sep 17 00:00:00 2001 From: Alexander Duyck Date: Fri, 6 Feb 2009 23:18:06 +0000 Subject: igb: remove unused rx_hdr_split statistic This statistic is not used and so it is safe to remove Signed-off-by: Alexander Duyck Signed-off-by: Jeff Kirsher Signed-off-by: David S. Miller --- drivers/net/igb/igb.h | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers/net/igb/igb.h') diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h index a2a812deb6b..88fdfe4961d 100644 --- a/drivers/net/igb/igb.h +++ b/drivers/net/igb/igb.h @@ -238,7 +238,6 @@ struct igb_adapter { u64 hw_csum_err; u64 hw_csum_good; - u64 rx_hdr_split; u32 alloc_rx_buff_failed; bool rx_csum; u32 gorc; -- cgit v1.2.3 From eebbbdba5eb44406061e4dff130257b654773d3f Mon Sep 17 00:00:00 2001 From: Alexander Duyck Date: Fri, 6 Feb 2009 23:19:29 +0000 Subject: igb: cleanup igb_netpoll to be more friendly with napi & GRO This patch cleans up igb_netpoll so that it is more friendly with both the current napi and newly introduced GRO features. Signed-off-by: Alexander Duyck Signed-off-by: Jeff Kirsher Signed-off-by: David S. Miller --- drivers/net/igb/igb.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'drivers/net/igb/igb.h') diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h index 88fdfe4961d..0519ae408af 100644 --- a/drivers/net/igb/igb.h +++ b/drivers/net/igb/igb.h @@ -280,9 +280,8 @@ struct igb_adapter { #define IGB_FLAG_HAS_MSI (1 << 0) #define IGB_FLAG_MSI_ENABLE (1 << 1) #define IGB_FLAG_DCA_ENABLED (1 << 2) -#define IGB_FLAG_IN_NETPOLL (1 << 3) -#define IGB_FLAG_QUAD_PORT_A (1 << 4) -#define IGB_FLAG_NEED_CTX_IDX (1 << 5) +#define IGB_FLAG_QUAD_PORT_A (1 << 3) +#define IGB_FLAG_NEED_CTX_IDX (1 << 4) enum e1000_state_t { __IGB_TESTING, -- cgit v1.2.3 From 86d5d38fa1afe2c96f184482d6c6d1a59ee7e2dc Mon Sep 17 00:00:00 2001 From: Alexander Duyck Date: Fri, 6 Feb 2009 23:23:12 +0000 Subject: igb: update version number and copyright dates Update the version number to 1.3.16 and update copyright dates for 2009. Signed-off-by: Alexander Duyck Signed-off-by: Jeff Kirsher Signed-off-by: David S. Miller --- drivers/net/igb/igb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/net/igb/igb.h') diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h index 0519ae408af..e507449b3cc 100644 --- a/drivers/net/igb/igb.h +++ b/drivers/net/igb/igb.h @@ -1,7 +1,7 @@ /******************************************************************************* Intel(R) Gigabit Ethernet Linux driver - Copyright(c) 2007 Intel Corporation. + Copyright(c) 2007-2009 Intel Corporation. This program is free software; you can redistribute it and/or modify it under the terms and conditions of the GNU General Public License, -- cgit v1.2.3 From 38c845c7648ee354fd1d2fb8a7fbc352f2d3dcc3 Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Thu, 12 Feb 2009 05:03:41 +0000 Subject: igb: access to NIC time Adds the register definitions and code to read the time register. Signed-off-by: John Ronciak Signed-off-by: Patrick Ohly Signed-off-by: David S. Miller --- drivers/net/igb/igb.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'drivers/net/igb/igb.h') diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h index e507449b3cc..797a9fe107a 100644 --- a/drivers/net/igb/igb.h +++ b/drivers/net/igb/igb.h @@ -34,6 +34,8 @@ #include "e1000_mac.h" #include "e1000_82575.h" +#include + struct igb_adapter; /* Interrupt defines */ @@ -251,6 +253,8 @@ struct igb_adapter { struct napi_struct napi; struct pci_dev *pdev; struct net_device_stats net_stats; + struct cyclecounter cycles; + struct timecounter clock; /* structs defined in e1000_hw.h */ struct e1000_hw hw; -- cgit v1.2.3 From 33af6bcc005a826726b48e8775df5d58112bc10b Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Thu, 12 Feb 2009 05:03:43 +0000 Subject: igb: use timecompare to implement hardware time stamping Both TX and RX hardware time stamping are implemented. Due to hardware limitations it is not possible to verify reliably which packet was time stamped when multiple were pending for sending; this could be solved by only allowing one packet marked for hardware time stamping into the queue (not implemented yet). RX time stamping relies on the flag in the packet descriptor which marks packets that were time stamped. In "all packet" mode this flag is not set. TODO: also support that mode (even though it'll suffer from race conditions). Signed-off-by: John Ronciak Signed-off-by: Patrick Ohly Signed-off-by: David S. Miller --- drivers/net/igb/igb.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'drivers/net/igb/igb.h') diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h index 797a9fe107a..bb8c35cec1a 100644 --- a/drivers/net/igb/igb.h +++ b/drivers/net/igb/igb.h @@ -35,6 +35,8 @@ #include "e1000_82575.h" #include +#include +#include struct igb_adapter; @@ -255,6 +257,8 @@ struct igb_adapter { struct net_device_stats net_stats; struct cyclecounter cycles; struct timecounter clock; + struct timecompare compare; + struct hwtstamp_config hwtstamp_config; /* structs defined in e1000_hw.h */ struct e1000_hw hw; -- cgit v1.2.3 From cbd347adfee2ba52a8ef85f92a46933d5840cc39 Mon Sep 17 00:00:00 2001 From: Alexander Duyck Date: Sun, 15 Feb 2009 23:59:44 -0800 Subject: igb: remove unused defines This patch removes all of the unused defines from the .h files contained in igb. For some defines there was a use and so I plugged them into the correct locations. Signed-off-by: Alexander Duyck Signed-off-by: Jeff Kirsher Signed-off-by: David S. Miller --- drivers/net/igb/igb.h | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) (limited to 'drivers/net/igb/igb.h') diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h index bb8c35cec1a..1f09e042a5f 100644 --- a/drivers/net/igb/igb.h +++ b/drivers/net/igb/igb.h @@ -40,17 +40,9 @@ struct igb_adapter; -/* Interrupt defines */ -#define IGB_MIN_DYN_ITR 3000 -#define IGB_MAX_DYN_ITR 96000 - /* ((1000000000ns / (6000ints/s * 1024ns)) << 2 = 648 */ #define IGB_START_ITR 648 -#define IGB_DYN_ITR_PACKET_THRESHOLD 2 -#define IGB_DYN_ITR_LENGTH_LOW 200 -#define IGB_DYN_ITR_LENGTH_HIGH 1000 - /* TX/RX descriptor defines */ #define IGB_DEFAULT_TXD 256 #define IGB_MIN_TXD 80 @@ -92,8 +84,6 @@ struct igb_adapter; #define IGB_RXBUFFER_512 512 #define IGB_RXBUFFER_1024 1024 #define IGB_RXBUFFER_2048 2048 -#define IGB_RXBUFFER_4096 4096 -#define IGB_RXBUFFER_8192 8192 #define IGB_RXBUFFER_16384 16384 /* Packet Buffer allocations */ @@ -286,10 +276,9 @@ struct igb_adapter { }; #define IGB_FLAG_HAS_MSI (1 << 0) -#define IGB_FLAG_MSI_ENABLE (1 << 1) -#define IGB_FLAG_DCA_ENABLED (1 << 2) -#define IGB_FLAG_QUAD_PORT_A (1 << 3) -#define IGB_FLAG_NEED_CTX_IDX (1 << 4) +#define IGB_FLAG_DCA_ENABLED (1 << 1) +#define IGB_FLAG_QUAD_PORT_A (1 << 2) +#define IGB_FLAG_NEED_CTX_IDX (1 << 3) enum e1000_state_t { __IGB_TESTING, -- cgit v1.2.3 From 85e8d004ecbc51ead6ae926e15973b42cf07b36e Mon Sep 17 00:00:00 2001 From: Alexander Duyck Date: Mon, 16 Feb 2009 00:00:20 -0800 Subject: igb: transition driver to only using advanced descriptors Currently the driver uses advanced descriptors for its main functionality, but then uses legacy when testing. This patch changes this so that advanced descriptors are used throughout and all mentions of legacy descriptors are removed. Signed-off-by: Alexander Duyck Acked-by: Peter P Waskiewicz Jr Signed-off-by: Jeff Kirsher Signed-off-by: David S. Miller --- drivers/net/igb/igb.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'drivers/net/igb/igb.h') diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h index 1f09e042a5f..49fc0daf45a 100644 --- a/drivers/net/igb/igb.h +++ b/drivers/net/igb/igb.h @@ -180,9 +180,6 @@ struct igb_ring { (&(((union e1000_adv_tx_desc *)((R).desc))[i])) #define E1000_TX_CTXTDESC_ADV(R, i) \ (&(((struct e1000_adv_tx_context_desc *)((R).desc))[i])) -#define E1000_GET_DESC(R, i, type) (&(((struct type *)((R).desc))[i])) -#define E1000_TX_DESC(R, i) E1000_GET_DESC(R, i, e1000_tx_desc) -#define E1000_RX_DESC(R, i) E1000_GET_DESC(R, i, e1000_rx_desc) /* board specific private data structure */ -- cgit v1.2.3 From 1bfaf07bb1d7201d3c6cb984bccd9c2416e19b6c Mon Sep 17 00:00:00 2001 From: Alexander Duyck Date: Thu, 19 Feb 2009 20:39:23 -0800 Subject: igb: add vfs_allocated_count as placeholder for number of vfs This is the first step in supporting sr-iov. The vf_allocated_count value will be 0 until we actually have vfs present. In the meantime it represents an offset value for the start of the queues. Signed-off-by: Alexander Duyck Signed-off-by: Jeff Kirsher Signed-off-by: David S. Miller --- drivers/net/igb/igb.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'drivers/net/igb/igb.h') diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h index 49fc0daf45a..3d3e5f6cd31 100644 --- a/drivers/net/igb/igb.h +++ b/drivers/net/igb/igb.h @@ -57,8 +57,10 @@ struct igb_adapter; #define IGB_MIN_ITR_USECS 10 /* Transmit and receive queues */ -#define IGB_MAX_RX_QUEUES 4 -#define IGB_MAX_TX_QUEUES 4 +#define IGB_MAX_RX_QUEUES (adapter->vfs_allocated_count ? \ + (adapter->vfs_allocated_count > 6 ? 1 : 2) : 4) +#define IGB_MAX_TX_QUEUES IGB_MAX_RX_QUEUES +#define IGB_ABS_MAX_TX_QUEUES 4 /* RX descriptor control thresholds. * PTHRESH - MAC will consider prefetch if it has fewer than this number of @@ -267,9 +269,10 @@ struct igb_adapter { unsigned int flags; u32 eeprom_wol; - struct igb_ring *multi_tx_table[IGB_MAX_TX_QUEUES]; + struct igb_ring *multi_tx_table[IGB_ABS_MAX_TX_QUEUES]; unsigned int tx_ring_count; unsigned int rx_ring_count; + unsigned int vfs_allocated_count; }; #define IGB_FLAG_HAS_MSI (1 << 0) -- cgit v1.2.3 From e173952257d7a3d3c64de3039d9fc02d1fbf49c3 Mon Sep 17 00:00:00 2001 From: Alexander Duyck Date: Thu, 19 Feb 2009 20:39:44 -0800 Subject: igb: add pf side of VMDq support Add the pf portion of vmdq support. This provides enough support so that VMDq is enabled, and the pf is functional without enabling vfs. Signed-off-by: Alexander Duyck Signed-off-by: Jeff Kirsher Signed-off-by: David S. Miller --- drivers/net/igb/igb.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'drivers/net/igb/igb.h') diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h index 3d3e5f6cd31..d925f7dd7fb 100644 --- a/drivers/net/igb/igb.h +++ b/drivers/net/igb/igb.h @@ -88,8 +88,7 @@ struct igb_adapter; #define IGB_RXBUFFER_2048 2048 #define IGB_RXBUFFER_16384 16384 -/* Packet Buffer allocations */ - +#define MAX_STD_JUMBO_FRAME_SIZE 9234 /* How many Tx Descriptors do we need to call netif_wake_queue ? */ #define IGB_TX_QUEUE_WAKE 16 -- cgit v1.2.3 From 4ae196dfd61d06b061c069edcdd7c73121e60a21 Mon Sep 17 00:00:00 2001 From: Alexander Duyck Date: Thu, 19 Feb 2009 20:40:07 -0800 Subject: igb: Add support for enabling VFs to PF driver. This patch adds the support to handle requests from the VF to perform operations such as completing resets, setting/reading mac address, adding vlans, adding multicast addresses, setting rlpml, and general communications between the PF and all VFs. Signed-off-by: Alexander Duyck Signed-off-by: Jeff Kirsher Signed-off-by: David S. Miller --- drivers/net/igb/igb.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'drivers/net/igb/igb.h') diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h index d925f7dd7fb..e18ac1bf45f 100644 --- a/drivers/net/igb/igb.h +++ b/drivers/net/igb/igb.h @@ -62,6 +62,17 @@ struct igb_adapter; #define IGB_MAX_TX_QUEUES IGB_MAX_RX_QUEUES #define IGB_ABS_MAX_TX_QUEUES 4 +#define IGB_MAX_VF_MC_ENTRIES 30 +#define IGB_MAX_VF_FUNCTIONS 8 +#define IGB_MAX_VFTA_ENTRIES 128 + +struct vf_data_storage { + unsigned char vf_mac_addresses[ETH_ALEN]; + u16 vf_mc_hashes[IGB_MAX_VF_MC_ENTRIES]; + u16 num_vf_mc_hashes; + bool clear_to_send; +}; + /* RX descriptor control thresholds. * PTHRESH - MAC will consider prefetch if it has fewer than this number of * descriptors available in its onboard memory. @@ -272,6 +283,7 @@ struct igb_adapter { unsigned int tx_ring_count; unsigned int rx_ring_count; unsigned int vfs_allocated_count; + struct vf_data_storage *vf_data; }; #define IGB_FLAG_HAS_MSI (1 << 0) -- cgit v1.2.3 From c493ea45a4251869fe7b820e0486b73b57df7c12 Mon Sep 17 00:00:00 2001 From: Alexander Duyck Date: Fri, 20 Mar 2009 00:16:50 +0000 Subject: igb: remove IGB_DESC_UNUSED since it is better handled by a function call This patch removes IGB_DESC_UNUSED and replaces it with a function call instead in order to cleanup some of the ugliness introduced by the macro. Signed-off-by: Alexander Duyck Signed-off-by: Jeff Kirsher Signed-off-by: David S. Miller --- drivers/net/igb/igb.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'drivers/net/igb/igb.h') diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h index e18ac1bf45f..4e8464b9df2 100644 --- a/drivers/net/igb/igb.h +++ b/drivers/net/igb/igb.h @@ -182,10 +182,6 @@ struct igb_ring { char name[IFNAMSIZ + 5]; }; -#define IGB_DESC_UNUSED(R) \ - ((((R)->next_to_clean > (R)->next_to_use) ? 0 : (R)->count) + \ - (R)->next_to_clean - (R)->next_to_use - 1) - #define E1000_RX_DESC_ADV(R, i) \ (&(((union e1000_adv_rx_desc *)((R).desc))[i])) #define E1000_TX_DESC_ADV(R, i) \ -- cgit v1.2.3