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 A144FA00C3; Mon, 17 Jan 2022 19:28:17 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 25EAF41C3B; Mon, 17 Jan 2022 19:28:17 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id 6ABA140140 for ; Mon, 17 Jan 2022 19:28:15 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1642444095; x=1673980095; h=message-id:date:to:cc:references:from:subject: in-reply-to:content-transfer-encoding:mime-version; bh=vDvZRiyRXlQbPwgp/ea6S4Ftr+o7PxRb/ElcplqWwX0=; b=JHyzxsH0S7wzXQIP4zlXdr4EeqMmXbuHDzsJaEhMeZCQMxTj1tvzz3pn lMNqj5esGrjwrFVmYoWOU5UQiC1u/CuipNE33iCqHGKA6D+jrPczDkC59 Tm7zije7pxgFu6kawB3pnfqPcsjLIX7vU1z+xj1I/wI7UHSEXGLK26zaH VpIUWkixScUqVYPfvAaDWHjZv8RZYN0g9mKHecBtHmashcNPJJFPQl1Li HXQT77WjCv3wQr+q42Sq/x92/RStnCOS8i6Kp0rrJy0KijwlIIQyVISP5 paEejaCq1ePJaEJ4FhS5FF/MKr2bKPbCldvBbnQIzrUF/1BGvYH5kJqfJ w==; X-IronPort-AV: E=McAfee;i="6200,9189,10229"; a="244872366" X-IronPort-AV: E=Sophos;i="5.88,296,1635231600"; d="scan'208";a="244872366" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jan 2022 10:28:14 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,296,1635231600"; d="scan'208";a="693151025" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga005.jf.intel.com with ESMTP; 17 Jan 2022 10:28:14 -0800 Received: from fmsmsx604.amr.corp.intel.com (10.18.126.84) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Mon, 17 Jan 2022 10:28:13 -0800 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Mon, 17 Jan 2022 10:28:13 -0800 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.176) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Mon, 17 Jan 2022 10:28:13 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PIvB39v13maXKQZIqh4c2jCTbtWoy7ZzUdTxJFk0Bv61lY0TX0IQEXl7/I8LwdUGzb0YNJPtRy/SG297DY54EwxqgqJKKGHz50Asy4kwDbeYw4GFNiJ4cavTg6qkUvl39Pk27ojtK60Y0bIFgxjxQwsVNKEWG+XZr+Nwm8ThwcY+O5rr8HSNYnaX62DHUsl090Ie3dDjIrIeeSg6gASQjBMK5BsFrDKNAHFOoftny05XMAUgCZHOeVPgGfu9VenazXDpWVgTI3KtWkoCt46kNJLZiwGK+L86KjNJsLG17LjigozV3im593KbnVjamuPlIDi/6UWL7EsROj805mSKRw== 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=S/BElFFm3P/aYEyWZCzZUtXs0P0QKqAs44fL7xiMGQM=; b=l5TtVqE6/jkvD2yAACTzkWz92Yn2AuTCsunfWnjc7u5w/Ni9gpZ9WeskNtyFOYGpJT8ZWjuq5Vck76mA9tloynvmOb3p4d5eN1iEXYozk0T4UHiuZ3qKH/JbD+235PtUUAkFUHGFGNTV1P9yfR6qZZkOYb9l9POxgfhE1rbLTGlDhZCXfF1OoSM0mpJneFxrJRTxu7z3I+SqGUL3uPpq/wkUavPZrCeD+I0sYffgpUjhrMIdkHMKp3L/3VZ2EfloSw0r/M7jHUQnQBxi4lhd3A//CY3lDcROnJBNIUiQuzSO/9NnTmzuYDJ7plVs1L3owxVtatzqRF1LRZmenqg+Pg== 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 DM6PR11MB4076.namprd11.prod.outlook.com (2603:10b6:5:197::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.10; Mon, 17 Jan 2022 18:28:10 +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; Mon, 17 Jan 2022 18:28:10 +0000 Message-ID: Date: Mon, 17 Jan 2022 18:28:04 +0000 Content-Language: en-US To: Kumara Parameshwaran , CC: , Kumara Parameshwaran , "Thomas Monjalon" , Andrew Rybchenko , David Marchand References: <20211126041515.96259-1-kumaraparamesh92@gmail.com> From: Ferruh Yigit Subject: Re: [PATCH] net/tap: Bug fix to populate fds in secondary process X-User: ferruhy In-Reply-To: <20211126041515.96259-1-kumaraparamesh92@gmail.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO2P265CA0371.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a3::23) 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: 4b2cbf85-f0b5-4e4a-1fe9-08d9d9e71d02 X-MS-TrafficTypeDiagnostic: DM6PR11MB4076:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rL+IVL2CZp+0cvVKGqS3Yq+FfCxlD4flxL4GrKIbdX5pAeV9nMh3ByNPIUYsbNu0jERxC6YZbrtN43upTC7UYKwcpJDIGCPx0XeibF6rvZSThZJXu/iUu24EbE1tb08+92IcZNrnAXXJYaTpyNO7dEyLPL0h6ZUsTLh74XWwesSYkeO2ioxBy3JGPbMLBN4iYMCDFP5Bq2ZNwVU5zUe3P0nAURwmb+dqVAsTVNhyPyCS9kG+MHN8043+r13PeA/+2TldXTwAEEwZb1P/TWNloOOHjYnS2F6zD/EZa8gym8VtHq/swvpu0sDERaC5oO82KO+8fua862ec2iS+dibNdXA8tEtjBmUEs0IUG8d4GSPTKrk4soIuEHDY3pNsofd66rhj2EVX6eusNiv7y8muO6jK0V2gRy54C2Uhjmd8Z7Nm4ab/vubhHuiwix6N3+VrSdp/n97WXWn96dLsv+rczcde6yu38iOfoDvbDuL9328JoezY6mnSokc/c1NA+kxFG22YkRLmFOpdxcK9Ajb6rQTN8qQiQfEcQB6vGcSi2TTMNBbyFcHLy4K+5oCjlg9rms5OhNRD2ef6F6PQx9BiexepkonqfFe2B4qpIue5/QXWdxB2g2H99CCPLBVbPHJIgkk9X0AM7KCmx3Hv88OKP75DQniFZprtE6+BV23xMNtDl9xNLiKlvPKzsW3MFtfVluj7sCjq1RL6o+yJg48fwg== 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)(36756003)(6512007)(54906003)(6486002)(316002)(83380400001)(2906002)(4326008)(508600001)(38100700002)(66476007)(66556008)(53546011)(86362001)(31696002)(5660300002)(26005)(186003)(2616005)(6666004)(8936002)(44832011)(6506007)(6636002)(31686004)(8676002)(82960400001)(66946007)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?RVF4YTJUczBaOXBVK1Y1SThNNnVKVm1zRWYxbmxSOUpqZ0FxN0dQMkFoUUZO?= =?utf-8?B?ek81QzBlNCtGVmFtalhFUzI0T1VoY1BoeDQ5eWU2RGdJeVFRTzV3MXkrUHZT?= =?utf-8?B?alo5OUk3QU1IMW10R2xCTUZoMHhUZlNqUFB4UDZ0SXczVGhqeUFkR1ZBei9p?= =?utf-8?B?SUxkRnJINURQOG9rZEluNzBsbXp3bEo3MitPL3ExTXdjWVFaNDRtZDhMaGhh?= =?utf-8?B?b3RiaE45Z2xPbDNEOWNGWHhBQ29zQ1hJNGdvdG9oa1VsT2Jad0VlR09jRm82?= =?utf-8?B?K0NzQWFORURScFNPQzhrTGFBbFlTY1p5TjY0VUFQbVgxR2djSHhYcDJ5cFcr?= =?utf-8?B?aVkxbUVHQUFvajVCTVRNRlBMN1lhN3FGS283RUo2czhmektMMjkxOGdtaXVP?= =?utf-8?B?QTJ6aW11RGdLbWVabHlmSWFvMWhhL0hwUGwweDMwZHJTc1VTa0NzVlJFdzVH?= =?utf-8?B?ei9nWFUrQ1ZRTnlrK2RWNmprNm9ndElY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.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jan 2022 18:28:09.9642 (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: 0vyJ0Vk4yVr7/f2pR9PqiOxYGjbEQ2npXCJhRcd6Kl3InNoaoP7/Jps/14z8Og77MpcbSet9rszt5FuRS9lXQQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB4076 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 11/26/2021 4:15 AM, Kumara Parameshwaran wrote: > From: Kumara Parameshwaran > > When a tap device is hotplugged to primary process which in turn > adds the device to all secondary process, the secondary process > does a tap_mp_attach_queues, but the fds are not populated in > the primary during the probe they are populated during the queue_setup, > added a fix to sync the queues during rte_eth_dev_start > > Signed-off-by: Kumara Parameshwaran <...> > > +static int > +tap_mp_req_start_rxtx(const struct rte_mp_msg *request, __rte_unused const void *peer) > +{ > + struct rte_eth_dev *dev; > + int ret; > + uint16_t port_id; > + const struct ipc_queues *request_param = > + (const struct ipc_queues *)request->param; > + int fd_iterator; > + int queue; > + struct pmd_process_private *process_private; > + > + 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?