From patchwork Thu Apr 5 11:24:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Varghese, Vipin" X-Patchwork-Id: 37218 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E04ED1C91F; Thu, 5 Apr 2018 07:42:45 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 8771C1C914 for ; Thu, 5 Apr 2018 07:42:43 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Apr 2018 22:42:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,410,1517904000"; d="scan'208";a="30265149" Received: from unknown (HELO localhost.localdomain) ([10.224.122.203]) by fmsmga008.fm.intel.com with ESMTP; 04 Apr 2018 22:42:39 -0700 From: Vipin Varghese To: dev@dpdk.org, harry.van.haaren@intel.com Cc: jerin.jacob@caviumnetworks.com, Vipin Varghese Date: Thu, 5 Apr 2018 16:54:03 +0530 Message-Id: <1522927443-13796-1-git-send-email-vipin.varghese@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1519932900-10571-1-git-send-email-vipin.varghese@intel.com> References: <1519932900-10571-1-git-send-email-vipin.varghese@intel.com> Subject: [dpdk-dev] [PATCH v2] event/sw: code refractor to reduce the fetch stall 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" With rearranging the code to prefetch the contents before loop check increases performance from single and multistage atomic pipeline. Signed-off-by: Vipin Varghese Acked-by: Harry van Haaren --- Changes in V2: - compilation fix for const flowid - Harry - Removal of sw_refill_pp_buf logic - Harry --- drivers/event/sw/sw_evdev_scheduler.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/drivers/event/sw/sw_evdev_scheduler.c b/drivers/event/sw/sw_evdev_scheduler.c index e3a41e0..98dcf68 100644 --- a/drivers/event/sw/sw_evdev_scheduler.c +++ b/drivers/event/sw/sw_evdev_scheduler.c @@ -44,12 +44,13 @@ uint32_t qid_id = qid->id; iq_dequeue_burst(sw, &qid->iq[iq_num], qes, count); - for (i = 0; i < count; i++) { - const struct rte_event *qe = &qes[i]; - const uint16_t flow_id = SW_HASH_FLOWID(qes[i].flow_id); - struct sw_fid_t *fid = &qid->fids[flow_id]; - int cq = fid->cq; + const struct rte_event *qe = &qes[i]; + uint16_t flow_id = SW_HASH_FLOWID(qes[i].flow_id); + struct sw_fid_t *fid = &qid->fids[flow_id]; + int cq = fid->cq; + + for (i = 0; i < count; i++) { if (cq < 0) { uint32_t cq_idx = qid->cq_next_tx++; if (qid->cq_next_tx == qid->cq_num_mapped_cqs) @@ -101,6 +102,14 @@ &sw->cq_ring_space[cq]); p->cq_buf_count = 0; } + + if (likely(i+1 < count)) { + qe = (qes + i + 1); + flow_id = SW_HASH_FLOWID(qes[i + 1].flow_id); + fid = &qid->fids[flow_id]; + cq = fid->cq; + } + } iq_put_back(sw, &qid->iq[iq_num], blocked_qes, nb_blocked);