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 8FB1AA0C4B; Sat, 6 Nov 2021 21:54:10 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 235B340151; Sat, 6 Nov 2021 21:54:10 +0100 (CET) Received: from na01-obe.outbound.protection.outlook.com (mail-cusazon11021024.outbound.protection.outlook.com [52.101.62.24]) by mails.dpdk.org (Postfix) with ESMTP id 353D240040 for ; Sat, 6 Nov 2021 21:54:09 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gV4s5yNDhbAC9+k3eeXcQmKynSUITfEybJLf0iRoA1PcZ/FBFwvCCofFhpM4tSGytl9cOaoN2EPKLKXxl5epNwhLuMHDpe6TdJOTr2YC+Jj9ltNLDUOTmzJp89kovxWg27b7TScM4wbzpqTwuHOKEhyyqxN9aLx1ZpeDbY3yTJb/tRCjFyQDH4DGYzgR3AIUKo/JBLhYJx0V38Q2d7GtMzfJs2YViB2seXQMSUnk8hfh4cy84OtJ3+JlxwEuCWdC2fWwkAs1TUnu/ZLIKvQ8zFiIYmbsm8ngUa0UG+ZJm3DKwrJR/dCnj3+b2MnlUSTjG+kESuALTaJOuT2rqCirPA== 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=Encsg9ICBSaBBItB2mwLHHVivE2LdxDkjDIoFijjpV0=; b=ASlLbTMeyO5qZapm84ST7llWdOnx2p2aI73CJfFZlNpP4ZRT+j+mTEv0GUK9XFoDS07R7WvumCneUdRRXIDmCBmuX1fCPjf1/Wnhy+NPO0cTWq0q65msVtmfNa7hfTBoOB6FLaONHz7RzManJg3iIsI/CSe+IUK38+m1bPPn9TTpDSR/N4aV/+KULACfAJxmehNzFQhAia1bArnyNRU+740Ueesi6dfEY1/3R8ySY2Fs4yvuBClSuOvWlyJGDieJCXt54jCJlMhAXRdgmXmZs9RNWKTQLUskfFVvuXC9YDUqiu2OY75BMSCyuWjGnR3Sj1ed04l89tH85qMP6eKaJA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Encsg9ICBSaBBItB2mwLHHVivE2LdxDkjDIoFijjpV0=; b=Cplbcj5ZGXYBZD7z2hM6uZhv+UJHtjHkTQOEAPXta39t4zFh2HyZKJUw9o/4D3jMNW/FUJVkjAg0icQ8eOZ7zVUoX0++P8ZoEFePjp+2sF72F1lTbuf0VuXsJFWvaHnybU/dRSuXgztxVo/nbcR+8PZdOqEG4bUCD3XQrNQdeJA= Received: from BY5PR21MB1506.namprd21.prod.outlook.com (2603:10b6:a03:23d::12) by SJ0PR21MB2056.namprd21.prod.outlook.com (2603:10b6:a03:395::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.3; Sat, 6 Nov 2021 20:54:00 +0000 Received: from BY5PR21MB1506.namprd21.prod.outlook.com ([fe80::1db2:a482:d774:93ea]) by BY5PR21MB1506.namprd21.prod.outlook.com ([fe80::1db2:a482:d774:93ea%3]) with mapi id 15.20.4713.000; Sat, 6 Nov 2021 20:54:00 +0000 From: Long Li To: Srikanth Kaka , Stephen Hemminger CC: "dev@dpdk.org" , Vag Singh , Anand Thulasiram Thread-Topic: [PATCH 09/11] net/netvsc: moving hotplug retry to OS dir Thread-Index: AQHXs6Wm9hHG3INY0kStg4cU952lAav3OXUA Date: Sat, 6 Nov 2021 20:54:00 +0000 Message-ID: References: <20210927134231.11177-1-srikanth.k@oneconvergence.com> <20210927134231.11177-10-srikanth.k@oneconvergence.com> In-Reply-To: <20210927134231.11177-10-srikanth.k@oneconvergence.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ActionId=28f30201-c837-4c00-99fe-77166c0d5817; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=true; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Standard; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=Internal; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2021-11-06T20:53:39Z; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=microsoft.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 07148c50-e400-438b-2add-08d9a1678f4f x-ms-traffictypediagnostic: SJ0PR21MB2056: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3276; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: +oV7yhKKQDBRJmY9Jw+0N4my405OD7/crr+wgtMdo7OOVARRLG7sq0c4LvMJ4uX+fHNxYJmmfulO76A5jVaXydGoEUMXXqoDpq/9Fo7E86CRpVIMLxBkDAiGsdsUa6zHfYliFGxaXp5FGxG7AeBkpo4QWNQv6l+wZ/4Hemqkc1eNo/9n1jT7Ek3C195T97QNaOhqFtHnmUGNvObfqRq/ZhMTPZ2y2H8kknqYCUXtSvGeeHnAY4DlXjEH9VVkenzjKM1T/Aet6aLFyZaLKSMQbC7/fOZO3ej3Ha4rFFYKJUi44/hTk07iG5Be4TgdF9Ivqt4w6n7L7myl8biUD92o07517mH8EY+vgQrpUoQx36iItCiCccUNyxKAyvuq8CjFrxqi5z/8k/ZIuiDczBI/QcLAxEW36lQwLFZvYWUbZ0m2wzsNYZKub++Pj9b/DBN4DXOUt1+gu4R98NYNeagLEUpwLEs44YpLqI0v1Rer4bhIxxTnPjgdtZqhMBAzLyYa5VuOMmhUl57kcbtN7Lyd7K8HQ7Ud5RQXeiTzUx0tGMVC/sTIXWC1kfXFH58qAP5sGBjMqhULuwsqDOFT+oFOycozJY+D0eJdDbOox/ex2SIS7+ShyxWyxCxz2ahc3z6kNvLu8YsJbVNkYH+nx3GN1hxwWL65d9pocKg+eBoFu+UmHOED/rIMeBv4VPSogRmloebmgHyP1B41ASz+k5rx+RQipkTQTpullox/Di3iCjfT6obHhX1ANJTE/6cyVijp x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BY5PR21MB1506.namprd21.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(2906002)(33656002)(6636002)(66946007)(8676002)(9686003)(55016002)(10290500003)(71200400001)(8936002)(26005)(66476007)(66556008)(64756008)(66446008)(186003)(508600001)(110136005)(316002)(54906003)(966005)(76116006)(52536014)(4326008)(6506007)(82960400001)(82950400001)(5660300002)(7696005)(38100700002)(83380400001)(38070700005)(122000001)(86362001)(8990500004)(10090945008); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?aa8YZ6Z3UGH5eOO7FjgANYlW5tsiF4GPS4j+gJVZpWEpSRG72vfEhWU5ZpSW?= =?us-ascii?Q?uKSj6CQep86fxKVUD3C1PTeTJThFP4PF2hUfqLC3tETDfurTKWW4/bzmRaII?= =?us-ascii?Q?1jUGGgp+pfyc5rZUXzcLbb18tRhh1lCJZE3dboDttQkYvlLtqZ2HMdXZT2T4?= =?us-ascii?Q?mkpMZiOOToXEaEFNLcKEjk9a/Si4wOqKfUsl4ZJkBOJGgGKBv9HrNhtUSKW/?= =?us-ascii?Q?mzRNLlBhfWfg79Mv+IF1eJfsH5WE6y5hhMstlli6X9NE5z6KOFMSl4nUjEIL?= =?us-ascii?Q?pRXY4Ww1E7ktu1ZO3/SvgNKZcbsPTMB881Mx1U6mtqJbAtZvuAmnBoyRXkpj?= =?us-ascii?Q?CMHXJrQZSjZuzt2XpuJkFo7KdmsQASIdcTNdc5js5wzsLlQQlOgoBK+AwZPT?= =?us-ascii?Q?JOh+CDaCTqrX5ntsHTwfQdwinkeVlzsYSPfDApSZgXFjfC2PSxWnH+Fc4I++?= =?us-ascii?Q?6il/mTnlIkBLAHX9i9RCe96LaozIln3ZQcQZhYVVvMxAxGWdVTECtcOkav/L?= =?us-ascii?Q?rFQb5AiyidwUQketE+VJ/eoDNnuuYDp6FtJjtpuh83GQ2zSy1NxBvYVDg1c5?= =?us-ascii?Q?C7O5kvgm8/jqbSW5dzpVx/arsXEI0kDXXjnPzyinCDixfB+PGKtlTLHJ/4ZY?= =?us-ascii?Q?cs6dZyrnrv2zComOla4Z0Mc1jpJHSSWbgXyFNkjGrGe78dzz5wEQeoHVuBhh?= =?us-ascii?Q?KHj/UfAaYAnOQbYEs6akWyqK871lc0z62dgmuGv2t1QgtMDPicf4FzlXk7Zk?= =?us-ascii?Q?MGSRaYaLN/HE2lmrEdfz/AUO2lY+bwQedIUU9U/svCVr/giwehzdtZFJbMs5?= =?us-ascii?Q?hOpGsLmCZXGD4UMbtLOsk6TkTNKHGoecp/ZAMvpyT4A3t7TBEnRqYcDr3Ppx?= =?us-ascii?Q?WxmXUtkd+6sVGm3O0udRXn2qtZA2ST6KxiuH+hXuKGtu3JwvARAf+eJfQPGb?= =?us-ascii?Q?LMq31ij76jcY6nSiTP+ay5dmWURwDf5XiEXrJ6TbkgHwS8p10mp8EowVyN+y?= =?us-ascii?Q?C+nVbRh+OyEEmlaCMebuxZIKt3hzo+Md39BDPXjncSvA6DjAmpAjWd0hltCa?= =?us-ascii?Q?7dHjBE34hSOcYUHjhN1VlQplfVWowb/DYguaSK8Kod+45KbXv4tO7Z2z56WX?= =?us-ascii?Q?1nB3IxbEwm/cHIZl6IaTOFkqTFOf06baDYjI7NLbr9A1t17dEaKm8slKIM2U?= =?us-ascii?Q?aQSO6Y1/9RFTDcmDO+L7Fl2prZjpTTr86o1N1iRs7mJg/d+xbkliE0oTQxls?= =?us-ascii?Q?2M/6q4LN2gMy7pFf9wpBimDH0Cn/3reRFiKLz1y8icuf1qEBcM6qfhJQiZZS?= =?us-ascii?Q?m/pHjYVE9anMwLC8kIc3sBbh54wd9lpdhemwTI88Fmq1U/zFmsNMBl1El7AJ?= =?us-ascii?Q?j7qtOqABJyYElkYgK/tSjQ9GoSS38hT4Q5zwr2nxKh+vdHGrPeVqgeXE2KZo?= =?us-ascii?Q?elt/Ue8pvtTBxoyikj5Lj9ufDBSgnrqUm0Wx/bMlVv0WHz87M8ozRVCSNQuq?= =?us-ascii?Q?zFfyET8pYXfsMQiMpyTACL84PRTaLwLNBkJQM/vdUfYGPtZIdEnrhMB+TqTG?= =?us-ascii?Q?gOZA/MBuL0vlfjRrtgCwS/OX++ku2vnjpmJ/qFEnCaOD9Y1ExKtWOfP2QSkj?= =?us-ascii?Q?8Q=3D=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BY5PR21MB1506.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 07148c50-e400-438b-2add-08d9a1678f4f X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Nov 2021 20:54:00.6604 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: /fQMyHfOWVzAWYcrmjgCgrZqJqOAh122W8iSygZrv6J+A1JdjdqaXMI5eMGnM2yysgaviM6xVd+1Xm+RxVe9Lw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR21MB2056 Subject: Re: [dpdk-dev] [PATCH 09/11] net/netvsc: moving hotplug retry to OS dir 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 Sender: "dev" > Subject: [PATCH 09/11] net/netvsc: moving hotplug retry to OS dir >=20 > [You don't often get email from srikanth.k@oneconvergence.com. Learn why > this is important at http://aka.ms/LearnAboutSenderIdentification.] >=20 > Moved netvsc_hotplug_retry to respective OS dir as it contains OS depende= nt > code. For Linux, it is copied as is and for FreeBSD it is not supported y= et. >=20 > Signed-off-by: Srikanth Kaka > Signed-off-by: Vag Singh > Signed-off-by: Anand Thulasiram Reviewed-by: Long Li > --- > drivers/net/netvsc/freebsd/hn_os.c | 8 +++ > drivers/net/netvsc/hn_ethdev.c | 84 --------------------------- > drivers/net/netvsc/hn_os.h | 2 + > drivers/net/netvsc/linux/hn_os.c | 92 ++++++++++++++++++++++++++++++ > 4 files changed, 102 insertions(+), 84 deletions(-) >=20 > diff --git a/drivers/net/netvsc/freebsd/hn_os.c > b/drivers/net/netvsc/freebsd/hn_os.c > index 3bd67e06c8..2ba4c32a76 100644 > --- a/drivers/net/netvsc/freebsd/hn_os.c > +++ b/drivers/net/netvsc/freebsd/hn_os.c > @@ -4,6 +4,8 @@ >=20 > #include >=20 > +#include > + > #include "hn_logs.h" > #include "hn_os.h" >=20 > @@ -12,3 +14,9 @@ int eth_hn_os_dev_event(void) > PMD_DRV_LOG(DEBUG, "rte_dev_event_monitor_start not supported on > FreeBSD"); > return 0; > } > + > +void netvsc_hotplug_retry(void *args) > +{ > + RTE_SET_USED(args); > + return; > +} > diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethde= v.c > index 61d7d3daeb..c299b98a6c 100644 > --- a/drivers/net/netvsc/hn_ethdev.c > +++ b/drivers/net/netvsc/hn_ethdev.c > @@ -57,9 +57,6 @@ > #define NETVSC_ARG_TXBREAK "tx_copybreak" > #define NETVSC_ARG_RX_EXTMBUF_ENABLE "rx_extmbuf_enable" >=20 > -/* The max number of retry when hot adding a VF device */ -#define > NETVSC_MAX_HOTADD_RETRY 10 > - > struct hn_xstats_name_off { > char name[RTE_ETH_XSTATS_NAME_SIZE]; > unsigned int offset; > @@ -556,87 +553,6 @@ static int hn_subchan_configure(struct hn_data *hv, > return err; > } >=20 > -static void netvsc_hotplug_retry(void *args) -{ > - int ret; > - struct hn_data *hv =3D args; > - struct rte_eth_dev *dev =3D &rte_eth_devices[hv->port_id]; > - struct rte_devargs *d =3D &hv->devargs; > - char buf[256]; > - > - DIR *di; > - struct dirent *dir; > - struct ifreq req; > - struct rte_ether_addr eth_addr; > - int s; > - > - PMD_DRV_LOG(DEBUG, "%s: retry count %d", > - __func__, hv->eal_hot_plug_retry); > - > - if (hv->eal_hot_plug_retry++ > NETVSC_MAX_HOTADD_RETRY) > - return; > - > - snprintf(buf, sizeof(buf), "/sys/bus/pci/devices/%s/net", d->name= ); > - di =3D opendir(buf); > - if (!di) { > - PMD_DRV_LOG(DEBUG, "%s: can't open directory %s, " > - "retrying in 1 second", __func__, buf); > - goto retry; > - } > - > - while ((dir =3D readdir(di))) { > - /* Skip . and .. directories */ > - if (!strcmp(dir->d_name, ".") || !strcmp(dir->d_name, "..= ")) > - continue; > - > - /* trying to get mac address if this is a network device*= / > - s =3D socket(PF_INET, SOCK_DGRAM, IPPROTO_IP); > - if (s =3D=3D -1) { > - PMD_DRV_LOG(ERR, "Failed to create socket errno %= d", > - errno); > - break; > - } > - strlcpy(req.ifr_name, dir->d_name, sizeof(req.ifr_name)); > - ret =3D ioctl(s, SIOCGIFHWADDR, &req); > - close(s); > - if (ret =3D=3D -1) { > - PMD_DRV_LOG(ERR, > - "Failed to send SIOCGIFHWADDR for dev= ice %s", > - dir->d_name); > - break; > - } > - if (req.ifr_hwaddr.sa_family !=3D ARPHRD_ETHER) { > - closedir(di); > - return; > - } > - memcpy(eth_addr.addr_bytes, req.ifr_hwaddr.sa_data, > - RTE_DIM(eth_addr.addr_bytes)); > - > - if (rte_is_same_ether_addr(ð_addr, dev->data->mac_addr= s)) { > - PMD_DRV_LOG(NOTICE, > - "Found matching MAC address, adding d= evice %s network > name %s", > - d->name, dir->d_name); > - ret =3D rte_eal_hotplug_add(d->bus->name, d->name= , > - d->args); > - if (ret) { > - PMD_DRV_LOG(ERR, > - "Failed to add PCI device %s"= , > - d->name); > - break; > - } > - } > - /* When the code reaches here, we either have already add= ed > - * the device, or its MAC address did not match. > - */ > - closedir(di); > - return; > - } > - closedir(di); > -retry: > - /* The device is still being initialized, retry after 1 second */ > - rte_eal_alarm_set(1000000, netvsc_hotplug_retry, hv); > -} > - > static void > netvsc_hotadd_callback(const char *device_name, enum rte_dev_event_type > type, > void *arg) > diff --git a/drivers/net/netvsc/hn_os.h b/drivers/net/netvsc/hn_os.h inde= x > 618c53cdcd..1fb7292b17 100644 > --- a/drivers/net/netvsc/hn_os.h > +++ b/drivers/net/netvsc/hn_os.h > @@ -4,3 +4,5 @@ > */ >=20 > int eth_hn_os_dev_event(void); > + > +void netvsc_hotplug_retry(void *args); > diff --git a/drivers/net/netvsc/linux/hn_os.c b/drivers/net/netvsc/linux/= hn_os.c > index 862dc190c1..9c2f4cd7a8 100644 > --- a/drivers/net/netvsc/linux/hn_os.c > +++ b/drivers/net/netvsc/linux/hn_os.c > @@ -2,11 +2,22 @@ > * Copyright(c) 2016-2021 Microsoft Corporation > */ >=20 > +#include > +#include > +#include > +#include > +#include > + > #include > +#include >=20 > #include "hn_logs.h" > +#include "hn_var.h" > #include "hn_os.h" >=20 > +/* The max number of retry when hot adding a VF device */ #define > +NETVSC_MAX_HOTADD_RETRY 10 > + > int eth_hn_os_dev_event(void) > { > int ret; > @@ -17,3 +28,84 @@ int eth_hn_os_dev_event(void) >=20 > return ret; > } > + > +void netvsc_hotplug_retry(void *args) > +{ > + int ret; > + struct hn_data *hv =3D args; > + struct rte_eth_dev *dev =3D &rte_eth_devices[hv->port_id]; > + struct rte_devargs *d =3D &hv->devargs; > + char buf[256]; > + > + DIR *di; > + struct dirent *dir; > + struct ifreq req; > + struct rte_ether_addr eth_addr; > + int s; > + > + PMD_DRV_LOG(DEBUG, "%s: retry count %d", > + __func__, hv->eal_hot_plug_retry); > + > + if (hv->eal_hot_plug_retry++ > NETVSC_MAX_HOTADD_RETRY) > + return; > + > + snprintf(buf, sizeof(buf), "/sys/bus/pci/devices/%s/net", d->name= ); > + di =3D opendir(buf); > + if (!di) { > + PMD_DRV_LOG(DEBUG, "%s: can't open directory %s, " > + "retrying in 1 second", __func__, buf); > + goto retry; > + } > + > + while ((dir =3D readdir(di))) { > + /* Skip . and .. directories */ > + if (!strcmp(dir->d_name, ".") || !strcmp(dir->d_name, "..= ")) > + continue; > + > + /* trying to get mac address if this is a network device*= / > + s =3D socket(PF_INET, SOCK_DGRAM, IPPROTO_IP); > + if (s =3D=3D -1) { > + PMD_DRV_LOG(ERR, "Failed to create socket errno %= d", > + errno); > + break; > + } > + strlcpy(req.ifr_name, dir->d_name, sizeof(req.ifr_name)); > + ret =3D ioctl(s, SIOCGIFHWADDR, &req); > + close(s); > + if (ret =3D=3D -1) { > + PMD_DRV_LOG(ERR, > + "Failed to send SIOCGIFHWADDR for dev= ice %s", > + dir->d_name); > + break; > + } > + if (req.ifr_hwaddr.sa_family !=3D ARPHRD_ETHER) { > + closedir(di); > + return; > + } > + memcpy(eth_addr.addr_bytes, req.ifr_hwaddr.sa_data, > + RTE_DIM(eth_addr.addr_bytes)); > + > + if (rte_is_same_ether_addr(ð_addr, dev->data->mac_addr= s)) { > + PMD_DRV_LOG(NOTICE, > + "Found matching MAC address, adding d= evice %s network > name %s", > + d->name, dir->d_name); > + ret =3D rte_eal_hotplug_add(d->bus->name, d->name= , > + d->args); > + if (ret) { > + PMD_DRV_LOG(ERR, > + "Failed to add PCI device %s"= , > + d->name); > + break; > + } > + } > + /* When the code reaches here, we either have already add= ed > + * the device, or its MAC address did not match. > + */ > + closedir(di); > + return; > + } > + closedir(di); > +retry: > + /* The device is still being initialized, retry after 1 second */ > + rte_eal_alarm_set(1000000, netvsc_hotplug_retry, hv); } > -- > 2.30.2