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 ED42AA00C3; Tue, 18 Jan 2022 10:47:15 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C8896426FA; Tue, 18 Jan 2022 10:47:15 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id 83F614068E for ; Tue, 18 Jan 2022 10:47:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1642499233; x=1674035233; h=message-id:date:to:cc:references:from:subject: in-reply-to:content-transfer-encoding:mime-version; bh=iT9g2/On2jDraI62TtWKBX/xtmq+xTRYJeNiXyL93tI=; b=DiFPRiUspmRfsqOPmhwZZqDNPHWWeRhRu927fgEj1d8Z8A7Yu9G35/qX 6OO5oRhFKIOspDfFQQO+QINofoL6orbTYsQ0KRHodxt+UZvH0cGS98Fn7 nVL3vxRNZ2NoPeppFKpmdOiVfKSRxwgInUb1uz2rKwjc1xMDVR8iwUhbr KNgpAd1ev0esKC/UnmTmj8uCKwQe985IB7uVKBrEewah4SOFFmuibT/XN jBxANB4Sd8etI0ngGOoDXB7e5cvb0SBO4Z+T/ey/2QbU69TNTmfLnImuX aconKmSosgCVXzF1de4EwKo2+pWbagh66MQEBts8ehHgVA8TKIf4lPBbc w==; X-IronPort-AV: E=McAfee;i="6200,9189,10230"; a="331127806" X-IronPort-AV: E=Sophos;i="5.88,297,1635231600"; d="scan'208";a="331127806" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jan 2022 01:47:12 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,297,1635231600"; d="scan'208";a="766863234" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmsmga005.fm.intel.com with ESMTP; 18 Jan 2022 01:47:12 -0800 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Tue, 18 Jan 2022 01:47:11 -0800 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX608.amr.corp.intel.com (10.22.229.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Tue, 18 Jan 2022 01:47:11 -0800 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Tue, 18 Jan 2022 01:47:11 -0800 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.168) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Tue, 18 Jan 2022 01:47:11 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TSqYLRUpr1BZ0jI285U1iyIvypHSzhyKqiu1Mj9EUK7V/z3Hl8WymmNtWeANkG9PnvF8faf+O07N7fIKRGy5+4E1Y9iB1nsOcmOS6QXdcP2RME2zk2ogqJxc+ee33ocSAEIhyldGVIWoY4nzgBX11YtFIcy0nNJ/6yJaqZBPoLsuKUts2ihZwWTpivKdipJSSnNB0e958DvbT+VpZBGfD1KoE8n56Z7kAvaqSHfV690bUu3aSdXyooW6NSs2IrjJ7eUaFqdJsZkaR0mSTxC5E8klgoBxYRSLMgYXMKaawQIfwtH7njSh8X/frl1udtGjh04qKY1BmgqdnsE01UjSJw== 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=ymPwUjAycOu91XGF5yt97/ZZysA2UIUgbEDPJtb/9nA=; b=iR6Uz2Wrbj/7RZS+z3Wdh46y7fwGxC1d0eOBfaNS5pAWdBxFPu9KGydxxwFjHWgkFQJLPS7gkYlxes3CDG5L4qc+HIg63rnlG/KLTlNjc3acsCV/f/9NQ8XsMjrb9ifkDijZO9Q+lYQhrtq1Y0XaNLQ56xXNk0nJXrCcno96zH2PWly3o1uqfUap5AonYtR4LSG8Vk0QCtO4S01fhbUJ347SOp7ulU7GzMZZrJHwGR0ocdYFxlL1rm9BzqARTA0az5buhXGByMukQL0CxQfmKEsNUMAl0zOfdfNf7jZPE8pg2O414Ed2UOZ1xmWI0mN/pqKYwJfclgeZ+Du7hmJPUg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) by DM6PR11MB2682.namprd11.prod.outlook.com (2603:10b6:5:c3::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.9; Tue, 18 Jan 2022 09:47:08 +0000 Received: from PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::5046:8550:928d:850e]) by PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::5046:8550:928d:850e%7]) with mapi id 15.20.4888.014; Tue, 18 Jan 2022 09:47:08 +0000 Message-ID: <6aed79d2-be6c-7f30-a562-7acd69ebae57@intel.com> Date: Tue, 18 Jan 2022 09:47:03 +0000 Content-Language: en-US To: Thomas Monjalon , Kumara Parameshwaran , CC: , Kumara Parameshwaran , "Andrew Rybchenko" , David Marchand References: <20211126041515.96259-1-kumaraparamesh92@gmail.com> <3166646.G96rZvMJ2N@thomas> From: Ferruh Yigit Subject: Re: [PATCH] net/tap: Bug fix to populate fds in secondary process X-User: ferruhy In-Reply-To: <3166646.G96rZvMJ2N@thomas> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0241.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1a7::12) To PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 58a62880-b9b5-49ce-5d49-08d9da677e4e X-MS-TrafficTypeDiagnostic: DM6PR11MB2682:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: f0JKZfXf9ifKnmsaONBxt1QqJlzgRC/Kc74fYl/au2E46p97xpzHx0L74UK5yU1T44JhOhpByNMjgwWjz4V3pE4/n7eHrPpw++m+BYkgGPQ5XL99eb3hz3A9RschdXI5KeHLe7Ga5pnJ/yLSiAhzzKmraX+xTGhUsLuhjHIX6FAflL6V8E6xCrFkxyM5Wt7+Sh2fkKchBTeeoTkfjkLjo5k3hrcskKbH+s3YTmWUmDb11Wf+e02EgvWQVXwzgq4N7Lax2wxifmpSAn+10e//NgDVPFdXl3rRSrUB/YGCrEanJbLRHuihGJuBoAuq8dplVNebWPSiFlRNcmjSQSmfblVHAbB1wZV8EU5WKqZ2pixrx25nFnc/DgiyAxGOda3QFh+tKUkKpKjzxpRbMndzErteBY3BYBXrsJFMNbIwkH43z45NCHlUCssyFt9f70fzi5nYKE39R8ItVimyLqyG+VgdOEhsuTcpdTXC1P9sIHAtDETN87Zzd6Dkpu/lRCKfJ3zdSnx1DiNtx8C1zAy82IM6L/zMlVEYSc6KojRLO20uBn+wV9h/geoOdU+A2BeSUvLeSrXspVWFQEKttU3+apt5/TYFdZ51Dufv68aJ6wNYQGMsuKSMVSVoMaQaCMW1fQ+hmUK3ORJqfQd7sYw3OxujSJ0Khyq60dLRqo5oysw5NkHcF2L06uy6TpaFryNLD1WIhuZhA4jV6m3VO7GQKQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5000.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(66476007)(66556008)(2906002)(31696002)(66946007)(6512007)(6636002)(6486002)(186003)(110136005)(44832011)(8936002)(4326008)(316002)(8676002)(6666004)(54906003)(2616005)(53546011)(508600001)(5660300002)(26005)(38100700002)(6506007)(36756003)(82960400001)(31686004)(86362001)(83380400001)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?ZGZZYlZYdUhjZzhmUnNZNkFCQ04yQUg0NGVLYXRxT3lvb1VTMUFsTjRyS0JQ?= =?utf-8?B?Q3F1RzJmZGxqekcrVUQ0NzIrM3ZDV2FzRUlFMjhoazY5eGx0SzhtVFhLQlIv?= =?utf-8?B?YmVDMlZ4SnJMTTAyREZycU03anI0NkUxVG9rbURUVHkzdVpXdlZkRzZuOWls?= =?utf-8?B?NTVwczlSeWZmVXkzMVRPaVgrVUdobEZyTnRWY01FdSs2b1R3TUNOYzV2OXIw?= =?utf-8?B?OTE5WWJLN2cvdDI3STRZa29zaFkwem4rTkRnK083R0xNd0pVbDV6aHlQYzVX?= =?utf-8?B?YndoNDNwQWVYd0Q5eEdNVDhFOTZ1eG4yNzVnWU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GR1WUZMbUlMV0RPQzFoNzdUT1F4NmpHMTl2M2o0bVo5SkRq?= =?utf-8?Q?ojWu/pf1mUbg2hntB3iaYtk=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 58a62880-b9b5-49ce-5d49-08d9da677e4e X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jan 2022 09:47:08.7530 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 4IP1f585QrMiQpVlufH0tj7gjN1mLAt8OSXlh6UGHuEm8AICIJ0hLq+AUOcudnFHl4G3azW+1GoYfFQ+XY2zcw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB2682 X-OriginatorOrg: intel.com 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 1/17/2022 6:33 PM, Thomas Monjalon wrote: > 17/01/2022 19:28, Ferruh Yigit: >>> + ret = rte_eth_dev_get_port_by_name(request_param->port_name, &port_id); >>> + if (ret) { >>> + TAP_LOG(ERR, "Failed to get port id for %s", >>> + request_param->port_name); >>> + return -1; >>> + } >>> + dev = &rte_eth_devices[port_id]; >> >> Since this is not really related with your patch, I want to have a separate thread for it. >> >> It is not good to access the 'rte_eth_devices' global variable directly from a driver, that >> is error prone. >> >> Btw, what 'peer' supposed to contain? >> >> It can be solved by adding an internal API, only for drivers to get eth_dev from the name, >> like: 'rte_eth_dev_get_by_name()'. >> This way a few other usage can be converted to this API. >> >> @Thomas and @Andrew what do you think about the new API proposal? > > It looks similar to rte_eth_dev_get_port_by_name() which returns a port_id. Exactly, but get eth_dev directly for drivers. For drivers no need to work with port_id handler, they can use eth_dev directly. Another solution can be an getter function for drivers, which gets port_id and returns the eth_dev. > It is a bit strange for an ethdev driver to not have access to its own ethdev struct. > Isn't there something broken in the logic? > This is callback function between primary and secondary applications sync. So port name will be same for both, but eth_dev will be different and port_id may be different. Driver finds its own eth_dev from the shared port name.