From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM04-CO1-obe.outbound.protection.outlook.com (mail-eopbgr690060.outbound.protection.outlook.com [40.107.69.60]) by dpdk.org (Postfix) with ESMTP id B776C1E93D for ; Thu, 14 Jun 2018 12:18:56 +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=9ERZsDJuk71amCycRhmSZNzLEf/h1C8ePR43ogA0kq0=; b=URk5mlumViMgRI7jy0SDZCZiDShGTTgdc3p8YMqrWR/zCf24+YWe4sv/LV+AWGdebOnzQ90BkN+HXL14HEAalpoBKUlv+Nmm/QbizORNF7IwsiI+qvfiUZi1RyKa7tGV913ciwA+xjqfx3YW96JKa+GB4a2kmcH5UjoH6IKGs/4= 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 BYAPR07MB4902.namprd07.prod.outlook.com (2603:10b6:a02:ef::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.841.19; Thu, 14 Jun 2018 10:18:52 +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 15:47:44 +0530 Message-Id: <1528971477-14156-3-git-send-email-anoob.joseph@caviumnetworks.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1528971477-14156-1-git-send-email-anoob.joseph@caviumnetworks.com> References: <1528477766-15788-1-git-send-email-anoob.joseph@caviumnetworks.com> <1528971477-14156-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: BM1PR0101CA0031.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:1a::17) To BYAPR07MB4902.namprd07.prod.outlook.com (2603:10b6:a02:ef::25) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f5d447ea-6db7-4316-699d-08d5d1e03c08 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(711020)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:BYAPR07MB4902; X-Microsoft-Exchange-Diagnostics: 1; BYAPR07MB4902; 3:1LwRJ9OdNxVN3WoMyCnGEmoYImvhFuhKV7W04UP4Rbrisg7OcxlHgEhUvCcHvfb0+YslNi1zyden9MlZLYzUqLR86O/4XG/kmEdqQFJiSWqyTbOXBp+BMcPivZfjhVe/R0/lTQgFCcJkCYw4ddIcHU7INlndA3gx+fnODyeISw7Ha5O2eKslVYCVWRol1l0J0fEq4EPxOv2oT1wfJiINH+a82U1H+bvRa2TiBeWSiIFDPEhlxQUTmIL6hp1XP75E; 25:O7fBdSE9WZKW2WOKo7oq6mlZX2GsmZedWRQJ9bnkzQPeAjLVfQjbYt7o02DONmOd54wQ92/Y/4W5cFB/rioR1jE7232KWZQg2jUAlW3sXYNsGQY7fQBgTTOwj1Hlj8Joz/Mm83Pk3PDXSzCZOrQvDri6HIndz2LLgWly6vIbITytC2bB9zn2JoKz8sG2g0y0tCAnhQM5NKXND9wDLjLYzVU13AGI1yfSoSUcHcCdMllyuAHsZBw+FFNS8j01ws12/Qzzxb4HiCxjYJyDR8iLDeNVWSCh2lYIfm1KSyGpeGitHfwTAODauDQ0kd2yjUM+bomxDu9gwYl5SgugVBwJ8A==; 31:vt67TesjKFmVv++OzIp3C1+VIryotEc9+hW5c0GQAS4Tuy7wW1x5PrhUYetZoyLnMwdApxOIU0DlVivHfOyYI9tWPTOkTkJB3O50ZD3TAYWdjIWQUNJdJq5pdGm4iKWVO4S0z7VgQDFUfiHo69G2Ku4KUGOjfg2UBjNRJy/Vz5kQlTLmX1yAiQKmqy1EBPV3+hbRU2IpNCeHOMvC1VbN+3L5poWLWNHsjab/l18n530= X-MS-TrafficTypeDiagnostic: BYAPR07MB4902: X-Microsoft-Exchange-Diagnostics: 1; BYAPR07MB4902; 20:t40TlzBy9rGptPM8904GRuiII7dic9Yo3b0q4Fhk2sTEmaQtcbtt3VUkL3fr3crCzKe1ugQpZtHYGxUkEsTpKhzuzi8PxaT+cerxNZSYvGgNmQjGr+/7rzM/9jPOMDUGKH7G3hqfxNazRONrq5lGj0R10NXRiSRI6cDJIhKqgcPbPCZ8DIka/T7QbfqjPx80d7RGvFoazDyqej0i7cDq+pe46AXhputkV6cKwnyXH6eFOSXyB3to/NZ38A8NcFaVLuvgY5aiZLFozYvM/RHRzyuhYrFwNuD3YPzYs9/gG81xAoQdPCQJ1RJPDq6QhtWb0nc+qWdOv+6B92QI2Q4Ljcp+bxaueRagQhEK2E6xc7nycWXXvJtSGDMhspzC+MMMsPPZPMrK/Se7txjb+jj29mpvlMXAawOimcFjDSfTtWsL5Ppx5TNXK/cGFx5YRGPfd9l6PiIxkB9b86qfoewoh6kz0RFNlLn5h6dQBUnmvzGlpuKAf8PrVH93Or2sVFMh1iqJKOvbQhu8Ee9xDrceGR23Te2Y/bEhOqkSpOBsGJHGEJuKLphfas34nTvcCz/njA1w2HIRr5eMBUGhx74GiSHqkV6uiGSu319jwwcJ+OI=; 4:0SFZmdPqwAJu+D332fv90xPZN4tv+0es0KqZFLg0xIthZKil9mL5WM/vMGVVls1TeRJqDTCCwxlOdqtkxz+kWO6MBFAxBK4cyZMUHdIBSgsPxesvZJ70leJ1dIJGudzZvvYwEbvPApLjmARWwx0vYH6opV1xoptoJvru+o1mEP8x9xTGUNrYIss186tVPNoeNrqHmaxdmtBwVByR4vpR3Qssgsq3P7m/c2gSH/OZsWB7kLFtC/fqK1SphaCtZyseQtJH9VNGdokZ659LH7K1ZA== 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)(5005006)(8121501046)(3231254)(944501410)(52105095)(10201501046)(93006095)(3002001)(149027)(150027)(6041310)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(6072148)(201708071742011)(7699016); SRVR:BYAPR07MB4902; BCL:0; PCL:0; RULEID:; SRVR:BYAPR07MB4902; X-Forefront-PRVS: 0703B549E4 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(39860400002)(39380400002)(376002)(396003)(366004)(189003)(199004)(316002)(6666003)(110136005)(68736007)(2906002)(66066001)(54906003)(47776003)(6512007)(5660300001)(50466002)(72206003)(48376002)(97736004)(6116002)(3846002)(53936002)(16586007)(105586002)(478600001)(6486002)(106356001)(6506007)(575784001)(36756003)(11346002)(956004)(25786009)(4326008)(50226002)(16526019)(186003)(81156014)(486006)(81166006)(8676002)(7736002)(26005)(8936002)(2616005)(476003)(386003)(44832011)(55236004)(52116002)(42882007)(51416003)(76176011)(446003)(305945005); DIR:OUT; SFP:1101; SCL:1; SRVR:BYAPR07MB4902; 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; BYAPR07MB4902; 23:VjSihHcw6LUbWtXy1Cw2eA6EppgKxm3CXjuP8wqDF?= =?us-ascii?Q?4WCilR/hO6nLJ6sOhxSvHALvSqX5yY5TQG25oezFB4PnGKlGQB2K+bjDn6UT?= =?us-ascii?Q?52r28P/WevL8ivpNT5bmIBYg27aesVd8ZFWhXxWdcJsQ/dlueo0DgDoNwK/9?= =?us-ascii?Q?TAAwXX4u7+IHygF88O86qKsYQvj1mpoZNSdhThk0A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?b1rhuMiM9UnGXZzckRML1rr2iMcE24KX12C77T6Xlqgkd98086qunnfyfszF?= =?us-ascii?Q?rBtsiipMILiKhd384moKcKOdONV+9aEK3+aQ7XrbWnOoPXTkgzueA+pWyFFe?= =?us-ascii?Q?VkpSmfOmhG6lk9uoFd15NDvFLDW6aHrd/IvpzOWZKNm0BZw/YUky80m47RbD?= =?us-ascii?Q?Xv/0pC/pV+3vBI+niSXsneoY0oXYbTVoQD2wWePw084Nai7GjjUGZWCmsgs4?= =?us-ascii?B?QT09?= X-Microsoft-Antispam-Message-Info: UFP2US5mxjg1BExZ2IE4YQ6+DQfKhTY1UhPm6WM9LiTpOTb51c+ml+8c+glC/TJO9lr35yPqMh3JTqHU01ggEMXxsMA2FRzsrqMign+G34V0y4n5mDANAzBCSbeXPJRQWfyDSq6mHfjYPTKnM27iwPa4+HpEt5jrH+Zw15BY91j5NZA2JesClI10U4lpaznw X-Microsoft-Exchange-Diagnostics: 1; BYAPR07MB4902; 6:ZmJ4Q8N2dpBtuYL9snKagKjWYApyXq7v4zFsJfcqzooftW/rwZLsGGfvZVlA2qteooC1tiE/om+cTP/FoLG3JJqx1Kttil0PpMH5H5b0wjFla7YQc3+RL0cilhhiLJvh47FqcwNmt4n2mMjGht5pAunvD871vTRzZn/xseo1SnRj+xOy0P8P7LIxO1lK20QO5Y8VSQyn+rZhdFPJQCfdWuhPvWfiEyLxbVnNhrGKQYuMYZ03zf78fmml8iW+aLcIyRoKcgIOWNeGnR98C41yL15izA+FWTMgrguFtMhPqhli5hm6BzUHmNkIw/5XYGyJ370KJA5hZKgAwAZyORwxvNm+A5+QkKRTXxtpq0SX7wFAvYw2B1dcGDdvmrpAOCFxVV3OgcXhWbGkb45bDhZaXq+0a9acrQ8DVZMF4N6VzG47jJ62tKgS33X7bQ1RyYvLw5wJtHS1SpAI2I441VyZ6Q==; 5:pgnHEf0C9X7/CHUSlyOz8UAK7uISAr+ffykh71lusO5zAulzSzB6eftxkNBZpU3N+GmXi64VvOpDCVQIk6O3XvxN7oKcElrqibOW6maqLzsOC8EljH2imF5gZjUy6Jm42wQDIJtzxyK52X/ilkbFg0KT6mEvcroYewrdx4nmbu4=; 24:vo6/IyW9GnQ0g+hl8FESVi5T5hxu7yEDJDa7ouK/zKw7MA3izBLfbxOfOfDGgUZcr4tcoI/bzj17belZOVVLQ4R7kCDvcEaJ1f4UE7Lg4DY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BYAPR07MB4902; 7:Q5xu43lDzh5rgLWxnxySegFcqEu9PfQbPHcamxaR3PQR50hHtM4km4jimXv2GabGZVdPf0a8MT9s2lx+ZHCor82Pcve4k06g1P3/C8EJAl4jHdxNVxyCOI3qWgz0Y8X12NsJzv+7wYZN4vuuwVMRdqei11ZY4ahJyVmbigitFIAgZoVrQHFSdwooIjgrB+OFXzOoCmpYXX9qIgHE05D28bzeYt8e3k5Wd1izxm25vChMafVCleL7zVjQgr00S2r8 X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jun 2018 10:18:52.9630 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f5d447ea-6db7-4316-699d-08d5d1e03c08 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR07MB4902 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 10:18:57 -0000 v1: * Retaining Intel license with copied code Signed-off-by: Anoob Joseph --- 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