linux_dsm_epyc7002/drivers/net/ethernet/intel/i40evf
Jacob Keller 11f29003d6 i40e/i40evf: bump tail only in multiples of 8
Hardware only fetches descriptors on cachelines of 8, essentially
ignoring the lower 3 bits of the tail register. Thus, it is pointless to
bump tail by an unaligned access as the hardware will ignore some of the
new descriptors we allocated. Thus, it's ideal if we can ensure tail
writes are always aligned to 8.

At first, it seems like we'd already do this, since we allocate
descriptors in batches which are a multiple of 8. Since we'd always
increment by a multiple of 8, it seems like the value should always be
aligned.

However, this ignores allocation failures. If we fail to allocate
a buffer, our tail register will become unaligned. Once it has become
unaligned it will essentially be stuck unaligned until a buffer
allocation happens to fail at the exact amount necessary to re-align it.

We can do better, by simply rounding down the number of buffers we're
about to allocate (cleaned_count) such that "next_to_clean
+ cleaned_count" is rounded to the nearest multiple of 8.

We do this by calculating how far off that value is and subtracting it
from the cleaned_count. This essentially defers allocation of buffers if
they're going to be ignored by hardware anyways, and re-aligns our
next_to_use and tail values after a failure to allocate a descriptor.

This calculation ensures that we always align the tail writes in a way
the hardware expects and don't unnecessarily allocate buffers which
won't be fetched immediately.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2017-10-09 14:26:29 -07:00
..
i40e_adminq_cmd.h i40e: Display error message if module does not meet thermal requirements 2017-10-06 08:11:31 -07:00
i40e_adminq.c i40e: reduce wait time for adminq command completion 2017-04-19 17:38:25 -07:00
i40e_adminq.h i40e: reduce wait time for adminq command completion 2017-04-19 17:38:25 -07:00
i40e_alloc.h
i40e_common.c i40e: Add support for 'ethtool -m' 2017-10-02 12:46:35 -07:00
i40e_devids.h i40evf: Add support for Adaptive Virtual Function 2017-06-01 14:30:02 -07:00
i40e_hmc.h i40e: use BIT and BIT_ULL macros 2015-07-23 05:33:55 -07:00
i40e_lan_hmc.h
i40e_osdep.h i40evf: remove unnecessary __packed 2017-07-26 03:25:21 -07:00
i40e_prototype.h i40e: Add support for 'ethtool -m' 2017-10-02 12:46:35 -07:00
i40e_register.h i40evf: Remove PF specific register definitions from the VF 2015-08-26 15:05:17 -07:00
i40e_status.h
i40e_trace.h i40e/i40evf: Add tracepoints 2017-04-19 16:47:31 -07:00
i40e_txrx.c i40e/i40evf: bump tail only in multiples of 8 2017-10-09 14:26:29 -07:00
i40e_txrx.h i40e/i40evf: fix incorrect default ITR values on driver load 2017-10-09 14:19:46 -07:00
i40e_type.h i40e: Stop dropping 802.1ad tags - eth proto 0x88a8 2017-10-02 12:46:36 -07:00
i40evf_client.c virtchnl: rename i40e to generic virtchnl 2017-06-01 14:08:53 -07:00
i40evf_client.h i40evf: add client interface 2017-03-15 01:31:38 -07:00
i40evf_ethtool.c i40evf: Enable VF to request an alternate queue allocation 2017-10-02 12:46:35 -07:00
i40evf_main.c i40e/i40evf: fix incorrect default ITR values on driver load 2017-10-09 14:19:46 -07:00
i40evf_virtchnl.c i40evf: Enable VF to request an alternate queue allocation 2017-10-02 12:46:35 -07:00
i40evf.h i40e/i40evf: organize and re-number feature flags 2017-10-06 08:11:32 -07:00
Makefile i40e/i40evf: Add tracepoints 2017-04-19 16:47:31 -07:00