From: Andrew Rybchenko Date: Sat, 27 May 2017 07:55:32 +0000 (+0100) Subject: net/sfc: handle already flushed Rx queue gracefully X-Git-Tag: spdx-start~3098 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=69d753f4833ad2da5e42646737cd3899b96fbef7;p=dpdk.git net/sfc: handle already flushed Rx queue gracefully Rx queue may be already flushed because of previous Rx error or MC reboot. Signed-off-by: Andrew Rybchenko --- diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c index 122b6570ce..325f32a071 100644 --- a/drivers/net/sfc/sfc_rx.c +++ b/drivers/net/sfc/sfc_rx.c @@ -529,6 +529,7 @@ sfc_rx_qflush(struct sfc_adapter *sa, unsigned int sw_index) struct sfc_rxq *rxq; unsigned int retry_count; unsigned int wait_count; + int rc; rxq = sa->rxq_info[sw_index].rxq; SFC_ASSERT(rxq->state & SFC_RXQ_STARTED); @@ -541,8 +542,10 @@ sfc_rx_qflush(struct sfc_adapter *sa, unsigned int sw_index) ((rxq->state & SFC_RXQ_FLUSHED) == 0) && (retry_count < SFC_RX_QFLUSH_ATTEMPTS); ++retry_count) { - if (efx_rx_qflush(rxq->common) != 0) { - rxq->state |= SFC_RXQ_FLUSH_FAILED; + rc = efx_rx_qflush(rxq->common); + if (rc != 0) { + rxq->state |= (rc == EALREADY) ? + SFC_RXQ_FLUSHED : SFC_RXQ_FLUSH_FAILED; break; } rxq->state &= ~SFC_RXQ_FLUSH_FAILED;