From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 82EF2A046B for ; Mon, 24 Jun 2019 04:25:16 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7B9C31BF6B; Mon, 24 Jun 2019 04:25:16 +0200 (CEST) Received: from mail-pf1-f196.google.com (mail-pf1-f196.google.com [209.85.210.196]) by dpdk.org (Postfix) with ESMTP id E34591BF6B for ; Mon, 24 Jun 2019 04:25:14 +0200 (CEST) Received: by mail-pf1-f196.google.com with SMTP id i189so6583183pfg.10 for ; Sun, 23 Jun 2019 19:25:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=um9wQZ3fRjVtkDIryVK/+fmh+JetP7wrmjYLsGXUxco=; b=klu7raGav7P7C5fHSxDl+d0QU9EK0fw3iegsqKwGq+xXGPeT1fz3iW91U+iZSksV0H 3BpJ+/AI/uzdTmBrlJRIBk8JXmOEzPnzfaDS4r20vkqKoFmvmO4HQH2ZKM8yk6uS1/8Z iw4yGtN3FRJu6/Sx0ZALes7jnFr7mKCLLWE4O8CY6EfwcLVPvP6zdiCv2Ci9aGMaad8q 0942AUQF5ToakE+Yg232pqf3PT93lwkc7KgpUv2tg63LB9CHtrVy1nutYNwWDhQEtWaT VU6atWqFoJyjbTx8qgRUuF9lPp9jOtiUdi5KaVhmHcCq/YESHtep2b/rVAUa5fnOckfu 6LHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=um9wQZ3fRjVtkDIryVK/+fmh+JetP7wrmjYLsGXUxco=; b=eXC9JkYzE9t4n8MGsikRj6NzLv0Blt2enIbYPRTS8JVojBkfjasydec3WsRuIc3Gt9 V/Arc4Wn2g7lqwTn3AH966lGdxL2Q7wubDyfW/4JxXaXneQ30B/WlBC8mrlSd5S19v4B U7GLjvp9NFDdDrmMrJJXNeXyWTRs19aIrZN71/cs9/kvys2jNGbzVDZ1xfmIum739lOs 8wPg2YOyL/gZChJjgHu0VAbHqeuFWZmU0Tjj5zjkhfbWdmjdwu1G6txby7L0TQJa1kYC MQXJtbuFIrZC//bR+D6U45Mq6QrUH45Lk2DGmNd1SXh9/KpGG4NjWlevFqCDSZVMYqe+ QwRQ== X-Gm-Message-State: APjAAAUGP3/S0EzZ75CGxp4w1wFMyJCMRi/9vR/Ieky/MZKBu6H27Q3+ lh+6jDD0bAzAcz+j+2E39FYKEmET X-Google-Smtp-Source: APXvYqxVTC4CoF4ugO5lP3Kp++K/+VYlUktms0y+VSKOLAFzpWob1NxZzErsl7JQwtJ/4loFLBEofw== X-Received: by 2002:a17:90a:9281:: with SMTP id n1mr21217412pjo.25.1561343114050; Sun, 23 Jun 2019 19:25:14 -0700 (PDT) Received: from localhost.localdomain ([192.47.164.146]) by smtp.gmail.com with ESMTPSA id a3sm9927461pje.3.2019.06.23.19.25.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 23 Jun 2019 19:25:13 -0700 (PDT) From: yasufum.o@gmail.com To: spp@dpdk.org, ferruh.yigit@intel.com, yasufum.o@gmail.com Date: Mon, 24 Jun 2019 11:24:54 +0900 Message-Id: <20190624022504.18752-2-yasufum.o@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190624022504.18752-1-yasufum.o@gmail.com> References: <20190624022504.18752-1-yasufum.o@gmail.com> Subject: [spp] [PATCH 01/11] shared/sec: refactor defines of VLAN in spp_vf 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: , Errors-To: spp-bounces@dpdk.org Sender: "spp" From: Yasufumi Ogawa * Rename `SPP_NUM_VLAN_VID` to `NOF_VLAN` and move it to `vf_deps.h`. * Rename `NUM_CLASSIFIER_MAC_INFO` to `NOF_CLS_INFO` and move it to `classifier_mac.c`. * Rename `NUM_CLASSIFIER_MAC_TABLE_ENTRY` to `NOF_CLS_TABLE_ENTRIES`. Signed-off-by: Yasufumi Ogawa --- src/shared/secondary/spp_worker_th/cmd_utils.h | 3 --- src/shared/secondary/spp_worker_th/vf_deps.h | 6 +++--- src/vf/classifier_mac.c | 17 ++++++++++------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/shared/secondary/spp_worker_th/cmd_utils.h b/src/shared/secondary/spp_worker_th/cmd_utils.h index ee44cee..1d6c332 100644 --- a/src/shared/secondary/spp_worker_th/cmd_utils.h +++ b/src/shared/secondary/spp_worker_th/cmd_utils.h @@ -40,9 +40,6 @@ #define SPP_PORT_ABILITY_MAX 4 /* Max num of port abilities. */ -/** Number of VLAN ID */ -#define SPP_NUM_VLAN_VID 4096 - /** Maximum VLAN PCP */ #define SPP_VLAN_PCP_MAX 7 diff --git a/src/shared/secondary/spp_worker_th/vf_deps.h b/src/shared/secondary/spp_worker_th/vf_deps.h index fe03490..fd0dc5d 100644 --- a/src/shared/secondary/spp_worker_th/vf_deps.h +++ b/src/shared/secondary/spp_worker_th/vf_deps.h @@ -9,8 +9,8 @@ #include #include "cmd_utils.h" -/* number of classifier information (reference/update) */ -#define NUM_CLASSIFIER_MAC_INFO 2 +/** Number of VLAN ID */ +#define NOF_VLAN 4096 /* mac address classification */ struct mac_classification { @@ -54,7 +54,7 @@ struct component_info { int mac_addr_entry; /* mac address entry flag */ /* mac address classification per vlan-id */ - struct mac_classification *mac_classifications[SPP_NUM_VLAN_VID]; + struct mac_classification *mac_classifications[NOF_VLAN]; int n_classified_data_tx; /* number of transmission ports */ struct classified_data classified_data_rx; /* RX handled by cls */ diff --git a/src/vf/classifier_mac.c b/src/vf/classifier_mac.c index b3a6cba..76dd9e7 100644 --- a/src/vf/classifier_mac.c +++ b/src/vf/classifier_mac.c @@ -35,8 +35,11 @@ #define DEFAULT_HASH_FUNC rte_jhash #endif +/* number of classifier information (reference/update) */ +#define NOF_CLS_INFO 2 + /* number of classifier mac table entry */ -#define NUM_CLASSIFIER_MAC_TABLE_ENTRY 128 +#define NOF_CLS_TABLE_ENTRIES 128 /* interval that wait until change update index (micro second) */ #define CHANGE_UPDATE_INDEX_WAIT_INTERVAL SPP_CHANGE_UPDATE_INTERVAL @@ -53,7 +56,7 @@ /* classifier management information */ struct management_info { /* classifier information */ - struct component_info cmp_infos[NUM_CLASSIFIER_MAC_INFO]; + struct component_info cmp_infos[NOF_CLS_INFO]; /* Reference index number for classifier information */ volatile int ref_index; @@ -75,7 +78,7 @@ uninit_classifier(struct management_info *mng_info) mng_info->is_used = 0; - for (i = 0; i < NUM_CLASSIFIER_MAC_INFO; ++i) + for (i = 0; i < NOF_CLS_INFO; ++i) uninit_component_info(mng_info->cmp_infos + (long)i); memset(mng_info, 0, sizeof(struct management_info)); @@ -298,7 +301,7 @@ create_mac_classification(void) /* set hash creating parameters */ struct rte_hash_parameters hash_params = { .name = hash_tab_name, - .entries = NUM_CLASSIFIER_MAC_TABLE_ENTRY, + .entries = NOF_CLS_TABLE_ENTRIES, .key_len = sizeof(struct ether_addr), .hash_func = DEFAULT_HASH_FUNC, .hash_func_init_val = 0, @@ -440,7 +443,7 @@ uninit_component_info(struct component_info *cmp_info) { int i; - for (i = 0; i < SPP_NUM_VLAN_VID; ++i) + for (i = 0; i < NOF_VLAN; ++i) free_mac_classification(cmp_info->mac_classifications[i]); memset(cmp_info, 0, sizeof(struct component_info)); @@ -686,7 +689,7 @@ change_classifier_index(struct management_info *mng_info, int id) "Core[%u] Change update index.\n", id); mng_info->ref_index = (mng_info->upd_index + 1) % - NUM_CLASSIFIER_MAC_INFO; + NOF_CLS_INFO; } } @@ -943,7 +946,7 @@ spp_classifier_mac_iterate_table( RTE_LOG(DEBUG, SPP_CLASSIFIER_MAC, "Core[%u] Start iterate classifier table.\n", i); - for (n = 0; n < SPP_NUM_VLAN_VID; ++n) { + for (n = 0; n < NOF_VLAN; ++n) { if (cmp_info->mac_classifications[n] == NULL) continue; -- 2.17.1