From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail04.ics.ntt-tx.co.jp (mail05.ics.ntt-tx.co.jp [210.232.35.69]) by dpdk.org (Postfix) with ESMTP id E48ED5F1C for ; Wed, 21 Nov 2018 02:41:10 +0100 (CET) Received: from gwchk03.silk.ntt-tx.co.jp (gwchk03.silk.ntt-tx.co.jp [10.107.0.111]) by mail04.ics.ntt-tx.co.jp (unknown) with ESMTP id wAL1f907002740; Wed, 21 Nov 2018 10:41:09 +0900 Received: (from root@localhost) by gwchk03.silk.ntt-tx.co.jp (unknown) id wAL1f8pJ004616; Wed, 21 Nov 2018 10:41:08 +0900 Received: from gwchk.silk.ntt-tx.co.jp [10.107.0.110] by gwchk03.silk.ntt-tx.co.jp with ESMTP id LAA01882; Wed, 21 Nov 2018 10:36:02 +0900 Received: from imss03.silk.ntt-tx.co.jp (localhost [127.0.0.1]) by imss03.silk.ntt-tx.co.jp (unknown) with ESMTP id wAL1a1dK009706; Wed, 21 Nov 2018 10:36:01 +0900 Received: from mgate02.silk.ntt-tx.co.jp (smtp02.silk.ntt-tx.co.jp [10.107.0.37]) by imss03.silk.ntt-tx.co.jp (unknown) with ESMTP id wAL1a1f9009703; Wed, 21 Nov 2018 10:36:01 +0900 Message-Id: <201811210136.wAL1a1f9009703@imss03.silk.ntt-tx.co.jp> Received: from localhost by mgate02.silk.ntt-tx.co.jp (unknown) id wAL1ZwWm008346 ; Wed, 21 Nov 2018 10:36:01 +0900 From: x-fn-spp@sl.ntt-tx.co.jp To: ferruh.yigit@intel.com, ogawa.yasufumi@lab.ntt.co.jp Cc: spp@dpdk.org Date: Wed, 21 Nov 2018 10:35:55 +0900 X-Mailer: git-send-email 2.18.0 In-Reply-To: <20181121013558.8869-1-x-fn-spp@sl.ntt-tx.co.jp> References: <20181121013558.8869-1-x-fn-spp@sl.ntt-tx.co.jp> X-TM-AS-MML: No Subject: [spp] [PATCH 20/23] spp_vf: add checking the number of ports X-BeenThere: spp@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Soft Patch Panel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 01:41:11 -0000 From: Hideyuki Yamashita Add checking the number of ports for classifier. It only allows exactly one of rx port, tx port and classifier table exist while starting to classify. Signed-off-by: Hideyuki Yamashita Signed-off-by: Naoki Takada --- src/vf/classifier_mac.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/vf/classifier_mac.c b/src/vf/classifier_mac.c index 0244f7e..cfaf96a 100644 --- a/src/vf/classifier_mac.c +++ b/src/vf/classifier_mac.c @@ -879,11 +879,25 @@ spp_classifier_mac_do(int id) /* change index of update side */ change_update_index(mng_info, id); - /* decide classifier information of the current cycle */ + /** + * decide classifier information of the current cycle + * If at least, one rx port, one tx port and one + * classifier_table exist, then start classifying. + * If not, stop classifying. + */ cmp_info = mng_info->cmp_infos + mng_info->ref_index; clsd_data_rx = &cmp_info->classified_data_rx; clsd_data_tx = cmp_info->classified_data_tx; + /** + * Perform condition check if reception/transmission + * of packet should be done or not + */ + if (!(clsd_data_rx->iface_type != UNDEF && + cmp_info->n_classified_data_tx >= 1 && + cmp_info->mac_addr_entry == 1)) + continue; + /* drain tx packets, if buffer is not filled for interval */ cur_tsc = rte_rdtsc(); if (unlikely(cur_tsc - prev_tsc > drain_tsc)) { -- 2.18.0