aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/sfc/tx_common.h
diff options
context:
space:
mode:
authorTom Zhao <tzhao@solarflare.com>2020-03-05 11:38:45 +0000
committerDavid S. Miller <davem@davemloft.net>2020-03-05 14:56:57 -0800
commit3b4f06c715d0d3ecd6497275e3c85fe91462d0ee (patch)
treece62bc533650ccd16ca01c9dd325a96b62999c37 /drivers/net/ethernet/sfc/tx_common.h
parentnet: hns3: fix a not link up issue when fibre port supports autoneg (diff)
downloadlinux-dev-3b4f06c715d0d3ecd6497275e3c85fe91462d0ee.tar.xz
linux-dev-3b4f06c715d0d3ecd6497275e3c85fe91462d0ee.zip
sfc: complete the next packet when we receive a timestamp
We now ignore the "completion" event when using tx queue timestamping, and only pay attention to the two (high and low) timestamp events. The NIC will send a pair of timestamp events for every packet transmitted. The current firmware may merge the completion events, and it is possible that future versions may reorder the completion and timestamp events. As such the completion event is not useful. Without this patch in place a merged completion event on a queue with timestamping will cause a "spurious TX completion" error. This affects SFN8000-series adapters. Signed-off-by: Tom Zhao <tzhao@solarflare.com> Acked-by: Martin Habets <mhabets@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/sfc/tx_common.h')
-rw-r--r--drivers/net/ethernet/sfc/tx_common.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/ethernet/sfc/tx_common.h b/drivers/net/ethernet/sfc/tx_common.h
index f92f1fe3a87f..99cf7ce2f36c 100644
--- a/drivers/net/ethernet/sfc/tx_common.h
+++ b/drivers/net/ethernet/sfc/tx_common.h
@@ -21,6 +21,12 @@ void efx_dequeue_buffer(struct efx_tx_queue *tx_queue,
unsigned int *pkts_compl,
unsigned int *bytes_compl);
+static inline bool efx_tx_buffer_in_use(struct efx_tx_buffer *buffer)
+{
+ return buffer->len || (buffer->flags & EFX_TX_BUF_OPTION);
+}
+
+void efx_xmit_done_check_empty(struct efx_tx_queue *tx_queue);
void efx_xmit_done(struct efx_tx_queue *tx_queue, unsigned int index);
void efx_enqueue_unwind(struct efx_tx_queue *tx_queue,