Commit 92a04168 authored by Ben Hutchings's avatar Ben Hutchings

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: default avatarBen Hutchings <bhutchings@solarflare.com>
parent 74cd60a4
...@@ -1766,6 +1766,8 @@ static int efx_ef10_handle_rx_event(struct efx_channel *channel, ...@@ -1766,6 +1766,8 @@ static int efx_ef10_handle_rx_event(struct efx_channel *channel,
((1 << ESF_DZ_RX_DSC_PTR_LBITS_WIDTH) - 1)); ((1 << ESF_DZ_RX_DSC_PTR_LBITS_WIDTH) - 1));
if (n_descs != rx_queue->scatter_n + 1) { if (n_descs != rx_queue->scatter_n + 1) {
struct efx_ef10_nic_data *nic_data = efx->nic_data;
/* detect rx abort */ /* detect rx abort */
if (unlikely(n_descs == rx_queue->scatter_n)) { if (unlikely(n_descs == rx_queue->scatter_n)) {
WARN_ON(rx_bytes != 0); WARN_ON(rx_bytes != 0);
...@@ -1773,10 +1775,13 @@ static int efx_ef10_handle_rx_event(struct efx_channel *channel, ...@@ -1773,10 +1775,13 @@ static int efx_ef10_handle_rx_event(struct efx_channel *channel,
return 0; return 0;
} }
if (unlikely(rx_queue->scatter_n != 0)) { /* Check that RX completion merging is valid, i.e.
/* Scattered packet completions cannot be * the current firmware supports it and this is a
* merged, so something has gone wrong. * non-scattered packet.
*/ */
if (!(nic_data->datapath_caps &
(1 << MC_CMD_GET_CAPABILITIES_OUT_RX_BATCHING_LBN)) ||
rx_queue->scatter_n != 0 || rx_cont) {
efx_ef10_handle_rx_bad_lbits( efx_ef10_handle_rx_bad_lbits(
rx_queue, next_ptr_lbits, rx_queue, next_ptr_lbits,
(rx_queue->removed_count + (rx_queue->removed_count +
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment