intr_vec was not properly configured. This is not a problem when
just one queue is supported but it fails with multiqueue.

Some minor refactoring also done for hardware interrupt configuration.

Fixes: ea121b28316d ("net/nfp: add Rx interrupts")

Signed-off-by: Alejandro Lucero <alejandro.luc...@netronome.com>
---
 drivers/net/nfp/nfp_net.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c
index 5ea55c7..1108af9 100644
--- a/drivers/net/nfp/nfp_net.c
+++ b/drivers/net/nfp/nfp_net.c
@@ -641,14 +641,19 @@ static void nfp_net_read_mac(struct nfp_net_hw *hw)
                PMD_INIT_LOG(INFO, "VF: enabling RX interrupt with UIO");
                /* UIO just supports one queue and no LSC*/
                nn_cfg_writeb(hw, NFP_NET_CFG_RXR_VEC(0), 0);
+               intr_handle->intr_vec[0] = 0;
        } else {
                PMD_INIT_LOG(INFO, "VF: enabling RX interrupt with VFIO");
-               for (i = 0; i < dev->data->nb_rx_queues; i++)
+               for (i = 0; i < dev->data->nb_rx_queues; i++) {
                        /*
                         * The first msix vector is reserved for non
                         * efd interrupts
                        */
                        nn_cfg_writeb(hw, NFP_NET_CFG_RXR_VEC(i), i + 1);
+                       intr_handle->intr_vec[i] = i + 1;
+                       PMD_INIT_LOG(DEBUG, "intr_vec[%d]= %d\n", i,
+                                           intr_handle->intr_vec[i]);
+               }
        }
 
        /* Avoiding TX interrupts */
@@ -698,20 +703,17 @@ static void nfp_net_read_mac(struct nfp_net_hw *hw)
                intr_vector = dev->data->nb_rx_queues;
                if (rte_intr_efd_enable(intr_handle, intr_vector))
                        return -1;
-       }
 
-       if (rte_intr_dp_is_en(intr_handle))
                nfp_configure_rx_interrupt(dev, intr_handle);
+               update = NFP_NET_CFG_UPDATE_MSIX;
+       }
 
        rte_intr_enable(intr_handle);
 
        /* Enable device */
        new_ctrl = hw->ctrl | NFP_NET_CFG_CTRL_ENABLE;
-       update = NFP_NET_CFG_UPDATE_GEN | NFP_NET_CFG_UPDATE_RING;
 
-       /* Just configuring queues interrupts when necessary */
-       if (rte_intr_dp_is_en(intr_handle))
-               update |= NFP_NET_CFG_UPDATE_MSIX;
+       update |= NFP_NET_CFG_UPDATE_GEN | NFP_NET_CFG_UPDATE_RING;
 
        if (hw->cap & NFP_NET_CFG_CTRL_RINGCFG)
                new_ctrl |= NFP_NET_CFG_CTRL_RINGCFG;
-- 
1.9.1

Reply via email to