From patchwork Fri Dec 15 10:24:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 122073 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp277790qgn; Fri, 15 Dec 2017 02:25:54 -0800 (PST) X-Google-Smtp-Source: ACJfBouvoVjhB0kShYDpglHxzbO7It13dOgXC+z4o40mwoGjrW+eQabyGQC4hKhUPNfRA13M4OlH X-Received: by 10.28.65.136 with SMTP id o130mr5148268wma.33.1513333554880; Fri, 15 Dec 2017 02:25:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513333554; cv=none; d=google.com; s=arc-20160816; b=ZhMi9Fpt30AHyQnkV7n15fPdUoOqwofwEqraH5R3YdqCbguYvom07SNO98brhI1ZY5 vQukHB2j3rZOHQN7Vt9Ot1ZyJc++5AMItCyPKrKTrD1wAT+wFLw3TPnUUR1A0ZeZwK8B 5z4XbI6r88v+3SL7nhHsah48bOdPg2RCDS4kHmflNfn+1WSK51RXssSnj9rz/7Std9E3 ghOYDfWBAsNPkiYhgYTuH/xepxl6YjbSUdeS01t8i4pAz5V4sLgDtYFLiDZ1bbGVpvN3 yZ65IZleu8dATD0SGWYyaaSsYAV0bAjjPJBANkHu7XK9KiZMVUWBDXrQTvjnCCZxp7Tx ArjA== 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=vcgJ0v9GJV7rjwC4QqWfdJ9PgBM8pr1wHh0gUBUHrgg=; b=XJomRgorIxCQFrOiVzJVOj3cY5E01sgi7YjBfi1nRbkp0s1TBa0VneEHodZ8sw0HM3 0Or7t9S/EdeKCK+C/uJsM4uUovcpiCDZ9+ZEkg6PAHToVlBi6plg2Z2bOqUaqN4492gZ 3P2ul0CloGn+/015NpilriC3z+3KYgZD5xiryS+3FixNVgjvimkJ+JLzetujC7hJd4zQ KBB+tMD8BIrydbuATHkF+Oyf102hNJw+iF5NkV+WSsxPdue9IH7JpUGisRAhLqfXpn32 6bAw3hoqqhPX3X+/QGawJ6QGyRv+ggfGbSUaXDcz5bPj6DCCsINGo+NSOOOftpZAW9xT 68ng== 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 o5si4290145wma.179.2017.12.15.02.25.54; Fri, 15 Dec 2017 02:25:54 -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 4DA8D1B01E; Fri, 15 Dec 2017 11:25:49 +0100 (CET) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0054.outbound.protection.outlook.com [104.47.36.54]) by dpdk.org (Postfix) with ESMTP id 0B5BE1B01C for ; Fri, 15 Dec 2017 11:25:46 +0100 (CET) Received: from CY1PR03CA0029.namprd03.prod.outlook.com (10.174.128.39) by BN3PR03MB2354.namprd03.prod.outlook.com (10.166.74.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.9; Fri, 15 Dec 2017 10:25:45 +0000 Received: from BN1BFFO11FD010.protection.gbl (2a01:111:f400:7c10::1:149) by CY1PR03CA0029.outlook.office365.com (2603:10b6:600::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.302.9 via Frontend Transport; Fri, 15 Dec 2017 10:25:45 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; 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 BN1BFFO11FD010.mail.protection.outlook.com (10.58.144.73) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.282.5 via Frontend Transport; Fri, 15 Dec 2017 10:25:35 +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 vBFAPe5j017334; Fri, 15 Dec 2017 03:25:42 -0700 From: Hemant Agrawal To: , CC: Date: Fri, 15 Dec 2017 15:54:42 +0530 Message-ID: <1513333483-4372-2-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513333483-4372-1-git-send-email-hemant.agrawal@nxp.com> References: <1499170968-23016-1-git-send-email-hemant.agrawal@nxp.com> <1513333483-4372-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131578071360572733; (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)(336005)(39380400002)(39860400002)(346002)(376002)(396003)(2980300002)(1110001)(1109001)(339900001)(199004)(189003)(2906002)(104016004)(15650500001)(316002)(110136005)(47776003)(16586007)(36756003)(498600001)(2950100002)(4326008)(53936002)(106466001)(50466002)(48376002)(105606002)(5660300001)(97736004)(305945005)(356003)(81156014)(50226002)(575784001)(8936002)(86362001)(85426001)(68736007)(76176011)(77096006)(59450400001)(51416003)(81166006)(8676002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR03MB2354; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD010; 1:aCmxJGIpq0nsVBIdaR8Au+wmnGo4ne5wrvogWBZE4JbnfCHSRJy6rCdrRezx0QKYAPMkXTouAuoqtb01kTucVyDNcb/VOwK8AD6DDIybSzXVHzJ8cd1TqHZnZwmK/DA2 MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2ace9785-0932-49c0-8d3d-08d543a62e24 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4628075)(201703131517081)(2017052603307); SRVR:BN3PR03MB2354; X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB2354; 3:o2KhYD12SmXdBt6XMwlw2plVPpQtfSeXChRu5hzKHek+oWs3e4NLOcctssddRHXyzwawin6DL7RdvI9DEIDaS+5YxqWwpyySaaX8QxFomvqWXCTjNSCMYWmFerRqUC+hujoy0T4aBzYJ3arcm9+vKkqoGAovag0S2kcUX+H1mrMRf6R6Oz8SgTrfYyDtKhKrtYl2NHYZ0xsUQq5DXmdxcYbDDrKmaSHZXMgXgtKdmbiiH3aWrZewVxDd3pQdOPG957W1BA0y+ftgILa7lA7Mgf6babw7rda8CEaYamX8V0vx1DSdtB9CYsqWWXbM/Chbt8B6duXlVDP1Bm3SGQkekYm0Q1L1zh1vT6e2CsP/KdI=; 25:XzPJpYerBGwf5NCL1k0mduvQ0WpdteT1xaIUZrgMNZZjSp33JTVfll3AC3Pjehyse8wANrnWgjg+3d2fPXhTntZEgPTWHAE56zW0dnyyxRFzezKbI4+sqX52llpyQo9qjPfYLCFr6V4WNt+oAP9NA/4+KdeN1zLTp7Q3Dj2QDBTiMwyiNKx9AZ0UiCcfM+0zf9fDbeaAmYhVDxQVCjgA4SUPN+Xk1FLIK0wAQ5UxuzPK0+09xQHaKUmS8tUyzuEPdjUQ5UK3U2f6xrCIq0GTKmdCxIw/i4SA5p61TvvjljF7rQ+9Ok+xBEfv1ju0GAIjQYta4jPEcnR3sgyuOco5gg== X-MS-TrafficTypeDiagnostic: BN3PR03MB2354: X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB2354; 31:42tYSCjKnY7105JbVltX30ZkEqg/4pYmMsAu2kSeiCdsXQ+fAd6biur4zaHYcvhzjA398rpISrF2bJfg2s+33eQQ4nVdBsGIh67x7Vj+PFOMeTlSzUgT70dSZtuVxPTVeGscvI0ZqMwGtuR37qxEEx0uPN8GvLDpx+XzNFqRK5D8j/Mw8t/GKDBIiIFyTlVOqKlZ/57ZXpcDqvjAaBomlu7EucaBki4AhJ1mW+gqvPM=; 4:i7e9B3x0UBqrwDygqZlaXfo6o1g43Tg/XnezBj7WegZnTJRdrwm4FjKCtbx6W4iWsJ/8zByKNU0fAhw+PpSDDcxxMMlBc7ln5msHIw1ochBOwe3nKtWIdoISmg4q1ZDYvVXUFFjlhCP0IDkT4L3dQNXyCOuT+etWGWPlSG6Z0dxsKIIqMM9IJ9F8o7D+dhrbJEGd6jO+b1TNQHkLqIz4nuqOeDW6jueDjdsNBHGbsZRjINJnonq3xjbf9PNwwnENQ+4BBSOwqvI8I9dF01POaWNJHiXobGabiuAnPXIdJT+dMtQlZzgh7CNgBnKAgkpf 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)(3002001)(93006095)(93001095)(10201501046)(3231023)(6055026)(6096035)(201703131430075)(201703131433075)(201703131441075)(201703131448075)(201703161259150)(20161123563025)(20161123559100)(20161123556025)(20161123561025)(20161123565025)(201708071742011); SRVR:BN3PR03MB2354; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:BN3PR03MB2354; X-Forefront-PRVS: 05220145DE X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR03MB2354; 23:eHoWd31T03YXii2nmF9KlJtPP3LcLcOjV7+3smdut?= cjXFJlqubnsWH3Gl10XCOGl5en9+447L5Taql5VrXlkhxH87L0vY9JiDnia1H7Ey+3vnQ/5m855WP3Z0MAiIrPbdwgH6POffRnugeEhvIEbXlWOJTeXe7aqjoIrMHnroxZg2bfNvcXrZiagPX20NCZlLfEc1R/KhLxCpCXiOOoaHT29OFS3qxamNyU8hinbGCyRcW+pzWZM748BfiO6iDMLmv1kNJqvffmD9J7FU2WZJaaauXvcc1nDMcbxUmXJbeMTpivkVKoGiVa7H2R6gOiVAXLjculHq2J54IXg3FPfmKoBd20aOI7hETKSx8vfUqZtI9Fk5/6zkag6jDe4xH9PTucDneufJVs5xpoPHDu0A/FglrpceUIjtnFAnT4Fy1e9dR+kCR/ua/nzZl3k2oJzgx/EZlMfvS4eH1d/RAAJ16ptsq2gSm1rbXh4x2G6SiHGNyMBnSJBPEqyS6aPBlHrQC3jS/Oe9YBmTb2gVi0nOE/P32aP/3gUJZbD8iUYPQUmIntYFcLf+TMuKqnVa6BZYhc7NbfCgBZ0kL1RnhAcui0QyQ1YEH/0vBBJ5oPBzq4+I3O5UAyMQOqfN8ar7Qm/s0SUUE0saQ/im57in4cJmnbb9iM1g/Tb9T9pNJAprGM/ym+tOPowZhXiG+IgE5G0BssWB2LXPCBIiH3c3M3Xz5Rv+4/sOrqvqvBWVT3r3rNAPjvBLySBtHHF4kNFFH6QubN36agyfEFtVJqDXV6zzazn94nOI7Mp+9H9ZZJbvDSJl/3b2T8IWfGc8D4XKpE44fu2334aYTcW6SpEbjmo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qOwukm5dDzU2bHhSf6+hKmm+PYUGV0QIf3J3I5nFcRjgH9BUyuNQumuRwquEuuCGK6BH9KjSJGrNkR48nQOSNSDAOC9WhExWe7npVa8i3DvoeLfdu2yNOTTqXsxNxzKeCv82Zp SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Dec 2017 10:25:35.8700 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2ace9785-0932-49c0-8d3d-08d543a62e24 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: BN3PR03MB2354 Subject: [dpdk-dev] [PATCH 1/2] mbuf: update default Mempool ops with HW active pool 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" With this patch the specific HW mempool are no longer required to be specified in the config file at compile. A default active hw mempool can be detected dynamically and published to default mempools ops config at run time. Only one type of HW mempool can be active default. Signed-off-by: Hemant Agrawal --- lib/librte_mbuf/rte_mbuf.c | 33 ++++++++++++++++++++++++++++++++- lib/librte_mbuf/rte_mbuf.h | 13 +++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) -- 2.7.4 diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c index 7543662..e074afa 100644 --- a/lib/librte_mbuf/rte_mbuf.c +++ b/lib/librte_mbuf/rte_mbuf.c @@ -148,6 +148,37 @@ rte_pktmbuf_init(struct rte_mempool *mp, m->next = NULL; } +static const char *active_mbuf_pool_ops_name; + +int +rte_pktmbuf_reg_active_mempool_ops(const char *ops_name) +{ + if (active_mbuf_pool_ops_name == NULL) { + active_mbuf_pool_ops_name = ops_name; + return 0; + } + RTE_LOG(ERR, MBUF, + "%s is already registered as active pktmbuf pool ops\n", + active_mbuf_pool_ops_name); + return -EACCES; +} + +/* Return mbuf pool ops name */ +static const char * +rte_pktmbuf_active_mempool_ops(void) +{ + const char *default_ops = rte_eal_mbuf_default_mempool_ops(); + + /* If mbuf default ops is same as compile time default + * Just to be sure that no one has updated it by other means. + */ + if ((strcmp(default_ops, RTE_MBUF_DEFAULT_MEMPOOL_OPS) == 0) && + (active_mbuf_pool_ops_name != NULL)) + return active_mbuf_pool_ops_name; + else + return default_ops; +} + /* helper to create a mbuf pool */ struct rte_mempool * rte_pktmbuf_pool_create(const char *name, unsigned n, @@ -176,7 +207,7 @@ rte_pktmbuf_pool_create(const char *name, unsigned n, if (mp == NULL) return NULL; - mp_ops_name = rte_eal_mbuf_default_mempool_ops(); + mp_ops_name = rte_pktmbuf_active_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"); diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h index ce8a05d..3140a0b 100644 --- a/lib/librte_mbuf/rte_mbuf.h +++ b/lib/librte_mbuf/rte_mbuf.h @@ -1081,6 +1081,19 @@ rte_pktmbuf_pool_create(const char *name, unsigned n, int socket_id); /** + * Register the active HW pkt mbuf pool + * + * Register the active pktmbuf HW pool to overwrite the default pool + * + * @param pool ops name + * @return + * - 0: Success + * - -EACCES: Active mempool is already registered. + */ +int +rte_pktmbuf_reg_active_mempool_ops(const char *ops_name); + +/** * Get the data room size of mbufs stored in a pktmbuf_pool * * The data room size is the amount of data that can be stored in a From patchwork Fri Dec 15 10:24:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 122074 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp278004qgn; Fri, 15 Dec 2017 02:26:10 -0800 (PST) X-Google-Smtp-Source: ACJfBouL7isJT/8GEOLc/+rrddENOEXlrrv386S17+sIJ/Q/b83458yDtVOM/oYDM6leM7nBxAch X-Received: by 10.223.154.182 with SMTP id a51mr8476449wrc.48.1513333570260; Fri, 15 Dec 2017 02:26:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513333570; cv=none; d=google.com; s=arc-20160816; b=UQTrAj1AYzQf7HX/29zVn94RRx1t4PuOhKUFzCNrJJdwKKGm7JlKfyhy2MFGa5+dUs LmCXxrh1LPuV4wzjDCZoHs16ckoToJZQ/cfH7wtM1K7CGzAGDVQx+WLLkrMY5u+VkHa+ fCz6qQ0YJzufXOx4Z2Xc/JOOv0Z6UTV/9mT8A5c5Gx+R9xjaKgr6ovCG+DeuyxXvW7Gi WeSCkSOhOiZUJcQ+fyvxBfcn9uuLoJklwsjjKkz60FW0HLq8d59QM3CKPGVNh+IvYAF1 2C9TJccfvo1luuPbP10e+NaxNzwd3Vv6m/klg/eNnGPDlqydX6HaQB7GD/1nFNEp8Fn5 KzVg== 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=h7okk3SU146WWRWg9xC5qwJA8//lTDZaiL7tmE1oD8E=; b=aYkxXUiLgar1XMkLQyI/58idBP529mFWyNUoTEcQ4oXVUQGGAwRPBNP0E+Ds8bT11g ZlUVy7vL8nbZrW4VmX8KjyLOoXomiyDvZB7I0LwEWIfw0RtBBD7XQDo9aNhgwmhW4NBQ b4TV71JZ7+QbQFo2y/KPgvZTHhyvUKJ3lLDSYzZt/ZbyNGl1nmGlfW/GRQrBUn8ssjH3 YX9+R8LH/1SIYE/F4FwIh0FE1s2l9jhBtOg+MbpUJ+LaQLB+3jGqRxlAcImyyyMOchJH p51nHJj7P+deOOQ6uRCyLZjf9h5ysg2BjQV70eVV9hIR61TAYiIjbZm1nBnwfuW8BDr9 Y/YQ== 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 a11si4995265wrh.34.2017.12.15.02.26.10; Fri, 15 Dec 2017 02:26:10 -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 7B8611B03F; Fri, 15 Dec 2017 11:25:51 +0100 (CET) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0071.outbound.protection.outlook.com [104.47.36.71]) by dpdk.org (Postfix) with ESMTP id ED03B1B01C for ; Fri, 15 Dec 2017 11:25:48 +0100 (CET) Received: from BN3PR03CA0072.namprd03.prod.outlook.com (10.167.1.160) by CY4PR03MB2694.namprd03.prod.outlook.com (10.173.43.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.9; Fri, 15 Dec 2017 10:25:47 +0000 Received: from BL2FFO11OLC008.protection.gbl (2a01:111:f400:7c09::111) by BN3PR03CA0072.outlook.office365.com (2a01:111:e400:7a4d::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.302.9 via Frontend Transport; Fri, 15 Dec 2017 10:25:46 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; 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 BL2FFO11OLC008.mail.protection.outlook.com (10.173.160.143) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.282.5 via Frontend Transport; Fri, 15 Dec 2017 10:25:37 +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 vBFAPe5k017334; Fri, 15 Dec 2017 03:25:44 -0700 From: Hemant Agrawal To: , CC: Date: Fri, 15 Dec 2017 15:54:43 +0530 Message-ID: <1513333483-4372-3-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513333483-4372-1-git-send-email-hemant.agrawal@nxp.com> References: <1499170968-23016-1-git-send-email-hemant.agrawal@nxp.com> <1513333483-4372-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131578071380416755; (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)(336005)(396003)(39860400002)(39380400002)(376002)(346002)(2980300002)(1110001)(1109001)(339900001)(199004)(189003)(85426001)(53936002)(305945005)(5660300001)(47776003)(110136005)(2950100002)(36756003)(50226002)(97736004)(68736007)(8936002)(498600001)(50466002)(48376002)(81166006)(105606002)(77096006)(106466001)(51416003)(86362001)(575784001)(81156014)(4326008)(8676002)(16586007)(356003)(104016004)(2906002)(59450400001)(316002)(76176011); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR03MB2694; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11OLC008; 1:0CjgwDrgaWMd+LIFPVQth675sGiSbcns+Za1SbB77tydGPTXUvTBLU7o7REqWWjZVk3xpKMlwoDJjk+1pVLyN7RdB1WqZHxPyJszXOWr8w9Khmd8CQyP2VjYjcRsU55i MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 699f4647-2303-4147-58f3-08d543a62f53 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4628075)(201703131517081)(2017052603307); SRVR:CY4PR03MB2694; X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2694; 3:c3AJVPoakVuVsinp4aC6OQUsLBHrazjwzoa8e1JOX3ItQlncARalVlpK8IAaBEmYUncvdcg70m59ZVmhpl62SuHfCgZ5hXwkCVmG0NKewvgLSi0sSX+eTKBE/u1cCXNb1muec7AAt7Mv6rUGQcJi1jBhF757v9ub8LaQ2FVlJi/15PO6xhRotJjTGJ5wINmEgJab1htRXBpEsDtVjkbQ+h6BQJUhmOZmt8s5ySNN6xgW7cLUJYKm1C2Si1MbB7WnSNJ5aZ9XsvSDjRr5JQw4gA7LKEhyWdveykfq/mS5xQMdyz8iAnAzyzA3F3YTC0DVtXyO78ZAQTfSN5JB/9k9Hdw4qBxh9qFko8tnz5vRCd8=; 25:FF5diVboPEV8ATNpTXp3IqcJQLs4smi8DmNPrJmZIv94AWmcRcgwtxtmGgcWQDA8PTnvkelCX6M7HDpJwp1QYD1gNqgs4PFlbJZ+4ADXL0phgoWvH4DH1VjZO5Cgo5WaNC7kTlTq1aeiR7jFQLXHJr8I1h466qlRjUClwBG1y/dz2+Fbl36D8X6TaDaFHWOo/HGnY57PxSuQxn/N3h3eZrSPGnFQ1KNAm2L/PneOpTzJvHmATqFIqT9u+dyLCQGbWLO9taoOJWCDoNrtZ87Y5xs4t9nG6YZl1DqOC1J4cm8Rck1/KixJhReMFxtKpW8su14MtyOjUnxLMLG3p0QVU2daHnEZOcM5AJN1v7nDbvo= X-MS-TrafficTypeDiagnostic: CY4PR03MB2694: X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2694; 31:i651NS2cG5x5aFMoEL4ASA4+tZDl8hEmHz3/n+cxuq2Cx5zUjiVKnuJeDW0x3GcKx1WgPZiul6x6ayJ+0sOJ3bWZNWnA/T8BrYCDs6AdRsOUF1+B03/dPLjbFTS6W61OHO0iklzxzN7fUXIOuzH/hwkpbi+i9b9C3cDeVzr8LkzeuGc7FPdLyeGwk+1ExihG2PvaIZgfi+t6McBKRLqJNACewmcRP3ImFHvDGEyHDD4=; 4:KzX7ql0y62yakai+ltS8O+YfoxuVoxNe6NsSEBik6848gLkPg1G0DzFZroGtTsJvpPiQ/WtPuoDUDWPSea2+eCmY5/D/ciI+rR0qkLeQDcc0uyl5/vllssJLOYA7yf4buKAtkyEN8ERaqW4q8wsupjB8m79o0mM/5Aanxvm4GitiXRhnRRPvFa3oYrBbFryRFJYNSVBlqJ8L9ggUHS15cdiYRhSOOvTlq3Jb0tCM3zBGGIuEH9jQWRAntmnzg89Xb4z3sLV+WDrws29QvesjITmKouclP69SfjiMoAZAKWOJCGUp3TlgqX3KwDslUKSvEqWYVJ8v8bOitnXBl1l6BoIQzRc239n7VzWCAWdN4mw= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(275809806118684); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(5005006)(8121501046)(10201501046)(3002001)(93006095)(93001095)(3231023)(6055026)(6096035)(20161123563025)(20161123561025)(20161123565025)(201703131430075)(201703131441075)(201703131448075)(201703131433075)(201703161259150)(20161123559100)(20161123556025)(201708071742011); SRVR:CY4PR03MB2694; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:CY4PR03MB2694; X-Forefront-PRVS: 05220145DE X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR03MB2694; 23:HmbKSpfOv/Ji3GIgHFh3o/8905K+v8MkbNIsdavi0?= 7CYGaztcRR63ra7UosZ0jlcbe24gGuhTf7z7wBWyXwXPXEFN2+0A6rQ+mt0OPGQiOsZPfXaOgUZzjlII8S6TsAsQabOv10oNIbSBCPKHWTjY11OjzUqjuphOz7gKfFoxx45vyIcROPW+ZGuVXxojvGKmRLZb3NlQsgH41ReUIUJTVZYFdyqIAQBhbk4jAImvTnXU8kXubzDJfCKSKK+45tUTGIlLPTDPX9TB/Ji/OWwxw4EDERkoY6ZsQczxFRTNj5gf/9o/kWgkFoxrSFu8Fjz3VspWfM0ZP4ON9BE9WqiJtUmspCQPdRBWcynsinE8kuCY/aJ+HRVh2BcGw/Uc1wajV0vw/w8rr1W83cWVSULJ3S8BEXAXOwHqdXTrw2mYdFBYZgZqhfDY87e79c9wbXEQUEjeQW+ceOL5T5UgC/7kWtSvtmA+ldms8OEw/iMk5vyS4XtGruLXbjnAq1oaeM6CtNE8Gwz8flpomIgKVqfs+MEugz4HAxm9meTodg4WjFy14Opac3cN5a4J7oOpo1nVCISbrgNtEk3LbY5qsaZ0WlpRkXz4eoCx4nLnetmG+add/gDGjcUsBcQuc3FtgymXDsuvXb4IsFwTvXQWbKE3/41nGS0nYuKnbPbB2TrX8cVHYDZSClQs2Hi6Xl2q4BoIYCIE+Ii0am+C4w78ZympB2/hzGyd+JyJYnQRWJtlwuh4ZD22FbuC3vrav3ZS7vFYr6XvmG4+sK8vuAzx7nQxusbeVlRBiqHEwHAjaDrSImTVywyWbalH7t3c84nWL862H1N7NQ5Lteg8867/Hc0xAc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ORrVSGlpb7Sp04IKJTbmjRF9Rs99cNuLW9WEqWjcgCilvWwtPAkttWFSXUHgA9zQqG9agjpdKxpAv+WDQ7sB3wQDQmSjxlfyg7fO SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Dec 2017 10:25:37.8700 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 699f4647-2303-4147-58f3-08d543a62f53 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: CY4PR03MB2694 Subject: [dpdk-dev] [PATCH 2/2] dpaa2: register dpaa2 mempool ops as active mempool 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" Detect if the DPAA2 mempool objects are present and they can serve as default mempool. Signed-off-by: Hemant Agrawal --- config/defconfig_arm64-dpaa2-linuxapp-gcc | 1 - drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c | 6 ++++++ drivers/bus/fslmc/portal/dpaa2_hw_pvt.h | 2 ++ drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 2 +- 4 files changed, 9 insertions(+), 2 deletions(-) -- 2.7.4 diff --git a/config/defconfig_arm64-dpaa2-linuxapp-gcc b/config/defconfig_arm64-dpaa2-linuxapp-gcc index 91f4993..703e8b3 100644 --- a/config/defconfig_arm64-dpaa2-linuxapp-gcc +++ b/config/defconfig_arm64-dpaa2-linuxapp-gcc @@ -53,7 +53,6 @@ CONFIG_RTE_LIBRTE_VHOST_NUMA=n # Compile Support Libraries for DPAA2 # CONFIG_RTE_LIBRTE_DPAA2_MEMPOOL=y -CONFIG_RTE_MBUF_DEFAULT_MEMPOOL_OPS="dpaa2" CONFIG_RTE_LIBRTE_DPAA2_USE_PHYS_IOVA=n # diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c index 334e1f5..5a6f292 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c +++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c @@ -64,6 +64,7 @@ dpaa2_create_dpbp_device(int vdev_fd __rte_unused, { struct dpaa2_dpbp_dev *dpbp_node; int ret; + static int active_pool; /* Allocate DPAA2 dpbp handle */ dpbp_node = rte_malloc(NULL, sizeof(struct dpaa2_dpbp_dev), 0); @@ -100,6 +101,11 @@ dpaa2_create_dpbp_device(int vdev_fd __rte_unused, RTE_LOG(DEBUG, PMD, "DPAA2: Added [dpbp.%d]\n", dpbp_id); + if (!active_pool) { + rte_pktmbuf_reg_active_mempool_ops(DPAA2_MEMPOOL_OPS_NAME); + active_pool = 1; + } + return 0; } diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h index c1b842f..2b0e871 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h +++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h @@ -70,6 +70,8 @@ /* Maximum release/acquire from QBMAN */ #define DPAA2_MBUF_MAX_ACQ_REL 7 +#define DPAA2_MEMPOOL_OPS_NAME "dpaa2" + #define MAX_BPID 256 #define DPAA2_MBUF_HW_ANNOTATION 64 #define DPAA2_FD_PTA_SIZE 0 diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c index 8bcbaa8..17c7d62 100644 --- a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c +++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c @@ -380,7 +380,7 @@ rte_hw_mbuf_get_count(const struct rte_mempool *mp) } struct rte_mempool_ops dpaa2_mpool_ops = { - .name = "dpaa2", + .name = DPAA2_MEMPOOL_OPS_NAME, .alloc = rte_hw_mbuf_create_pool, .free = rte_hw_mbuf_free_pool, .enqueue = rte_hw_mbuf_free_bulk,