net/sfc: move EvQ entries to the EvQ control structure
authorAndrew Rybchenko <arybchenko@solarflare.com>
Fri, 31 Mar 2017 10:22:14 +0000 (11:22 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 4 Apr 2017 17:03:00 +0000 (19:03 +0200)
EvQ info array is a problem on device reconfigure when number of
Rx and Tx queues may change. It is a step to get rid of it.

Fixes: 58294ee65afb ("net/sfc: support event queue")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
drivers/net/sfc/sfc_ev.c
drivers/net/sfc/sfc_ev.h

index 7c8ec32..60288ce 100644 (file)
@@ -599,11 +599,10 @@ sfc_ev_qstart(struct sfc_adapter *sa, unsigned int sw_index)
        esmp = &evq->mem;
 
        /* Clear all events */
-       (void)memset((void *)esmp->esm_base, 0xff,
-                    EFX_EVQ_SIZE(evq_info->entries));
+       (void)memset((void *)esmp->esm_base, 0xff, EFX_EVQ_SIZE(evq->entries));
 
        /* Create the common code event queue */
-       rc = efx_ev_qcreate(sa->nic, sw_index, esmp, evq_info->entries,
+       rc = efx_ev_qcreate(sa->nic, sw_index, esmp, evq->entries,
                            0 /* unused on EF10 */, 0, evq_info->flags,
                            &evq->common);
        if (rc != 0)
@@ -814,7 +813,6 @@ sfc_ev_qinit(struct sfc_adapter *sa, unsigned int sw_index,
        evq_info = &sa->evq_info[sw_index];
 
        SFC_ASSERT(rte_is_power_of_2(entries));
-       evq_info->entries = entries;
 
        rc = ENOMEM;
        evq = rte_zmalloc_socket("sfc-evq", sizeof(*evq), RTE_CACHE_LINE_SIZE,
@@ -825,11 +823,11 @@ sfc_ev_qinit(struct sfc_adapter *sa, unsigned int sw_index,
        evq->sa = sa;
        evq->evq_index = sw_index;
        evq->type = type;
+       evq->entries = entries;
 
        /* Allocate DMA space */
        rc = sfc_dma_alloc(sa, sfc_evq_type2str(type), type_index,
-                          EFX_EVQ_SIZE(evq_info->entries),
-                          socket_id, &evq->mem);
+                          EFX_EVQ_SIZE(evq->entries), socket_id, &evq->mem);
        if (rc != 0)
                goto fail_dma_alloc;
 
index 8f43d73..a0addd7 100644 (file)
@@ -81,11 +81,10 @@ struct sfc_evq {
        unsigned int                    evq_index;
        enum sfc_evq_state              init_state;
        enum sfc_evq_type               type;
+       unsigned int                    entries;
 };
 
 struct sfc_evq_info {
-       /* Number of EVQ entries */
-       unsigned int            entries;
        /* Event queue creation flags */
        uint32_t                flags;
        /* NUMA-aware EVQ data structure used on datapath */