From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-eopbgr770071.outbound.protection.outlook.com [40.107.77.71]) by dpdk.org (Postfix) with ESMTP id 0B7BE5699; Tue, 12 Mar 2019 16:25:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=AQUANTIA1COM.onmicrosoft.com; s=selector1-aquantia-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/cpHjI6uoHXsoj+Y8vM6EkegxQ9MgOaR81q3imLsohc=; b=JPWoGOQ3ZYEwYdQalrT3l+pUydNUElzCx885+5Ds27o0T4KVbrrg4qEvwFkLAadVPRc5Iec/qmmn+IFIcpvYOm2qiUJSJAJBSSfJVXEJLZN+JQrLWQQkrwAWTIOW13bepai0CCL2Miwl5NoZ2wv+Ps4T1LCZU/C6uFZ9DUgu/XI= Received: from DM6PR11MB3625.namprd11.prod.outlook.com (20.178.230.149) by DM6PR11MB3068.namprd11.prod.outlook.com (20.177.218.153) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1686.19; Tue, 12 Mar 2019 15:25:04 +0000 Received: from DM6PR11MB3625.namprd11.prod.outlook.com ([fe80::d145:a1f4:ed34:e31b]) by DM6PR11MB3625.namprd11.prod.outlook.com ([fe80::d145:a1f4:ed34:e31b%3]) with mapi id 15.20.1686.021; Tue, 12 Mar 2019 15:25:04 +0000 From: Igor Russkikh To: "dev@dpdk.org" CC: Pavel Belous , Igor Russkikh , "stable@dpdk.org" Thread-Topic: [PATCH v3 07/10] net/atlantic: fix link configuration Thread-Index: AQHU2OfEXowG8t5j2U+ZL3BMTsOeLQ== Date: Tue, 12 Mar 2019 15:25:03 +0000 Message-ID: <78c4ae4e6390cc14855961faf7c8568840aad47e.1552402263.git.igor.russkikh@aquantia.com> References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HE1PR0901CA0050.eurprd09.prod.outlook.com (2603:10a6:3:45::18) To DM6PR11MB3625.namprd11.prod.outlook.com (2603:10b6:5:13a::21) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Igor.Russkikh@aquantia.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [95.79.108.179] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 2faefe88-30ba-44a3-c308-08d6a6fee651 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(2017052603328)(7153060)(7193020); SRVR:DM6PR11MB3068; x-ms-traffictypediagnostic: DM6PR11MB3068: x-microsoft-exchange-diagnostics: =?iso-8859-1?Q?1; DM6PR11MB3068; 23:w31+9t9pL9O0IbCLnmUeCfbvYlXt8o7ts5ju2bZ?= =?iso-8859-1?Q?rYe6OnC7BwodUsACtY+XHc1+u7l/AFaAQSATVO63a9t3qD0p2OpyXyJZFv?= =?iso-8859-1?Q?PDxfX2ODUmDTVkqSGs6kcdqF6ir2NDZWC1YW8pWz0wxmt+SOmtGPJNpIFG?= =?iso-8859-1?Q?q80l+GxqeTYeUtRoDv/wtAynpfYyYqvREUBZ429Yb/fkUvdh5ol4oEn0o6?= =?iso-8859-1?Q?m33cw4UIyqzBkELsmrZlNiRGJplIzRKvnSPuUqZlow+5e5TUEqzuGcV4RT?= =?iso-8859-1?Q?BiBdyg9Bft2MnZsXomb6c7/IKSMBk25uLJ12NozCX+9G7VNlWbuEQQOB+Y?= =?iso-8859-1?Q?GkDrNiqY/Y1/5DSVNwlsUQpYyiHcPJ/9HRqjPMkbtkn9tCvF+pERmS/f4L?= =?iso-8859-1?Q?2hvJlJ3HM2WtuRK+sOTydCkY3uRKAjbu3LgdaVgpLZzCzBZ/8KPOa+NMSd?= =?iso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MFnMa2iqlVGAC90H8TSZK1PhJi6Di+U4ArCmLS9fI?= =?iso-8859-1?Q?QzEbbBAc3eFSLoDaxYiqjlmt7dU/wjRTmVrf9CQ9DcL6LZGD3zut2mCQZ/?= =?iso-8859-1?Q?QG1G9g4dVNbofo=3D?= x-microsoft-antispam-prvs: x-forefront-prvs: 09749A275C x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(346002)(136003)(366004)(39850400004)(396003)(199004)(189003)(72206003)(97736004)(4326008)(14454004)(81166006)(2906002)(5660300002)(6916009)(8676002)(71200400001)(478600001)(25786009)(118296001)(71190400001)(86362001)(14444005)(256004)(1730700003)(3846002)(81156014)(36756003)(68736007)(6116002)(305945005)(54906003)(316002)(446003)(8936002)(44832011)(53936002)(5640700003)(26005)(11346002)(476003)(76176011)(66066001)(106356001)(99286004)(2616005)(105586002)(186003)(450100002)(386003)(52116002)(7736002)(6436002)(6486002)(2351001)(6506007)(2501003)(6512007)(102836004)(50226002)(486006); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR11MB3068; H:DM6PR11MB3625.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: aquantia.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: z9ZoEmAuHmMCdNDU3twxtKwDxWL8oklx5QKMpFZtO+YNApbjV97id/gLcNgaMhK5WWtlduiDlC9LxfHeReOvlxVFsbMxdkTTfqiGtotRdLxZnqhgIWij5w12Yb/MGV784BgbUcZX8U4eBG6jxGRy9yUe0fQcoOXuCyqGjBqGbxjNDyi2uQ02wCR+K01ghB8gIn/Dg8xvh6e9rTk4B4uueB7MSS8zoK2kHsG25LMacHGm+OnfLkmc+0DTpWV2PDlCk8kLP1/RldTHDQezYD7j1k0dJMlHUhuIGhgCPcPVXcRWNgCGht1XSzH1x1Ybph8PQplgffaCyK0kBUWDGh0pec5/KDqJaKwuu73CgJK2vQN7/vtLJ5BC4WdqMUbLq6ScAL+e0jo9upYcnKiMJTtTsYxoY73ZGcaN46cEeRcvtTA= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: aquantia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2faefe88-30ba-44a3-c308-08d6a6fee651 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Mar 2019 15:25:03.9198 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 83e2e134-991c-4ede-8ced-34d47e38e6b1 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3068 Subject: [dpdk-dev] [PATCH v3 07/10] net/atlantic: fix link configuration 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: Tue, 12 Mar 2019 15:25:06 -0000 In case link speed is re configured after port start, it does not takes the requested speed value, but instead just sets full autoneg mask. Cc: stable@dpdk.org Fixes: 7943ba05f67c ("net/atlantic: add link status and interrupt managemen= t") Signed-off-by: Igor Russkikh --- drivers/net/atlantic/atl_ethdev.c | 44 ++++++++++++++----------------- 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/drivers/net/atlantic/atl_ethdev.c b/drivers/net/atlantic/atl_e= thdev.c index a510646a5f7e..e43e1e724696 100644 --- a/drivers/net/atlantic/atl_ethdev.c +++ b/drivers/net/atlantic/atl_ethdev.c @@ -465,8 +465,6 @@ atl_dev_start(struct rte_eth_dev *dev) struct rte_pci_device *pci_dev =3D RTE_ETH_DEV_TO_PCI(dev); struct rte_intr_handle *intr_handle =3D &pci_dev->intr_handle; uint32_t intr_vector =3D 0; - uint32_t *link_speeds; - uint32_t speed =3D 0; int status; int err; =20 @@ -543,6 +541,8 @@ atl_dev_start(struct rte_eth_dev *dev) goto error; } =20 + err =3D atl_dev_set_link_up(dev); + err =3D hw->aq_fw_ops->update_link_status(hw); =20 if (err) @@ -550,26 +550,6 @@ atl_dev_start(struct rte_eth_dev *dev) =20 dev->data->dev_link.link_status =3D hw->aq_link_status.mbps !=3D 0; =20 - link_speeds =3D &dev->data->dev_conf.link_speeds; - - speed =3D 0x0; - - if (*link_speeds =3D=3D ETH_LINK_SPEED_AUTONEG) { - speed =3D hw->aq_nic_cfg->link_speed_msk; - } else { - if (*link_speeds & ETH_LINK_SPEED_10G) - speed |=3D AQ_NIC_RATE_10G; - if (*link_speeds & ETH_LINK_SPEED_5G) - speed |=3D AQ_NIC_RATE_5G; - if (*link_speeds & ETH_LINK_SPEED_1G) - speed |=3D AQ_NIC_RATE_1G; - if (*link_speeds & ETH_LINK_SPEED_2_5G) - speed |=3D AQ_NIC_RATE_2G5; - if (*link_speeds & ETH_LINK_SPEED_100M) - speed |=3D AQ_NIC_RATE_100M; - } - - err =3D hw->aq_fw_ops->set_link_speed(hw, speed); if (err) goto error; =20 @@ -657,9 +637,25 @@ static int atl_dev_set_link_up(struct rte_eth_dev *dev) { struct aq_hw_s *hw =3D ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private); + uint32_t link_speeds =3D dev->data->dev_conf.link_speeds; + uint32_t speed_mask =3D 0; + + if (link_speeds =3D=3D ETH_LINK_SPEED_AUTONEG) { + speed_mask =3D hw->aq_nic_cfg->link_speed_msk; + } else { + if (link_speeds & ETH_LINK_SPEED_10G) + speed_mask |=3D AQ_NIC_RATE_10G; + if (link_speeds & ETH_LINK_SPEED_5G) + speed_mask |=3D AQ_NIC_RATE_5G; + if (link_speeds & ETH_LINK_SPEED_1G) + speed_mask |=3D AQ_NIC_RATE_1G; + if (link_speeds & ETH_LINK_SPEED_2_5G) + speed_mask |=3D AQ_NIC_RATE_2G5; + if (link_speeds & ETH_LINK_SPEED_100M) + speed_mask |=3D AQ_NIC_RATE_100M; + } =20 - return hw->aq_fw_ops->set_link_speed(hw, - hw->aq_nic_cfg->link_speed_msk); + return hw->aq_fw_ops->set_link_speed(hw, speed_mask); } =20 /* --=20 2.17.1