Soft Patch Panel
 help / color / mirror / Atom feed
From: x-fn-spp@sl.ntt-tx.co.jp
To: ferruh.yigit@intel.com, ogawa.yasufumi@lab.ntt.co.jp
Cc: spp@dpdk.org
Subject: [spp] [PATCH 1/5] spp_vf: remove while loop in classifier_mac
Date: Tue,  5 Feb 2019 20:47:38 +0900	[thread overview]
Message-ID: <201902051147.x15Blg5C014220@imss03.silk.ntt-tx.co.jp> (raw)
In-Reply-To: <20190205114742.24502-1-x-fn-spp@sl.ntt-tx.co.jp>

From: Hideyuki Yamashita <yamashita.hideyuki@po.ntt-tx.co.jp>

So far, spp_classifier_mac_do() has while loop and it does not return
until the classifier component is requested to stop and thus the worker
thread can not execute packet processing for forwarder/merger.
To introduce core-sharing, this patch removes the while loop.

Signed-off-by: Hideyuki Yamashita <yamashita.hideyuki@po.ntt-tx.co.jp>
Signed-off-by: Naoki Takada <takada.naoki@lab.ntt.co.jp>
---
 src/vf/spp_vf.c | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/src/vf/spp_vf.c b/src/vf/spp_vf.c
index b98444d..bdc4c10 100644
--- a/src/vf/spp_vf.c
+++ b/src/vf/spp_vf.c
@@ -1,5 +1,5 @@
 /* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2017-2018 Nippon Telegraph and Telephone Corporation
+ * Copyright(c) 2017-2019 Nippon Telegraph and Telephone Corporation
  */
 
 #include <netinet/in.h>
@@ -209,21 +209,18 @@ slave_main(void *arg __attribute__ ((unused)))
 			core = get_core_info(lcore_id);
 		}
 
+		/* It is for processing multiple components. */
 		for (cnt = 0; cnt < core->num; cnt++) {
-			if (spp_get_component_type(lcore_id) ==
+			if (spp_get_component_type(core->id[cnt]) ==
 					SPP_COMPONENT_CLASSIFIER_MAC) {
-				/* Classifier loops inside the function. */
 				ret = spp_classifier_mac_do(core->id[cnt]);
-				break;
+				if (unlikely(ret != 0))
+					break;
+			} else {
+				ret = spp_forward(core->id[cnt]);
+				if (unlikely(ret != 0))
+					break;
 			}
-
-			/*
-			 * Forward / Merge returns at once.
-			 * It is for processing multiple components.
-			 */
-			ret = spp_forward(core->id[cnt]);
-			if (unlikely(ret != 0))
-				break;
 		}
 		if (unlikely(ret != 0)) {
 			RTE_LOG(ERR, APP, "Core[%d] Component Error. "
-- 
2.17.1

       reply	other threads:[~2019-02-05 11:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20190205114742.24502-1-x-fn-spp@sl.ntt-tx.co.jp>
2019-02-05 11:47 ` x-fn-spp [this message]
2019-02-06  3:46   ` Yasufumi Ogawa
2019-02-05 11:47 ` [spp] [PATCH 2/5] spp_vf: change to handle multiples component x-fn-spp
2019-02-06  3:58   ` Yasufumi Ogawa
2019-02-05 11:47 ` [spp] [PATCH 3/5] spp_vf: move classifier component init x-fn-spp
2019-02-05 11:47 ` [spp] [PATCH 4/5] spp_vf: remove to check unused cores no needed x-fn-spp
2019-02-05 11:47 ` [spp] [PATCH 5/5] spp_vf: change retrieve component type x-fn-spp

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201902051147.x15Blg5C014220@imss03.silk.ntt-tx.co.jp \
    --to=x-fn-spp@sl.ntt-tx.co.jp \
    --cc=ferruh.yigit@intel.com \
    --cc=ogawa.yasufumi@lab.ntt.co.jp \
    --cc=spp@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).