diff options
author | Edward Cree <ecree@solarflare.com> | 2020-09-03 22:34:57 +0100 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2020-09-05 12:21:40 -0700 |
commit | 5374d6024cd47e028f96a382104b2653f010b430 (patch) | |
tree | 0ef043f9bf31093acc8660897bb0a258628c7e3d /drivers/net/ethernet/sfc/net_driver.h | |
parent | 8cb2675634ab8ec7986aa9dfe1a7a934872ef51d (diff) |
sfc: use tx_queue->old_read_count in EF100 TX path
As in the Siena/EF10 case, it minimises cacheline ping-pong between
the TX and completion paths.
Signed-off-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/ethernet/sfc/net_driver.h')
-rw-r--r-- | drivers/net/ethernet/sfc/net_driver.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/net/ethernet/sfc/net_driver.h b/drivers/net/ethernet/sfc/net_driver.h index adc138f9d15f..366e649fa869 100644 --- a/drivers/net/ethernet/sfc/net_driver.h +++ b/drivers/net/ethernet/sfc/net_driver.h @@ -1692,6 +1692,20 @@ efx_channel_tx_fill_level(struct efx_channel *channel) return fill_level; } +/* Conservative approximation of efx_channel_tx_fill_level using cached value */ +static inline unsigned int +efx_channel_tx_old_fill_level(struct efx_channel *channel) +{ + struct efx_tx_queue *tx_queue; + unsigned int fill_level = 0; + + efx_for_each_channel_tx_queue(tx_queue, channel) + fill_level = max(fill_level, + tx_queue->insert_count - tx_queue->old_read_count); + + return fill_level; +} + /* Get all supported features. * If a feature is not fixed, it is present in hw_features. * If a feature is fixed, it does not present in hw_features, but |