From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20077.outbound.protection.outlook.com [40.107.2.77]) by dpdk.org (Postfix) with ESMTP id DAC5CA48A; Thu, 15 Mar 2018 19:08:52 +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=aeg5SSkantxxr0DYXkbj7LEHVQ95ErjDg97mbIKHFuc=; b=BMUgO+UOsHEHgWVmC5ISKRCv2wPt9HqqhFWtbErAfIv1rj8OqVh/Fn76IEVVZJfrg8xdBtJgz21dt7uLoj1LBq7EtJF4sQOD50+tl3VZICx3nhbTAJlMkZ5LY3pInORKqSt7nLHxG9Zs6EELYZW6VAuBBN/Y8pt1dDJ73j9Rrt0= Received: from VI1PR0501MB2045.eurprd05.prod.outlook.com (10.167.195.147) by VI1PR0501MB2830.eurprd05.prod.outlook.com (10.172.11.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.588.14; Thu, 15 Mar 2018 18:08:50 +0000 Received: from VI1PR0501MB2045.eurprd05.prod.outlook.com ([fe80::59c:947c:846:ff92]) by VI1PR0501MB2045.eurprd05.prod.outlook.com ([fe80::59c:947c:846:ff92%13]) with mapi id 15.20.0588.016; Thu, 15 Mar 2018 18:08:50 +0000 From: Yongseok Koh To: =?iso-8859-1?Q?N=E9lio_Laranjeiro?= CC: "dev@dpdk.org" , Adrien Mazarguil , Shahaf Shuler , "stable@dpdk.org" Thread-Topic: [PATCH v2 2/3] net/mlx5: fix link status behavior Thread-Index: AQHTughGt7BsIUMl7EiAb98V8FXBtaPRnUKA Date: Thu, 15 Mar 2018 18:08:50 +0000 Message-ID: <4BA1D6F0-0477-46E6-8B00-B726042FE32F@mellanox.com> References: <21fb91002768a627d9c7f3d81e0c8a12fbf6811f.1518684427.git.nelio.laranjeiro@6wind.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=yskoh@mellanox.com; x-originating-ip: [209.116.155.178] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR0501MB2830; 7:WUCFhYSGAEvQjS8A1LP7aaIua0XXA7KBpQruUDSjie4iDqMHb3W1j68BiZ/kXin/m5zRCXVh5ZBnjm19bz4OitjZ0Vpt5Vvdu3slNFF/lsRzi3V7va0jm+jFcYViG7Z/ynocY+ibvQz4AlKOA72hdkxxlDByne/wQYKXqPu6TOSIUrS3uaC88ASuUnOPRf2CHE6mkkj1+AeNEgGCv2Me0gTG7Hv4Af8BSa75CEG97jzg2C9H1JZf5BE4BuBZJA/N x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 4c695af0-88b9-48d6-ca90-08d58a9fce13 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:VI1PR0501MB2830; x-ms-traffictypediagnostic: VI1PR0501MB2830: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(189930954265078)(45079756050767); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(3231221)(944501244)(52105095)(3002001)(10201501046)(6055026)(6041310)(20161123558120)(20161123560045)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:VI1PR0501MB2830; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0501MB2830; x-forefront-prvs: 0612E553B4 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(39860400002)(39380400002)(366004)(346002)(396003)(189003)(199004)(478600001)(14454004)(3846002)(83716003)(6436002)(966005)(3660700001)(2950100002)(86362001)(6916009)(575784001)(36756003)(3280700002)(2900100001)(2906002)(4326008)(5660300001)(6486002)(5250100002)(82746002)(6506007)(186003)(53936002)(7736002)(59450400001)(102836004)(53546011)(305945005)(106356001)(76176011)(6512007)(316002)(6116002)(229853002)(25786009)(97736004)(26005)(105586002)(66066001)(99286004)(54906003)(6246003)(68736007)(8936002)(45080400002)(81156014)(6306002)(33656002)(8676002)(81166006); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0501MB2830; H:VI1PR0501MB2045.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: HQwwK9grLeXF/OaFJBze2psSlLVkIVKywjBOPmw1sXf9M0NADG0VNNb08TvsfQKrkizyM0Z39uwerDFckJC7AXRB+Bu/OhFZLGR/5RvRXGngKvK8gqDYZD1jTxUmC0YQ8h9JWc1uyoPdi9npBpnYUKzdXDPSsVV4Fy1UdbeOwK1xIKLQHObtDD9ARugreo5Z7MlbsAyKWbMcyRNZgoLu6le3yWdjA7guLC+eoPQpKo2SqnwnnTT5oqtTvQxejYndVFenuRryPUpyMpimoj5076dDuaxwW73Cfbi7jOEjwRWR4qwvm3XyNbvfhUsd/A3ogM6nlPuf7q8yANYd2xLsMw== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-ID: <50224E3E07E8B74B90AE78181498C04B@eurprd05.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4c695af0-88b9-48d6-ca90-08d58a9fce13 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Mar 2018 18:08:50.1348 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0501MB2830 Subject: Re: [dpdk-stable] [PATCH v2 2/3] net/mlx5: fix link status behavior X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Mar 2018 18:08:53 -0000 > On Mar 12, 2018, at 6:43 AM, Nelio Laranjeiro wrote: >=20 > This behavior is mixed between what should be handled by the application > and what is under PMD responsibility. >=20 > According to DPDK API: > - link_update() should only query the link status [1] > - link_set_{up,down}() should only set the link to the according status [= 1] > - dev_{start,stop}() should enable/disable traffic reception/emission [2] >=20 > On this PMD, the link status is retrieved from the net device associated > owned by the Linux Kernel, it does not means that even when this interfac= e > is down, the PMD cannot send/receive traffic from the NIC those two > information are unrelated, until the physical port is active and has a > link, the PMD can receive/send traffic on the wire. >=20 > According to DPDK API, calling the rte_eth_dev_start() even when the Linu= x > interface link is down is then possible and allowed, as the traffic will > flow between the DPDK application and the Physical port. >=20 > This also means that a synchronisation between the Linux interface and th= e > DPDK application remains under the DPDK application responsibility. >=20 > To handle such synchronisation the application should behave as the > following scheme, to start: >=20 > rte_eth_get_link(port_id, &link); > if (link.link_status =3D=3D ETH_DOWN) > rte_eth_dev_set_link_up(port_id); > rte_eth_dev_start(port_id); >=20 > Taking in account the possible returned values fro each function. >=20 > and to stop: >=20 > rte_eth_dev_stop(port_id); > rte_eth_dev_set_link_down(port_id); >=20 > The application should also set the LSC interrupt callbacks to catch and > behave accordingly when the administrator set the Linux device down/up. > The same callbacks are called when the link on the medium falls/raise. >=20 > Fixes: c7bf62255edf ("net/mlx5: fix handling link status event") > Fixes: e313ef4c2fe8 ("net/mlx5: fix link state on device start") > Cc: yskoh@mellanox.com > Cc: shahafs@mellanox.com > Cc: stable@dpdk.org >=20 > [1] https://emea01.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2F= dpdk.org%2Fbrowse%2Fdpdk%2Ftree%2Flib%2Flibrte_ether%2Frte_ethdev_core.h&da= ta=3D02%7C01%7Cyskoh%40mellanox.com%7Cf3d27421af9541c0d74608d5881f67af%7Ca6= 52971c7d2e4d9ba6a4d149256f461b%7C0%7C0%7C636564590830553144&sdata=3Ddn%2BQO= q9IG2O4eYC7aSAMjvQ%2BT9rkVW%2BRo7t9RxLODTk%3D&reserved=3D0 > [2] https://emea01.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2F= dpdk.org%2Fbrowse%2Fdpdk%2Ftree%2Flib%2Flibrte_ether%2Frte_ethdev.h%23n1677= &data=3D02%7C01%7Cyskoh%40mellanox.com%7Cf3d27421af9541c0d74608d5881f67af%7= Ca652971c7d2e4d9ba6a4d149256f461b%7C0%7C0%7C636564590830553144&sdata=3D2zY%= 2F9gpIRcjz1mo4442u9uHTJPj5GVRftxHW8oVi6Ug%3D&reserved=3D0 >=20 > Signed-off-by: Nelio Laranjeiro > Acked-by: Adrien Mazarguil > --- Acked-by: Yongseok Koh =20 Thanks=