From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0044.outbound.protection.outlook.com [104.47.1.44]) by dpdk.org (Postfix) with ESMTP id 527241B76B; Wed, 31 Jan 2018 11:08:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=ellJIDzMCOka65ue6h3/jNZ/7NmwnqCjAicr2XQffmY=; b=HoaGbK4lagHjHhC59pw+w7MCbldGAszGgwpHGHZGp2fINKKfwGS+IM33Wli0U8QxLzHI1N5BYQcF+eGVc0K+ag2T/AdAQ6L+/Rv1Q0wn2Tmzpdap+8j8nH7urR77HKeoW4pz+CkvSKWCfSmSCdZm0lozUsFMlotprMFarNgvE+0= Received: from AM4PR0501MB2657.eurprd05.prod.outlook.com (10.172.215.19) by AM4PR0501MB1970.eurprd05.prod.outlook.com (10.167.91.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.444.14; Wed, 31 Jan 2018 10:08:06 +0000 Received: from AM4PR0501MB2657.eurprd05.prod.outlook.com ([fe80::50a5:cd88:b3d8:763e]) by AM4PR0501MB2657.eurprd05.prod.outlook.com ([fe80::50a5:cd88:b3d8:763e%17]) with mapi id 15.20.0444.016; Wed, 31 Jan 2018 10:08:06 +0000 From: Matan Azrad To: Adrien Mazarguil , Shahaf Shuler CC: Mordechay Haimovsky , "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v3] net/mlx4: fix dev rmv not detected after port stop Thread-Index: AQHTmO+Hm+/SeYFlrUKI7lriU6B1uaOMKrYAgAC3mgCAANPQgIAABB/w Date: Wed, 31 Jan 2018 10:08:06 +0000 Message-ID: References: <1516357009-15463-1-git-send-email-motih@mellanox.com> <1517214877-126768-1-git-send-email-motih@mellanox.com> <20180130093958.GE4256@6wind.com> <20180131091513.GS4256@6wind.com> In-Reply-To: <20180131091513.GS4256@6wind.com> Accept-Language: en-US, he-IL Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=matan@mellanox.com; x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM4PR0501MB1970; 7:z/lP2XdoNXA9imimDlpDHAWyVllHvdpd1hKiRZ+3p4GtEPGwpyVpR9/OoUcS2NTSjTJM+DTkIXCjJyYYP48Yihx9R/rkjh0oVMFb1NdGKYvj7PoLyOCCJXnotkV1swgAZaP7ofncnTCw/v/VoYrkqCkktvw8TVvx7Kw/MqRHgG6SWu8hqeBd8Dya7WhvE0StReCsuom1JCN29xOVDH2QO/HgFDBbtRN5NMWBSk0rDp55VezqHot9suV3kq1Z6Et6 x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: d14ac38b-91f9-43c9-acba-08d5689285c8 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(3008032)(2017052603307)(7153060)(7193020); SRVR:AM4PR0501MB1970; x-ms-traffictypediagnostic: AM4PR0501MB1970: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(278428928389397); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(8121501046)(5005006)(10201501046)(3231101)(2400082)(944501161)(3002001)(93006095)(93001095)(6055026)(6041288)(20161123558120)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(6072148)(201708071742011); SRVR:AM4PR0501MB1970; BCL:0; PCL:0; RULEID:; SRVR:AM4PR0501MB1970; x-forefront-prvs: 056929CBB8 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(39860400002)(366004)(346002)(39380400002)(396003)(53754006)(189003)(199004)(51444003)(6246003)(5250100002)(6636002)(2900100001)(55016002)(9686003)(6436002)(110136005)(26005)(229853002)(53936002)(3280700002)(86362001)(102836004)(54906003)(59450400001)(25786009)(4326008)(7696005)(6506007)(3660700001)(2906002)(478600001)(76176011)(8936002)(3846002)(6116002)(81166006)(66066001)(186003)(93886005)(33656002)(68736007)(97736004)(81156014)(105586002)(316002)(5890100001)(14454004)(99286004)(305945005)(74316002)(7736002)(2950100002)(5660300001)(106356001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR0501MB1970; H:AM4PR0501MB2657.eurprd05.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: fJzEQGsRiTl3ZQQ16NSL0WMFd2u/UQcCatBPQgshDosSGOVzUPY1MD1iUX8ZqLaoUNgbByGW+1qlrjb13Jv/dQ== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: d14ac38b-91f9-43c9-acba-08d5689285c8 X-MS-Exchange-CrossTenant-originalarrivaltime: 31 Jan 2018 10:08:06.0422 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR0501MB1970 Subject: Re: [dpdk-dev] [PATCH v3] net/mlx4: fix dev rmv not detected after port stop 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: , X-List-Received-Date: Wed, 31 Jan 2018 10:08:07 -0000 Hi all From: Adrien Mazarguil > On Tue, Jan 30, 2018 at 08:37:06PM +0000, Shahaf Shuler wrote: > > Tuesday, January 30, 2018 11:40 AM, Adrien Mazarguil: > > > Unfortunately I didn't get a chance to review this patch before it wa= s > applied. > > > I'm not sure a stopped port is supposed to report events > > > (interrupts). Will applications expect them to occur at this point? > > > > Why not? > > > > Stopped port is still counted as attached. The fact the application sto= pped > the packet receive on it doesn't mean it should not receive a sync events > (such as the remove event). > > async events, by definition, are not related to traffic being flows thr= ough > the port. >=20 > My comment is based on my understanding of rte_eth_dev_stop(), which is > a device (or port) is completely stopped, in a suspended state and no > interrupts shall occur, as a means for applications to temporarily not be > bothered by them until restarted. Stopping traffic is not saying that the application is not interesting in t= he device, I think that you mean to dev_close(). Any event may still be usable for application between dev_stop() to dev_sta= rt(),=20 especially RMV or LCS can still be interested. > Think about it that way: applications do not want to get interrupts > immediately after the device is initialized, because they might not be re= ady > to process them at this point. An explicit call to rte_eth_dev_start() te= lls the > PMD when it's OK to do so. The converse is rte_eth_dev_stop(). So, they can delay the event registration to the time they interesting in t= he events. And use event unregister when they are not interesting in it anymore. > Stopping traffic can already be achieved by not polling from the applicat= ion > side, calling rte_eth_dev_[rt]x_queue_stop() and/or toggling RX/TX > interrupts through rte_eth_dev_[rt]x_intr_enable(). rte_eth_dev_stop() > provides lower-level device control. =20 I think it makes sense only for Rx interrupt which is traffic oriented(like= stop and start).=20 > Perhaps documentation is not clear, however that's how LSC seems > implemented in all PMDs; it gets disabled after rte_eth_dev_stop() and on= e > should explicitly use rte_eth_link_get() to retrieve link status afterwar= d. I > think RMV should behave similarly with rte_eth_dev_is_removed(). > Adapting fail-safe should be easier than modifying all the remaining PMDs= . Or maybe PMDs which do it make mistakes. Matan. > > > In my opinion it's not a fix, as in, it doesn't address an issue > > > introduced by the mentioned patch whose behavior was correct. > > > > > > It's probably too late to change it now and it does address an issue > > > seen with a use case involving this PMD, however I think the > > > fail-safe PMD could as well poll using the recently-added > > > rte_eth_dev_is_removed() when it's aware the underlying port is > stopped instead of expecting interrupts. > > > > > > -- > > > Adrien Mazarguil > > > 6WIND >=20 > -- > Adrien Mazarguil > 6WIND