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 D05A2A04B9; Mon, 7 Sep 2020 10:09:35 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 143722BAB; Mon, 7 Sep 2020 10:09:35 +0200 (CEST) Received: from nat-hk.nvidia.com (nat-hk.nvidia.com [203.18.50.4]) by dpdk.org (Postfix) with ESMTP id 7E6791DB8 for ; Mon, 7 Sep 2020 10:09:33 +0200 (CEST) Received: from hkpgpgate101.nvidia.com (Not Verified[10.18.92.9]) by nat-hk.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Mon, 07 Sep 2020 16:09:31 +0800 Received: from HKMAIL102.nvidia.com ([10.18.16.11]) by hkpgpgate101.nvidia.com (PGP Universal service); Mon, 07 Sep 2020 01:09:31 -0700 X-PGP-Universal: processed; by hkpgpgate101.nvidia.com on Mon, 07 Sep 2020 01:09:31 -0700 Received: from HKMAIL102.nvidia.com (10.18.16.11) by HKMAIL102.nvidia.com (10.18.16.11) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 7 Sep 2020 08:09:31 +0000 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.168) by HKMAIL102.nvidia.com (10.18.16.11) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Mon, 7 Sep 2020 08:09:31 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oEhANZvnPdK8imf+vMJg8lCEskY1onqUb1XBjJ/2EOUpRsz3s9Dn/ksVqB+Ubkw2M9NYMkZIZ0xFSbRiw9ubNtfl1jAq5lBDtgxCb3lRzSF3mQKhL99aTssV5CbbLxjwRIfNex8tdLV1T16vaw14OjCIbp5HeXKLv9Tu09cymLmUj1pTM47Hrw2+AeQXhqdVm7RM+Bn31ynVFNqFjry5IjWv35ccha+bZL9Xyqcv11P0kUPxY5EECjPDB26cSrtZUZTIVag+2TGK6P2WUt00N+0s1eh/aLBlRAL02JTNNkeuJQbcZ4cBcEV32C38xKPFJcRV3tQIDqDjIkzadEZrRQ== 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=tGlasTURkC6ZbPQTv/nsLoP7W2bMSDVrqLbdkIGuZ7k=; b=A0wHZDwzEpNyyBnNzNcKT35peniNLSoEq00Ay6W3swpOIri0CXdiI+FZK4q13xC2mDNwiz44+Go3pBXcXgUDhqjHZ45mKJel33HGCZuTmGqoJxgYIsHITsybjUeSd2IdNKoUmuKCVRS7w0P5oW2YOZTsLsxNwvAIs/GOFFiCAdAHzTvwy6eas880Xdwkc2m8nGu+gwNcZ8cwTDZHiGFrbutbzr8FqBIzsBDpbMltesSYrmDyQl3TVCl3UoINkJ0KovOHry6qXMVSYOiCSJn7FY37XWBnfsmsZ3A95O1AuvwKO9UoqatM1f36+ne/rdlaI1tlRnP9WI9fyoMdBpoMgA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none Received: from MW2PR12MB2492.namprd12.prod.outlook.com (2603:10b6:907:8::19) by MWHPR12MB1487.namprd12.prod.outlook.com (2603:10b6:301:3::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3348.16; Mon, 7 Sep 2020 08:09:28 +0000 Received: from MW2PR12MB2492.namprd12.prod.outlook.com ([fe80::693f:4ec4:caa9:ac9c]) by MW2PR12MB2492.namprd12.prod.outlook.com ([fe80::693f:4ec4:caa9:ac9c%5]) with mapi id 15.20.3348.019; Mon, 7 Sep 2020 08:09:28 +0000 From: Matan Azrad To: Stephen Hemminger CC: "matan@mellanox.com" , "grive@u246.net" , "dev@dpdk.org" , Raslan Darawsheh Thread-Topic: [dpdk-dev] [PATCH] net/vdev_netvsc: handle removal of associated pci device Thread-Index: AQHWhHw23ILUeXN8QkudN0MmJsMwS6lcrkbQ Date: Mon, 7 Sep 2020 08:09:27 +0000 Message-ID: References: <20200819175333.19601-1-stephen@networkplumber.org> <20200906113309.4a320400@hermes.lan> In-Reply-To: <20200906113309.4a320400@hermes.lan> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: networkplumber.org; dkim=none (message not signed) header.d=none;networkplumber.org; dmarc=none action=none header.from=nvidia.com; x-originating-ip: [77.126.81.41] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 72479291-c939-483a-1dca-08d853055786 x-ms-traffictypediagnostic: MWHPR12MB1487: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 2sezBK9cTYohbTQpZFTXC1LW99tD2cBgqkNdRij6Ms8IeYqWnqChDEQ+SzdFLivCsGMfe6WwkwDMi6Q5CuNKk6GHFGMUxOOUN9W4rWfg2mNtmH/QpE0qwnl5e8pO4isFAuSx2jEGeCNLL6nmDqZ0Vz2Me5nXDtngGH7MQ8pxoT0VBXI6mN2kRkWo/ZUYhExmuJdL0htUnBHQNg4Q9wFHvehammd6dxTB5ykQftU3nyrg0a+oiQeChZZyvTqmV2DOnRZyrYcERdk0V357g/cDLZG1uIBuSocMT8x/N0B8bMoIj+p/vsu34/AM3qhu9NlX x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MW2PR12MB2492.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(366004)(39860400002)(396003)(346002)(376002)(2906002)(7696005)(26005)(6506007)(478600001)(5660300002)(4326008)(316002)(186003)(6916009)(76116006)(54906003)(66476007)(66946007)(66556008)(107886003)(64756008)(66446008)(8936002)(55016002)(52536014)(9686003)(86362001)(83380400001)(71200400001)(8676002)(33656002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: bVXIXqXGUZSaWDHGtWB3KNcEAt+PSLnNr3WJaikJpV/KJwHua4J1uBuDXb79imgEW0KHA9ekQFRUASt3wL4lbxds6KBIEU6qK4buzDJpJGvMgS3RKTuRvBD8xrlt0Txd61ab6ndj5tAYL+eSyNc6BbDqUeF2wErO9JigjiYmX9no8jQWN/eoVPVRsKywArQgzNC6uq1kBIL9ozCiLSdxervQYiTzBLl1efaPOagvGhLk9m5xPZoJ1GCKA+v9BaW9fjD6Y7FI5zZuEYvl4Dp4onuIEC2pt9MWsB1vwkZu7/Zr4CkzhXShgJuT0Tcil5wJLh4EjeQfcw0LgDDtLcA/ecIxRt8c3q+a4NMu5oT1SqVqhx/9pNZ9JU+klTMhlrUOQ9CAzo701dRBrgeYzu0pHSQI8U3Loc1gwiXoxed6EawRJzz5FFm76LEa1hcw4YH8Mx1eDP/rkEuLBySiJ6m0O0iO+B1JJfXF/CnpwU8mJe9/Q9Y9lO9BpqeQmBfRKrrDiOLK6t38gzFoCLAcz78appF2qldXiWPTgjdlGubCWcNrAD+AsVyk0MnRqlsnFg5GXXHjZCklKFErRrUm7K6XIv7A0XGop+hY1nBXtMTX4+Mr7SD1LUA70GYEBlGxyijp4cPDJP6xJNIjDqD3zdX8Nw== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW2PR12MB2492.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 72479291-c939-483a-1dca-08d853055786 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Sep 2020 08:09:27.9415 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: l1ZQuyKjHr/pUzwtFOvLmJsy4TzL/gD0AaUVEN0aAv0oTrnFleHMlu/ff4w/5nXRG/wFfgL3kgrEPp3wyiK/Ww== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1487 X-OriginatorOrg: Nvidia.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1599466171; bh=tGlasTURkC6ZbPQTv/nsLoP7W2bMSDVrqLbdkIGuZ7k=; h=X-PGP-Universal:ARC-Seal:ARC-Message-Signature: ARC-Authentication-Results:From:To:CC:Subject:Thread-Topic: Thread-Index:Date:Message-ID:References:In-Reply-To: Accept-Language:Content-Language:X-MS-Has-Attach: X-MS-TNEF-Correlator:authentication-results:x-originating-ip: x-ms-publictraffictype:x-ms-office365-filtering-correlation-id: x-ms-traffictypediagnostic:x-ms-exchange-transport-forked: x-microsoft-antispam-prvs:x-ms-oob-tlc-oobclassifiers: x-ms-exchange-senderadcheck:x-microsoft-antispam: x-microsoft-antispam-message-info:x-forefront-antispam-report: x-ms-exchange-antispam-messagedata:Content-Type: Content-Transfer-Encoding:MIME-Version: X-MS-Exchange-CrossTenant-AuthAs: X-MS-Exchange-CrossTenant-AuthSource: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-originalarrivaltime: X-MS-Exchange-CrossTenant-fromentityheader: X-MS-Exchange-CrossTenant-id:X-MS-Exchange-CrossTenant-mailboxtype: X-MS-Exchange-CrossTenant-userprincipalname: X-MS-Exchange-Transport-CrossTenantHeadersStamped:X-OriginatorOrg; b=sQtK6jsBVMJtuHiN+8JLT7pr18L+vQW+pSTvhTWWg9Q7SuuX3LziN21JMwYEwgbgH d4J1PWS7QyzCTREKM7R+iArgYire1kHR1hISLAXgfvFZvNUdXCSuCyiemQKbVEuxxk YTZqZJ1jvVHleimViV4MPhi0lgGOEZnTq0avAYklQFZ42mW4nl4wP4FQYe5Z5OvNV6 A46XKMWT+H4NJPG6cb6jBMu4p1h5GAMH1SIdhWUOfg2GfeKv5+w/+0KJUa/+JQa8dy AdzECSg5VgFSSzrrLFO4A2Nu39yCQ/FKzWzdjpgdz37w/X7AuY32LICh0AysjIjKjR v5pLp+bms5+tw== Subject: Re: [dpdk-dev] [PATCH] net/vdev_netvsc: handle removal of associated pci device 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" Hi Stephen From: Stephen Hemminger: > On Sun, 6 Sep 2020 12:38:18 +0000 > Matan Azrad wrote: >=20 > > Hi Stephen > > > > From: Stephen Hemminger: > > > The vdev_netvsc was not detecting when the associated PCI device > > > (SRIOV) was removed. Because of that it would keep feeding the same > > > (removed) device to failsafe PMD which would then unsuccessfully try > > > and probe for it. > > > > > > Change to use a mark/sweep method to detect that PCI device was > > > removed, and also only tell failsafe about new PCI devices. > > > Vdev_netvsc does not have to keep stuffing the pipe with the same > > > already existing PCI device. > > > > As I know, the vdev_netvsc driver doesn't call to failsafe if the PCI d= evice is > not detected by the readlink command(considered as removed)... > > Am I missing something? >=20 > The original code is broken because ctx_yield is not cleared, it keeps se= nding > the same value. Looking on the code again, It looks like ctx->yield has no effect on the ne= xt pipe write, It is just used for log. After the PCI interface matching to the netvsc interface, the pipe write is= triggered only if the readlink commands success to see the plugged-in PCI = device: readlink /sys/class/net/[iface]/device/subsystem shows "pci" readlink /sys/class/net/[iface]/device shows the pci device ID. So, the assumption is when the above readlink failed on the interface the d= evice is removed(plugged-out) and the fd write will not happen. The code will continue to retry probe again and again until success only fo= r plugged-in pci device matched the netvsc device. > It looks like device removal and add was never tested. This is basic test we have to test plug-in plug-out and it passed every day= in the last years. Maybe something new and special in your setup? > If you test removal you will see that vdev_netvsc: > 1. Sends same PCI device repeatedly to failsafe (every alarm call) > This is harmless, but useless. > 2. When device is removed, keeps doing #1