New upstream version 16.11.5
[deb_dpdk.git] / drivers / net / i40e / i40e_fdir.c
index 335bf15..e25b8e0 100644 (file)
@@ -165,7 +165,6 @@ i40e_fdir_rx_queue_init(struct i40e_rx_queue *rxq)
 
        rte_wmb();
        /* Init the RX tail regieter. */
-       I40E_PCI_REG_WRITE(rxq->qrx_tail, 0);
        I40E_PCI_REG_WRITE(rxq->qrx_tail, rxq->nb_rx_desc - 1);
 
        return err;
@@ -294,8 +293,12 @@ i40e_fdir_teardown(struct i40e_pf *pf)
        vsi = pf->fdir.fdir_vsi;
        if (!vsi)
                return;
-       i40e_switch_tx_queue(hw, vsi->base_queue, FALSE);
-       i40e_switch_rx_queue(hw, vsi->base_queue, FALSE);
+       int err = i40e_switch_tx_queue(hw, vsi->base_queue, FALSE);
+       if (err)
+               PMD_DRV_LOG(DEBUG, "Failed to do FDIR TX switch off");
+       err = i40e_switch_rx_queue(hw, vsi->base_queue, FALSE);
+       if (err)
+               PMD_DRV_LOG(DEBUG, "Failed to do FDIR RX switch off");
        i40e_dev_rx_queue_release(pf->fdir.rxq);
        pf->fdir.rxq = NULL;
        i40e_dev_tx_queue_release(pf->fdir.txq);
@@ -1007,13 +1010,18 @@ i40e_check_fdir_programming_status(struct i40e_rx_queue *rxq)
                                PMD_DRV_LOG(ERR, "invalid programming status"
                                            " reported, error = %u.", error);
                } else
-                       PMD_DRV_LOG(ERR, "unknown programming status"
+                       PMD_DRV_LOG(INFO, "unknown programming status"
                                    " reported, len = %d, id = %u.", len, id);
                rxdp->wb.qword1.status_error_len = 0;
                rxq->rx_tail++;
                if (unlikely(rxq->rx_tail == rxq->nb_rx_desc))
                        rxq->rx_tail = 0;
+               if (rxq->rx_tail == 0)
+                       I40E_PCI_REG_WRITE(rxq->qrx_tail, rxq->nb_rx_desc - 1);
+               else
+                       I40E_PCI_REG_WRITE(rxq->qrx_tail, rxq->rx_tail - 1);
        }
+
        return ret;
 }