From patchwork Mon Jan 15 06:11:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 124470 Delivered-To: patch@linaro.org Received: by 10.46.64.148 with SMTP id r20csp568610lje; Sun, 14 Jan 2018 22:12:40 -0800 (PST) X-Google-Smtp-Source: ACJfBouOr69Q5QtVpSFhlXsp5I3mTyTymAFVRJLXbZDhT7eKB6KqUP7hu/xlxlmqjiMZ3kT92aiP X-Received: by 10.80.181.130 with SMTP id a2mr25204034ede.287.1515996760306; Sun, 14 Jan 2018 22:12:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515996760; cv=none; d=google.com; s=arc-20160816; b=VYxKUYnsWhEIUsXWyoI8QAHQCSQI/YxnY6T3K2wdXrOCJQiwISUN60d8ULoMGtPO7O slQCgGXIGWYed/m/eqWYwK7SJSRGTn8KUh611PXih0vI9s/8chUaZUOrrrL8IDdbrDLr SgvXgBrZLK6WDRSwCWCYH6mDrOsLGf+uMAPe1Tio6TwE+nZzfqk9pn47gAVJL9EfPlB7 b1NK4YHgzCueGUQQr3VZTbotf/zry4EQSvq8W3zkqgMO5PmAjsb0YD+UxydjGi73J994 wi4BitpuQ2x2JTAWIPs6UwiCiP8V7DW7sb7s/7z0ghZ0dOQbiqa8j6gqKjUIYLLF/rR2 jwmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:cc:to:from:arc-authentication-results; bh=qhaH7Kpt5vTt4/qRDwqnLJwwLlYufDnpK/sYY4OGFe0=; b=fpHOhRlYwwlmNYznkwp0Jkf+JftmGpCZgBjM4bg8Rv4OgKLRs03QPB9GQVKGblB/PJ l+uL7hZ/8enRYurKQgChH4MrA+w9RFmqSm3Pm1jPOXQ4nMzHnuWvLvckcajjusEs4M5m Z2fu62dbzX8U6f4epER+JH5ptKuMg7mD9EzaK9sT+t1yMa5vypc/tBVplriryfI9yfUo iFHCLL2vRDK4SBDCHHlt2dS0jILYyPhnXTpiXx5I15YG5mX8+3g+Hb2iwjHvT1VGqb54 po2enyCLOEV6OkXmCSavfVkM3ym8COe32rsNiyFvxOCbIsSEr3cQsSe+472+XSf0cqxK Y0Tw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id u63si48639edc.43.2018.01.14.22.12.40; Sun, 14 Jan 2018 22:12:40 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DF61B7260; Mon, 15 Jan 2018 07:12:31 +0100 (CET) Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0080.outbound.protection.outlook.com [104.47.40.80]) by dpdk.org (Postfix) with ESMTP id 82BD671B5 for ; Mon, 15 Jan 2018 07:12:30 +0100 (CET) Received: from BN6PR03CA0094.namprd03.prod.outlook.com (10.164.122.160) by BN6PR03MB2692.namprd03.prod.outlook.com (10.173.144.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.407.7; Mon, 15 Jan 2018 06:12:29 +0000 Received: from BN1AFFO11OLC004.protection.gbl (2a01:111:f400:7c10::129) by BN6PR03CA0094.outlook.office365.com (2603:10b6:405:6f::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.407.7 via Frontend Transport; Mon, 15 Jan 2018 06:12:29 +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 BN1AFFO11OLC004.mail.protection.outlook.com (10.58.53.75) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.345.12 via Frontend Transport; Mon, 15 Jan 2018 06:12:26 +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 w0F6CKAF011776; Sun, 14 Jan 2018 23:12:24 -0700 From: Hemant Agrawal To: CC: , , Date: Mon, 15 Jan 2018 11:41:10 +0530 Message-ID: <1515996674-26338-2-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515996674-26338-1-git-send-email-hemant.agrawal@nxp.com> References: <1513333483-4372-1-git-send-email-hemant.agrawal@nxp.com> <1515996674-26338-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131604703487678465; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(376002)(396003)(346002)(39860400002)(39380400002)(2980300002)(1109001)(1110001)(339900001)(199004)(189003)(51416003)(76176011)(4326008)(54906003)(498600001)(48376002)(6916009)(85426001)(2950100002)(6666003)(316002)(16586007)(5660300001)(68736007)(77096006)(50226002)(105606002)(53936002)(106466001)(2351001)(296002)(8676002)(8936002)(81156014)(81166006)(2906002)(36756003)(47776003)(356003)(305945005)(86362001)(97736004)(104016004)(50466002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR03MB2692; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11OLC004; 1:4rj2HgwMglhhnwNH9/z9qHskMJJM0gy5Q9IOZlo17qCYXX69/mfi/WLKh3lA1Y9F4TFd9bBFIKUERhFLBwdGgp3f3guG9pgKUEt52XAfrPGFQe/6uybMEwn/yNSTwWe4 MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a7336db4-21c6-46de-5801-08d55bdef49e X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(5600026)(4604075)(2017052603307); SRVR:BN6PR03MB2692; X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2692; 3:2hmpdM7H5gGfxCJCfFrXD868V+AkBalSsS/Eh/17C+YElbX3B8ioVGLndkLFD8TXQp2jc6uMpOb/7e2ymJJsWgeR8Rv4fOCeigI6honxZsw2O4eHekMYbU2xT2faQu5Z3yRNwIIzs8K6z24YP2zW4BYwx6qPUyVRcgU0slKMn01M+Bn2NvAiD9G/zjsEhK2mxI0keDWKaoxbTpTUCjcqQyzfrBGMTbFwiJLGK+dFeeMmrPhda1OfetIPZSxf5r1koMjp8LpIdoXs983nr24F1MR2GiwJQvfpK72oy6yapJClwiGco2IJaUa4hmuKU/bl9xntzpSp0kfhy4Drk9UivnvlC8nYnAvSOVnGZSoQL10=; 25:5FS8ASGzO26QuSqV0sxbukgjfnkd6YBc2ODu49acA9JenEDya+Gagy5/2rU3bVJ0t7Z4EiHDDEe618pj6lhU3pC+QZejfNggiHzQlzStrWcrlpRo+36Pq9iDd9jeMPVr9hRj6ChGuUWQ/ABlxIPnsMp6wHeH0UZnSLX3OW8aEkUF1iKg5ml4Yq5EHnhvVst3Cz2j6LyJU/MPkJ9KkjFiF0UHku0HuK7Fwk/zopjGPLjfBvJJXfEsknLhzOQtek9nt83fxlB4x0DSfFtlMr5LeIV4aFfobTM72BJFMBuBLb6PWnEzNY1cNl57ee1nWxeE4Gd1lGphisgPHeoVYqL8vw== X-MS-TrafficTypeDiagnostic: BN6PR03MB2692: X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2692; 31:guZvWyoA74vcO0z2DOQFuFzGnztcI5ldzNRMeODYahq3o4SQsTe+aZxqOPD685YiHYoL5eA3ZHZ0bOd7WY7hqlNv2dsH/i0R1WKWOP8ho3Kd3gROrVRP9Ebmt09UcBvOi/uo5Ws9NMqIngjF+9+wP18zmfSUdF76IXlDokijR4fVcTnZvffFxXGxZ3ezKiLekvsnLM5XqGmLuVH6DSpQitRN8IT5Xd7Pj1ASI2Qr8gU=; 4:BX7p5YXAu3DkjqxRwRnE3d2qLMqLn5k8PmelXREx8erUkt8HR5LyNBoM+F21mZ7uDp2NNKzpjKT8hLCmeD7k54T8kzHyl72NCt0jfjU/JkBBtqw5CBgTLJ+W467wgF974ovDIHSVEJBxVfrI2xopxKeoomxQzfUFkvbI6zMqVevAPaRPzrSirJVCxftj7gmXahsuh6F5KmXUfVvVs0L84n74llQ709cme2RdRlTQ/3qRn4rGJ1MB0z8qFDfJ8vsjwbmUHog6IArQAYT7ZkK0Hv2d3J708yqgRmGQFoDJrfehwE1UHl/OEX57oT2Nhdqt 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)(3231023)(944501161)(3002001)(10201501046)(93006095)(93001095)(6055026)(6096035)(20161123559100)(20161123563025)(201703131430075)(201703131520075)(201703131448075)(201703131433075)(201703151042153)(20161123561025)(20161123556025)(20161123565025)(201708071742011); SRVR:BN6PR03MB2692; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:BN6PR03MB2692; X-Forefront-PRVS: 0553CBB77A X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR03MB2692; 23:lMnFQVl97AtJxaA7yBuW+BFRb74Ov1MNEItF6OSng?= sMcgEw3ml7kvlk6c8mBIxdXvB4ZeooQYxYiNNkgRaS1b6Xq7r34Ls5IXzMiFQsVddhVaLbm41Vz+AWe+mdsAeRh92QWcUoQME7+dG/OUTkKiuirTGIOcdx/pt4TInGHNAlRAk1cgxCiHywutyO1Zh4jsaBwj8kpewfM6lks0WFbwZLzsUxwoA/sSZFyG6xI11ID0NUPvSlY/WduDZ6YZCzmV6X3+DKo3POjZbvMTVIiwUm4kD0NC5A8WdeggbmEn6jS31lmf0jhrrczuWdSfeAZgemPT5GKsUoKvzKxKBI1xwHeMzuV51QRAS5hXpdimJMpbVdV6eoX07c6wb2HlrrsLl50uSEQXk8GwOK+UDcUvG8HFMbD65SdJn14GSlJ2oMaMucWm2ndJf5tzdJfDW8RA+sNu4Z0zIu8p9wYJklIlZbq3Vu+jcM9gbOMEMjrd+oETv6XqlWISlA99SIT5kD1Oa5xgNE/xTa6YakAy70nw87d+zpw32ZNwf8Z4gEm3OXESNmF4cCnw72IUCXwlp6cCIL7z+UY1sxBecaaIR1MERwU8f3iohejxIrtB6TwjSo6X+q/Xw779FGOqV1V/JR9MQ6R7bb2Uu5bhCo5/5o7ZSlWJJJ6E9G2CSXvKvvCAAHgaWRVE5jv2sC7KmVI5HT/eg5D6aSK/EsdyLwtxSGuLs+OiB7MkL/141tgs9UGKYyZUvws6LeABdgc4n57TRF+Q1ggoCE0FUksTnc8NJXXFDfdI98KLjhUNub2nZhPSSH8pYYxxvEU17DfrdCgSfxuPbXYjdc7c/iM8DvgGiHkK9PsVkW5C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ARMqmeeyhGhIY4XTmGnX1V+ia4tDCaoFD8Q0A2V32zzxGEfxx8RjSonqq15ObGu8CQ5WgPgmWBe/d+8wgEY5tdaex9MnF SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jan 2018 06:12:26.8490 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a7336db4-21c6-46de-5801-08d55bdef49e 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: BN6PR03MB2692 Subject: [dpdk-dev] [PATCH v2 1/5] 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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(-) -- 2.7.4 diff --git a/lib/librte_eal/bsdapp/eal/eal.c b/lib/librte_eal/bsdapp/eal/eal.c index 369a682..8261bb1 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");