From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0041.outbound.protection.outlook.com [104.47.34.41]) by dpdk.org (Postfix) with ESMTP id C5F6D1B45B for ; Wed, 11 Jul 2018 08:08:03 +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=DsppX8hlY+yGSEn/zFUhXFjPO3/YnZVWs5guX5URqBA=; b=g4FLCa8RzjOi/HT6aG4+QsWCbrYzyp718CKOVOoXOhi4lIImR634JTSo8/DdJX2ze/S8zU8pvxxXR926OCYYwWGsiDKA61hw561yStX7HL8yL3l2pn+4K9B1tLrev2QTmZsherONQxhb5osytTReR0hq9J1bV3l/CwRpzcoI0qI= 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.930.21; Wed, 11 Jul 2018 06:08:00 +0000 From: Anoob Joseph To: Bruce Richardson , Pablo de Lara Cc: Anoob Joseph , Jerin Jacob , Narayana Prasad , dev@dpdk.org Date: Wed, 11 Jul 2018 11:37:17 +0530 Message-Id: <1531289248-20025-2-git-send-email-anoob.joseph@caviumnetworks.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1531289248-20025-1-git-send-email-anoob.joseph@caviumnetworks.com> References: <1528976946-14396-1-git-send-email-anoob.joseph@caviumnetworks.com> <1531289248-20025-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: BMXPR01CA0027.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:c::13) To BN7PR07MB4898.namprd07.prod.outlook.com (2603:10b6:406:ef::27) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d3d3833e-696f-4ec7-0018-08d5e6f4a90d X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600053)(711020)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020); SRVR:BN7PR07MB4898; X-Microsoft-Exchange-Diagnostics: 1; BN7PR07MB4898; 3:DFq2ZTfIabmMwc9z7FYFBts90m/eCgEJpIkjjRaZb56Gh7cRLTnoZJy17vME3FynezwFh82EpfHgkez7QYexPx9a4/QCo1juyg4g1eNRCgvXafHVdn5ZlQPNRiB1fPSgdlQ93fQEEjqZHy0eOgn6DJrfshMs8XIZ1I75dlrOtceK3m3OFe26O5s3phca8KwcDz1NZMcSsiuda+zEPbnRcJXMZ4WNgAdkNSpe/U2YNzQsKprKnjjYz8i30PLXiaj6; 25:5NVP88hSBmMPnZdYUY2ILEAngm6H6nzF88jnYvyhWfiweTZRRg38XxjXYHJmwNWcxF4E5hhy5NEou/uxSsCSUhyKpqHTso22MqHSNLL3+oEmRo2v5uQNNxIXlgerV6A4HIy13y48wjJkxxwBnOK6T53ZoKxuYlKvgW+d6JeAZKzPLZS2Ej023RiLTPHg3BZr5TvCEXibPcTMYKJCHIEtwxs1ftpYzEyvr9Qq0T0PnWFMG5cSiPCzuH25h0P9cTB00b/obSZi8LSeRBmjnD3eqhGqD6oLI7MXg+QZWP/P7/LTRN5bkp1JAZ5mWleH0wCcqUKLQeWbfEtlImhsIdXYbg==; 31:g7GVKDcouksWW/np1eb9g70OAbIaVEAlvd1XD1m/38aoM8xCa0gUy7u/AHbKBHuo/lhcmIgenOfM78DoSmW9uHrfn7ZRQCuGBbvb4q6o2xUUjxD+IR1CVqJ/qnUwpb2YHv+D+iPgZN6BNkC0tpP7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eCw== X-Microsoft-Antispam-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)(3231311)(944501410)(52105095)(10201501046)(93006095)(3002001)(149027)(150027)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123564045)(20161123558120)(6072148)(201708071742011)(7699016); SRVR:BN7PR07MB4898; BCL:0; PCL:0; RULEID:; SRVR:BN7PR07MB4898; X-Forefront-PRVS: 0730093765 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(376002)(136003)(39860400002)(366004)(396003)(189003)(199004)(68736007)(81166006)(8676002)(81156014)(44832011)(50466002)(6666003)(25786009)(6512007)(7736002)(4326008)(6486002)(48376002)(8936002)(2906002)(3846002)(478600001)(575784001)(72206003)(305945005)(6116002)(486006)(16586007)(2616005)(54906003)(110136005)(316002)(36756003)(476003)(956004)(446003)(11346002)(47776003)(26005)(42882007)(52116002)(105586002)(186003)(76176011)(16526019)(66066001)(106356001)(51416003)(97736004)(6506007)(55236004)(50226002)(53936002)(5660300001)(386003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN7PR07MB4898; H:ajoseph83.caveonetworks.com.caveonetworks.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A: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:unK1kfdbF6rCJOZ1v+B95UXoSYDAyy1/62X74U5H8?= =?us-ascii?Q?LJMYM/J9tevuS35duexPgO8cxtS5QGTf5wE59YLAbZ8xIRlT6L8N2Fvzjh6b?= =?us-ascii?Q?h1KpJRFbRw1Lfgulumi7fUl74K1SptHuafTOj5ThVyqJPgabvMHTgPgufuLs?= =?us-ascii?Q?J5b3zp80s2tq9LwW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4nnRnh34Ur1b0nsgJpAgzcRxs9KpjMm7abiFMtEWR1GZiAGFLBKPWrdV6R8le3reMBCRSWX1RjCmNPsP2zJVDGGQqkttdsYkw==; 5:gqIRW2i84EsPo0+Akvdz0TPScUpgK+umdCsZY6aVxBHyNZGLJiXpDXHHjkSfeDrHRYmk/2nEulvU7WR2Pv03tRz2IsnyIjLT7FCgHfjxLrJmnpdrRJa14Tr/peyURZoB/pkaOoHwQ/JPXlm9CT+TRmeKTgxTzcwTHIujHy5Db6Y=; 24:DTGoXS6+dnUMqhiFthI/PwUbuvpQSZ2jIzMqqn3d21L+ueVibWGkG+jtUwlx7o2tdhjnFBF+olizoed/Bj+TP0i3AF/weePS38q82FmUlJw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN7PR07MB4898; 7:xxaUyCtxCYyveDBwzbz/U0oqAJqL00IQb8f/+4A1SrAru+2WukUA7opua1EvIXeIRTKth+rgb1xH+HsMOUu1o/JwvduqfYTSAaCL4kiDLr9QHsBzd3Fx++CtogSLSNHB4ICL9JjZFSeyGqWgbp5NhKXYWwNpm9R8GFwQM8U+JTN/nYks2MQbbYdivJjFPNCeUy65b3dhbCP5PgusJBjx+1LljsYRSpUaAYCxZmjuvSiZiGE8/DyMS2aNDZ8mGRwA X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jul 2018 06:08:00.7590 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d3d3833e-696f-4ec7-0018-08d5e6f4a90d 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 v2 01/12] 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: Wed, 11 Jul 2018 06:08:04 -0000 Signed-off-by: Anoob Joseph --- v2: * Merged the patch which was adding the common header v1: * Retaining Intel license with copied code examples/l2fwd/l2fwd_common.h | 25 +++++++++++++++++++++++++ examples/l2fwd/main.c | 16 ++-------------- 2 files changed, 27 insertions(+), 14 deletions(-) create mode 100644 examples/l2fwd/l2fwd_common.h diff --git a/examples/l2fwd/l2fwd_common.h b/examples/l2fwd/l2fwd_common.h new file mode 100644 index 0000000..fceb0c3 --- /dev/null +++ b/examples/l2fwd/l2fwd_common.h @@ -0,0 +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