From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0054.outbound.protection.outlook.com [104.47.38.54]) by dpdk.org (Postfix) with ESMTP id 1D39D1DEBE for ; Thu, 14 Jun 2018 13:50:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OoEKQ4TBni+X6jM320M2jOJYvz3KgUqXo5r1KYbnhgU=; b=oXNpNppr4VRDNldp7NdN7zZPoXe5a0uKDFjFpEOOTFOKbV3qvbO0scknQoNe6NGHTpiwgyYcT6/+uAEJsi3oRJaEJt8BiGN4Jd/H7saoE+aEgERWomng5ZgtlELWVkgPPJUyt7tpeY+V1xE2H/ktRQIcfcbRn4V+o6jdMrPp/4w= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Anoob.Joseph@cavium.com; Received: from ajoseph83.caveonetworks.com.caveonetworks.com (115.113.156.2) by BN7PR07MB4898.namprd07.prod.outlook.com (2603:10b6:406:ef::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.863.16; Thu, 14 Jun 2018 11:49:59 +0000 From: Anoob Joseph To: Bruce Richardson , Pablo de Lara Cc: Anoob Joseph , Jerin Jacob , Narayana Prasad , dev@dpdk.org Date: Thu, 14 Jun 2018 17:18:53 +0530 Message-Id: <1528976946-14396-3-git-send-email-anoob.joseph@caviumnetworks.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1528976946-14396-1-git-send-email-anoob.joseph@caviumnetworks.com> References: <1528477766-15788-1-git-send-email-anoob.joseph@caviumnetworks.com> <1528976946-14396-1-git-send-email-anoob.joseph@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [115.113.156.2] X-ClientProxiedBy: PN1PR01CA0095.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00::11) To BN7PR07MB4898.namprd07.prod.outlook.com (2603:10b6:406:ef::27) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b4edf335-138d-4600-01d5-08d5d1ecf601 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(711020)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:BN7PR07MB4898; X-Microsoft-Exchange-Diagnostics: 1; BN7PR07MB4898; 3:Q6ZrCM1fSTWJdrsdwPdbYpZxvJSZmssY9DOTy1PGlTB8INnrykQ4pAFZ2r4qFVk3YdCIosaxABWu9Mpq6tfrbKgNYiPx/JEEI1wO7XO0KpegXjmCLYYHvJEPZEsn8g61gDtM4vmrny2j4ysaG+YuoiIAosmtO6fYL0/Or1FdYwQZHaQRfIUaawNKt5wBv22igfmfUgugTFMbQkVTIvbZ/pjwMpiS2LemR4aSm1du2ToZJ+IrdrsB/KI7gwieubq1; 25:hCQtwT9CMLAcqc2sPxF946tj9RMYeOW1b4dDkVeJWpoQrk/0OQwhfomR4oHBmMoV4qI8ZoviVvEWNMhxGxj65QrF81BnJXzZtfIquSSREhoSGbe9Z/3eQdz4K8NXWINQITLiwgSoRafAo5eyyekNCIktagcuOOar1sPKrDr7ezCQFfCQQyGZ0J7VRBuD4ardlfc8TYtvZzGUngBM3Km/9Qgd9xaZ4I+22iClPeUJrQvh/YrCNiHBSjyhNRP+Hj26+tCZHBYlY/fUGI9l9RA0pdo6oMSEa+TTiEvHOgK5LKyK0PxZAH+B1AdYZVQZONdMMOA6WxOiPjOEF00eMzLg3A==; 31:xlZN1Q2CqL4IQluNYb3jeahUMXu/xtnQ/UmWB/sTQKipB7d2q98lPjV6wT1ZzgstnZfkaZF0cLvPID17+tWoWu7VBZ24a3WvPPUplIdfqSLnqnVHrWt3k6s+hIg78iftpMc9bR/N3srpy0Q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ispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(3231254)(944501410)(52105095)(93006095)(3002001)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123558120)(20161123564045)(6072148)(201708071742011)(7699016); SRVR:BN7PR07MB4898; BCL:0; PCL:0; RULEID:; SRVR:BN7PR07MB4898; X-Forefront-PRVS: 0703B549E4 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(39380400002)(396003)(376002)(346002)(366004)(199004)(189003)(446003)(956004)(2616005)(305945005)(6666003)(47776003)(476003)(54906003)(44832011)(53936002)(68736007)(486006)(110136005)(8936002)(8676002)(81156014)(16586007)(316002)(81166006)(25786009)(4326008)(7736002)(6116002)(3846002)(11346002)(97736004)(36756003)(106356001)(478600001)(105586002)(42882007)(52116002)(51416003)(26005)(16526019)(186003)(50226002)(66066001)(72206003)(6486002)(2906002)(55236004)(50466002)(575784001)(6512007)(386003)(6506007)(5660300001)(76176011)(48376002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN7PR07MB4898; H:ajoseph83.caveonetworks.com.caveonetworks.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN7PR07MB4898; 23:LkN0PWIK25SPzYboFMCU6wqH/STHGIF+XyooTWW+a?= =?us-ascii?Q?WEeypED3yZLNIGnxlMpNIUNP/Ch9xhlIpVCElIKPdnPhqEvpnoEwU45A+ZX3?= =?us-ascii?Q?SuQdqPxLy3SHfX19ldu9hfFAP5OJCKuaYkQqxcVZoWPUo9QKIGhpB9qNIqlq?= =?us-ascii?Q?BhfIOCcZHVsi/jlE1BSw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U66W0ppmORUD+NB9nugwl+qCOmRYE+dIZSHxlcOj4WRsS6SHlJkDoic64T69JU4XlbzwqkMAr5e0YP3S4kQSeHAUhIZHQaCM4Qs8FeOQIYGnDB2Tvmtzc1I=; 24:eb3sQVcfO3ebPLijgzhz6Uj0WYT9O/G5BZiwTVzAkbxvdts6q3Ab7rQ8G4L4vIxv/Qu5qFFAC/zx3iY7/VqPVme4nNEAyH9ICki0oYWv1Cs= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN7PR07MB4898; 7:HIpJUw2iRXJJm3dFBqkehCyNBUWtDdfdyRC8J5qK2174nJsFusxYTyd9yH9q1BQtNtCpHAUgsmGkQw8P3ToCvBL/AyeH4VnTi6nAh7mFEE0/7n0WXdZmmCjoiT/aLjlDqZTh8AymZiTEaIkW6P2g47WBjgRkxmFL7TDIpkPx1+ZWUmHzuBAJ5vXjvXYZ2UJ9uG1yr1X675pfQC/k3bFZMENA1oglR7823irEuHnHFoy9vdVYEwvDYQ5hIYVJVZXB X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jun 2018 11:49:59.5179 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b4edf335-138d-4600-01d5-08d5d1ecf601 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR07MB4898 Subject: [dpdk-dev] [PATCH v1 02/15] examples/l2fwd: move macro definitions to common header 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: Thu, 14 Jun 2018 11:50:02 -0000 Signed-off-by: Anoob Joseph --- v1: * Retaining Intel license with copied code examples/l2fwd/l2fwd_common.h | 19 +++++++++++++++++++ examples/l2fwd/main.c | 16 ++-------------- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/examples/l2fwd/l2fwd_common.h b/examples/l2fwd/l2fwd_common.h index 15059f4..fceb0c3 100644 --- a/examples/l2fwd/l2fwd_common.h +++ b/examples/l2fwd/l2fwd_common.h @@ -1,6 +1,25 @@ /* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2010-2016 Intel Corporation * Copyright(c) 2018 Cavium, Inc */ #ifndef _L2FWD_COMMON_H_ #define _L2FWD_COMMON_H_ + +#define RTE_LOGTYPE_L2FWD RTE_LOGTYPE_USER1 + +#define MAX_PKT_BURST 32 +#define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */ +#define MEMPOOL_CACHE_SIZE 256 + +/* + * Configurable number of RX/TX ring descriptors + */ +#define RTE_TEST_RX_DESC_DEFAULT 1024 +#define RTE_TEST_TX_DESC_DEFAULT 1024 + +#define MAX_RX_QUEUE_PER_LCORE 16 +#define MAX_TX_QUEUE_PER_PORT 16 + +#define MAX_TIMER_PERIOD 86400 /* 1 day max */ + #endif /* _L2FWD_COMMON_H_ */ diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c index 6908435..9f873c7 100644 --- a/examples/l2fwd/main.c +++ b/examples/l2fwd/main.c @@ -39,22 +39,13 @@ #include #include +#include "l2fwd_common.h" + static volatile bool force_quit; /* MAC updating enabled by default */ static int mac_updating = 1; -#define RTE_LOGTYPE_L2FWD RTE_LOGTYPE_USER1 - -#define MAX_PKT_BURST 32 -#define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */ -#define MEMPOOL_CACHE_SIZE 256 - -/* - * Configurable number of RX/TX ring descriptors - */ -#define RTE_TEST_RX_DESC_DEFAULT 1024 -#define RTE_TEST_TX_DESC_DEFAULT 1024 static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT; static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT; @@ -69,8 +60,6 @@ static uint32_t l2fwd_dst_ports[RTE_MAX_ETHPORTS]; static unsigned int l2fwd_rx_queue_per_lcore = 1; -#define MAX_RX_QUEUE_PER_LCORE 16 -#define MAX_TX_QUEUE_PER_PORT 16 struct lcore_queue_conf { unsigned n_rx_port; unsigned rx_port_list[MAX_RX_QUEUE_PER_LCORE]; @@ -100,7 +89,6 @@ struct l2fwd_port_statistics { } __rte_cache_aligned; struct l2fwd_port_statistics port_statistics[RTE_MAX_ETHPORTS]; -#define MAX_TIMER_PERIOD 86400 /* 1 day max */ /* A tsc-based timer responsible for triggering statistics printout */ static uint64_t timer_period = 10; /* default period is 10 seconds */ -- 2.7.4