From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id BB6F9A00E6 for ; Wed, 7 Aug 2019 10:39:42 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5DB473576; Wed, 7 Aug 2019 10:39:41 +0200 (CEST) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70128.outbound.protection.outlook.com [40.107.7.128]) by dpdk.org (Postfix) with ESMTP id E9D412BE1; Wed, 7 Aug 2019 10:39:39 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ADZyuQ63+N9cYEe/CjmUpntpfBGmErlh7bqTJvjpKZMErKbRwlPM8IL1V43djXWruBSCeTfC5SfuGosmebtivB3jhgxwzvQ+Wt9KFZG2uV24Avf+9B5+ADr3tB8gT28XZGK4qAQmxPcAgukNYFvNKTQtnBgiYZmOi8t0Sq2CA+ofdqGx7mYAT1ivaSiuCfDRvKuXymHWsixGMHvNrXEXcetofnT42K8ZTgqQSqWE4Cnmtf7Et5rdwDCSMmb/e63i22psiFnCntoCfdJ8QYll0su2bYxIN3kA8VabgQHTydLHOtmXZQOzaNbr47SQBWHh8Im7XRggmN0WexDUTBDQSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=v/Sg3wywXHbW1eTJQiZPlWebJOrUQYSZOXBHCG3Rtvo=; b=WraxUZTrNyK/Ns4UPxNRpRGANemqI6OLULRB/VYYfMRhZjFcLkJ0H/bO/Khygc8dKXTMI8vLRN2CzgmTc5OjcPbcx3TVXpoIspZe9XgDXiQdlzikhXk7duWkvRo+tQ4wtI69D0ZkrjBuJ8euTZ2uSWcw0fWytnShVGSCkqgFYLp+tWtMMGBy2adQPtU7I381mkXzBi+KKwNIkvU19e0hxRKxZFYAIdrFFzXfTFW//3EGUBf1rRcxqa+kCdPr+MFXtgTSlkbwEigZyeBW5KMY7J7Y7Z0zbtXmQm6yYBxSjlrVWzWK7iZ+7ZP3VNtHt1E8cqSc5Afb7lq6vGv8FtXNaQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 131.228.2.8) smtp.rcpttodomain=intel.com smtp.mailfrom=nokia.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=nokia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nokia.onmicrosoft.com; s=selector1-nokia-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=v/Sg3wywXHbW1eTJQiZPlWebJOrUQYSZOXBHCG3Rtvo=; b=qK1WZYOwBKw2pt8AZ6+L5/Rp4jL4z7X/vHw1slirgDQfbDTLnByfNKLZ7DFkuuCG8hB7ryTsRjjWea1ikrjApTqLY9IG8UKFMD+ZSLNm5PEfVGb8PUnU71DkRhE3BY0/ofJ5RtND0EtePOktPYxbftjhfZuemAxro5ec/jg2xHc= Received: from DB6PR07CA0181.eurprd07.prod.outlook.com (2603:10a6:6:42::11) by VI1PR07MB3888.eurprd07.prod.outlook.com (2603:10a6:803:36::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2157.8; Wed, 7 Aug 2019 08:39:38 +0000 Received: from AM5EUR03FT019.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e08::208) by DB6PR07CA0181.outlook.office365.com (2603:10a6:6:42::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2157.8 via Frontend Transport; Wed, 7 Aug 2019 08:39:38 +0000 Authentication-Results: spf=pass (sender IP is 131.228.2.8) smtp.mailfrom=nokia.com; intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=pass action=none header.from=nokia.com; Received-SPF: Pass (protection.outlook.com: domain of nokia.com designates 131.228.2.8 as permitted sender) receiver=protection.outlook.com; client-ip=131.228.2.8; helo=fihe3nok0734.emea.nsn-net.net; Received: from fihe3nok0734.emea.nsn-net.net (131.228.2.8) by AM5EUR03FT019.mail.protection.outlook.com (10.152.16.104) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2052.18 via Frontend Transport; Wed, 7 Aug 2019 08:39:37 +0000 Received: from lfs-up-04.novalocal ([10.157.84.234]) by fihe3nok0734.emea.nsn-net.net (GMO) with ESMTP id x778dZgQ024495; Wed, 7 Aug 2019 08:39:36 GMT Received: by lfs-up-04.novalocal (Postfix, from userid 62146483) id 0A57C5BD5; Wed, 7 Aug 2019 11:39:35 +0300 (EEST) From: Julien Meunier To: Pablo de Lara , Declan Doherty , Anatoly Burakov CC: , Date: Wed, 7 Aug 2019 11:39:23 +0300 Message-ID: <20190807083924.39191-1-julien.meunier@nokia.com> X-Mailer: git-send-email 2.10.2 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:131.228.2.8; IPV:CAL; SCL:-1; CTRY:FI; EFV:NLI; SFV:NSPM; SFS:(10019020)(4636009)(39860400002)(346002)(136003)(396003)(376002)(2980300002)(199004)(189003)(6666004)(356004)(2906002)(50466002)(52956003)(5660300002)(86362001)(110136005)(54906003)(316002)(16586007)(48376002)(47776003)(42186006)(106002)(36756003)(51416003)(2616005)(476003)(126002)(44832011)(486006)(103686004)(8676002)(81166006)(81156014)(26005)(8936002)(26826003)(50226002)(186003)(1076003)(53936002)(4326008)(68736007)(305945005)(70206006)(70586007)(76130400001)(6266002)(336012)(478600001); DIR:OUT; SFP:1102; SCL:1; SRVR:VI1PR07MB3888; H:fihe3nok0734.emea.nsn-net.net; FPR:; SPF:Pass; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d7a3271c-efc8-41af-66fe-08d71b12c844 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(4709080)(1401327)(2017052603328); SRVR:VI1PR07MB3888; X-MS-TrafficTypeDiagnostic: VI1PR07MB3888: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-Forefront-PRVS: 01221E3973 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: zIXEtRoQj0rkc5iz5X744LR+SUZi5Yq8c0ukAyAd58fk5JFYbxQ0KfPqo02hqVAPfwrMY0uoszWKMfQIFujRbr8nqI2oRxk0u3VRSuQNEcZmea1bxNfk/C9uOlSern0TlPu7j0nfcoXoRXEcgjL8qk2QpLZanXjkiJGKFhss9f2DgwLImwVm0VQXcvM3qxqvHlV8hWsOcayHNqV9H9zqAtpbCqVHp9lMyBCfihdcIIsHZPqSN9+6re6kLFXn+DEx6hUBcg2y9q9l38E8xbkqCMno4ps6RwkAK5prjzIyR1QyAlmjIWta00PhIsIo80a6l731PSLQaIQvze40pfhDYWHBCbMhM8E1R8QqcYLNMhNl8xjWQQR9VPK51q+Vt98Un42W5ZxxsZTRH+wRdY6FjTr6Myv1FTACYP69K+8e8l0= X-OriginatorOrg: nokia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2019 08:39:37.7600 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d7a3271c-efc8-41af-66fe-08d71b12c844 X-MS-Exchange-CrossTenant-Id: 5d471751-9675-428d-917b-70f44f9630b0 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5d471751-9675-428d-917b-70f44f9630b0; Ip=[131.228.2.8]; Helo=[fihe3nok0734.emea.nsn-net.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR07MB3888 Subject: [dpdk-dev] [PATCH] cryptodev: fix pmd allocation on multi-process 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" Primary process is responsible to initialize the data struct of each crypto devices. Secondary process should not override this data during the initialization. Fixes: d11b0f30df88 ("cryptodev: introduce API and framework for crypto devices") Cc: stable@dpdk.org Signed-off-by: Julien Meunier --- lib/librte_cryptodev/rte_cryptodev.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c index 43bc335..b16ef7b 100644 --- a/lib/librte_cryptodev/rte_cryptodev.c +++ b/lib/librte_cryptodev/rte_cryptodev.c @@ -725,12 +725,14 @@ rte_cryptodev_pmd_allocate(const char *name, int socket_id) cryptodev->data = *cryptodev_data; - strlcpy(cryptodev->data->name, name, - RTE_CRYPTODEV_NAME_MAX_LEN); + if (rte_eal_process_type() == RTE_PROC_PRIMARY) { + strlcpy(cryptodev->data->name, name, + RTE_CRYPTODEV_NAME_MAX_LEN); - cryptodev->data->dev_id = dev_id; - cryptodev->data->socket_id = socket_id; - cryptodev->data->dev_started = 0; + cryptodev->data->dev_id = dev_id; + cryptodev->data->socket_id = socket_id; + cryptodev->data->dev_started = 0; + } /* init user callbacks */ TAILQ_INIT(&(cryptodev->link_intr_cbs)); -- 2.10.2