From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0085.outbound.protection.outlook.com [104.47.41.85]) by dpdk.org (Postfix) with ESMTP id 1F37A1B2CC for ; Thu, 18 Jan 2018 14:27:50 +0100 (CET) Received: from CY1PR03CA0006.namprd03.prod.outlook.com (10.174.128.16) by BN3PR03MB2355.namprd03.prod.outlook.com (10.166.74.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.407.7; Thu, 18 Jan 2018 13:27:49 +0000 Received: from BN1AFFO11FD041.protection.gbl (2a01:111:f400:7c10::157) by CY1PR03CA0006.outlook.office365.com (2603:10b6:600::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.407.7 via Frontend Transport; Thu, 18 Jan 2018 13:27:49 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; NXP1.onmicrosoft.com; dkim=none (message not signed) header.d=none;NXP1.onmicrosoft.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1AFFO11FD041.mail.protection.outlook.com (10.58.52.252) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.345.12 via Frontend Transport; Thu, 18 Jan 2018 13:27:46 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id w0IDRdIk028023; Thu, 18 Jan 2018 06:27:43 -0700 From: Hemant Agrawal To: CC: , , Date: Thu, 18 Jan 2018 18:56:26 +0530 Message-ID: <1516281992-6873-2-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516281992-6873-1-git-send-email-hemant.agrawal@nxp.com> References: <1515996674-26338-1-git-send-email-hemant.agrawal@nxp.com> <1516281992-6873-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131607556682700679; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(7966004)(376002)(39380400002)(39860400002)(396003)(346002)(2980300002)(1110001)(1109001)(339900001)(189003)(199004)(296002)(8676002)(6666003)(36756003)(2906002)(76176011)(53936002)(4326008)(51416003)(508600001)(2950100002)(8936002)(105606002)(106466001)(6916009)(316002)(81166006)(77096007)(68736007)(5660300001)(2351001)(81156014)(50226002)(50466002)(97736004)(47776003)(104016004)(48376002)(86362001)(356003)(16586007)(54906003)(305945005)(26005)(85426001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR03MB2355; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD041; 1:I+npww5v6NgrdX/Uhp8DMu1qsAQW1HB7ZweSAL/2YndhABtXmPDlrfgqOCAtQtoP2PWSHF+s9hbCeB9RZqH4ONJBfkROQiZWu/sArdCN54B3et5IRNXPqNUFn+DWebaB MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: dc22c7cb-d779-4f3d-5787-08d55e77444b X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(5600026)(4604075)(2017052603307); SRVR:BN3PR03MB2355; X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB2355; 3:v5uKAzWBBsO/0Lhlr+h5UOiBaMKsX8mWgVpya+VaRUmpfA9GukprxA65RYT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x+Xy8hGfRxup8b4kyA3QdMYU6fwyVnmL4s9BDoPxh4ovGUlWZX52dkn9oneNKGiRCbjaAlzasavh/NwMe59Mq+1hcc/mBrjjq5HW/0H4w8KW2sd9Md1ZwwbEjabdmz8loDkw6vyo4jvzebla0GzsLbBnEqysorp9D+/x/tpiXY1MK5y4CDBd6mJFJnZNp6Mfd08W2CVdlXWP/lE X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(5005006)(8121501046)(93006095)(93001095)(3002001)(3231023)(2400062)(944501161)(10201501046)(6055026)(6096035)(20161123556025)(20161123565025)(20161123563025)(20161123559100)(201703131430075)(201703131520075)(201703131441075)(201703131448075)(201703131433075)(20161123561025)(201708071742011); SRVR:BN3PR03MB2355; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:BN3PR03MB2355; X-Forefront-PRVS: 05568D1FF7 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR03MB2355; 23:wbqAnqKikOwj14vstfNQpa9A2uSI7Z5124nliTsUA?= =?us-ascii?Q?8P+bg78t2vQjTSSfkIsu0S5bZkFqHguHRw5w1S2NUEO67l12qGlJAfb0rneb?= =?us-ascii?Q?3lID/o72uBq7S9zNripBQNjluwk3iGyFjserggALXe0YTj3YQo3v7kCwL5WQ?= =?us-ascii?Q?/QGoeBoOrF8UHZRUm2MESnfaKVDkJABbNfhrELvz9v+Sn1PFPVFncbKXL4Tv?= =?us-ascii?Q?ExZMh8vIek/jCCtE/JZNMVb6kct0JnqVcSAwoqt0C0+Zn3GSlZPDn4js9kPi?= =?us-ascii?Q?dK0wtpksZkwiYIGRcr6BAy9NVnTyUZtO2Tyj/u4TzH3j4g2q0mZ6v9zfikzZ?= =?us-ascii?Q?9tXCHeiCvkT9rWQqX2Hj/B+CiHHbxc3B3jMZH2sNxaCXfmWtG/r4pjVm0jIg?= =?us-ascii?Q?WSAYwcI7gWpV05A9xK6QTQwh9QKM7aFMSbQW/LeOOq3seHzouOJFX/YMjvOM?= =?us-ascii?Q?E+A3WCfbgASbI4mWjW6pQHNOGG5CnlynmwzrJYHAIvU5Pz2JbEMD23mILaa+?= =?us-ascii?Q?hKGPWC+NVQBtlBsgTftMFKzXLR391Gw0i4NdAOPnRQDLF5g858ZYs1366CvX?= =?us-ascii?Q?Cahsq92KhO4R/B3YBRsXhALhSjielONDhtgbqE58Zrii/pCju4EY8VA+ua3i?= =?us-ascii?Q?rsEQ3xDNrSroXnGEMYQp8HxFH8tntjDF4601i5bo5BhHAt3zJwdpSIW8qEWg?= =?us-ascii?Q?2J6PT9oDT+HUU1nbtj28YnczKiu2gaLGOYQhACL31QwBZKjHN3IVUmjx8tEX?= =?us-ascii?Q?faysrhYmTbSNZkKXVUT9AuaKH42buEmgWXU9VkkmhwxDOz0pxmaf5hDik1UG?= =?us-ascii?Q?s3vPCE5e50sAY4GcSn7OyD3roKU115mM1ktWiC0hUVgaaujYhk3v4O1b0XBr?= =?us-ascii?Q?rVcLqtctqq7MFHLssWh3P0bpGBOg5yIkCZGmIYyxO+C/uoJcEkAgomDoBai6?= =?us-ascii?Q?DCSe/djk5PjK+aCC0zcmKHKhNEWAWzSbuktZaJvJ8vTOn93mWb4tax9LzylG?= =?us-ascii?Q?Y5NulAMROEfsIImc+MuMdLiQMiy7JWcVO7b8F4DMzxKSEt+EgzHv9vlcAqKp?= =?us-ascii?Q?4DOoRC9uVVR+4XDaAyt0XLUYZxPn81vNbtzRO8/fHfyuJ7wkg=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB2355; 6:4pYhW4URz0FAnzr8MvjCezaluLgp+KnnLmjPcf2EikSuZPySkIkfjAS6lZ7yDRayGjt8cBi5a+PWDqKW05LUQEUsBGOZF9Ze4JGC0VI0fqdRG+RczCp8A3SBt3+SJociSGz7kLkCDXxIPufBUlwu6yuaMNmTBUkxEKMu3IRDZvoYwNtmmaP2ZQOb7wsG4bBh/7D2bzybNqyOlu7HybEXoMm2Omiqr+dHmQNEerbE865ANfyfbRpoeF1dYP/pmCJ03AiO1HSqW2DC7Xps0GeYSekq0AJUSm6AG2nUkOf60dT+U/Ed66NBoggmxKm0cALQxfuc/IDgMRNwdqYaoKjrzpU7D+h00Rg+5lSpDf2nLLY=; 5:kVbouDMOV3dWH8SnHgsu/0do3hD8vzVtLNcbUuta3G/3xwd4VR3mH5r345yYst8/EFsDrLwQV3BRdeWQsaCE/XZ+iA8ehuh0NRD+48DnPeq15/3x3G1qPpU01DaN9DmZxrGgmK0x+xtYl21gD8F39uy7FkNuxKt+ZS2U8rDCuKw=; 24:86VQA4U2hb7b0paHFJtD3kIov0U22NAM4YPmOfPul0IQFHjc59OKsLTANcPJMGeWG1hrtEeH14g/IWhRp8uOUWB9PxTpjkYaWaox/pEImCs=; 7:OTsYqfzrzVaCqWvQVZGw5rfDWchd65LT7unKVEuSlkpAIV1b+yMxquFnZTDTYXBAeTP67DHpNU5C4ZLLsQz5CGgn8W8e8Hfi//HVE4GpNJrSdAMHV9R2NquvqX35LUA4GdXEWOwImLwap94JPQquUfYn+3ZFDn1dtpTn9/pK4abnIIC2uQ8mY1MoZRRomO5i0tpCEAGxun8IEnVY7cuT4n+Jh+jlpKCw8VxeEAfD8TjFwLuXlW6ccshBQz5eLyhw SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jan 2018 13:27:46.3513 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: dc22c7cb-d779-4f3d-5787-08d55e77444b X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR03MB2355 Subject: [dpdk-dev] [PATCH v3 1/7] eal: prefix mbuf pool ops name with user defined 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, 18 Jan 2018 13:27:51 -0000 This patch prefix the mbuf pool ops name with "user" to indicate that it is user defined. This patch also change the logic to maintain the value of user defined and compile time i.e. RTE_MBUF_DEFAULT_MEMPOOL_OPS. The pktmbuf_create_pool is updated to reflect the same. Signed-off-by: Hemant Agrawal --- lib/librte_eal/bsdapp/eal/eal.c | 4 ++-- lib/librte_eal/common/eal_common_options.c | 2 +- lib/librte_eal/common/eal_internal_cfg.h | 3 ++- lib/librte_eal/linuxapp/eal/eal.c | 4 ++-- lib/librte_mbuf/rte_mbuf.c | 2 ++ 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/librte_eal/bsdapp/eal/eal.c b/lib/librte_eal/bsdapp/eal/eal.c index 04cbd81..c602d02 100644 --- a/lib/librte_eal/bsdapp/eal/eal.c +++ b/lib/librte_eal/bsdapp/eal/eal.c @@ -114,7 +114,7 @@ int rte_cycles_vmware_tsc_map; const char * rte_eal_mbuf_default_mempool_ops(void) { - return internal_config.mbuf_pool_ops_name; + return internal_config.user_mbuf_pool_ops_name; } /* Return a pointer to the configuration structure */ @@ -397,7 +397,7 @@ eal_parse_args(int argc, char **argv) switch (opt) { case OPT_MBUF_POOL_OPS_NAME_NUM: - internal_config.mbuf_pool_ops_name = optarg; + internal_config.user_mbuf_pool_ops_name = optarg; break; case 'h': eal_usage(prgname); diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c index 996a034..b6d2762 100644 --- a/lib/librte_eal/common/eal_common_options.c +++ b/lib/librte_eal/common/eal_common_options.c @@ -218,7 +218,7 @@ eal_reset_internal_config(struct internal_config *internal_cfg) #endif internal_cfg->vmware_tsc_map = 0; internal_cfg->create_uio_dev = 0; - internal_cfg->mbuf_pool_ops_name = RTE_MBUF_DEFAULT_MEMPOOL_OPS; + internal_cfg->user_mbuf_pool_ops_name = NULL; } static int diff --git a/lib/librte_eal/common/eal_internal_cfg.h b/lib/librte_eal/common/eal_internal_cfg.h index c67685c..1169fcc 100644 --- a/lib/librte_eal/common/eal_internal_cfg.h +++ b/lib/librte_eal/common/eal_internal_cfg.h @@ -52,7 +52,8 @@ struct internal_config { volatile enum rte_intr_mode vfio_intr_mode; const char *hugefile_prefix; /**< the base filename of hugetlbfs files */ const char *hugepage_dir; /**< specific hugetlbfs directory to use */ - const char *mbuf_pool_ops_name; /**< mbuf pool ops name */ + const char *user_mbuf_pool_ops_name; + /**< user defined mbuf pool ops name */ unsigned num_hugepage_sizes; /**< how many sizes on this system */ struct hugepage_info hugepage_info[MAX_HUGEPAGE_SIZES]; }; diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c index 229eec9..e8c7100 100644 --- a/lib/librte_eal/linuxapp/eal/eal.c +++ b/lib/librte_eal/linuxapp/eal/eal.c @@ -124,7 +124,7 @@ int rte_cycles_vmware_tsc_map; const char * rte_eal_mbuf_default_mempool_ops(void) { - return internal_config.mbuf_pool_ops_name; + return internal_config.user_mbuf_pool_ops_name; } /* Return a pointer to the configuration structure */ @@ -609,7 +609,7 @@ eal_parse_args(int argc, char **argv) break; case OPT_MBUF_POOL_OPS_NAME_NUM: - internal_config.mbuf_pool_ops_name = optarg; + internal_config.user_mbuf_pool_ops_name = optarg; break; default: diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c index 937fd70..c085c37 100644 --- a/lib/librte_mbuf/rte_mbuf.c +++ b/lib/librte_mbuf/rte_mbuf.c @@ -177,6 +177,8 @@ rte_pktmbuf_pool_create(const char *name, unsigned n, return NULL; mp_ops_name = rte_eal_mbuf_default_mempool_ops(); + if (mp_ops_name == NULL) + mp_ops_name = RTE_MBUF_DEFAULT_MEMPOOL_OPS; ret = rte_mempool_set_ops_byname(mp, mp_ops_name, NULL); if (ret != 0) { RTE_LOG(ERR, MBUF, "error setting mempool handler\n"); -- 2.7.4