From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D13C941CEC; Mon, 20 Feb 2023 15:17:39 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B429843050; Mon, 20 Feb 2023 15:17:39 +0100 (CET) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2056.outbound.protection.outlook.com [40.107.220.56]) by mails.dpdk.org (Postfix) with ESMTP id 84BBF40395 for ; Mon, 20 Feb 2023 15:17:38 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OR2Jq72t4v/0L+ZzXbdwPVpw4836blzCvUNcjX/TnYLgkOjdaA78xBwLzCwGrYQaa2uMSJLCywIG8+brLrwHCeNYGdb9oo42GG/E6ACsCiyUf8ToxlDFvG2o4AA2NisolKts50M1Q5c3fSA67SFnfzGpogtNEn4qjZOxTDOuInU3uO3q02ox/EKGkb2StFZS/6XLLs5zP//eu62FLN3HIrrC1IvTP7eXapG5RM3KULfRBVj/bF98UlYQrzeL/8Jy2xrnBXAx+istqYpCON8ESIjNGBq+0Gb6OqII2jqNKZw48IpI4YKmnjSqrZE5i7JvCXPmqHgpqaObyAXd0MELHA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=67BV8LMSXqB03w/9BJ5f8yKhzsXY9pY0FRUDFp1mHes=; b=gszqsVXhaa6xS1leNPWdLKSzYXqCgSAwUc4ivWYnQEPOx4rGF3cLRrDGGUIPjCiYO8w/QLJT66x1UUzkYFQbOcjFEwxAWl1CLkIpYjjfbYESUdeUDuqucBYZZC2+E608TYwg+3Asyb3h4whUMCQH1wZtA5vrx+1dkUvPardcHdPdp9s75SSxH0ok9T2/FyT9VOkVc9XYYkNNFaW51TF32ZWRnSucAdhtcM/tyKuYoV9b0ClrrVmdHiXzftonMDMDumgUvFLtYUBBU4LsK0agBVDKOhUnN+roav/lXA1GKKLJBq1Ki0bVM6wrV/X+G3NoGxPink69kjl/uqKjCoEhmQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=67BV8LMSXqB03w/9BJ5f8yKhzsXY9pY0FRUDFp1mHes=; b=gNLblmjS1fUK/ElMGLpIPdGpl8BGCFBehP0GYP75d8yPgKNU7pDQ1NVwfDgBQlUM2UpepA0kqu9foz8e2bcAFbBK/0KMYIGfW5ZbzofHnXJh6hJ8oB2aWwncfrDwCRFN5MXQXdGwSvwVA1KgSilQovXnOPaH0YDMLYZc5MNd9iw= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) by SN7PR12MB8130.namprd12.prod.outlook.com (2603:10b6:806:32e::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.18; Mon, 20 Feb 2023 14:17:36 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::3614:22ed:ed5:5b48]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::3614:22ed:ed5:5b48%8]) with mapi id 15.20.6111.020; Mon, 20 Feb 2023 14:17:36 +0000 Message-ID: Date: Mon, 20 Feb 2023 14:17:30 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Content-Language: en-US To: Ed Czeck , dev@dpdk.org Cc: stephen@networkplumber.org, John Miller , Shepard Siegel , Anatoly Burakov References: <20230217160039.2487085-1-ed.czeck@atomicrules.com> <20230217215923.2561685-1-ed.czeck@atomicrules.com> From: Ferruh Yigit Subject: Re: [PATCH v2 1/3] net/ark: support secondary process In-Reply-To: <20230217215923.2561685-1-ed.czeck@atomicrules.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P265CA0274.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:37a::6) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|SN7PR12MB8130:EE_ X-MS-Office365-Filtering-Correlation-Id: 57beb806-9150-4af0-2f96-08db134d36ea X-LD-Processed: 3dd8961f-e488-4e60-8e11-a82d994e183d,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: P0jq7JthQyv3NuLKf6P16XUK3lOc0tifgTmcH0tXRQVZIUFiyJCFm5AGHfAMl2pvLXgQj1ZmXcveRrVfgjtpmG2rU6H/lrt7TOSqQdqobGWuVWzDCqkXBxPOWKMaLjNZ/uGanw3FJekHCtRah2av7UxGi+Pi8FUvV7HKq6rbDDRK1LCfjVa6gQh2xxsUU2WX+a/B2hS3Bzifex8GAqAbXm4eG74pu72M2M5aNR2WwSx+5ddIZG/wB+M9g1bC6fv1hefgSHFT/4ZDfzdtS1kSjeC/8y8EJdNV6+RLGTeW29wMFjBQmwEVWQ5u1av2Dwd9aKKHKUdeLpgnR8WPgCGvUukX9Tl18PK6KU/vztim9TsanUVGXskB7wXhW7LJW9WjDaKBiDZjO57Dzi2wMUiBsjkjbLU2vnTNJURGbztWnT3UjzRxZYh2AjZWccEFbUZf6qZY27FKWj7xog/TSYF8OUU9ZHgjZYjrubWymdprqqARDQAnZxS2ZJe0uFwrAJN58tra3vdYWjIb9BpBMGK8C+URBVfOZq9IyhMPxLR8pRU7thZ3SFIERePmtKsaJ4irkd4JuxNKHjbA97T/J/5NDNYoPsoPcbTR4imBhLKOj43uzLuWaONODpwjYhkYrQnZx745Qpk+5hTUQCGW13NK9NbZThx1f+c6Be1RXCJ/eceJn0nCdmavOnenlyB5521RaItykIxZhircYC0HL7stM8vBygHjJGPClgINUfXQ6VA= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(376002)(396003)(346002)(366004)(39860400002)(136003)(451199018)(26005)(53546011)(2616005)(6666004)(6506007)(36756003)(186003)(6512007)(54906003)(316002)(38100700002)(6486002)(478600001)(44832011)(31696002)(2906002)(8936002)(66556008)(66476007)(66946007)(8676002)(86362001)(4326008)(5660300002)(41300700001)(31686004)(83380400001)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?eFplSjdaNjlwQTRkZlpySk1NNDRNOEoyYUNxcGNwQWpuNHVxVUozYnl5cEw1?= =?utf-8?B?R1pycVlMWEtGeUp2bFk5ajdraTlsRWEzSSt5eDdqcVE4eE9TZGJEVjRqMWEx?= =?utf-8?B?OFFtN254ZVpCMExMYVgvMEZLb09NaFBWUmNHbi9WazAzQ3NJaXl2aXBhUVor?= =?utf-8?B?bkNKNUE0RHA3TmdWNGFTS0dmaDVJTWdpM2ZseVZ1N3dnaXhoRk56dFBlWjZE?= =?utf-8?B?aWIvdVlUK3Awbk5TRUswTEJrNndOSTZENHNuWlpkVFM1SGdWSE40MFpsZE11?= =?utf-8?B?dWtENjVoL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?Q?mKGJ+G/7Mw+451eJ4ZnnEun5V?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 57beb806-9150-4af0-2f96-08db134d36ea X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Feb 2023 14:17:36.0127 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: k54/MMxbIPfJG1QlgHFO++FhwqN4m8iRL+Be/wseE8408wTiunNUCUuolnfO3lgL X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB8130 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On 2/17/2023 9:59 PM, Ed Czeck wrote: > From: John Miller > > disable device configuration for secondary processes > > Signed-off-by: John Miller > --- > v2: > * Use standard logging > --- > drivers/net/ark/ark_ethdev.c | 11 ++++++++--- > 1 file changed, 8 insertions(+), 3 deletions(-) > > diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c > index b2995427c8..d237e80cf4 100644 > --- a/drivers/net/ark/ark_ethdev.c > +++ b/drivers/net/ark/ark_ethdev.c > @@ -147,6 +147,9 @@ eth_ark_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, > struct rte_eth_dev *eth_dev; > int ret; > > + if (rte_eal_process_type() == RTE_PROC_SECONDARY) > + ARK_PMD_LOG(DEBUG, "ARK probed by secondary process\n"); > + > eth_dev = rte_eth_dev_pci_allocate(pci_dev, sizeof(struct ark_adapter)); > > if (eth_dev == NULL) > @@ -385,9 +388,11 @@ eth_ark_dev_init(struct rte_eth_dev *dev) > 0xcafef00d, ark->sysctrl.t32[4], __func__); > > /* We are a single function multi-port device. */ > - ret = ark_config_device(dev); > - if (ret) > - return -1; > + if (rte_eal_process_type() == RTE_PROC_PRIMARY) { > + ret = ark_config_device(dev); > + if (ret) > + return -1; > + } Hi Ed, As far as I can see both primary and secondary process continues to run after this point, and below there are a few places that updates 'eth_dev->data'. 'eth_dev->data' is shared between primary and secondaries, so each secondary will be overwriting the shared data. Better usage is shared data only updated by primary process and secondary processes use available values. But 'eth_dev' is process specific and all primary and shared processes must set fields of this struct. You may need to re-order calls in function to make secondary quit after 'eth_dev' fields updated and before 'eth_dev->data' updated, to make sure secondaries don't update shared data. > > dev->dev_ops = &ark_eth_dev_ops; > dev->rx_queue_count = eth_ark_dev_rx_queue_count;