From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [67.231.154.164]) by dpdk.org (Postfix) with ESMTP id 974982BB0 for ; Fri, 31 Mar 2017 12:22:42 +0200 (CEST) Received: from pure.maildistiller.com (unknown [10.110.50.29]) by dispatch1-us1.ppe-hosted.com (Proofpoint Essentials ESMTP Server) with ESMTP id 36C1F60051 for ; Fri, 31 Mar 2017 10:22:42 +0000 (UTC) X-Virus-Scanned: Proofpoint Essentials engine Received: from mx8-us1.ppe-hosted.com (unknown [10.110.49.251]) by pure.maildistiller.com (Proofpoint Essentials ESMTP Server) with ESMTPS id 637D56004C for ; Fri, 31 Mar 2017 10:22:39 +0000 (UTC) Received: from webmail.solarflare.com (webmail.solarflare.com [12.187.104.26]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx8-us1.ppe-hosted.com (Proofpoint Essentials ESMTP Server) with ESMTPS id 03F6B44006D for ; Fri, 31 Mar 2017 10:22:38 +0000 (UTC) Received: from ocex03.SolarFlarecom.com (10.20.40.36) by ocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server (TLS) id 15.0.1044.25; Fri, 31 Mar 2017 03:22:30 -0700 Received: from opal.uk.solarflarecom.com (10.17.10.1) by ocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server (TLS) id 15.0.1044.25 via Frontend Transport; Fri, 31 Mar 2017 03:22:30 -0700 Received: from uklogin.uk.solarflarecom.com (uklogin.uk.solarflarecom.com [10.17.10.10]) by opal.uk.solarflarecom.com (8.13.8/8.13.8) with ESMTP id v2VAMTLv030638 for ; Fri, 31 Mar 2017 11:22:29 +0100 Received: from uklogin.uk.solarflarecom.com (localhost.localdomain [127.0.0.1]) by uklogin.uk.solarflarecom.com (8.13.8/8.13.8) with ESMTP id v2VAMTQi009951 for ; Fri, 31 Mar 2017 11:22:29 +0100 From: Andrew Rybchenko To: Date: Fri, 31 Mar 2017 11:22:14 +0100 Message-ID: <1490955743-9868-5-git-send-email-arybchenko@solarflare.com> X-Mailer: git-send-email 1.8.2.3 In-Reply-To: <1490955743-9868-1-git-send-email-arybchenko@solarflare.com> References: <1490955743-9868-1-git-send-email-arybchenko@solarflare.com> MIME-Version: 1.0 Content-Type: text/plain X-MDID: 1490955762-MOA9px1qMfSc Subject: [dpdk-dev] [PATCH 04/13] net/sfc: move EvQ entries to the EvQ control structure X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Mar 2017 10:22:43 -0000 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") Signed-off-by: Andrew Rybchenko Reviewed-by: Andy Moreton --- drivers/net/sfc/sfc_ev.c | 10 ++++------ drivers/net/sfc/sfc_ev.h | 3 +-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/net/sfc/sfc_ev.c b/drivers/net/sfc/sfc_ev.c index 7c8ec32..60288ce 100644 --- a/drivers/net/sfc/sfc_ev.c +++ b/drivers/net/sfc/sfc_ev.c @@ -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; diff --git a/drivers/net/sfc/sfc_ev.h b/drivers/net/sfc/sfc_ev.h index 8f43d73..a0addd7 100644 --- a/drivers/net/sfc/sfc_ev.h +++ b/drivers/net/sfc/sfc_ev.h @@ -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 */ -- 2.9.3