From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM05-CO1-obe.outbound.protection.outlook.com (mail-eopbgr720060.outbound.protection.outlook.com [40.107.72.60]) by dpdk.org (Postfix) with ESMTP id AFC2B4C9F; Sat, 9 Mar 2019 15:03:37 +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=sg2ckF1YSz0JoFrGCU9j27ARXnPBYWGd8vFAXSgaKA8=; b=hH5CfAD3pAURDupuZQtTLSzdpqwaB0vrFpezkgVLTzqtmChEFpdmq1w4tudAiUwLSuCjCZ5EFPGG6BabybIUCHHSBx9TWoqK9+DkqCr7h9+9ZZUew7Xg4E+vW/jVn0qruhN611ux+pvq2T2nTdqCLrSC9LVfxSmqD0X0qjvRFcE= Received: from DM6PR11MB3625.namprd11.prod.outlook.com (20.178.230.149) by DM6PR11MB2892.namprd11.prod.outlook.com (20.177.216.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1686.18; Sat, 9 Mar 2019 14:03:36 +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.1665.020; Sat, 9 Mar 2019 14:03:36 +0000 From: Igor Russkikh To: "dev@dpdk.org" CC: Pavel Belous , Igor Russkikh , "stable@dpdk.org" Thread-Topic: [PATCH v2 07/10] net/atlantic: fix link configuration Thread-Index: AQHU1oDjcLyaSIcia0ycajnZwr+cyg== Date: Sat, 9 Mar 2019 14:03:36 +0000 Message-ID: <990e873dd65514d8b56ffc52be664cb667259f63.1552138867.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: HE1PR05CA0278.eurprd05.prod.outlook.com (2603:10a6:3:fc::30) 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: b4a1e36b-9f88-40af-abfe-08d6a49805d7 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(2017052603328)(7153060)(7193020); SRVR:DM6PR11MB2892; x-ms-traffictypediagnostic: DM6PR11MB2892: x-microsoft-exchange-diagnostics: =?iso-8859-1?Q?1; DM6PR11MB2892; 23:COBFR/zoKajre5tlxhYlxGvMaqr+C/x/ou7/LMd?= =?iso-8859-1?Q?tMxaXz4a4+qXK14krARiEoJkV9mIJqChDFYM3bO/Qy2CmcmqTqE7TE9NQW?= =?iso-8859-1?Q?crljJtvZmifeRoPqUtLXHL7yR7E12o4bXSVcJngre2cWlZ1KVZsQmZlHBS?= =?iso-8859-1?Q?c4KIRH0I70ZAm7J/HCUxXSoGzLI0EaNUyxJ09klSFuTAHPHvccZiQMmiLc?= =?iso-8859-1?Q?WYljNnEaNGCQSCtFhgFPHyeH9EXZv88/5TcSTw1Sh3bOeiq4mHmzKm6UPW?= =?iso-8859-1?Q?Mz8b+CYJHicLAZwfcJdLNRWspFb6bV7muH6eAWSp1qlNyFNQuupqq2zfld?= =?iso-8859-1?Q?Bcr7sO3JgNOAnf1JJJb7wFdSooafbN13OyitRe2vkCd357kqtaThLvflcU?= =?iso-8859-1?Q?GQMcYxul1vQQgGNdkMRBWw7wK8L2vAqPqmwRHtyCYJ1VmSsjaBnfLkZ2vR?= =?iso-8859-1?Q?oRkz/P0Zh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DXN?= =?iso-8859-1?Q?e+ZoUffWpDDfuaMK5n5jE/Aj8xhhlNWvL6Smdpqo/B2WEtd7vYBqQlDe2h?= =?iso-8859-1?Q?kUIv72ChjJiS1g=3D?= x-microsoft-antispam-prvs: x-forefront-prvs: 0971922F40 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(376002)(366004)(39850400004)(136003)(346002)(199004)(189003)(106356001)(5660300002)(6116002)(26005)(4326008)(99286004)(52116002)(2906002)(3846002)(76176011)(2351001)(105586002)(14454004)(102836004)(97736004)(476003)(68736007)(44832011)(386003)(186003)(486006)(11346002)(446003)(2616005)(6506007)(450100002)(25786009)(2501003)(86362001)(305945005)(7736002)(14444005)(72206003)(8676002)(6486002)(256004)(118296001)(316002)(8936002)(66066001)(6436002)(81156014)(1730700003)(53936002)(5640700003)(81166006)(50226002)(71190400001)(6916009)(54906003)(36756003)(71200400001)(478600001)(6512007); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR11MB2892; 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: rvMbdyFjreZQJx2tGYwPyj99Nmcba84ztp/k/kX3sqsjEWe0buQyZq2k9D2Lgqn6S8ctnqGyoepK3oJxWehFcCqqsqFmGUYBHOnBCJ2VCrjrpbfHA0L1RxMFZCm1fGnAr1lIjcTJZTqBOqLGCmdzrrGUCSqIEYlYwEu0UvK7yFeyoGZiS5zZIS+lCzCy1iupdmkt6FzPKqH2l1CcPZEUBLKk4wIUn7OI8w0DKpdFR+pXBo1KH+m21XaKbHUGKZjoM8XCx9AKVmgq2OiXFEkrR74sD8nm9+6v3aUnc/lZHcgnfRhHJFnrf2b+oojGzChAgwOkeMOVT91mysB7lFYMufbKdN4vNcB2JQW3mKPwwU/bOJoqpNO6jg2uMJGMXnTfn04LRbenJZiUQ5kzGYjlnO0lEQfGyifr6CEtCmwpx84= 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: b4a1e36b-9f88-40af-abfe-08d6a49805d7 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Mar 2019 14:03:36.3050 (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: DM6PR11MB2892 Subject: [dpdk-dev] [PATCH v2 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: Sat, 09 Mar 2019 14:03:38 -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 925f9722ec66..c869ff321bf5 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