Eric Dumazet [Thu, 20 Oct 2011 09:22:18 +0000 (09:22 +0000)]
igbvf: fix truesize underestimation
igbvf allocates half a page per skb fragment. We must account
PAGE_SIZE/2 increments on skb->truesize, not the actual frag length.
(cherry picked from commit 7b8b59617ead5acc6ff041a9ad2ea1fe7a58094f) Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> CC: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Greg Rose [Sat, 27 Aug 2011 06:24:59 +0000 (06:24 +0000)]
igbvf: Fix trunk vlan
Changes to clean up the VLAN Rx path by Jiri Pirko broke trunk VLAN.
Trunk VLANs in a VF driver are those set using
"ip link set <pfdev> vf <n> <vlanid>"
(cherry picked from commit 4d2d55ac94f52ea8787270ec29579ced83f5f96b) Signed-off-by: Greg Rose <gregory.v.rose@intel.com> CC: Jiri Pirko <jpirko@redhat.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Michał Mirosław [Tue, 30 Aug 2011 17:07:11 +0000 (17:07 +0000)]
igbvf: convert to ndo_fix_features
Private rx_csum flags are now duplicate of netdev->features & NETIF_F_RXCSUM.
Removing this needs deeper surgery.
Things noticed:
- HW VLAN acceleration probably can be toggled, but it's left as is
- the resets on RX csum offload change can probably be avoided
- there is A LOT of copy-and-pasted code here
(cherry picked from commit fd38f734cb8200529e281338514945fcbff2364b) Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Benjamin Poirier [Thu, 10 May 2012 15:38:37 +0000 (15:38 +0000)]
igb: fix rtnl race in PM resume path
Since the caller (PM resume code) is not the one holding rtnl, when taking the
'else' branch rtnl may be released at any moment, thereby defeating the whole
purpose of this code block.
(cherry picked from commit cfb8c3aa59302636c69890be10b2ef23a7ca83b2) Signed-off-by: Benjamin Poirier <bpoirier@suse.de> Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Emil Tantilov [Sat, 28 Jan 2012 08:10:35 +0000 (08:10 +0000)]
igb: fix warning about unused function
This patch fixes a warning about unused function when CONFIG_PM_SLEEP
is not selected in the kernel config:
igb_main.c: warning: `igb_suspend` defined but not used [W-unused-function]
(cherry picked from commit d9dd966d7fc088a6bed991c2b1e2fba4485e0a31) Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Greg Rose [Thu, 2 Feb 2012 23:51:43 +0000 (23:51 +0000)]
igb: fix vf lookup
Recent addition of code to find already allocated VFs failed to take
account that systems with 2 or more multi-port SR-IOV capable controllers
might have already enabled VFs. Make sure that the VFs the function is
finding are actually subordinate to the particular instance of the adapter
that is looking for them and not subordinate to some device that has
previously enabled SR-IOV.
This is applicable to 3.2+ kernels.
CC: stable@vger.kernel.org Reported-by: David Ahern <daahern@cisco.com>
(cherry picked from commit 0629292117572a60465f38cdedde2f8164c3df0b) Signed-off-by: Greg Rose <gregory.v.rose@intel.com> Tested-by: Robert E Garrett <robertX.e.garrett@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Carolyn Wyborny [Wed, 18 Jan 2012 22:13:27 +0000 (22:13 +0000)]
igb: Update Copyright on all Intel copyrighted files.
(cherry picked from commit 6e861326b1d78bb439c0724864a6ca83ec23d289) Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Stephen Hemminger [Wed, 18 Jan 2012 22:13:26 +0000 (22:13 +0000)]
igb: make local functions static
Sparse caught two functions that were only being used in one file.
(cherry picked from commit c50b52a0c7ec8522983f5021c0b0952b4d678adf) Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Koki Sanagi [Wed, 4 Jan 2012 20:23:38 +0000 (20:23 +0000)]
igb: reset PHY after recovering from PHY power down
According to 82576_Datasheet.pdf, PHY setting is lost after PHY power down.
So resetting PHY is needed when recovering from PHY power down to set a default
setting to PHY register.
Owing to this lack, NIC doesn't link up in some rare situation.
(cherry picked from commit a95a07445ee97a2fef65befafbadcc30ca1bd145) Signed-off-by: Koki Sanagi <sanagi.koki@jp.fujitsu.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Yan, Zheng [Wed, 4 Jan 2012 20:23:37 +0000 (20:23 +0000)]
igb: add basic runtime PM support
Use the runtime power management framework to add basic runtime PM support
to the igb driver. Namely, make the driver suspend the device when the link
is off and set it up for generating a wakeup event after the link has been
detected again. This feature is disabled by default.
Based on e1000e's runtime PM code.
Changes since v1:
Don't suspend the device when shutting down the interface.
Avoid race between runtime suspending and ethtool operations.
(cherry picked from commit 749ab2cd127046df79084b6b9165b23491b1db5f) Signed-off-by: Zheng Yan <zheng.z.yan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Carolyn Wyborny [Fri, 2 Dec 2011 00:03:15 +0000 (00:03 +0000)]
igb: Add flow control advertising to ethtool setting.
Added pause flag for bi-directional flow control advertising to ethtool
settings.
(cherry picked from commit f83396ad8318db0d5e55756a496af61a217bbfda) Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Matthew Vick [Thu, 17 Nov 2011 08:33:12 +0000 (08:33 +0000)]
igb: Update DMA Coalescing threshold calculation.
This patch updates the DMA Coalescing feature parameters to account for
larger MTUs. Previously, sufficient space may not have been allocated in
the receive buffer, causing packet drop.
(cherry picked from commit e8c626e9d8e99fdffd8af0e535ed5ac76ed356db) Signed-off-by: Matthew Vick <matthew.vick@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Joe Perches [Fri, 21 Oct 2011 20:04:09 +0000 (20:04 +0000)]
igb: Convert bare printk to pr_notice
printks should use KERN_ levels.
(cherry picked from commit 82bbcdebbac75bf7636bf63ac0e6e4a49b128978) Signed-off-by: Joe Perches <joe@perches.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Jeff Kirsher [Fri, 21 Oct 2011 20:01:34 +0000 (20:01 +0000)]
igb: Convert printks to pr_<level>
Based on original patch from Joe Perches <joe@perches.com>
Use the current logging styles.
pr_<level> conversions are now prefixed with "igb: "
Correct a defect where the trailing NTU may have been printed
on a separate line because of an interleaving hex_dump.
Remove unnecessary uses of KERN_CONT and use single pr_info()s
to avoid any possible output interleaving from other modules.
Coalesce formats as appropriate.
-v2 fix-up to make checkpatch.pl compliant and remove change to
the copyright line
CC: Joe Perches <joe@perches.com>
(cherry picked from commit 876d2d6f6e60b1170f7ed664b9659def92b87be3) Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Kantecki, Tomasz [Mon, 17 Oct 2011 22:06:59 +0000 (22:06 +0000)]
igb: Fix for I347AT4 PHY cable length unit detection
The PHY cable length unit detection was not using the correct
the correct PHY data variable for I347AT4.
(cherry picked from commit d5a0e3640c05b7d07c548f9f8f986dbb87cfad98) Signed-off-by: Tomasz Kantecki <tomasz.kantecki@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Carolyn Wyborny [Fri, 14 Oct 2011 00:13:49 +0000 (00:13 +0000)]
igb: VFTA Table Fix for i350 devices
Due to a hardware problem, writes to the VFTA register can
theoretically fail. Although the likelihood of this is very low.
This patch adds a shadow vfta in the adapter struct for reading
and adds new write functions for these devices to work around the problem.
(cherry picked from commit 1128c756bef8285db3bbde5b26d4a6b4c7e2e613) Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Carolyn Wyborny [Thu, 13 Oct 2011 17:29:59 +0000 (17:29 +0000)]
igb: Move DMA Coalescing init code to separate function.
This patch moves the DMA Coalescing feature initialization code from
igb_reset to a new function and replaces it with a call to the new
function.
(cherry picked from commit b6e0c419f040cee87813660bb4efd1fe43a8ebee) Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Carolyn Wyborny [Thu, 13 Oct 2011 17:28:39 +0000 (17:28 +0000)]
igb: Fix for Alt MAC Address feature on 82580 and later devices
In 82580 and later devices, the alternate MAC address feature is
completely handled by the option ROM and software does not handle
it anymore. This patch changes the check_alt_mac_addr function to
exit immediately if device is 82580 or later.
(cherry picked from commit 65189d284b48bd2e747e8cf9dfb0ff63b859682f) Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
RongQing Li [Tue, 18 Oct 2011 22:52:35 +0000 (22:52 +0000)]
igb: fix a compile warning
control these three function declarations and
definitions with same macro CONFIG_PCI_IOV
drivers/net/igb/igb_main.c:165:
warning: ‘igb_vf_configure’ declared ‘static’ but never defined
drivers/net/igb/igb_main.c:166:
warning: ‘igb_find_enabled_vfs’ declared ‘static’ but never defined
drivers/net/igb/igb_main.c:167:
warning: ‘igb_check_vf_assignment’ declared ‘static’ but never defined
(cherry picked from commit 46a016985a442b499faa52dff7e74a79f6a22cef) Signed-off-by: RongQing Li <roy.qing.li@gmail.com> Acked-by: Greg Rose <gregory.v.rose@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Greg Rose [Fri, 14 Oct 2011 02:57:14 +0000 (02:57 +0000)]
igb: Check if subordinate VFs are assigned to virtual machines
Kvm and the Xen pci-back driver will set a flag in the virtual function
pci device dev_flags when the VF is assigned to a guest VM. Before
destroying subordinate VFs check to see if the flag is set and if so
skip the call to pci_disable_sriov() to avoid system crashes.
Copy the maintainer for the Xen pci-back driver. Also CC'ing
maintainers of all drivers found to call pci_disable_sriov().
V2 - Fix uninitialized variable warning
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Cc: Christian Benvenuti <benve@cisco.com> Cc: Sathya Perla <sathya.perla@emulex.com> Cc: Dimitris Michailidis <dm@chelsio.com> Cc: Jon Mason <jdmason@kudzu.us> Cc: James Smart <james.smart@emulex.com>
(cherry picked from commit 0224d663063d542b3d829706f3fcbd0f640f19b3) Signed-off-by: Greg Rose <gregory.v.rose@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Greg Rose [Fri, 22 Jul 2011 05:46:07 +0000 (05:46 +0000)]
pci: Add flag indicating device has been assigned by KVM
Device drivers that create and destroy SR-IOV virtual functions via
calls to pci_enable_sriov() and pci_disable_sriov can cause catastrophic
failures if they attempt to destroy VFs while they are assigned to
guest virtual machines. By adding a flag for use by the KVM module
to indicate that a device is assigned a device driver can check that
flag and avoid destroying VFs while they are assigned and avoid system
failures.
CC: Ian Campbell <ijc@hellion.org.uk> CC: Konrad Wilk <konrad.wilk@oracle.com> Signed-off-by: Greg Rose <gregory.v.rose@intel.com> Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 6777829cfe1c4ed78319ad40aaee60254222da76)
Jacob Keller [Wed, 12 Oct 2011 00:51:54 +0000 (00:51 +0000)]
igb: enable l4 timestamping for v2 event packets
When enabling hardware timestamping for ptp v2 event packets, the
software does not setup the queue for l4 packets, although layer 4
packets are valid for v2. This patch adds the flag which enables
setting up a queue and enabling udp packet timestamping.
(cherry picked from commit 11ba69e876e1141fa4b11a7c0efb256a8df9ae7d) Signed-off-by: Jacob E Keller <jacob.e.keller@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Eric Dumazet [Thu, 13 Oct 2011 07:56:41 +0000 (07:56 +0000)]
igb: fix skb truesize underestimation
e1000 allocates half a page per skb fragment. We must account
PAGE_SIZE/2 increments on skb->truesize, not the actual frag length.
(cherry picked from commit 95b9c1dfb7b929f5f3b203ed95c28bdfd069d122) Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Carolyn Wyborny [Fri, 7 Oct 2011 07:00:27 +0000 (07:00 +0000)]
igb: Version bump.
This change updates the driver version to 3.2.10.
(cherry picked from commit a28dc43f1d8dfc4fe61c9b9505c1b902285c96b8) Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
igb: Loopback functionality supports for i350 devices
This patch adds VMDq loopback pf support for i350 devices. The patch
is necessary since the register that enabled loopback was moved and
renamed from DTXSWC to TXSWC.
(cherry picked from commit ca2e3e7ec98937e12df4bbdcc9a367b8768290ce) Signed-off-by: "Akeem G. Abodunrin" <akeem.g.abodunrin@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Emil Tantilov [Tue, 30 Aug 2011 06:35:04 +0000 (06:35 +0000)]
igb: fix static function warnings reported by sparse
igb_update/validate_nvm_checksum_with_offset() should be static.
Also removes unneeded prototypes for the above functions.
(cherry picked from commit bed45a6ed51d00007f5eb6d75560218ddcecfe51) Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Alexander Duyck [Fri, 26 Aug 2011 07:47:11 +0000 (07:47 +0000)]
igb: Add workaround for byte swapped VLAN on i350 local traffic
On i350 when traffic is looped back from a VF to the PF the value is byte
swapped from the normal format. In order to address this we need to add a
flag indicating that the ring will need to byte swap the loopback packets
prior to processing them.
(cherry picked from commit 8be10e9130a75c49ddcffdfca74b19b1c3169230) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Alexander Duyck [Fri, 26 Aug 2011 07:47:01 +0000 (07:47 +0000)]
igb: Drop unnecessary write of E1000_IMS from igb_msix_other
Since we mask interrupts in EIMS not in IMS there is no need to re-enable
mask bits in that register. As such we can remove the write to IMS from
the end of igb_msix_other.
(cherry picked from commit 9ab64ba3c74540cfb8716232834df486bcc6120d) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Alexander Duyck [Fri, 26 Aug 2011 07:46:55 +0000 (07:46 +0000)]
igb: Fix features that are currently 82580 only and should also be i350
This change allows support for per packet timesync and global device reset
on the i350 adapter. These features were supported on both 82580 and i350
however it looks like several checks where not updated and as such the i350
support was not enabled.
(cherry picked from commit 06218a8dbf046c0e9ba51dcbe1ce980a10a0be42) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Alexander Duyck [Fri, 26 Aug 2011 07:46:45 +0000 (07:46 +0000)]
igb: Make certain one vector is always assigned in igb_request_irq
This change makes certain that one interrupt is always initialized in
igb_request_irq. In addition we drop the use of adapter->pdev and
instead just call pdev since we made a local copy of the pointer earlier in
the function.
(cherry picked from commit c74d588e2addd9a13cca49a4d9172e0e2948448f) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Alexander Duyck [Fri, 26 Aug 2011 07:46:34 +0000 (07:46 +0000)]
igb: avoid unnecessarily creating a local copy of the q_vector
This is mostly a drop of unnecessary pointer defines for q_vector when we
don't have issues with line width and don't have multiple references to
the pointer.
(cherry picked from commit 0d1ae7f46f1b51623bed2904576d15f6ecd5dc10) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Alexander Duyck [Fri, 26 Aug 2011 07:46:29 +0000 (07:46 +0000)]
igb: add support for NETIF_F_RXHASH
This patch adds support for Rx hashing.
(cherry picked from commit 077887c386226e4def56898449c26bb15f523728) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Alexander Duyck [Fri, 26 Aug 2011 07:46:19 +0000 (07:46 +0000)]
igb: move TX hang check flag into ring->flags
This change moves the Tx hang check into the ring flags.
(cherry picked from commit 6d095fa8cb1bb87fe8bf956cdf6211e784b4c9e4) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Alexander Duyck [Fri, 26 Aug 2011 07:46:08 +0000 (07:46 +0000)]
igb: fix recent VLAN changes that would leave VLANs disabled after reset
This patch cleans up several issues with VLANs on igb after the recent
changes that were meant to leave the VLANs enabled/disable via the
netdev->features flags.
Specifically the Rx VLAN settings were being dropped after reset due to the
fact that they were not being restored correctly. In addition I removed
the IRQ disable/enable since those were in place to protect the setting of
vlgrp.
(cherry picked from commit 5faf030c9b6cc48c33301b4f3341f2b5c374f6b5) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Alexander Duyck [Fri, 26 Aug 2011 07:46:03 +0000 (07:46 +0000)]
igb: leave staterr in place and instead us a helper function to check bits
Instead of doing a byte swap on the staterr bits in the Rx descriptor we can
save ourselves a bit of space and some CPU time by instead just testing for
the various bits out of the Rx descriptor directly.
(cherry picked from commit 3ceb90fd4898853cdac43084f0c6ee7270cb15f3) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Alexander Duyck [Fri, 26 Aug 2011 07:45:57 +0000 (07:45 +0000)]
igb: retire the RX_CSUM flag and use the netdev flag instead
Since the netdev now has its' own checksum flag to indicate if Rx checksum
is enabled we might as well use that instead of using the ring flag.
(cherry picked from commit 294e7d78f5b929536b81620ed33c6507f2921463) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Alexander Duyck [Fri, 26 Aug 2011 07:45:52 +0000 (07:45 +0000)]
igb: cleanup IVAR configuration
This change is meant to cleanup some of the IVAR register configuration.
igb_assign_vector had become pretty large with multiple copies of the same
general code for setting the IVAR. This change consolidates most of that
code by adding the igb_write_ivar function which allows us just to compute
the index and offset and then use that information to setup the IVAR.
(cherry picked from commit 4be000c874576541cd1d4d0498a0a72a1c60bf0b) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Alexander Duyck [Fri, 26 Aug 2011 07:45:47 +0000 (07:45 +0000)]
igb: Move ITR related data into work container within the q_vector
This change moves information related to interrupt throttle rate
configuration into a separate q_vector sub-structure called a work
container. A similar change has already been made for ixgbe and this work
is based off of that.
(cherry picked from commit 0ba829943c5180d458cd8fc37c37fa08773209e1) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Alexander Duyck [Fri, 26 Aug 2011 07:45:36 +0000 (07:45 +0000)]
igb: Consolidate all of the ring feature flags into a single value
This change moves all of the ring flags into a single value. The advantage
to this is that there is one central area for all of these flags and they
can all make use of the set/test bit operations.
(cherry picked from commit 866cff06903ed63b7410c75ce8d4e0c86127a563) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Alexander Duyck [Fri, 26 Aug 2011 07:45:26 +0000 (07:45 +0000)]
igb: avoid unnecessary conversions from u16 to int
There are a number of places where we have values that are stored as u16
but are being converted to int unnecessarily. In order to avoid that we
should convert all variables that deal with the next_to_clean, next_to_use,
and count to u16 values.
(cherry picked from commit 6ad4edfcd7b6321da34e7cd0c88dd97adddd7f57) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Alexander Duyck [Fri, 26 Aug 2011 07:45:20 +0000 (07:45 +0000)]
igb: Use node specific allocations for the q_vectors and rings
This change is meant to update the ring and vector allocations so that they
are per node instead of allocating everything on the node that
ifconfig/modprobe is called on. By doing this we can cut down
significantly on cross node traffic.
(cherry picked from commit 81c2fc22323f461aee30cf7028a79eb67426e4b6) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Alexander Duyck [Fri, 26 Aug 2011 07:45:15 +0000 (07:45 +0000)]
igb: push data into first igb_tx_buffer sooner to reduce stack usage
Instead of storing most of the data for the TX hot path in the stack until
we are ready to write the descriptor we can save ourselves some time and
effort by pushing the SKB, tx_flags, gso_size, bytecount, and protocol into
the first igb_tx_buffer since that is where we will end up putting it
anyway.
(cherry picked from commit 7af40ad909e3e92a1cbb728999c427d2fa3b381d) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Alexander Duyck [Fri, 26 Aug 2011 07:45:09 +0000 (07:45 +0000)]
igb: consolidate creation of Tx buffer info and data descriptor
This change will combine the writes of tx_buffer_info and the Tx data
descriptors into a single function. The advantage of this is that we can
avoid needless memory reads from the buffer info struct and speed things up
by keeping the accesses to the local registers.
(cherry picked from commit ebe42d169bd0b4c3e2e355374d07ba7d51744601) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Alexander Duyck [Fri, 26 Aug 2011 07:44:59 +0000 (07:44 +0000)]
igb: Combine all flag info fields into a single tx_flags structure
This change is meant to combine all of the TX flags fields into one u32
flags field so that it can be stored into the tx_buffer_info structure.
This includes the time stamp flag as well as mapped_as_page flag info.
(cherry picked from commit 2bbfebe2db3453f9ad5a3de56b77d383b91a7829) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Alexander Duyck [Fri, 26 Aug 2011 07:44:53 +0000 (07:44 +0000)]
igb: Cleanup protocol handling in transmit path
This change is meant to cleanup the protocol handling in the transmit path
so that it correctly offloads software VLAN tagged frames.
(cherry picked from commit 31f6adbb352ae118550ab51f2a5ed1023ec7eb03) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Alexander Duyck [Fri, 26 Aug 2011 07:44:48 +0000 (07:44 +0000)]
igb: Create separate functions for generating cmd_type and olinfo
This change is meant to improve the readability of the driver by separating
out the cmd_type configuration and the olinfo configuration into their own
functions. By doing this it is much easier to determine which ingredients
go into setting up these to portions of the descriptor.
(cherry picked from commit e032afc80ca16e6b62cfe5938977bf678eec0dd0) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Alexander Duyck [Fri, 26 Aug 2011 07:44:43 +0000 (07:44 +0000)]
igb: Make first and tx_buffer_info->next_to_watch into pointers
This change converts two tx_buffer_info index values into pointers. The
advantage to this is that we reduce unnecessary computations and in the case
of next_to_watch we get an added bonus of the value being able to provide
additional information as a NULL value indicates it is unset versus a 0 not
having any meaning for the index value.
(cherry picked from commit 8542db05dbc99f603889c349e5cf8f3f81cddbf5) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Alexander Duyck [Fri, 26 Aug 2011 07:44:32 +0000 (07:44 +0000)]
igb: Consolidate creation of Tx context descriptors into a single function
This patch is meant to simplify the transmit path by reducing the overhead
for creating a transmit context descriptor. The current implementation is
split with igb_tso and igb_tx_csum doing two separate implementations on
how to setup the tx_buffer_info structure and the tx_desc. By combining
them it is possible to reduce code and simplify things since now only one
function will create context descriptors.
(cherry picked from commit 7d13a7d0da74d127457cc6f88e47fd8e85960a13) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Ian Campbell [Mon, 29 Aug 2011 23:18:26 +0000 (23:18 +0000)]
intel: convert to SKB paged frag API.
(cherry picked from commit 877749bf3f2f7a517ae74cd2c2fa4eed7aa9b51d) Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Cc: Jesse Brandeburg <jesse.brandeburg@intel.com> Cc: Bruce Allan <bruce.w.allan@intel.com> Cc: Carolyn Wyborny <carolyn.wyborny@intel.com> Cc: Don Skidmore <donald.c.skidmore@intel.com> Cc: Greg Rose <gregory.v.rose@intel.com> Cc: PJ Waskiewicz <peter.p.waskiewicz.jr@intel.com> Cc: Alex Duyck <alexander.h.duyck@intel.com> Cc: John Ronciak <john.ronciak@intel.com> Cc: e1000-devel@lists.sourceforge.net Cc: netdev@vger.kernel.org Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Alexander Duyck [Fri, 15 Jul 2011 02:31:25 +0000 (02:31 +0000)]
ixgbe: Refactor transmit map and cleanup routines
This patch implements a partial refactor of the TX map/queue and cleanup
routines. It merges the map and queue functionality and as a result
improves the transmit performance by avoiding unnecessary reads from memory.
(cherry picked from commit d3d0023979c87ee00f61946deb08b6a1ebd0455d) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Alexander Duyck [Fri, 26 Aug 2011 07:44:22 +0000 (07:44 +0000)]
igb: split buffer_info into tx_buffer_info and rx_buffer_info
In order to be able to improve the performance of the TX path it has been
necessary to add addition info to the tx_buffer_info structure. However a
side effect is that the structure has gotten larger and this in turn has
also increased the size of the RX buffer info structure. In order to avoid
this in the future I am splitting the single buffer_info structure into two
separate ones and instead I will join them by making the buffer_info
pointer in the ring a union of the two.
(cherry picked from commit 0603464956e863810af60c08b4b2e8ab50363a54) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Alexander Duyck [Wed, 5 Oct 2011 13:35:24 +0000 (13:35 +0000)]
igb: Make Tx budget for NAPI user adjustable
This change is to make the NAPI budget limits for transmit
adjustable. Currently they are only set to 128, and when
the changes/improvements to NAPI occur to allow for adjustability,
it would be possible to tune the value for optimal
performance with applications such as routing.
v2: remove tie between NAPI and interrupt moderation
fix work limit define name (s/IXGBE/IGB/)
Update patch description to better reflect patch
(cherry picked from commit 13fde97a48b622a192ae7d0a8011248be891cdd4) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Only function 1 has support for Alternate MAC Address in the EEPROM before,
this update now allow function 2 and 3 to have support for Alternate MAC
Address in the EEPROM.
(cherry picked from commit 45b58465acaa9d98354e7fa730e3172c5355da06) Signed-off-by: "Akeem G. Abodunrin" <akeem.g.abodunrin@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
This code check word 0x37 in the EEPROM, if it is 0xFFFF _or_ 0x0000, then
there is no Alternate MAC Address in the EEPROM.
(cherry picked from commit 6538ee62d597ca09035c33838d7516455f4fd3e1) Signed-off-by: "Akeem G. Abodunrin" <akeem.g.abodunrin@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
This patch fixes "overwrite" problem. without this fix, SFP I2C EEPROM
data, which is located at A0 can be overwritten by the phy write function.
(cherry picked from commit 76d06521f514e4e7e6bfb848ef0e3f8eb421f46d) Signed-off-by: "Akeem G. Abodunrin" <akeem.g.abodunrin@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Alexander Duyck [Fri, 26 Aug 2011 07:44:10 +0000 (07:44 +0000)]
igb: Remove multi_tx_table and simplify igb_xmit_frame
Instead of using the multi_tx_table to map possible Tx queues to Tx rings
we can just do simple subtraction for the unlikely event that the Tx queue
provided exceeds the number of Tx rings.
(cherry picked from commit 1cc3bd879288c7f2f47eaebdde38ac5db4bfd082) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Joe Jin [Thu, 17 May 2012 08:55:55 +0000 (16:55 +0800)]
igb: drop the "adv" off function names relating to descriptors
Many of the function names in the hot path are carrying an extra "_adv"
suffix on the end of them to represent the fact that they are using
advanced descriptors instead of legacy descriptors. However since all igb
uses are advanced descriptors adding the extra suffix doesn't really add
any additional data. Since this is the case it is easiest to just drop the
suffix and save us from having to store the extra characters.
(backported from commit cd392f5ca976b5ad166acc368c239cce2f0df58a) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Alexander Duyck [Fri, 26 Aug 2011 07:44:05 +0000 (07:44 +0000)]
igb: Replace E1000_XX_DESC_ADV with IGB_XX_DESC
Since igb only uses advanced descriptors we might as well just use an IGB
specific define and drop the _ADV suffix for the descriptor declarations.
In addition this can be further reduced by assuming that it will be working
on pointers since that is normally how the Tx descriptors are handled.
(cherry picked from commit 6013690699dd8316f4018324a6c2d90377d50d2c) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Alexander Duyck [Fri, 26 Aug 2011 07:43:54 +0000 (07:43 +0000)]
igb: Refactor clean_rx_irq to reduce overhead and improve performance
This change is meant to be a general cleanup and performance improvement
for clean_rx_irq. The previous patch should have updated the allocation so
that the rings can be treated as read-only within the clean_rx_irq
function. In addition I am re-ordering the operations such that several
goals are accomplished including reducing the overhead for packet
accounting, reducing the number of items on the stack, and improving
overall performance.
(cherry picked from commit 16eb8815c2355b50bff218513367778e6303e9f9) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Alexander Duyck [Fri, 26 Aug 2011 07:43:48 +0000 (07:43 +0000)]
igb: update ring and adapter structure to improve performance
This change is meant to improve performance by splitting the Tx and Rx
rings into 3 sections. The first is primarily a read only section
containing basic things like the indexes, a pointer to the dev and netdev
structures, and basic information. The second section contains the stats
and next_to_use and next_to_clean values. The third section is primarily
unused values that can just be placed at the end of the ring and are not
used in the hot path.
The adapter structure has several sections that are read in the hot path.
In order to improve performance there I am combining the frequent read
hot path items into a single cache line.
(cherry picked from commit 238ac817fd23f7dd5f61a8c51b4678f8d199db57) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Alexander Duyck [Fri, 26 Aug 2011 07:43:43 +0000 (07:43 +0000)]
igb: streamline Rx buffer allocation and cleanup
This change is meant to streamline the Rx buffer allocation and cleanup.
This is accomplished by reducing the number of writes by only having the Rx
descriptor ring written by software during allocation, and it will only be
read during cleanup.
(cherry picked from commit c023cd8898dbee857c8e82b357b4e68dc2d9561d) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Alexander Duyck [Fri, 26 Aug 2011 07:43:38 +0000 (07:43 +0000)]
igb: drop support for single buffer mode
This change removes support for single buffer mode from igb and makes the
driver function in packet split always. The advantage to doing this is
that we can reduce total memory allocation overhead significantly as we
will only need to allocate one 1K slab per packet and then make use of a
reusable half page instead of allocating a 2K slab per packet.
(cherry picked from commit 44390ca6cb3d4d3c7c4078bafde11073b5268150) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Alexander Duyck [Fri, 26 Aug 2011 07:43:32 +0000 (07:43 +0000)]
igb: Update max_frame_size to account for an optional VLAN tag if present
This patch modifies the max_frame_size in order account for an optional
VLAN tag. In order to support this we must also increase the
MAX_STD_JUMBO_FRAME_SIZE to account for the 4 extra bytes.
(cherry picked from commit 153285f9ce88b2d37e29a351dfcf7601ff274c69) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Alexander Duyck [Fri, 26 Aug 2011 07:43:27 +0000 (07:43 +0000)]
igb: Update RXDCTL/TXDCTL configurations
This change cleans up the RXDCTL and TXDCTL configurations and optimizes RX
performance by allowing back write-backs on all hardware other than 82576.
(cherry picked from commit a74420e0f3bdb4bfd8b59a4e67442d642f22e5b9) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Remove duplicated #include('s) in
drivers/net/igb/igb_main.c
Signed-off-by: Huang Weiyi <weiyi.huang@gmail.com> Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 48b03754dcdabb52bcb14f8288ca51f9bea8eb44)
Robert Healy [Tue, 12 Jul 2011 08:46:20 +0000 (08:46 +0000)]
igb: Fix for DH89xxCC near end loopback test
On this chipset it is required to configure the MPHY block for loopback tests. If MPHY is not configured then all loopback tests will report failures.
Signed-off-by: Robert Healy <robert.healy@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit a14bc2bb7075e59be635a2470dc0a32c5a0e8e21)
- unify vlan and nonvlan rx path
- kill adapter->vlgrp and igb_vlan_rx_register
- allow to turn on/off rx/tx vlan accel via ethtool (set_features)
Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit b2cb09b1a7725408a3464b2f593ceb222eff1042)
Signed-off-by: Tobias Klauser <tklauser@distanz.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 58d14d4fbaeb0cede14c59e8a2648b4791c0afe2)
Jon Mason [Mon, 27 Jun 2011 07:44:01 +0000 (07:44 +0000)]
igb: remove unnecessary reads of PCI_CAP_ID_EXP
The PCIE capability offset is saved during PCI bus walking. It will
remove an unnecessary search in the PCI configuration space if this
value is referenced instead of reacquiring it.
Signed-off-by: Jon Mason <jdmason@kudzu.us> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit bdaae04c65ef88645f50dabb43992033c754c4a7)
Michał Mirosław [Wed, 8 Jun 2011 08:38:01 +0000 (08:38 +0000)]
igb: convert to ndo_fix_features
Private rx_csum flags are now duplicate of netdev->features & NETIF_F_RXCSUM.
Removing this needs deeper surgery.
Things noticed:
- HW VLAN acceleration probably can be toggled, but it's left as is
- the resets on RX csum offload change can probably be avoided
- there is A LOT of copy-and-pasted code here
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit ac52caa31e0a135a8940a66de763751760820f37)
Carolyn Wyborny [Thu, 26 May 2011 03:02:26 +0000 (03:02 +0000)]
igb: Change version to remove number after -k in kernel versions.
This patch changes the way versioning is done for igb in the kernel by
removing the number after the "k." It has been determined that just the
"k" is sufficient to identify a kernel version and the following number
was used in an inconsistent manner.
Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com> Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 929dd047720785f099e12113780b3d7914ce6d9f)
Jeff Kirsher [Fri, 20 Apr 2012 08:51:45 +0000 (08:51 +0000)]
e1000e: Fix default interrupt throttle rate not set in NIC HW
Based on the original patch from Ying Cai <ycai@google.com>
This change ensures that the itr/itr_setting adjustment logic is used,
even for the default/compiled-in value.
Context:
When we changed the default InterruptThrottleRate value from default
(3 = dynamic mode) to 8000 for example, only adapter->itr_setting
(which controls interrupt coalescing mode) was set to 8000, but
adapter->itr (which controls the value set in NIC register) was not
updated accordingly. So from ethtool, it seemed the interrupt
throttling is enabled at 8000 intr/s, but the NIC actually was
running in dynamic mode which has lower CPU efficiency especially
when throughput is not high.
CC: Ying Cai <ycai@google.com> CC: David Decotigny <david.decotigny@google.com>
(cherry picked from commit 727c356f4d799b53f94cf8fe43e19d64482348c7) Signed-off-by: Jeff Kirsher <jeffrey.kirsher@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
e1000e: MSI interrupt test failed, using legacy interrupt
Following logs where seen on Systems with multiple NICs,
while using MSI interrupts as shown below:
Feb 16 15:09:32 (none) user.notice kernel: 0000:00:0d.0: lan0_0: NIC Link is Up
1000 Mbps Full Duplex, Flow Control: RX/TX
Feb 16 15:09:32 (none) user.notice kernel: 0000:40:0d.0: wan0_1: NIC Link is Up
1000 Mbps Full Duplex, Flow Control: RX/TX
Feb 16 15:09:32 (none) user.notice kernel: 0000:40:0d.0: lan0_1: NIC Link is Up
1000 Mbps Full Duplex, Flow Control: RX/TX
Feb 16 15:09:32 (none) user.warn kernel: 0000:40:0e.0: wan4_0: MSI interrupt
test failed, using legacy interrupt.
Feb 16 15:09:32 (none) user.notice kernel: 0000:00:0e.0: wan1_0: NIC Link is Up
1000 Mbps Full Duplex, Flow Control: RX/TX
Feb 16 15:09:33 (none) user.notice kernel: 0000:00:0e.0: lan1_0: NIC Link is Up
1000 Mbps Full Duplex, Flow Control: RX/TX
Feb 16 15:09:33 (none) user.notice kernel: 0000:00:0f.0: wan2_0: NIC Link is Up
1000 Mbps Full Duplex, Flow Control: RX/TX
Feb 16 15:09:33 (none) user.notice kernel: 0000:00:0f.0: lan2_0: NIC Link is Up
1000 Mbps Full Duplex, Flow Control: RX/TX
Feb 16 15:09:33 (none) user.notice kernel: 0000:40:0a.0: wan3_0: NIC Link is Up
1000 Mbps Full Duplex, Flow Control: RX/TX
Feb 16 15:09:33 (none) user.notice kernel: 0000:40:0a.0: lan3_0: NIC Link is Up
1000 Mbps Full Duplex, Flow Control: RX/TX
Feb 16 15:09:34 (none) user.notice kernel: 0000:40:0e.0: lan4_0: NIC Link is Up
1000 Mbps Full Duplex, Flow Control: RX/TX
Feb 16 15:09:34 (none) user.notice kernel: 0000:40:0f.0: wan5_0: NIC Link is Up
1000 Mbps Full Duplex, Flow Control: RX/TX
Feb 16 15:09:34 (none) user.notice kernel: 0000:40:0f.0: lan5_0: NIC Link is Up
1000 Mbps Full Duplex, Flow Control: RX/TX
This patch fixes this problem by increasing the msleep from 50 to 100.
(cherry picked from commit 569a3aff70e880588fe4b3f1622ac60abbeb4a28) Signed-off-by: Prasanna S Panchamukhi <ppanchamukhi@riverbed.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Joe Jin [Thu, 17 May 2012 07:58:35 +0000 (15:58 +0800)]
e1000e: issues in Sx on 82577/8/9
A workaround was previously put in the driver to reset the device when
transitioning to Sx in order to activate the changed settings of the PHY
OEM bits (Low Power Link Up, or LPLU, and GbE disable configuration) for
82577/8/9 devices. After further review, it was found such a reset can
cause the 82579 to confuse which version of 82579 it actually is and broke
LPLU on all 82577/8/9 devices. The workaround during an S0->Sx transition
on 82579 (instead of resetting the PHY) is to restart auto-negotiation
after the OEM bits are configured; the restart of auto-negotiation
activates the new OEM bits as does the reset. With 82577/8, the reset is
changed to a generic reset which fixes the LPLU bits getting set wrong.
(backported from commit 92fe173391b3e0d0a7212fa8b9d72c8d61f31c26) Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
In rare circumstances, a descriptor writeback flush may not work if it
arrives on a specific clock cycle as a writeback request is going out.
(cherry picked from commit bf03085f85112eac2d19036ea3003071220285bb) Signed-off-by: Matthew Vick <matthew.vick@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Bruce Allan [Wed, 21 Mar 2012 00:39:12 +0000 (00:39 +0000)]
e1000e: prevent oops when adapter is being closed and reset simultaneously
When the adapter is closed while it is simultaneously going through a
reset, it can cause a null-pointer dereference when the two different code
paths simultaneously cleanup up the Tx/Rx resources.
(cherry picked from commit bb9e44d0d0f45da356c39e485edacff6e14ba961) Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Joe Jin [Thu, 17 May 2012 07:56:02 +0000 (15:56 +0800)]
e1000e: use msleep instead of mdelay
The e1000_link_stall_workaround_lv() function is always called in non-
atomic context so it should use msleep instead of mdelay. Also, remove
unnecessary #include <linux/delay.h>.
(backported from commit bb9c5ee15b560f944a8877f60e7d3d77ad542286) Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Bruce Allan [Wed, 8 Feb 2012 02:55:56 +0000 (02:55 +0000)]
e1000e: cleanup goto statements to exit points without common work
Per ./Documentation/CodingStyle, goto statements are acceptable for the
centralized exiting of functions when there are multiple exit points which
share common work such as cleanup. When no common work is required for
multiple exit points, the function should just return at these exit points
instead of doing an unnecessary jump to a centralized return. This patch
cleans up the inappropriate use of goto statements, and removes unnecessary
variables (or move to a smaller scope) where possible as a result of the
cleanups.
(cherry picked from commit 5015e53a4cf0c88977120faede7eb02b0459d90e) Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Bruce Allan [Wed, 8 Feb 2012 02:55:51 +0000 (02:55 +0000)]
e1000e: potentially incorrect return for e1000e_setup_fiber_serdes_link
In the unlikely event that e1000_poll_fiber_serdes_link_generic() is called
and it returns an error, the returned error code value is not propagated to
the caller of e1000e_setup_fiber_serdes_link().
(cherry picked from commit 2a31b37a8956154df099400ba93cd6898a629c6d) Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Bruce Allan [Wed, 8 Feb 2012 02:55:46 +0000 (02:55 +0000)]
e1000e: potentially incorrect return for e1000_init_hw_ich8lan
In the unlikely event that e1000_setup_link_ich8lan() returns an error,
the returned error code value is not propagated to the caller of
e1000_init_hw_ich8lan().
(cherry picked from commit e561a705a61e8d4c32a1259c611703a3976347aa) Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Bruce Allan [Wed, 8 Feb 2012 02:55:40 +0000 (02:55 +0000)]
e1000e: cleanup: minor whitespace addition (insert blank line separator)
(cherry picked from commit 3fa82936347bba431f147e23c788f6364c3e5b36) Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
(cherry picked from commit f71dde6a44c6f817a104ab8a95a2eeabac5614df) Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Bruce Allan [Wed, 8 Feb 2012 02:55:30 +0000 (02:55 +0000)]
e1000e: cleanup: remove unnecessary test and return
Fall-through to a return statement that effectively does the same.
(cherry picked from commit f764956fd6c93be36cc60726ffd101d59fc3f581) Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
ret_val gets initialized to -E1000_ERR_NVM and never set differently, so
get rid of it and just return -E1000_ERR_NVM.
(cherry picked from commit 55920b5eae24cfd2666f3f80bc5f2c0b3b18043b) Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Bruce Allan [Wed, 8 Feb 2012 02:55:19 +0000 (02:55 +0000)]
e1000e: cleanup: remove unreachable statement
(cherry picked from commit f1a3fe17f9ef0e51c63662b82e9915a693e8e375) Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Bruce Allan [Wed, 8 Feb 2012 02:55:14 +0000 (02:55 +0000)]
e1000e: potentially incorrect return for e1000_set_d3_lplu_state_ich8lan
In the unlikely event that e1e_wphy() returns an error, the returned error
code is not propogated to the caller of e1000_set_d3_lplu_state_ich8lan().
With this change, there is a rare possibility that ret_val might not get
set so it must be initialized.
(cherry picked from commit d7eb33840bee3c8de3f64f3861350bcfac3eaf82) Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Bruce Allan [Wed, 8 Feb 2012 02:55:09 +0000 (02:55 +0000)]
e1000e: cleanup: always return 0
These are a few instances of returning a value that can only be 0 so just
use a 'return 0' to make it more obvious.
(cherry picked from commit 826072555b0dceac44a6e69a0c5be137e829c9d4) Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Bruce Allan [Wed, 8 Feb 2012 02:55:03 +0000 (02:55 +0000)]
e1000e: cleanup: remove unnecessary assignments just before returning
Just return the appropriate value.
(cherry picked from commit 7eb61d81946ccb61726600c6e8ceefcce9844f02) Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Bruce Allan [Wed, 8 Feb 2012 02:54:58 +0000 (02:54 +0000)]
e1000e: potential incorrect return for e1000_setup_copper_link_80003es2lan
In the unlikely event that e1000e_setup_copper_link() returns an error,
the returned error code value is not propogated to the caller of
e1000_setup_copper_link_80003es2lan().
(cherry picked from commit 8649f4319656f9fcaa59726799a824254b0a1bce) Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Bruce Allan [Wed, 8 Feb 2012 02:54:53 +0000 (02:54 +0000)]
e1000e: potentially incorrect return for e1000_cfg_kmrn_10_100_80003es2lan
In the unlikely event that e1e_wphy() returns an error, the returned error
code value is not propogated to the caller of
e1000_cfg_kmrn_10_100_80003es2lan().
(cherry picked from commit 520d6f225f83128e9ea083a9a226f807235cc76c) Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Bruce Allan [Wed, 8 Feb 2012 02:54:48 +0000 (02:54 +0000)]
e1000e: cleanup: rename goto labels to be more meaningful
In the following functions, rename the generic 'out' goto label to the more
descriptive 'release' to indicate the type of common work that is done
before exiting the functions. No functional change, cosmetic only.
(cherry picked from commit 75ce15327030128d713079d1f5e23cbe7af532f6) Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Bruce Allan [Wed, 8 Feb 2012 02:54:42 +0000 (02:54 +0000)]
e1000e: cleanup: use goto for common work needed by multiple exit points
There are two exit points of e1000e_write_nvm_spi() which require the
nvm->ops.release() function pointer called just before exiting.
Consolidate the two duplicate pieces of common work with a goto. With
this change, the value ret_val will need to be returned instead of 0.
(cherry picked from commit ffacd472c4c577c9d39a97a1f7ac36f59443723b) Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Bruce Allan [Wed, 1 Feb 2012 11:16:42 +0000 (11:16 +0000)]
e1000e: replace '1' with 'true' for boolean get_link_status
(cherry picked from commit f92518ddec7ce0ef2f7e91ae5f07e0a9e19055bf) Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Bruce Allan [Wed, 1 Feb 2012 10:53:05 +0000 (10:53 +0000)]
e1000e: pass pointer to hw struct for e1000_init_mac_params_XXX()
The e1000_init_mac_params_XXX() functions (where XXX is one of the three
MAC-family types 80003es2lan, 82571 and ich8lan) was not meant to require a
pointer to the adapter struct but does require a pointer to the hw struct.
Pass that pointer in to the functions instead.
(cherry picked from commit ec34c170da8798f521f0d40cad54580ff93cea3a) Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Bruce Allan [Tue, 31 Jan 2012 07:03:02 +0000 (07:03 +0000)]
e1000e: use true/false for bool autoneg_false
v2 - replaced mac->autoneg_failed == false with !mac->autoneg_failed
(cherry picked from commit 07914ee3ccbf93ce688f1aaba15d8b01f19c5d77) Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Bruce Allan [Tue, 31 Jan 2012 07:02:56 +0000 (07:02 +0000)]
e1000e: remove unnecessary parentheses
(cherry picked from commit 668018d74762741c3fe5a54f0eea1bd65dcabd7e) Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Bruce Allan [Tue, 31 Jan 2012 06:37:54 +0000 (06:37 +0000)]
e1000e: remove unnecessary returns from void functions
...and convert some goto's which simply return to just return.
(cherry picked from commit fe1e980f24697edb7d4e17cd74bbeae4a0388525) Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Bruce Allan [Tue, 31 Jan 2012 06:37:59 +0000 (06:37 +0000)]
e1000e: remove test that is always false
warning: comparison of unsigned expression < 0 is always false
Remove an unnecessary test that is reported when compiling driver with W=1.
The test is unnecessary because Intel wired GbE hardware older (i.e. less)
than 82571 is not supported by this driver.
(cherry picked from commit 4bcf053baf6b255e8c82c7ecd0d15954adb0379b) Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>