aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/i40e/i40e_txrx.c
AgeCommit message (Collapse)Author
2017-12-08i40e: Use smp_rmb rather than read_barrier_dependsBrian King
[ Upstream commit 52c6912fde0133981ee50ba08808f257829c4c93 ] The original issue being fixed in this patch was seen with the ixgbe driver, but the same issue exists with i40e as well, as the code is very similar. read_barrier_depends is not sufficient to ensure loads following it are not speculatively loaded out of order by the CPU, which can result in stale data being loaded, causing potential system crashes. Cc: stable <stable@vger.kernel.org> Signed-off-by: Brian King <brking@linux.vnet.ibm.com> Acked-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
2015-06-04i40e/i40evf: Fix mixed size frags and linearizationAnjali Singhai Jain
This patch fixes a bug where the i40e Tx queue will hang if this skb is passed to the driver. With mixed size fragments while using TSO there was a corner case where we needed to linearize but we were not. This was seen with iSCSI traffic and could be reproduced with a frag list that looks like this: num_frags = 17, gso_segs = 17, hdr_len = 66, skb_shinfo(skb)->gso_size = 1448 size = 3002, j = 1, frag_size = 2936, num_frags = 17 size = 4268, j = 1, frag_size = 4096, num_frags = 16 size = 5534, j = 1, frag_size = 4096, num_frags = 15 size = 5352, j = 1, frag_size = 4096, num_frags = 14 size = 5170, j = 1, frag_size = 4096, num_frags = 13 size = 3468, j = 1, frag_size = 2576, num_frags = 12 size = 750, j = 1, frag_size = 112, num_frags = 11 size = 862, j = 2, frag_size = 112, num_frags = 10 size = 974, j = 3, frag_size = 112, num_frags = 9 size = 1126, j = 4, frag_size = 152, num_frags = 8 size = 1330, j = 5, frag_size = 204, num_frags = 7 size = 1534, j = 6, frag_size = 204, num_frags = 6 size = 356, j = 1, frag_size = 204, num_frags = 5 size = 560, j = 2, frag_size = 204, num_frags = 4 size = 764, j = 3, frag_size = 204, num_frags = 3 size = 968, j = 4, frag_size = 204, num_frags = 2 size = 1140, j = 5, frag_size = 172, num_frags = 1 result: linearize = 0, j = 6 Change-ID: I79bb1aeab0af255fe2ce28e93672a85d85bf47e8 Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com> Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2015-04-09i40e/i40evf: Use dma_rmb where appropriateAlexander Duyck
Update i40e and i40evf to use dma_rmb. This should improve performance by decreasing the barrier overhead on strong ordered architectures. Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Alexander Duyck <alexander.h.duyck@redhat.com> Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-04-03i40e/i40evf: Set Ethernet protocol correctly when Tx VLAN offloads are disabledGreg Rose
If transmit VLAN HW offloads are disabled then the network stack sends up an skb with the protocol set to 8021q. In that case to get the correct checksum offloads we have to reset the skb protocol to the encapsulated ethertype. Change-ID: I903d78533de09b1c5d3ec695ee1990dd0fa5dd0d Signed-off-by: Greg Rose <gregory.v.rose@intel.com> Tested-by: Jim Young <james.m.young@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2015-04-03i40e/i40evf: fix bug when skb allocation failsJesse Brandeburg
If the skb allocation fails we should not continue using the skb pointer. Breaking out at the point of failure means that at the next RX interrupt the driver will try the allocation again. Change-ID: Iefaad69856ced7418bfd92afe55322676341f82e Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Tested-by: Jim Young <james.m.young@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2015-03-09i40e: Fix inconsistent use of PF/VF vs pf/vfJeff Kirsher
Joe Perches pointed out that we were inconsistent in the use of PF vs pf or VF vs vf in our driver code. Since acronyms are usually capitalized to denote that it is an acronym, changed all references to be consistent throughout the code. Reported-by: Joe Perches <joe@perches.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2015-03-09i40e/i40evf: fix accidental write to ITR registersJesse Brandeburg
Fix a bug introduced in the force writeback code, where the interrupt rate was set to 0 (maximum) by accident. The driver must correctly set the NOITR fields to avoid ITR update as a side effect of triggering the software interrupt. Change-ID: I290851ae04ef3811c43aab5ee33242029f26c1a3 Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2015-03-07i40e/i40evf: enable prefetch of Tx descriptors during cleanupJesse Brandeburg
Performance can be improved a bit by imitating ixgbe and using prefetch to get us the next Tx descriptor. Change-ID: Ice7ffd4cd0ce87c35295059bdb7972a7f53723aa Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2015-03-07i40e/i40evf: Simplify tunnel selection logicAnjali Singhai Jain
Use l4_tunnel type generically to keep code flow simple. Change-ID: Ic52287e3b1ca4204e6b6e13431890c1a6ae9c422 Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2015-03-07i40e: FD filters flush policy changesAnjali Singhai Jain
Since GLQF_FDCNT_0 register now has the right offset, use it to simplify our FD flush flow. If the filter add error happens to be for SB we just auto disable SB. If filter error happens to be for ATR, auto disable ATR and mark the state to FD_FLUSH_REQUESTED. Which gets cleared when flush completes. If we are entering flush too quickly (< 30 seconds) and we have quite a few SB rules, its time to disable ATR for good. Since SB + ATR rules is most likely making the FD table unstable. ATR can be re-enabled by turning ntuple off (ethtool -K ntuple off) and will remain off after turning ntuple on till it gets unstable again. Change-ID: I2154a2e0a5d44851a2f0eb8731e2f1d4a4d1acbc Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2015-03-07i40e: Avoid logs while adding/deleting FD-SB filtersAnjali Singhai Jain
It is not necessary to print FD filter add/delete log with normal debug settings because ethtool -n ethx shows all the FD-SB filters on an interface. The log can still be turned on through higher debug levels and it will continue to print a log if there was an error in the add/delete process. Change-ID: I67db2baf49e2075d2f537de40f7895e5b02cd610 Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2015-03-07i40e/i40evf: Refactor i40e_debug_aq and make some functions staticShannon Nelson
A sparse complaint in i40e_debug_aq in a funky buffer write goes away by straightening out the code out to something less convoluted. Also fix some other sparse warnings while we are at it, making some functions static and using NULL instead of 0. Change-ID: I93907534fe1f1f675830774b3d14ecf1c6ffc9a0 Signed-off-by: Shannon Nelson <shannon.nelson@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2015-03-03Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller
Conflicts: drivers/net/ethernet/rocker/rocker.c The rocker commit was two overlapping changes, one to rename the ->vport member to ->pport, and another making the bitmask expression use '1ULL' instead of plain '1'. Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-03i40e/i40evf: Add missing packet types for VXLAN encapsulated packet typesAnjali Singhai Jain
We were missing a few packet types for VXLAN offload. This patch fixes that. Change-ID: I4b23aa0b08e40ed49d0df6c49a5ed9f2009b44ce Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2015-03-03i40e: Skip the priority tagging if DCB is not enabledNeerav Parikh
If DCB is not enabled priority tagging is not needed so skip over that section. Change-ID: Ia3f3fa07945b421259a9ca38329d6d1cbd6c6bcc Signed-off-by: Neerav Parikh <neerav.parikh@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2015-02-26i40e: fix race in hang checkJesse Brandeburg
The driver was having some issues with false Tx hang detection. This makes the driver a little more direct with the checks for progress forward by directly checking the head write back address and tail register when determining progress. This avoids Tx hangs where the software gets behind, because we are directly checking hardware state when determining hang state. Change-ID: I774f0e861c9e8ab5ccb213634100fe15440ae24a Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Tested-by: Jim Young <james.m.young@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2015-02-26i40e: Fix TSO with more than 8 frags per segment issueAnjali Singhai
The hardware has some limitations the driver needs to adhere to, that we found in extended testing. 1) no more than 8 descriptors per packet on the wire 2) no header can span more than 3 descriptors If one of these events occurs, the hardware will generate an internal error and freeze the Tx queue. This patch linearizes the skb to avoid these situations. Change-ID: I37dab7d3966e14895a9663ec4d0aaa8eb0d9e115 Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com> Tested-by: Jim Young <james.m.young@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2015-02-23i40e/i40evf: Refactor the receive routinesMitch Williams
Split the receive hot path code into two, one for packet split and one for single buffer. This improves receive performance since we only need to check if the ring is in packet split mode once per NAPI poll time, not several times per packet. The single buffer code is further improved by the removal of a bunch of code and several variables that are not needed. On a receive-oriented test this can improve single-threaded throughput. Also refactor the packet split receive path to use a fixed buffer for headers, like ixgbe does. This vastly reduces the number of DMA mappings and unmappings we need to do, allowing for much better performance in the presence of an IOMMU. Lastly, correct packet split descriptor types now that we are actually using them. Change-ID: I3a194a93af3d2c31e77ff17644ac7376da6f3e4b Signed-off-by: Mitch Williams <mitch.a.williams@intel.com> Tested-by: Jim Young <james.m.young@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2015-02-09i40e: Fix for stats init function call in Rx setupCarolyn Wyborny
This patch fixes indentation issue and error found in argument reported by static analysis. Without this patch, sparse and other static analysis errors will be found. Reported-by: Fengguang Wu <fengguang.wu@intel.com> Reported-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-02-09i40e/i40evf: Add call to u64_stats_init to initCarolyn Wyborny
This patch adds a call to u64_stats_init to Rx setup. This done in order to avoid lockdep errors with seqcount on newer kernels. Change-ID: Ia8ba8f0bcbd1c0e926f97d70aeee4ce4fd055e93 Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2015-02-09i40evf: Force Tx writeback on ITRAnjali Singhai Jain
This patch forces Tx descriptor writebacks on ITR by kicking off the SWINT interrupt when we notice that there are non-cache-aligned Tx descriptors waiting in the ring while interrupts are disabled under NAPI. Change-ID: dd6d9675629bf266c7515ad7a201394618c35444 Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2015-01-16i40e: check I40E_FLAG_PTP before handling Tx or Rx timestampsJacob Keller
We should not be doing Tx or Rx timestamps if we do not have PTP enabled. Add checks to ensure that we don't attempt to handle any PTP related timestamping code if we have not enabled PTP on that PF. Change-ID: I4335942ae2d5c5f91abfdbeeea02bcace49e7677 Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2015-01-15Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller
Conflicts: drivers/net/xen-netfront.c Minor overlapping changes in xen-netfront.c, mostly to do with some buffer management changes alongside the split of stats into TX and RX. Signed-off-by: David S. Miller <davem@davemloft.net>
2015-01-13net: rename vlan_tx_* helpers since "tx" is misleading thereJiri Pirko
The same macros are used for rx as well. So rename it. Signed-off-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-01-06i40e: Fix bug with TCP over IPv6 over VXLANAnjali Singhai
The driver was examining the outer protocol layer to set the inner protocol layer checksum offload. In the case of TCP over IPV6 over an IPv4 based VXLAN the inner checksum offloads would be set to look for IPv4/UDP instead of IPv6/TCP. This code fixes that so that the driver will look at the proper layer for encapsulation offload settings. Signed-off-by: Anjali Singhai <anjali.singhai@intel.com> Signed-off-by: Greg Rose <gregory.v.rose@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2015-01-06i40e: Fix Rx checksum error counterAnjali Singhai
The Rx port checksum error counter was incrementing incorrectly with UDP encapsulated tunneled traffic. This patch fixes the problem so that the port_rx_csum counter will show accurate statistics. Signed-off-by: Anjali Singhai <anjali.singhai@intel.com> Signed-off-by: Greg Rose <gregory.v.rose@intel.com> Tested-by: Jim Young <james.m.young@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2015-01-06i40e: fix un-necessary Tx hangsJesse Brandeburg
When the driver was polling with interrupts disabled the hardware will occasionally not write back descriptors. This patch causes the driver to detect this situation and force an interrupt to fire which will flush the stuck descriptor. Does not conflict with napi because if we are already polling the napi_schedule is ignored. Additionally the extra interrupts are rate limited, so don't cause a burden to the CPU. Change-ID: Iba4616d2a71288672a5f08e4512e2704b97335e8 Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2014-12-08ethernet/intel: Use eth_skb_pad and skb_put_padto helpersAlexander Duyck
Update the Intel Ethernet drivers to use eth_skb_pad() and skb_put_padto instead of doing their own implementations of the function. Also this cleans up two other spots where skb_pad was called but the length and tail pointers were being manipulated directly instead of just having the padding length added via __skb_put. Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Alexander Duyck <alexander.h.duyck@redhat.com> Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-10-08i40e: skb->xmit_more supportEric Dumazet
Support skb->xmit_more in i40e is straightforward : we need to move around i40e_maybe_stop_tx() call to correctly test netif_xmit_stopped() before taking the decision to not kick the NIC. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-10-02i40e/igb: Convert to dev_consume_skb_any()Rick Jones
Convert two more Intel NIC drivers to dev_consume_skb_any() to help make dropped packet profiling sane. Signed-off-by: Rick Jones <rick.jones2@hp.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Tested-by: Jim Young <jamesx.m.young@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2014-09-07Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller
2014-08-29i40e: Set skb->csum_level for encapsulated checksumTom Herbert
Set skb->csum_level instead of skb->encapsulation when indicating CHECKSUM_UNNECESSARY for an encapsulated checksum. Signed-off-by: Tom Herbert <therbert@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-08-27i40e/i40evf: Ignore a driver perceived Tx hang if the number of desc pending < 4Anjali Singhai Jain
We are seeing situations where the driver sees a hang with less than 4 desc pending, if the driver chooses to ignore it the queue progresses forward and the stack never experiences a real hang. With this patch we will log a stat when this situation happens "tx_sluggish" will increment and we can see some more details at a higher debug level. Other than that we will ignore this particular case of Tx hang. Change-ID: I7d1d1666d990e2b12f4f6bed0d17d22e1b6410d5 Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2014-08-26i40e: ATR policy change to flush the table to clean stale ATR rulesAnjali Singhai Jain
Instead of disabling ATR when we get a programming error, we now will wait it out to see if some room gets created by ATR rule deletion. If we still have too many errors and ATR filter count did not change much, its time to flush and replay. We no more auto-disable ATR when we have errors in programming. The disabling of ATR when we get programming error was buggy and was still adding new rules and causing continuous errors. With this policy change we flush instead when we see too many errors. ATR is still disabled if we add a SB rule for TCP/IPv4 flow type, more logic is added to re-enable it once all SB TCP/IPv4 rules are gone. Change-ID: I77edcbeab9500c72a7e0bd7b5c5b113ced133a9c Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com> Tested-by: Jim Young <jamesx.m.young@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2014-08-26i40e: Some FD message fixesAnjali Singhai Jain
Change the message that gets printed when adding/deleting a filter to the SB, so that user can tell if a filter was added or deleted. Print filter add failures only in case of SB filters. For ATR the information is not useful to the user and hence suppress it unless in higher debug mode. Change-ID: I78d7a7a6ecfa82a38a582b0d7b4da038355e3735 Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com> Tested-by: Jim Young <jamesx.m.young@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2014-08-26i40e: Update flow director error messages to reduce user confusionCarolyn Wyborny
This patch changes the wording of the flow director add/remove and asynchronous failure messages to include fd_id to try and add some way to track the operations on a given fd_id. Its not perfect, but its better than what we had as PCTYPE can apply to several different filter requests. This patch also removes a redundant message when filter addition fails due to full condition. Change-ID: Icf58b0603d4f162d9fc542f11a74866a907049f2 Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com> Tested-by: Jim Young <jamesx.m.young@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2014-08-25i40e: Fix TSO and hw checksums for non-accelerated vlan packets.Vlad Yasevich
This device claims TSO and checksum support for vlans. It also allows a user to control vlan acceleration offloading. As such, it is possible to turn off vlan acceleration and configure a vlan which will continue to support TSO and hw checksums. In such situation the packet passed down the the device will contain a vlan header and skb->protocol will be set to ETH_P_8021Q. The device assumes that skb->protocol contains network protocol value and uses that value to set up TSO and checksum information. This results in corrupted frames sent on the wire. This patch extract the protocol value correctly and corrects TSO and checksums for non-accelerated traffic. Fix this by using vlan_get_protocol() helper. 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: Alex Duyck <alexander.h.duyck@intel.com> CC: John Ronciak <john.ronciak@intel.com> CC: Mitch Williams <mitch.a.williams@intel.com> CC: Linux NICS <linux.nics@intel.com> CC: e1000-devel@lists.sourceforge.net Signed-off-by: Vladislav Yasevich <vyasevic@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-08-02i40e: Adds FCoE related code to i40e core driverVasu Dev
Adds FCoE specific code to existing i40e core driver to:- 1. have separate FCoE VSI with additional FCoE queues pairs. 2. have FCoE related hash defines. 3. have additional FCoE related stats code. 4. export and then re-use existing functions required by FCoE build. Signed-off-by: Vasu Dev <vasu.dev@intel.com> Tested-by: Jack Morgan<jack.morgan@intel.com> Signed-off-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-07-24i40e/i40evf: fix extension header csum logicJesse Brandeburg
The hardware design requires that the driver avoid indicating checksum offload success on some ipv6 frames with extension headers. The code needs to just check for the IPV6EXADD bit and if it is set punt the checksum to the stack. I don't know why the code was checking TCP on inner protocol, as that code doesn't make any sense to me but seems wrong, so remove it. Change-ID: I10d3aacdbb1819fb60b4b0eb80e6cc67ef2c9599 Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Tested-By: Jim Young <jamesx.m.young@intel.com> Tested-by: Sibai Li <sibai.li@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2014-07-16i40e/i40evf: Clean up codePaul M Stillwell Jr
1. Remove some break statements that will never get touched. 2. Remove an extra space. 3. Remove a comment for a parameter that doesn't exist 4. Move the assignment of a variable up to get rid of an else case. Change-ID: I308a4b5ec070b1f0601f13b041ba4375aaad4b06 Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com> Tested-by: Jim Young <jamesx.m.young@intel.com> Tested-by: Sibai Li <sibai.li@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2014-07-16i40e: fix race conditions on queuing skb for HW time stampJakub Kicinski
i40e has a single set of TX time stamping resources per NIC. Use a simple bit lock to avoid race conditions and leaking skbs when multiple TX rings try to claim time stamping. Signed-off-by: Jakub Kicinski <kubakici@wp.pl> Tested-By: Jim Young <jamesx.m.young@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2014-07-16i40e: never generate both software and hardware timestampsJakub Kicinski
skb_tx_timestamp() does not report software time stamp if SKBTX_IN_PROGRESS is set. According to timestamping.txt software time stamps are a fallback and should not be generated if hardware time stamp is provided. Move call to skb_tx_timestamp() after setting SKBTX_IN_PROGRESS. Signed-off-by: Jakub Kicinski <kubakici@wp.pl> Tested-by: Jim Young <jamesx.m.young@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2014-07-02i40e/i40evf: Do not free the dummy packet buffer synchronouslyAnjali Singhai Jain
The HW still needs to consume it and freeing it in the function that created it would mean we will be racing with the HW. The i40e_clean_tx_ring() routine will free up the buffer attached once the HW has consumed it. The clean_fdir_tx_irq function had to be fixed to handle the freeing correctly. Cases where we program more than one filter per flow (Ipv4), the code had to be changed to allocate dummy buffer multiple times since it will be freed by the clean routine. This also fixes an issue where the filter program routine was not checking if there were descriptors available for programming a filter. Change-ID: Idf72028fd873221934e319d021ef65a1e51acaf7 Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com> Tested-by: Jim Young <jamesx.m.young@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2014-07-01i40e/i40evf: initialize context descriptorJesse Brandeburg
Driver needs to initialize all members of context descriptor. Stale data is possible otherwise. Change-ID: Idc6b53af45583509da42d5ec0824cbaf78aee64f Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2014-07-01i40e: FD filter replay logic bug fixAnjali Singhai Jain
With the auto_disable flags added there was a bug that was causing the replay logic to not work correctly. This patch fixes the issue so that we call a replay after a sideband reset correctly. Change-ID: I005fe1ac361188ee5b19517a83c922038cba1b00 Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2014-06-26i40e: fix fdir programmingJesse Brandeburg
There were a couple of fields in the fdir descriptor setup that were not being reprogrammed, which left the opportunity for stale data to be pushed as part of the descriptor next time it was used. Change-ID: Ieee5c96a7d4713d469693f086c4854de949a7633 Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2014-06-26i40e: Fix the FD sideband logic to detect a FD table full conditionAnjali Singhai Jain
Hardware does not have a way of telling a PF how much of the global shared FD table space is still available or is consumed. Previously, every PF but PF0 would think there was still space available when there wasn't. The PFs would continue to try to add filters and fail. With this new logic if a filter programming error is detected we just check if we are close to the guaranteed space full and that can be used as a hint to say, there might not be space and we should turn off the features. This way we can turn off the feature in SW for all PFs in time. Change-ID: I725cb2fab16c033f883056362b4542c1400503c5 Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2014-06-26i40e: Avoid adding the TCP-IPv4 filter twiceAnjali Singhai Jain
There wasn't a need to play the logic twice, it seems like a left over from when we had to add two PTYPEs for one filter. There should be no change in the number of filters that actually got added to the hardware. Change-ID: I5071d02eafd020b60e30eb96219f110f334eec85 Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2014-06-11i40e/i40evf: Add Flow director stats to PF statsAnjali Singhai Jain
Add members to stat struct to keep track of Flow director ATR and SideBand filter packet matches. Change-ID: Ibbb31a53c7adcc2bb96991dd80565442a2f2513c Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2014-06-09i40e/i40evf: add PPRS bit to error bits and fix bug in Rx checksumJesse Brandeburg
The driver was not marking packets with bad checksums correctly, especially IPv6 packets with a bad checksum. To do this correctly we need a define that may be set by hardware in rare cases. Change-ID: I1a997b72b491ded27a78ac3bce1197b2d2611130 Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>