aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2013-09-24 18:21:57 -0400
committerBen Hutchings <bhutchings@solarflare.com>2013-12-12 17:06:49 -0500
commit92a04168390a2cb67cb60891e5870626d58c2abb (patch)
tree4585cbe20c49086826e4606147382515c49d8eed
parent74cd60a4d7b4f686146efd7ed211974691f0c2c1 (diff)
sfc: Tighten the check for RX merged completion events
The addition of RX event merging support means we don't reliably detect dropped RX events now. Currently we will only detect them if the previous event for the RX queue had the CONT bit set. Only accept RX completion events as merged if the GET_CAPABILITIES_OUT_RX_BATCHING bit is set in datapath_caps (which it won't be for the low-latency datapath) and the CONT bit is not set on the event. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
-rw-r--r--drivers/net/ethernet/sfc/ef10.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/net/ethernet/sfc/ef10.c b/drivers/net/ethernet/sfc/ef10.c
index 5d46d155b642..2f77359607d2 100644
--- a/drivers/net/ethernet/sfc/ef10.c
+++ b/drivers/net/ethernet/sfc/ef10.c
@@ -1766,6 +1766,8 @@ static int efx_ef10_handle_rx_event(struct efx_channel *channel,
1766 ((1 << ESF_DZ_RX_DSC_PTR_LBITS_WIDTH) - 1)); 1766 ((1 << ESF_DZ_RX_DSC_PTR_LBITS_WIDTH) - 1));
1767 1767
1768 if (n_descs != rx_queue->scatter_n + 1) { 1768 if (n_descs != rx_queue->scatter_n + 1) {
1769 struct efx_ef10_nic_data *nic_data = efx->nic_data;
1770
1769 /* detect rx abort */ 1771 /* detect rx abort */
1770 if (unlikely(n_descs == rx_queue->scatter_n)) { 1772 if (unlikely(n_descs == rx_queue->scatter_n)) {
1771 WARN_ON(rx_bytes != 0); 1773 WARN_ON(rx_bytes != 0);
@@ -1773,10 +1775,13 @@ static int efx_ef10_handle_rx_event(struct efx_channel *channel,
1773 return 0; 1775 return 0;
1774 } 1776 }
1775 1777
1776 if (unlikely(rx_queue->scatter_n != 0)) { 1778 /* Check that RX completion merging is valid, i.e.
1777 /* Scattered packet completions cannot be 1779 * the current firmware supports it and this is a
1778 * merged, so something has gone wrong. 1780 * non-scattered packet.
1779 */ 1781 */
1782 if (!(nic_data->datapath_caps &
1783 (1 << MC_CMD_GET_CAPABILITIES_OUT_RX_BATCHING_LBN)) ||
1784 rx_queue->scatter_n != 0 || rx_cont) {
1780 efx_ef10_handle_rx_bad_lbits( 1785 efx_ef10_handle_rx_bad_lbits(
1781 rx_queue, next_ptr_lbits, 1786 rx_queue, next_ptr_lbits,
1782 (rx_queue->removed_count + 1787 (rx_queue->removed_count +