From patchwork Mon Apr 29 08:20:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Russkikh X-Patchwork-Id: 53131 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E23D71B1F7; Mon, 29 Apr 2019 10:20:15 +0200 (CEST) Received: from NAM04-BN3-obe.outbound.protection.outlook.com (mail-eopbgr680049.outbound.protection.outlook.com [40.107.68.49]) by dpdk.org (Postfix) with ESMTP id 95AA81B1EE; Mon, 29 Apr 2019 10:20:11 +0200 (CEST) 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=bW12gxajkuG9kCEoxhLZ5Q9r98Qcf0HMmwEREbROT7I=; b=ikshGNbX0BRZBp6sQkQN6qxWALNjJvz15Q1MBEggAJjj+/WSYj0pqJJ9h0jEmmUEwkhNGEA6qh/0cgdzDRZD/EfBMo7g718uwu2W5jdqSvAs24T81UE3+YcIvSV9ijHpQVfSlstSV44zcUkDiGBab6GDGTmRmpbG62dkC1P2QhM= Received: from DM6PR11MB3625.namprd11.prod.outlook.com (20.178.230.149) by DM6PR11MB2841.namprd11.prod.outlook.com (20.176.100.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1835.13; Mon, 29 Apr 2019 08:20:10 +0000 Received: from DM6PR11MB3625.namprd11.prod.outlook.com ([fe80::f035:2c20:5a61:7653]) by DM6PR11MB3625.namprd11.prod.outlook.com ([fe80::f035:2c20:5a61:7653%3]) with mapi id 15.20.1835.010; Mon, 29 Apr 2019 08:20:10 +0000 From: Igor Russkikh To: "dev@dpdk.org" CC: Pavel Belous , Igor Russkikh , "stable@dpdk.org" Thread-Topic: [PATCH 01/11] net/atlantic: enable broadcast traffic Thread-Index: AQHU/mRchcaeyOoTWUik+NiRP76cNQ== Date: Mon, 29 Apr 2019 08:20:09 +0000 Message-ID: <4ac8d29ba31000ea77866a70845299e1c29783f7.1556525874.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: HE1P190CA0016.EURP190.PROD.OUTLOOK.COM (2603:10a6:3:bc::26) 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: e7f87656-158a-42c9-98b8-08d6cc7b7e73 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(2017052603328)(7193020); SRVR:DM6PR11MB2841; x-ms-traffictypediagnostic: DM6PR11MB2841: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:626; x-forefront-prvs: 0022134A87 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(376002)(396003)(136003)(39840400004)(346002)(199004)(189003)(44832011)(99286004)(186003)(118296001)(478600001)(71200400001)(53936002)(6506007)(71190400001)(446003)(5660300002)(2351001)(14454004)(486006)(66556008)(73956011)(66946007)(64756008)(66476007)(66446008)(386003)(52116002)(316002)(11346002)(2616005)(7736002)(476003)(4744005)(72206003)(54906003)(305945005)(81166006)(1730700003)(2501003)(36756003)(76176011)(81156014)(6486002)(3846002)(66066001)(102836004)(6916009)(97736004)(8936002)(450100002)(86362001)(6116002)(6436002)(26005)(256004)(8676002)(50226002)(2906002)(25786009)(5640700003)(6512007)(68736007)(4326008); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR11MB2841; 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: wogidMCCQrpVnM/PXUmggKxa4nCd4zYJmgnEzQz9dlxdx1yEIR/E5TTLd9mQz5OuPuXkUhWiOMHZPpb1+es3pSRNERD2jx1JwV4p9iAqCZWevDnGjHY5uz7UnDceRa2xJArIjx6l9a2ZH4vfo03p0qheOv7qmu18HCeoixpmmsEbU677qEt9L6O8/tLb+p0adDlJHfI3VUxEuahcBSekDPrfS3i6lWPwbEnksWXFJwYl1JHDvJOL6ADT804Yj1QroQCT77kKMSw2cxvxv8JYz0x/HgFYVK3ZHEVpsCXBTQvLeq+Aw7erDAtub7owUupviWhA2J0LgEZnzcMGlWbkFxPiSQuMKO6spjc9DuKa2AWYcrxuLZNKgPzUlBp9DKjgJfXm48KCsO/4HAl7LK8kXhw2L+iiRF5XpDcVUxaw+j4= MIME-Version: 1.0 X-OriginatorOrg: aquantia.com X-MS-Exchange-CrossTenant-Network-Message-Id: e7f87656-158a-42c9-98b8-08d6cc7b7e73 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Apr 2019 08:20:09.9246 (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: DM6PR11MB2841 Subject: [dpdk-dev] [PATCH 01/11] net/atlantic: enable broadcast traffic 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" Broadcast was not correctly and fully initialized Signed-off-by: Igor Russkikh Fixes: 7906661edac6 ("net/atlantic: add b0 hardware layer") cc: stable@dpdk.org --- drivers/net/atlantic/hw_atl/hw_atl_b0.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/atlantic/hw_atl/hw_atl_b0.c b/drivers/net/atlantic/hw_atl/hw_atl_b0.c index 53fd8e9f0237..e525a8581e6f 100644 --- a/drivers/net/atlantic/hw_atl/hw_atl_b0.c +++ b/drivers/net/atlantic/hw_atl/hw_atl_b0.c @@ -286,6 +286,8 @@ int hw_atl_b0_hw_init_rx_path(struct aq_hw_s *self) hw_atl_rpfl2broadcast_flr_act_set(self, 1U); hw_atl_rpfl2broadcast_count_threshold_set(self, 0xFFFFU & (~0U / 256U)); + hw_atl_rpfl2broadcast_en_set(self, 1U); + hw_atl_rdm_rx_dca_en_set(self, 0U); hw_atl_rdm_rx_dca_mode_set(self, 0U); From patchwork Mon Apr 29 08:20:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Russkikh X-Patchwork-Id: 53132 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E1F231B20E; Mon, 29 Apr 2019 10:20:18 +0200 (CEST) Received: from NAM04-BN3-obe.outbound.protection.outlook.com (mail-eopbgr680072.outbound.protection.outlook.com [40.107.68.72]) by dpdk.org (Postfix) with ESMTP id 09F6E1B1F4 for ; Mon, 29 Apr 2019 10:20:13 +0200 (CEST) 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=8WOYtcDUr2acRkJfo53GDIwQvK7Vz1wr7mxWXcrXxVU=; b=Npt0FLPW6Ggg5MkUhcd7SJ3/ryJYKQd7JgxMQuIRIhmCqKkOV87yOOzSupqNeGNKtwUZ1XZGb5eJ+9QrYGiPUUlY+3oWLpIfqGtaPuC8kOp7efXSf9DDLxZGupjcc7b/J4dJNxGeCGkJsCGWOyRRPjYaYxYfm0Vrjie+EezV1Ec= Received: from DM6PR11MB3625.namprd11.prod.outlook.com (20.178.230.149) by DM6PR11MB2841.namprd11.prod.outlook.com (20.176.100.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1835.13; Mon, 29 Apr 2019 08:20:12 +0000 Received: from DM6PR11MB3625.namprd11.prod.outlook.com ([fe80::f035:2c20:5a61:7653]) by DM6PR11MB3625.namprd11.prod.outlook.com ([fe80::f035:2c20:5a61:7653%3]) with mapi id 15.20.1835.010; Mon, 29 Apr 2019 08:20:12 +0000 From: Igor Russkikh To: "dev@dpdk.org" CC: Pavel Belous , Igor Russkikh Thread-Topic: [PATCH 02/11] net/atlantic: extra line at eof Thread-Index: AQHU/mRdDpE2BDGgB0GIpg7ZgIbC1w== Date: Mon, 29 Apr 2019 08:20:11 +0000 Message-ID: <030adb8131d52bfcf9a9f3e591050450c2fed17f.1556525874.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: HE1P190CA0016.EURP190.PROD.OUTLOOK.COM (2603:10a6:3:bc::26) 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: d97680c3-75eb-42e8-f06f-08d6cc7b7f96 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(2017052603328)(7193020); SRVR:DM6PR11MB2841; x-ms-traffictypediagnostic: DM6PR11MB2841: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:454; x-forefront-prvs: 0022134A87 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(376002)(396003)(136003)(39840400004)(346002)(199004)(189003)(44832011)(99286004)(186003)(118296001)(478600001)(71200400001)(53936002)(6506007)(71190400001)(446003)(5660300002)(2351001)(14454004)(14444005)(486006)(66556008)(73956011)(66946007)(64756008)(66476007)(66446008)(386003)(52116002)(316002)(11346002)(2616005)(7736002)(476003)(4744005)(72206003)(54906003)(305945005)(107886003)(81166006)(1730700003)(2501003)(36756003)(76176011)(81156014)(6486002)(3846002)(66066001)(102836004)(6916009)(97736004)(8936002)(86362001)(6116002)(6436002)(26005)(256004)(8676002)(50226002)(2906002)(25786009)(5640700003)(6512007)(68736007)(4326008); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR11MB2841; 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: oN5zeNR20aAdVenkUBL8ZM9xhdyEu5YUksHo6pboEcE5Qo8gsCCy95QN4hP7jVSh04IC5BvcOk/Gbg/k1KEpNEzluLsRGeoZ1AXYHTKPJC8FmoqulzdJoXtEgjTX/dr36H+GUEOp436yo9eXXv9jjaOVMbYRIB/NNzD0vjihKCRVhIYfMihL/H7ERjw4HfFByczRfLQLyXAm/z/xho/KVcWCxqy43Sz7Ttw00NoI6XOFrdicl8aA9q+cjR2Ag3HSiaslpT2JZ4nEq6obhO158vMW3DkYppWcLguS67ffzBpKCgUV6wKhQh9NfwGN2HsRZaB3lWVrGgNz17b45yVaemEWqZTTdcgzJQw+VAuKwUrQQIYkOT5GQroQsy8TwOOZ/TGqYoNwTTzYuAKmgWFJEe0SU2HD0w4YI/nioaFPt9s= MIME-Version: 1.0 X-OriginatorOrg: aquantia.com X-MS-Exchange-CrossTenant-Network-Message-Id: d97680c3-75eb-42e8-f06f-08d6cc7b7f96 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Apr 2019 08:20:11.7809 (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: DM6PR11MB2841 Subject: [dpdk-dev] [PATCH 02/11] net/atlantic: extra line at eof 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" Remove extra empty line at EOF Signed-off-by: Igor Russkikh --- drivers/net/atlantic/atl_rxtx.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/atlantic/atl_rxtx.c b/drivers/net/atlantic/atl_rxtx.c index f1519594adad..fe0077044097 100644 --- a/drivers/net/atlantic/atl_rxtx.c +++ b/drivers/net/atlantic/atl_rxtx.c @@ -1348,4 +1348,3 @@ atl_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) return nb_tx; } - From patchwork Mon Apr 29 08:20:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Russkikh X-Patchwork-Id: 53133 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B8BC91B216; Mon, 29 Apr 2019 10:20:21 +0200 (CEST) Received: from NAM04-BN3-obe.outbound.protection.outlook.com (mail-eopbgr680047.outbound.protection.outlook.com [40.107.68.47]) by dpdk.org (Postfix) with ESMTP id D30581B1F4 for ; Mon, 29 Apr 2019 10:20:14 +0200 (CEST) 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=drCXk3StvJnGM5j9E5DDKOVpC7MQLtOAZgjPWq9vLXU=; b=fy7q4u1LD0ImG4I537BO11X2RoZ0Qp1YcEhXanSlj4d7hkYmfTjtTCwnqMFDKZtl0c1QhDVz6jlUbinm6PE3bgTfdXzOnxgLJM4gsmD+hAZu8SMF9ckb3x2wFPGnJJGYpYpqPBlAy+1mlcNPwsg+ZvVxQY3N9FGK7qvtT9pi+nk= Received: from DM6PR11MB3625.namprd11.prod.outlook.com (20.178.230.149) by DM6PR11MB2841.namprd11.prod.outlook.com (20.176.100.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1835.13; Mon, 29 Apr 2019 08:20:13 +0000 Received: from DM6PR11MB3625.namprd11.prod.outlook.com ([fe80::f035:2c20:5a61:7653]) by DM6PR11MB3625.namprd11.prod.outlook.com ([fe80::f035:2c20:5a61:7653%3]) with mapi id 15.20.1835.010; Mon, 29 Apr 2019 08:20:13 +0000 From: Igor Russkikh To: "dev@dpdk.org" CC: Pavel Belous , Igor Russkikh Thread-Topic: [PATCH 03/11] net/atlantic: bad indentation Thread-Index: AQHU/mRe3nsKPuW4OkGYZ0xTxB3CyQ== Date: Mon, 29 Apr 2019 08:20:13 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HE1P190CA0016.EURP190.PROD.OUTLOOK.COM (2603:10a6:3:bc::26) 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: 5c796c58-3157-471b-84bf-08d6cc7b80b9 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(2017052603328)(7193020); SRVR:DM6PR11MB2841; x-ms-traffictypediagnostic: DM6PR11MB2841: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:346; x-forefront-prvs: 0022134A87 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(376002)(396003)(136003)(39840400004)(346002)(199004)(189003)(44832011)(99286004)(186003)(118296001)(478600001)(71200400001)(53936002)(6506007)(71190400001)(446003)(5660300002)(2351001)(14454004)(486006)(66556008)(73956011)(66946007)(64756008)(66476007)(66446008)(386003)(52116002)(316002)(11346002)(2616005)(7736002)(476003)(4744005)(72206003)(54906003)(305945005)(107886003)(81166006)(1730700003)(2501003)(36756003)(76176011)(81156014)(6486002)(3846002)(66066001)(102836004)(6916009)(97736004)(8936002)(86362001)(6116002)(6436002)(26005)(256004)(8676002)(50226002)(2906002)(25786009)(5640700003)(6512007)(68736007)(4326008); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR11MB2841; 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: 35XyVE78u1e50Frq/JAO13z9APR4X/3zlb4CEZq6NDRh/WYAVsBi2Qupxdxu8uO75hlesF9Y+hOXD3hqBtoNsStp+/RWbxkUrVt2fo4Dz+VDCnuXYKihJxU3kzeKlC10Ow7tzTinCoBDtqefcwueFRhuV7CRKG+N1dAT5EtPZDXab2wY8XDYg8Hr03sLVseKwCu3WzyiaKno6AWqxDZb17sPu7YOWtq7G3SXlA6qGmyihwnNV6PtjHoB92TUcf4Tg7fJVKxHqP6GD+0PuSEDLz5TQIiNEBbCa6QhdtWDCjkx/ntBGXW612UoZWkh7IAFQj3XmG3g1hiLPHku8XIufclFjoHNwNwXwpeYUMD9lFaqy+ewr9zyxDtB2cKx7gq5IFB3YQFkopggfJTom+1atYiAC1TqPpJU8dp1py0yG6k= MIME-Version: 1.0 X-OriginatorOrg: aquantia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5c796c58-3157-471b-84bf-08d6cc7b80b9 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Apr 2019 08:20:13.6832 (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: DM6PR11MB2841 Subject: [dpdk-dev] [PATCH 03/11] net/atlantic: bad indentation 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" Make indentation correct. No functional impact. Signed-off-by: Igor Russkikh --- drivers/net/atlantic/hw_atl/hw_atl_utils.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/atlantic/hw_atl/hw_atl_utils.c b/drivers/net/atlantic/hw_atl/hw_atl_utils.c index 4299b7016e2f..1910bd4c94a2 100644 --- a/drivers/net/atlantic/hw_atl/hw_atl_utils.c +++ b/drivers/net/atlantic/hw_atl/hw_atl_utils.c @@ -305,10 +305,10 @@ int hw_atl_utils_fw_downld_dwords(struct aq_hw_s *self, u32 a, AQ_HW_WAIT_FOR(!(0x100 & aq_hw_read_reg(self, HW_ATL_MIF_CMD)), 1, 1000U); - if (err) { - err = -ETIMEDOUT; - goto err_exit; - } + if (err) { + err = -ETIMEDOUT; + goto err_exit; + } *(p++) = aq_hw_read_reg(self, HW_ATL_MIF_VAL); a += 4; From patchwork Mon Apr 29 08:20:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Russkikh X-Patchwork-Id: 53134 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9CC471B276; Mon, 29 Apr 2019 10:20:24 +0200 (CEST) Received: from NAM04-BN3-obe.outbound.protection.outlook.com (mail-eopbgr680081.outbound.protection.outlook.com [40.107.68.81]) by dpdk.org (Postfix) with ESMTP id 2986E1B206; Mon, 29 Apr 2019 10:20:17 +0200 (CEST) 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=yTKIb7WX2dRRVZ+duHYMarHFcyErfsWz4VRZsroPoVs=; b=kz1dXyW2DWLjJX1mdIpIWHoRRbNwxzForTObweBwsTx85PWB9hqF1PTKOEIsVejVzG9BGsocyWZFfH+X4YNhtxz3YPCaMUhH+aoAbJ/2qkPkJ8A+jZS+bvl2Ta7Hy/HSwORkJmlsWHikVmE5PTFSIVlUnnx7nzlHXrgfopX5CBw= Received: from DM6PR11MB3625.namprd11.prod.outlook.com (20.178.230.149) by DM6PR11MB2841.namprd11.prod.outlook.com (20.176.100.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1835.13; Mon, 29 Apr 2019 08:20:16 +0000 Received: from DM6PR11MB3625.namprd11.prod.outlook.com ([fe80::f035:2c20:5a61:7653]) by DM6PR11MB3625.namprd11.prod.outlook.com ([fe80::f035:2c20:5a61:7653%3]) with mapi id 15.20.1835.010; Mon, 29 Apr 2019 08:20:15 +0000 From: Igor Russkikh To: "dev@dpdk.org" CC: Pavel Belous , Igor Russkikh , "stable@dpdk.org" Thread-Topic: [PATCH 04/11] net/atlantic: eeprom get/set should consider offset Thread-Index: AQHU/mRfs2t+UBKUo0OqSueAV2G1dw== Date: Mon, 29 Apr 2019 08:20:15 +0000 Message-ID: <8daab002f486a50a0ad1aa02cd39513c732c94b8.1556525874.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: HE1P190CA0016.EURP190.PROD.OUTLOOK.COM (2603:10a6:3:bc::26) 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: 08567be1-4aa2-4858-aaae-08d6cc7b81f6 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(2017052603328)(7193020); SRVR:DM6PR11MB2841; x-ms-traffictypediagnostic: DM6PR11MB2841: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:221; x-forefront-prvs: 0022134A87 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(376002)(396003)(136003)(39840400004)(346002)(199004)(189003)(44832011)(99286004)(186003)(118296001)(478600001)(71200400001)(53936002)(6506007)(71190400001)(446003)(5660300002)(2351001)(14454004)(14444005)(486006)(66556008)(73956011)(66946007)(64756008)(66476007)(66446008)(386003)(52116002)(316002)(11346002)(2616005)(7736002)(476003)(72206003)(54906003)(305945005)(81166006)(1730700003)(2501003)(36756003)(76176011)(81156014)(6486002)(3846002)(66066001)(102836004)(6916009)(97736004)(8936002)(450100002)(86362001)(6116002)(6436002)(26005)(256004)(8676002)(50226002)(2906002)(25786009)(5640700003)(6512007)(68736007)(4326008); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR11MB2841; 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: dUcrxUl827IY22xFcgFKtsnPyxpIdXqiziQcDmALFKHmrvRhk6pFrNTGQjstY7DdCVfMwcOVFR5JpG5Jv6sNggDllJIzhTCYbD73bTbDH9t8siQ2E9/H0h+P6Dn9iR5vbYi+XfY5dBhXbduxoo0iJL16bL1i7DS7hCKtZzpl7TRbwzEwx5JcpTL8UgsnIGUhhZ1IYdx2skeIvZS4GO+WsivM3APpDTzwIyVFarHqxg9cMKkmBG/uf0oZcj0tOAQhQfvtXi8cIa9Lf2IHatlOAjrTcxR7X0mD0ocnIbYNDeYcyyLVkbPmMyiBpygt6YpcaNZYrtiWl1OtjE29uUYWZ2pKhWjFF5t0XHKqFjzz2T5LqVB1dd25PY4jvg10rV3EcbX5dYkL8gM7dD+AMTgWL2u5By65iRSwbfq6O4FPDe4= MIME-Version: 1.0 X-OriginatorOrg: aquantia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 08567be1-4aa2-4858-aaae-08d6cc7b81f6 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Apr 2019 08:20:15.7026 (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: DM6PR11MB2841 Subject: [dpdk-dev] [PATCH 04/11] net/atlantic: eeprom get/set should consider offset 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" From: Pavel Belous EEPROM get/set offset logic should take offset into account. Data transfers to/from FW should also correctly use dword based transfer interface, taking into account the remainder. We also check error code returned from FW. cc: stable@dpdk.org Fixes: ce4e8d418097 ("net/atlantic: implement EEPROM get/set") Signed-off-by: Igor Russkikh Signed-off-by: Pavel Belous --- drivers/net/atlantic/atl_ethdev.c | 7 +- drivers/net/atlantic/atl_types.h | 2 +- drivers/net/atlantic/hw_atl/hw_atl_utils.h | 11 +-- .../net/atlantic/hw_atl/hw_atl_utils_fw2x.c | 95 ++++++++++++------- 4 files changed, 68 insertions(+), 47 deletions(-) diff --git a/drivers/net/atlantic/atl_ethdev.c b/drivers/net/atlantic/atl_ethdev.c index 4e6124aa318e..7be97ab3095e 100644 --- a/drivers/net/atlantic/atl_ethdev.c +++ b/drivers/net/atlantic/atl_ethdev.c @@ -1448,14 +1448,15 @@ int atl_dev_set_eeprom(struct rte_eth_dev *dev, if (hw->aq_fw_ops->set_eeprom == NULL) return -ENOTSUP; - if (eeprom->length != SFP_EEPROM_SIZE || eeprom->data == NULL) + if (eeprom->length + eeprom->offset > SFP_EEPROM_SIZE || + eeprom->data == NULL) return -EINVAL; if (eeprom->magic) dev_addr = eeprom->magic; - return hw->aq_fw_ops->set_eeprom(hw, dev_addr, - eeprom->data, eeprom->length); + return hw->aq_fw_ops->set_eeprom(hw, dev_addr, eeprom->data, + eeprom->length, eeprom->offset); } static int diff --git a/drivers/net/atlantic/atl_types.h b/drivers/net/atlantic/atl_types.h index dbaf2c635f50..84a4776951db 100644 --- a/drivers/net/atlantic/atl_types.h +++ b/drivers/net/atlantic/atl_types.h @@ -177,7 +177,7 @@ struct aq_fw_ops { u32 *data, u32 len, u32 offset); int (*set_eeprom)(struct aq_hw_s *self, int dev_addr, - u32 *data, u32 len); + u32 *data, u32 len, u32 offset); int (*send_macsec_req)(struct aq_hw_s *self, struct macsec_msg_fw_request *req, diff --git a/drivers/net/atlantic/hw_atl/hw_atl_utils.h b/drivers/net/atlantic/hw_atl/hw_atl_utils.h index b7c531573623..81caffaedfd0 100644 --- a/drivers/net/atlantic/hw_atl/hw_atl_utils.h +++ b/drivers/net/atlantic/hw_atl/hw_atl_utils.h @@ -337,15 +337,8 @@ struct offload_info { u8 buf[0]; } __attribute__((__packed__)); -struct smbus_read_request { - u32 offset; /* not used */ - u32 device_id; - u32 address; - u32 length; -} __attribute__((__packed__)); - -struct smbus_write_request { - u32 offset; /* not used */ +struct smbus_request { + u32 msg_id; /* not used */ u32 device_id; u32 address; u32 length; diff --git a/drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c b/drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c index 89a3759b89b4..de4189441fad 100644 --- a/drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c +++ b/drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c @@ -498,14 +498,17 @@ static int aq_fw2x_led_control(struct aq_hw_s *self, u32 mode) static int aq_fw2x_get_eeprom(struct aq_hw_s *self, int dev_addr, u32 *data, u32 len, u32 offset) { - int err = 0; - struct smbus_read_request request; - u32 mpi_opts; + u32 bytes_remains = len % sizeof(u32); + u32 num_dwords = len / sizeof(u32); + struct smbus_request request; u32 result = 0; + u32 mpi_opts; + int err = 0; if (self->fw_ver_actual < HW_ATL_FW_FEATURE_EEPROM) return -EOPNOTSUPP; + request.msg_id = 0; request.device_id = dev_addr; request.address = offset; request.length = len; @@ -540,34 +543,33 @@ static int aq_fw2x_get_eeprom(struct aq_hw_s *self, int dev_addr, if (err < 0) return err; - if (result == 0) { - u32 num_dwords = len / sizeof(u32); - u32 bytes_remains = len % sizeof(u32); + if (result) + return -EIO; - if (num_dwords) { - err = hw_atl_utils_fw_downld_dwords(self, - self->rpc_addr + sizeof(u32) * 2, - data, - num_dwords); + if (num_dwords) { + err = hw_atl_utils_fw_downld_dwords(self, + self->rpc_addr + sizeof(u32) * 2, + data, + num_dwords); - if (err < 0) - return err; - } + if (err < 0) + return err; + } - if (bytes_remains) { - u32 val = 0; + if (bytes_remains) { + u32 val = 0; - err = hw_atl_utils_fw_downld_dwords(self, - self->rpc_addr + sizeof(u32) * 2 + num_dwords, - &val, - sizeof(u32)); + err = hw_atl_utils_fw_downld_dwords(self, + self->rpc_addr + (sizeof(u32) * 2) + + (num_dwords * sizeof(u32)), + &val, + 1); - if (err < 0) - return err; + if (err < 0) + return err; - rte_memcpy((u8 *)data + len - bytes_remains, - &val, bytes_remains); - } + rte_memcpy((u8 *)data + len - bytes_remains, + &val, bytes_remains); } return 0; @@ -575,17 +577,18 @@ static int aq_fw2x_get_eeprom(struct aq_hw_s *self, int dev_addr, static int aq_fw2x_set_eeprom(struct aq_hw_s *self, int dev_addr, - u32 *data, u32 len) + u32 *data, u32 len, u32 offset) { - struct smbus_write_request request; + struct smbus_request request; u32 mpi_opts, result = 0; int err = 0; if (self->fw_ver_actual < HW_ATL_FW_FEATURE_EEPROM) return -EOPNOTSUPP; + request.msg_id = 0; request.device_id = dev_addr; - request.address = 0; + request.address = offset; request.length = len; /* Write SMBUS request to cfg memory */ @@ -597,13 +600,34 @@ static int aq_fw2x_set_eeprom(struct aq_hw_s *self, int dev_addr, return err; /* Write SMBUS data to cfg memory */ - err = hw_atl_utils_fw_upload_dwords(self, - self->rpc_addr + sizeof(request), - (u32 *)(void *)data, - RTE_ALIGN(len, sizeof(u32))); + u32 num_dwords = len / sizeof(u32); + u32 bytes_remains = len % sizeof(u32); - if (err < 0) - return err; + if (num_dwords) { + err = hw_atl_utils_fw_upload_dwords(self, + self->rpc_addr + sizeof(request), + (u32 *)(void *)data, + num_dwords); + + if (err < 0) + return err; + } + + if (bytes_remains) { + u32 val = 0; + + rte_memcpy(&val, (u8 *)data + (sizeof(u32) * num_dwords), + bytes_remains); + + err = hw_atl_utils_fw_upload_dwords(self, + self->rpc_addr + sizeof(request) + + (num_dwords * sizeof(u32)), + &val, + 1); + + if (err < 0) + return err; + } /* Toggle 0x368.CAPS_LO_SMBUS_WRITE bit */ mpi_opts = aq_hw_read_reg(self, HW_ATL_FW2X_MPI_CONTROL_ADDR); @@ -627,6 +651,9 @@ static int aq_fw2x_set_eeprom(struct aq_hw_s *self, int dev_addr, if (err < 0) return err; + if (result) + return -EIO; + return 0; } From patchwork Mon Apr 29 08:20:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Russkikh X-Patchwork-Id: 53135 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DC28F1B399; Mon, 29 Apr 2019 10:20:31 +0200 (CEST) Received: from NAM04-BN3-obe.outbound.protection.outlook.com (mail-eopbgr680075.outbound.protection.outlook.com [40.107.68.75]) by dpdk.org (Postfix) with ESMTP id DF3051B20D; Mon, 29 Apr 2019 10:20:18 +0200 (CEST) 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=RBan/evbZhSIt/2jVqNP2AhqpEkqjNJxbnBw6ekoENU=; b=SSRMBUaBZw3t+BLUFKLkqis0FSmD/OrHrfCC5qBHDR8Vvm0SKDL0n/9K7Ch4b4twz9YMvJGGbO6eL1prsvEs+i6d0fFEkqqYNx37j2fgbCll+VWWHkTOZyA1YS1YkKk7jqyH2g6+LYzml+hU098ZFQumbgOFjQiMgfBAY2l/mx8= Received: from DM6PR11MB3625.namprd11.prod.outlook.com (20.178.230.149) by DM6PR11MB2841.namprd11.prod.outlook.com (20.176.100.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1835.13; Mon, 29 Apr 2019 08:20:17 +0000 Received: from DM6PR11MB3625.namprd11.prod.outlook.com ([fe80::f035:2c20:5a61:7653]) by DM6PR11MB3625.namprd11.prod.outlook.com ([fe80::f035:2c20:5a61:7653%3]) with mapi id 15.20.1835.010; Mon, 29 Apr 2019 08:20:17 +0000 From: Igor Russkikh To: "dev@dpdk.org" CC: Pavel Belous , Igor Russkikh , "stable@dpdk.org" Thread-Topic: [PATCH 05/11] net/atlantic: fix max eeprom size Thread-Index: AQHU/mRgXKbSDfaoB0ufoXHmpqnMMQ== Date: Mon, 29 Apr 2019 08:20:17 +0000 Message-ID: <8e68fd777409b63685af2a8c79bd60e166e0bf2b.1556525874.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: HE1P190CA0016.EURP190.PROD.OUTLOOK.COM (2603:10a6:3:bc::26) 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: 16109f31-df5a-40e2-0adb-08d6cc7b832a x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(2017052603328)(7193020); SRVR:DM6PR11MB2841; x-ms-traffictypediagnostic: DM6PR11MB2841: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1728; x-forefront-prvs: 0022134A87 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(376002)(396003)(136003)(39840400004)(346002)(199004)(189003)(44832011)(99286004)(186003)(118296001)(478600001)(71200400001)(53936002)(6506007)(71190400001)(446003)(5660300002)(2351001)(14454004)(14444005)(486006)(66556008)(73956011)(66946007)(64756008)(66476007)(66446008)(386003)(52116002)(316002)(11346002)(2616005)(7736002)(476003)(72206003)(54906003)(305945005)(81166006)(1730700003)(2501003)(36756003)(76176011)(81156014)(6486002)(3846002)(66066001)(102836004)(6916009)(97736004)(8936002)(450100002)(86362001)(6116002)(6436002)(26005)(256004)(8676002)(50226002)(2906002)(25786009)(5640700003)(6512007)(68736007)(4326008); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR11MB2841; 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: IZoH6Cg4KyUKJDHgPUAZfLRY5VXdtWxMmpELwwGkd5m9R49FeOq8A7m+RMLz2s805eQsZqAyJxT8zdYpGaChmQpwhUHX0NppQtriwMNrxuWOGnmRoARQprwDh+T0ePKUhCit4pKYdlm/tCX/+u1DRw9ZEgQRBAC4pqfacIoelSquRQTdmAiuoaEISDVY7Xn96Rs6RZsMUK7MIokakLq0sHDFdTcgk+jRz4fpH083jzpxgIt2wcHr92m/4441orwVY6q99qbRGi8vYgwXMFm+tEQ78I6HiTwmX2jXXU+EtRFLWU90XBsGWgKOyAXXK6NuODWIEZaOvivtII2D4a9X8oqaBlcBrNvrHp0hq7HQ30wyzIM9zp1s1ra1pOWsQODjNYspYGR4/2vMn3BhV6+jNutxUZ1g693XL42Ys1FtHrg= MIME-Version: 1.0 X-OriginatorOrg: aquantia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 16109f31-df5a-40e2-0adb-08d6cc7b832a X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Apr 2019 08:20:17.6870 (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: DM6PR11MB2841 Subject: [dpdk-dev] [PATCH 05/11] net/atlantic: fix max eeprom size 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" Maximum size should be 256 bytes. Move declaration to the top of the file Fixes: ce4e8d418097 ("net/atlantic: implement EEPROM get/set") Signed-off-by: Igor Russkikh Signed-off-by: Pavel Belous cc: stable@dpdk.org --- drivers/net/atlantic/atl_ethdev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/atlantic/atl_ethdev.c b/drivers/net/atlantic/atl_ethdev.c index 7be97ab3095e..8a177ea5b4a3 100644 --- a/drivers/net/atlantic/atl_ethdev.c +++ b/drivers/net/atlantic/atl_ethdev.c @@ -179,6 +179,8 @@ static struct rte_pci_driver rte_atl_pmd = { | DEV_TX_OFFLOAD_MACSEC_INSERT \ | DEV_TX_OFFLOAD_MULTI_SEGS) +#define SFP_EEPROM_SIZE 0x100 + static const struct rte_eth_desc_lim rx_desc_lim = { .nb_max = ATL_MAX_RING_DESC, .nb_min = ATL_MIN_RING_DESC, @@ -1411,7 +1413,6 @@ atl_dev_interrupt_handler(void *param) atl_dev_interrupt_action(dev, dev->intr_handle); } -#define SFP_EEPROM_SIZE 0xff static int atl_dev_get_eeprom_length(struct rte_eth_dev *dev __rte_unused) From patchwork Mon Apr 29 08:20:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Russkikh X-Patchwork-Id: 53136 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7DA321B2AE; Mon, 29 Apr 2019 10:20:38 +0200 (CEST) Received: from NAM04-BN3-obe.outbound.protection.outlook.com (mail-eopbgr680051.outbound.protection.outlook.com [40.107.68.51]) by dpdk.org (Postfix) with ESMTP id C26781B215 for ; Mon, 29 Apr 2019 10:20:20 +0200 (CEST) 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=vKZxZ+Sb/wU/zm04tiReKbDS1cO1Ln1+cggCnxs9tu0=; b=RNdlyro2PX+tbi+3f+716wNh77T/Hx/OpdZBLmIQXGXcFuTcwcraQhcfG/tBSjBhwmF3oMxEDmhvyC7lLyyGXEVFSCNr2lMmFI3aTG3ByuQnyDQl1ur4kCPTw0xCaJkQFusVohJ/uw42Nfzu93npnuWIrnsdZ8cziDAerJzOd44= Received: from DM6PR11MB3625.namprd11.prod.outlook.com (20.178.230.149) by DM6PR11MB2841.namprd11.prod.outlook.com (20.176.100.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1835.13; Mon, 29 Apr 2019 08:20:19 +0000 Received: from DM6PR11MB3625.namprd11.prod.outlook.com ([fe80::f035:2c20:5a61:7653]) by DM6PR11MB3625.namprd11.prod.outlook.com ([fe80::f035:2c20:5a61:7653%3]) with mapi id 15.20.1835.010; Mon, 29 Apr 2019 08:20:19 +0000 From: Igor Russkikh To: "dev@dpdk.org" CC: Pavel Belous , Igor Russkikh Thread-Topic: [PATCH 06/11] net/atlantic: validity check for eeprom dev address Thread-Index: AQHU/mRi4DumC20w90OofJVMLxRung== Date: Mon, 29 Apr 2019 08:20:19 +0000 Message-ID: <5fe871b21ba5c4c75e8384d71cd5effbfccb8ddf.1556525874.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: HE1P190CA0016.EURP190.PROD.OUTLOOK.COM (2603:10a6:3:bc::26) 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: a0a3aa13-c42c-490e-65d4-08d6cc7b8437 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(2017052603328)(7193020); SRVR:DM6PR11MB2841; x-ms-traffictypediagnostic: DM6PR11MB2841: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2043; x-forefront-prvs: 0022134A87 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(376002)(396003)(136003)(39840400004)(346002)(199004)(189003)(44832011)(99286004)(186003)(118296001)(478600001)(71200400001)(53936002)(6506007)(71190400001)(446003)(5660300002)(2351001)(14454004)(14444005)(486006)(66556008)(73956011)(66946007)(64756008)(66476007)(66446008)(386003)(52116002)(316002)(11346002)(2616005)(7736002)(476003)(4744005)(72206003)(54906003)(305945005)(107886003)(81166006)(1730700003)(2501003)(36756003)(76176011)(81156014)(6486002)(3846002)(66066001)(102836004)(6916009)(97736004)(8936002)(86362001)(6116002)(6436002)(26005)(256004)(8676002)(50226002)(2906002)(25786009)(5640700003)(6512007)(68736007)(4326008); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR11MB2841; 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: FBbBWoHn2wCTmV2ilp39ukJcbB42ihRI14hm8llTNeDvxSY0nBPuurxWemHZ7bqcTh2AeedCK9DXkQwqgciA7KPxCm2AGNfiTxTRpsjJbbW+JlV/jrb+a6oXJlS09000SYImemH9nvHFMPuYlebzy3DfBanWPEC9hZToFVvz45WghW1ZJB2lgnhRpLmRiC5txvH5HRkiYCVq0ZHZsUgxXtgBMaeaMwfzxWjD4ekSCOCiU34LZL4ymJ7+DuTfaiMShTsra2ZD5Be3JIRPM1Wo/GKW81nwlrQGLZJEZ8xC1h4Pkg0MrCnLfk8PWXVWM7mbyLMLjSsoqcJ1U9rcLHFtxTtJe0AdH9RFWglQMBU/aL3yzO5a9TKFUcWZKCAGdxS7mHmDtCycUtVcBBu/lUrz+6K2GtwomZTTIwefdltiSkg= MIME-Version: 1.0 X-OriginatorOrg: aquantia.com X-MS-Exchange-CrossTenant-Network-Message-Id: a0a3aa13-c42c-490e-65d4-08d6cc7b8437 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Apr 2019 08:20:19.5664 (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: DM6PR11MB2841 Subject: [dpdk-dev] [PATCH 06/11] net/atlantic: validity check for eeprom dev address 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" Clients may not fillin magic field, thus causing garbage to be passed as a device addr. Limit that to maximum SMbus address. Signed-off-by: Igor Russkikh --- drivers/net/atlantic/atl_ethdev.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/atlantic/atl_ethdev.c b/drivers/net/atlantic/atl_ethdev.c index 8a177ea5b4a3..485ef159eb05 100644 --- a/drivers/net/atlantic/atl_ethdev.c +++ b/drivers/net/atlantic/atl_ethdev.c @@ -1433,6 +1433,9 @@ int atl_dev_get_eeprom(struct rte_eth_dev *dev, eeprom->data == NULL) return -EINVAL; + if (eeprom->magic > 0x7F) + return -EINVAL; + if (eeprom->magic) dev_addr = eeprom->magic; @@ -1453,6 +1456,9 @@ int atl_dev_set_eeprom(struct rte_eth_dev *dev, eeprom->data == NULL) return -EINVAL; + if (eeprom->magic > 0x7F) + return -EINVAL; + if (eeprom->magic) dev_addr = eeprom->magic; From patchwork Mon Apr 29 08:20:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Russkikh X-Patchwork-Id: 53137 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B69691B3A4; Mon, 29 Apr 2019 10:20:40 +0200 (CEST) Received: from NAM04-BN3-obe.outbound.protection.outlook.com (mail-eopbgr680081.outbound.protection.outlook.com [40.107.68.81]) by dpdk.org (Postfix) with ESMTP id B27A51B273; Mon, 29 Apr 2019 10:20:22 +0200 (CEST) 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=cbuRQgMqMo57CFzkELeh9zOt5zK5OccZobt3I4yUd78=; b=rXBz6lDnziQNJjOecuh3ghE/WIdpiIX4sBBH21HinB7M8o13aY1p4P5olL+ukzCmtNm/oQuFRCFzYO3vrcT4uLYGU/v4DtDqs3PiVzLhMLIPCMFeGjKwkaJVQk/tRNy/nfSUbt53syAqDZZAWkozBdzFBOKIONHLUFYoCJ97StE= Received: from DM6PR11MB3625.namprd11.prod.outlook.com (20.178.230.149) by DM6PR11MB2841.namprd11.prod.outlook.com (20.176.100.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1835.13; Mon, 29 Apr 2019 08:20:21 +0000 Received: from DM6PR11MB3625.namprd11.prod.outlook.com ([fe80::f035:2c20:5a61:7653]) by DM6PR11MB3625.namprd11.prod.outlook.com ([fe80::f035:2c20:5a61:7653%3]) with mapi id 15.20.1835.010; Mon, 29 Apr 2019 08:20:21 +0000 From: Igor Russkikh To: "dev@dpdk.org" CC: Pavel Belous , Igor Russkikh , "stable@dpdk.org" Thread-Topic: [PATCH 07/11] net/atlantic: bad logic with offsets talking with firmware Thread-Index: AQHU/mRjziGBtbIgZk69qR8VDf9LjQ== Date: Mon, 29 Apr 2019 08:20:21 +0000 Message-ID: <64f16386ccec77553d782d82164b3ffc2e5e3b48.1556525874.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: HE1P190CA0016.EURP190.PROD.OUTLOOK.COM (2603:10a6:3:bc::26) 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: d629cb2b-c9a9-4e82-f96d-08d6cc7b8578 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(2017052603328)(7193020); SRVR:DM6PR11MB2841; x-ms-traffictypediagnostic: DM6PR11MB2841: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:741; x-forefront-prvs: 0022134A87 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(376002)(396003)(136003)(39840400004)(346002)(199004)(189003)(44832011)(99286004)(186003)(118296001)(478600001)(71200400001)(53936002)(6506007)(71190400001)(446003)(5660300002)(2351001)(14454004)(486006)(66556008)(73956011)(66946007)(64756008)(66476007)(66446008)(386003)(52116002)(316002)(11346002)(2616005)(7736002)(476003)(72206003)(54906003)(305945005)(81166006)(1730700003)(2501003)(36756003)(76176011)(81156014)(6486002)(3846002)(66066001)(102836004)(6916009)(97736004)(8936002)(450100002)(86362001)(6116002)(6436002)(26005)(256004)(8676002)(50226002)(2906002)(25786009)(5640700003)(6512007)(68736007)(4326008); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR11MB2841; 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: MmwQPg3SF59kdcyB0muKEHKBu9das2xnsUprjb/EeMxoXKdQVg/tzTXlmfv4UQzTblf2dUlySQh7AZxbVML4tgVMo15agg1t+2tzVHzm2eJtbdNLfNoQmJjrOY+oXrLHc5T2qsSVZ+oaIXtGviIRvdl4+GNKi3zbHb9iOeKC6Ux3q7FmQzFR5WSiR8QWsgHXoKiswhIF364c1iTEBr8BmogzazvSqeMtlKEqJEPoBDfiq7Iuprm3n28PuvNZcNsZ1BdvzM5wf6kIlRkVs1Z04nBBb/oR+I/hW4MrrLOxUOYTSM+PLineJRrnYU94BuM9ghs6yS3uzkZ58Sae6KVlsDfbbTgackxTaJ3iC23dF8O1z/P9fXI4CwYB2kI9Owtr/D11+zG+zp6pYunTHJ5I6R6bDEm/fNVU95zrSZJZRbA= MIME-Version: 1.0 X-OriginatorOrg: aquantia.com X-MS-Exchange-CrossTenant-Network-Message-Id: d629cb2b-c9a9-4e82-f96d-08d6cc7b8578 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Apr 2019 08:20:21.5568 (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: DM6PR11MB2841 Subject: [dpdk-dev] [PATCH 07/11] net/atlantic: bad logic with offsets talking with firmware 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" From: Pavel Belous eeprom write accesses start using non zero configuration memory accesses. This revealed an issue where firmware interface was actually always did the uploads starting with zero offset Fixes: 86d36773bd42 ("net/atlantic: implement firmware operations") cc: stable@dpdk.org Signed-off-by: Igor Russkikh Signed-off-by: Pavel Belous --- drivers/net/atlantic/hw_atl/hw_atl_utils.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/net/atlantic/hw_atl/hw_atl_utils.c b/drivers/net/atlantic/hw_atl/hw_atl_utils.c index 1910bd4c94a2..b399ae392dbd 100644 --- a/drivers/net/atlantic/hw_atl/hw_atl_utils.c +++ b/drivers/net/atlantic/hw_atl/hw_atl_utils.c @@ -332,12 +332,13 @@ int hw_atl_utils_fw_upload_dwords(struct aq_hw_s *self, u32 a, u32 *p, goto err_exit; } if (IS_CHIP_FEATURE(REVISION_B1)) { - u32 offset = 0; + u32 mbox_offset = (a - self->rpc_addr) / sizeof(u32); + u32 data_offset = 0; - for (; offset < cnt; ++offset) { - aq_hw_write_reg(self, 0x328, p[offset]); + for (; data_offset < cnt; ++mbox_offset, ++data_offset) { + aq_hw_write_reg(self, 0x328, p[data_offset]); aq_hw_write_reg(self, 0x32C, - (0x80000000 | (0xFFFF & (offset * 4)))); + (0x80000000 | (0xFFFF & (mbox_offset * 4)))); hw_atl_mcp_up_force_intr_set(self, 1); /* 1000 times by 10us = 10ms */ AQ_HW_WAIT_FOR((aq_hw_read_reg(self, From patchwork Mon Apr 29 08:20:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Russkikh X-Patchwork-Id: 53138 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D64C21B3B7; Mon, 29 Apr 2019 10:20:43 +0200 (CEST) Received: from NAM04-BN3-obe.outbound.protection.outlook.com (mail-eopbgr680048.outbound.protection.outlook.com [40.107.68.48]) by dpdk.org (Postfix) with ESMTP id 11B4F1B293; Mon, 29 Apr 2019 10:20:24 +0200 (CEST) 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=ZoxOdNKP1kKMjLphI+6qcIbD/gU7sU4AQtoaitJQP7E=; b=KkBKaS+Emgv90JeaArjqnA2D5EhGkMZ6UYT0YeQ5TaZmPvwe1N+W6AAx/wJXGfuI8P10mH1T0CKgkTYWN9dI7sCtxtVgGnT10GUNRAEBXGYmF6KLZrK50comeBelCyeg3BZh0q8tDq+zWPD9GK/M8IcflUOP39JOmbdzsx3vf0k= Received: from DM6PR11MB3625.namprd11.prod.outlook.com (20.178.230.149) by DM6PR11MB2841.namprd11.prod.outlook.com (20.176.100.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1835.13; Mon, 29 Apr 2019 08:20:23 +0000 Received: from DM6PR11MB3625.namprd11.prod.outlook.com ([fe80::f035:2c20:5a61:7653]) by DM6PR11MB3625.namprd11.prod.outlook.com ([fe80::f035:2c20:5a61:7653%3]) with mapi id 15.20.1835.010; Mon, 29 Apr 2019 08:20:23 +0000 From: Igor Russkikh To: "dev@dpdk.org" CC: Pavel Belous , Igor Russkikh , "stable@dpdk.org" Thread-Topic: [PATCH 08/11] net/atlantic: flow control settings synchronization on rx Thread-Index: AQHU/mRkdclvqqwRRkmP4e/LB8gyiw== Date: Mon, 29 Apr 2019 08:20:23 +0000 Message-ID: <78861b0be3a56a2e5d3996467e5eb05bcd395ea6.1556525874.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: HE1P190CA0016.EURP190.PROD.OUTLOOK.COM (2603:10a6:3:bc::26) 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: bd76f106-bfa9-422f-8c2e-08d6cc7b86a6 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(2017052603328)(7193020); SRVR:DM6PR11MB2841; x-ms-traffictypediagnostic: DM6PR11MB2841: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:61; x-forefront-prvs: 0022134A87 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(376002)(396003)(136003)(39840400004)(346002)(199004)(189003)(44832011)(99286004)(186003)(118296001)(478600001)(71200400001)(53936002)(6506007)(71190400001)(446003)(5660300002)(2351001)(14454004)(14444005)(486006)(66556008)(73956011)(66946007)(64756008)(66476007)(66446008)(386003)(52116002)(316002)(11346002)(2616005)(7736002)(476003)(72206003)(54906003)(305945005)(81166006)(1730700003)(2501003)(36756003)(76176011)(81156014)(6486002)(3846002)(66066001)(102836004)(6916009)(97736004)(8936002)(450100002)(86362001)(6116002)(6436002)(26005)(256004)(8676002)(50226002)(2906002)(25786009)(5640700003)(6512007)(68736007)(4326008)(83323001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR11MB2841; 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: nmHE2uS4Ou7CjbiZ60d/wp8Urj6OXjzqwmDCv44HshoCFMyxbQDW+2St+lxxrKI3ottybvi1Mx3jx/eL1zhKHTJ3YGNMGsjSjBC03dBFwUge8C4oEca+ecNDXyj7tRvqsfJw6IU//Qz/oDECgstzGryJA2hHFAakYaZ7yqstK7YfzGBbdwBMessDFRNhQEA3VaVbb30RsJcFggt7+3kyDojocfMN6+2MtBFc69P4siJOH8t68+zltsQTv3dRHdg7P1uXGyrp8borfcvaWO+ceEYaaliSQU666683EgmbJ+Zu2HJGMm9vBZK4vQcgRgtPdJmiMR6aTM07Hkwy3bFJf+uM+49cotS9W3eZ+JWC7715pa33Im4Naby/owFWqomZHwvxwQ6kEdCid4rgLirq7BdD5AUQreQJKrXGXsnwHvM= MIME-Version: 1.0 X-OriginatorOrg: aquantia.com X-MS-Exchange-CrossTenant-Network-Message-Id: bd76f106-bfa9-422f-8c2e-08d6cc7b86a6 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Apr 2019 08:20:23.4911 (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: DM6PR11MB2841 Subject: [dpdk-dev] [PATCH 08/11] net/atlantic: flow control settings synchronization on rx 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" From: Pavel Belous Driver should track negotiated PHY flow control settings during link state changes and update MAC level flow control configuration. Otherwise there could be unexpected pause frames generation which could lockup the datapath. Fixes: 4c1c8f76463f ("net/atlantic: add flow control configuration") cc: stable@dpdk.org Signed-off-by: Igor Russkikh Signed-off-by: Pavel Belous --- drivers/net/atlantic/atl_ethdev.c | 24 +++++++++++++++---- drivers/net/atlantic/atl_types.h | 1 + drivers/net/atlantic/hw_atl/hw_atl_b0.c | 6 +++++ drivers/net/atlantic/hw_atl/hw_atl_b0.h | 2 ++ .../net/atlantic/hw_atl/hw_atl_utils_fw2x.c | 9 +++++++ 5 files changed, 38 insertions(+), 4 deletions(-) diff --git a/drivers/net/atlantic/atl_ethdev.c b/drivers/net/atlantic/atl_ethdev.c index 485ef159eb05..6cc8d198041e 100644 --- a/drivers/net/atlantic/atl_ethdev.c +++ b/drivers/net/atlantic/atl_ethdev.c @@ -1160,6 +1160,7 @@ atl_dev_link_update(struct rte_eth_dev *dev, int wait __rte_unused) { struct aq_hw_s *hw = ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private); struct rte_eth_link link, old; + u32 fc = AQ_NIC_FC_OFF; int err = 0; link.link_status = ETH_LINK_DOWN; @@ -1194,6 +1195,15 @@ atl_dev_link_update(struct rte_eth_dev *dev, int wait __rte_unused) if (link.link_status == old.link_status) return -1; + /* Driver has to update flow control settings on RX block + * on any link event. + * We should query FW whether it negotiated FC. + */ + if (hw->aq_fw_ops->get_flow_control) { + hw->aq_fw_ops->get_flow_control(hw, &fc); + hw_atl_b0_set_fc(hw, fc, 0U); + } + if (rte_eal_alarm_set(1000 * 1000, atl_dev_delayed_handler, (void *)dev) < 0) PMD_DRV_LOG(ERR, "rte_eal_alarm_set fail"); @@ -1496,14 +1506,20 @@ static int atl_flow_ctrl_get(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf) { struct aq_hw_s *hw = ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private); + u32 fc = AQ_NIC_FC_OFF; + + if (hw->aq_fw_ops->get_flow_control == NULL) + return -ENOTSUP; + + hw->aq_fw_ops->get_flow_control(hw, &fc); - if (hw->aq_nic_cfg->flow_control == AQ_NIC_FC_OFF) + if (fc == AQ_NIC_FC_OFF) fc_conf->mode = RTE_FC_NONE; - else if (hw->aq_nic_cfg->flow_control & (AQ_NIC_FC_RX | AQ_NIC_FC_TX)) + else if (fc & (AQ_NIC_FC_RX | AQ_NIC_FC_TX)) fc_conf->mode = RTE_FC_FULL; - else if (hw->aq_nic_cfg->flow_control & AQ_NIC_FC_RX) + else if (fc & AQ_NIC_FC_RX) fc_conf->mode = RTE_FC_RX_PAUSE; - else if (hw->aq_nic_cfg->flow_control & AQ_NIC_FC_RX) + else if (fc & AQ_NIC_FC_RX) fc_conf->mode = RTE_FC_TX_PAUSE; return 0; diff --git a/drivers/net/atlantic/atl_types.h b/drivers/net/atlantic/atl_types.h index 84a4776951db..19aaf37673cd 100644 --- a/drivers/net/atlantic/atl_types.h +++ b/drivers/net/atlantic/atl_types.h @@ -169,6 +169,7 @@ struct aq_fw_ops { int (*get_eee_rate)(struct aq_hw_s *self, u32 *rate, u32 *supported_rates); + int (*get_flow_control)(struct aq_hw_s *self, u32 *fc); int (*set_flow_control)(struct aq_hw_s *self); int (*led_control)(struct aq_hw_s *self, u32 mode); diff --git a/drivers/net/atlantic/hw_atl/hw_atl_b0.c b/drivers/net/atlantic/hw_atl/hw_atl_b0.c index e525a8581e6f..a76268e923e6 100644 --- a/drivers/net/atlantic/hw_atl/hw_atl_b0.c +++ b/drivers/net/atlantic/hw_atl/hw_atl_b0.c @@ -26,6 +26,12 @@ int hw_atl_b0_hw_reset(struct aq_hw_s *self) return err; } +int hw_atl_b0_set_fc(struct aq_hw_s *self, u32 fc, u32 tc) +{ + hw_atl_rpb_rx_xoff_en_per_tc_set(self, !!(fc & AQ_NIC_FC_RX), tc); + return 0; +} + static int hw_atl_b0_hw_qos_set(struct aq_hw_s *self) { u32 tc = 0U; diff --git a/drivers/net/atlantic/hw_atl/hw_atl_b0.h b/drivers/net/atlantic/hw_atl/hw_atl_b0.h index 06feb56c1620..d1ba2aceb390 100644 --- a/drivers/net/atlantic/hw_atl/hw_atl_b0.h +++ b/drivers/net/atlantic/hw_atl/hw_atl_b0.h @@ -11,6 +11,8 @@ int hw_atl_b0_hw_reset(struct aq_hw_s *self); int hw_atl_b0_hw_init(struct aq_hw_s *self, u8 *mac_addr); +int hw_atl_b0_set_fc(struct aq_hw_s *self, u32 fc, u32 tc); + int hw_atl_b0_hw_ring_tx_init(struct aq_hw_s *self, uint64_t base_addr, int index, int size, int cpu, int vec); int hw_atl_b0_hw_ring_rx_init(struct aq_hw_s *self, uint64_t base_addr, diff --git a/drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c b/drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c index de4189441fad..e07ed5e3a8c9 100644 --- a/drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c +++ b/drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c @@ -473,7 +473,15 @@ static int aq_fw2x_get_eee_rate(struct aq_hw_s *self, u32 *rate, return err; } +static int aq_fw2x_get_flow_control(struct aq_hw_s *self, u32 *fc) +{ + u32 mpi_state = aq_hw_read_reg(self, HW_ATL_FW2X_MPI_CONTROL2_ADDR); + + *fc = ((mpi_state & BIT(CAPS_HI_PAUSE)) ? AQ_NIC_FC_RX : 0) | + ((mpi_state & BIT(CAPS_HI_ASYMMETRIC_PAUSE)) ? AQ_NIC_FC_TX : 0); + return 0; +} static int aq_fw2x_set_flow_control(struct aq_hw_s *self) { @@ -714,6 +722,7 @@ const struct aq_fw_ops aq_fw_2x_ops = { .get_cable_len = aq_fw2x_get_cable_len, .set_eee_rate = aq_fw2x_set_eee_rate, .get_eee_rate = aq_fw2x_get_eee_rate, + .get_flow_control = aq_fw2x_get_flow_control, .set_flow_control = aq_fw2x_set_flow_control, .led_control = aq_fw2x_led_control, .get_eeprom = aq_fw2x_get_eeprom, From patchwork Mon Apr 29 08:20:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Russkikh X-Patchwork-Id: 53139 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 126B01B207; Mon, 29 Apr 2019 10:20:46 +0200 (CEST) Received: from NAM04-BN3-obe.outbound.protection.outlook.com (mail-eopbgr680080.outbound.protection.outlook.com [40.107.68.80]) by dpdk.org (Postfix) with ESMTP id 6A7D51B20B for ; Mon, 29 Apr 2019 10:20:26 +0200 (CEST) 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=0F6Rj++DpZPUEaUHsEgSWVYXXHEhY7B5H7eCBCmJbs8=; b=NlnmeGgIz4/UDK0XsfYM/HvSXonW1yH/QlJtMfpm/G//nhEAnowvHdgtnOTARUMYLXwj1EXcZQXVlyMH40vfr05DpxgTmNkWWfudAxya7hVw6fQePf5a9kyuWQMSGdbAIq1+Q3XB0zMxxkCvk92fVmfHPFnHnBPbCbwSIaRuapM= Received: from DM6PR11MB3625.namprd11.prod.outlook.com (20.178.230.149) by DM6PR11MB2841.namprd11.prod.outlook.com (20.176.100.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1835.13; Mon, 29 Apr 2019 08:20:25 +0000 Received: from DM6PR11MB3625.namprd11.prod.outlook.com ([fe80::f035:2c20:5a61:7653]) by DM6PR11MB3625.namprd11.prod.outlook.com ([fe80::f035:2c20:5a61:7653%3]) with mapi id 15.20.1835.010; Mon, 29 Apr 2019 08:20:25 +0000 From: Igor Russkikh To: "dev@dpdk.org" CC: Pavel Belous , Igor Russkikh Thread-Topic: [PATCH 09/11] net/atlantic: use capability bits to detect eeprom access Thread-Index: AQHU/mRlHJLcENXmz0icFXx4hsLPhA== Date: Mon, 29 Apr 2019 08:20:25 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HE1P190CA0016.EURP190.PROD.OUTLOOK.COM (2603:10a6:3:bc::26) 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: cfdc6c99-f861-4a35-f273-08d6cc7b87ad x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(2017052603328)(7193020); SRVR:DM6PR11MB2841; x-ms-traffictypediagnostic: DM6PR11MB2841: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:299; x-forefront-prvs: 0022134A87 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(376002)(396003)(136003)(39840400004)(346002)(199004)(189003)(44832011)(99286004)(186003)(118296001)(478600001)(71200400001)(53936002)(6506007)(71190400001)(446003)(5660300002)(2351001)(14454004)(14444005)(486006)(66556008)(73956011)(66946007)(64756008)(66476007)(66446008)(386003)(52116002)(316002)(11346002)(2616005)(7736002)(476003)(72206003)(54906003)(305945005)(107886003)(81166006)(1730700003)(2501003)(36756003)(76176011)(81156014)(6486002)(3846002)(66066001)(102836004)(6916009)(97736004)(8936002)(86362001)(6116002)(6436002)(26005)(256004)(8676002)(50226002)(2906002)(25786009)(5640700003)(6512007)(68736007)(4326008); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR11MB2841; 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: eP5Ytw9029OnY3dBtHSj2lHtA9NVrTzUvtRYBRTINtNWI8xtKW9xGVeubBonWdOeoyRsR5JYOF00jNENeHd1aRcG9EDbgYsUeP7Do6xnlQDpOX9+49dEL/eLN+rEzKNdniy4u9PPRGxJaBjKELnW1bm/jEMsE1UBsQl9oubvOAKXrj4nk/0ykUzb3dW3Jz4uiCUTZdDwRXfEd5cdQtmsR/UqOuGgxdJNivFdd2ZfvuT+0qFvrzZ9zF197KqtN1Epl9vLqnF3x+VMNfmSPGXeNUtR0vTv206hVzKjUmdz4aHwUObpjbloo3HvQZHHMX6T/Xp9ae1wmgRO3YNO8flccQecyQPF5Yu7fVQtWoqAxzJ3sHTMwr/HRSitmL82XMrY2NYWNwD+wawp85gziS6hPEObdarnBPcA+ywGx5PRROA= MIME-Version: 1.0 X-OriginatorOrg: aquantia.com X-MS-Exchange-CrossTenant-Network-Message-Id: cfdc6c99-f861-4a35-f273-08d6cc7b87ad X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Apr 2019 08:20:25.2834 (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: DM6PR11MB2841 Subject: [dpdk-dev] [PATCH 09/11] net/atlantic: use capability bits to detect eeprom access 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" From: Pavel Belous Its better to use capability bits FW provides to detect whether firmware has APIs for EEPROM access. Before that explicit FW version comparison was used and that may cause conflicts. Signed-off-by: Igor Russkikh Signed-off-by: Pavel Belous --- drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c b/drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c index e07ed5e3a8c9..0d24aa99bda0 100644 --- a/drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c +++ b/drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c @@ -34,7 +34,6 @@ #define HAL_ATLANTIC_WOL_FILTERS_COUNT 8 #define HAL_ATLANTIC_UTILS_FW2X_MSG_WOL 0x0E -#define HW_ATL_FW_FEATURE_EEPROM 0x03010025 #define HW_ATL_FW_FEATURE_LED 0x03010026 struct fw2x_msg_wol_pattern { @@ -513,7 +512,7 @@ static int aq_fw2x_get_eeprom(struct aq_hw_s *self, int dev_addr, u32 mpi_opts; int err = 0; - if (self->fw_ver_actual < HW_ATL_FW_FEATURE_EEPROM) + if ((self->caps_lo & BIT(CAPS_LO_SMBUS_READ)) == 0) return -EOPNOTSUPP; request.msg_id = 0; @@ -591,7 +590,7 @@ static int aq_fw2x_set_eeprom(struct aq_hw_s *self, int dev_addr, u32 mpi_opts, result = 0; int err = 0; - if (self->fw_ver_actual < HW_ATL_FW_FEATURE_EEPROM) + if ((self->caps_lo & BIT(CAPS_LO_SMBUS_WRITE)) == 0) return -EOPNOTSUPP; request.msg_id = 0; From patchwork Mon Apr 29 08:20:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Russkikh X-Patchwork-Id: 53140 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 576E61B3D7; Mon, 29 Apr 2019 10:20:48 +0200 (CEST) Received: from NAM04-BN3-obe.outbound.protection.outlook.com (mail-eopbgr680045.outbound.protection.outlook.com [40.107.68.45]) by dpdk.org (Postfix) with ESMTP id 4C6431B277 for ; Mon, 29 Apr 2019 10:20:28 +0200 (CEST) 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=fxoh6buLrFM6JkLVmWccFqvs1mAl54fmeZvafTZobVs=; b=JZ3i9AUryAj8Nm+iHMjRYv3Qh2JVfpEhSYmIxiKT3OrwyOSSX4WYmLuQe9eTSRqzRLGYa42IbiXO2us1XL8wK6YqoDRG+TVZ18mp9XQx7Wlt4GTYRTOYBVjkqcMM8hulzMM7cL45iJo0mVGbqpXIhMO0BPgtL1MVlVnaYC04UK8= Received: from DM6PR11MB3625.namprd11.prod.outlook.com (20.178.230.149) by DM6PR11MB2841.namprd11.prod.outlook.com (20.176.100.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1835.13; Mon, 29 Apr 2019 08:20:27 +0000 Received: from DM6PR11MB3625.namprd11.prod.outlook.com ([fe80::f035:2c20:5a61:7653]) by DM6PR11MB3625.namprd11.prod.outlook.com ([fe80::f035:2c20:5a61:7653%3]) with mapi id 15.20.1835.010; Mon, 29 Apr 2019 08:20:27 +0000 From: Igor Russkikh To: "dev@dpdk.org" CC: Pavel Belous , Igor Russkikh Thread-Topic: [PATCH 10/11] net/atlantic: typo on args check Thread-Index: AQHU/mRmh/cyHVtct0iGGc7VFhx/Kw== Date: Mon, 29 Apr 2019 08:20:27 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HE1P190CA0016.EURP190.PROD.OUTLOOK.COM (2603:10a6:3:bc::26) 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: b0c70c6d-70a0-4cd4-5359-08d6cc7b88c2 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(2017052603328)(7193020); SRVR:DM6PR11MB2841; x-ms-traffictypediagnostic: DM6PR11MB2841: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:843; x-forefront-prvs: 0022134A87 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(376002)(396003)(136003)(39840400004)(346002)(199004)(189003)(44832011)(99286004)(186003)(118296001)(478600001)(71200400001)(53936002)(6506007)(71190400001)(446003)(5660300002)(2351001)(14454004)(14444005)(486006)(66556008)(73956011)(66946007)(64756008)(66476007)(66446008)(386003)(52116002)(316002)(11346002)(2616005)(7736002)(476003)(4744005)(72206003)(54906003)(305945005)(107886003)(81166006)(1730700003)(2501003)(36756003)(76176011)(81156014)(6486002)(3846002)(66066001)(102836004)(6916009)(97736004)(8936002)(86362001)(6116002)(6436002)(26005)(256004)(8676002)(50226002)(2906002)(25786009)(5640700003)(6512007)(68736007)(4326008); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR11MB2841; 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: YKDKoHkfMKu1QDR6CBTekWIJ2Qh/LFvLpObBM7tTAxz13LVbwZ7CdEPTagy/qhndZKTeXI6LmqlYW8j4um3sow54I67UK09uSfQzxYXj6F1T3NSVMpNnUIF0SOHr5PeCjpYdjJQr3tvqGycaKuYRvUEj85zcE2OVNbtsH2KafTWxgAZqK1bYZTyUO2FuPI2HKHkGM6O7E+VRxi68kz7kZAdxPLmHHS/xXOwMFBkVRyYhty766Hr5Su1DpA4ti5lSL2IN7EXmxzQe1lNNf1Mb8JotmeBPq0SRnygYNWEvauVV4rtA8xWPJVdkwSIMPAAc6rkMk89saG+OOUH/AVrg0jOvuz0cizjKfvH2pVNLIxXT+T4Jy+7yTI7/MmV3pdJViCC5S8nRIYMrhltBLj8zR88k69Us+Mg/HeoALtBMMTE= MIME-Version: 1.0 X-OriginatorOrg: aquantia.com X-MS-Exchange-CrossTenant-Network-Message-Id: b0c70c6d-70a0-4cd4-5359-08d6cc7b88c2 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Apr 2019 08:20:27.1387 (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: DM6PR11MB2841 Subject: [dpdk-dev] [PATCH 10/11] net/atlantic: typo on args check 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" Found by coverity scan, two pointer args should be not zero checked Coverity issue: 337929 Fixes: 2f40244b39ba ("net/atlantic: implement MACsec firmware interface") Signed-off-by: Igor Russkikh --- drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c b/drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c index 0d24aa99bda0..5927d90f1813 100644 --- a/drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c +++ b/drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c @@ -671,7 +671,7 @@ static int aq_fw2x_send_macsec_request(struct aq_hw_s *self, int err = 0; u32 mpi_opts = 0; - if (!response || !response) + if (!req || !response) return 0; if ((self->caps_lo & BIT(CAPS_LO_MACSEC)) == 0) From patchwork Mon Apr 29 08:20:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Russkikh X-Patchwork-Id: 53141 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DBB7C1B3F5; Mon, 29 Apr 2019 10:20:51 +0200 (CEST) Received: from NAM04-BN3-obe.outbound.protection.outlook.com (mail-eopbgr680071.outbound.protection.outlook.com [40.107.68.71]) by dpdk.org (Postfix) with ESMTP id 1CDDB1B293 for ; Mon, 29 Apr 2019 10:20:30 +0200 (CEST) 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=eLPw7VnYfhWwsq+wsi5IFoybq5N2LDe+26I8AbAtgNQ=; b=E7kFd6/RpAcCJdpCf6dLyNbeRAtpPIVG1y64wzlMQ1klibT32wIm2MPcK/WNjy8aBohbcYftXkC7Kph2ek1ehDHFfrasqBrGZ2iVPV8N8e7vf1co+nvINqnQOG4dcCTaIl6zHyYtaWsa4C4EvsD2sC6QhfwoByO9alrlRWLOMeI= Received: from DM6PR11MB3625.namprd11.prod.outlook.com (20.178.230.149) by DM6PR11MB2841.namprd11.prod.outlook.com (20.176.100.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1835.13; Mon, 29 Apr 2019 08:20:29 +0000 Received: from DM6PR11MB3625.namprd11.prod.outlook.com ([fe80::f035:2c20:5a61:7653]) by DM6PR11MB3625.namprd11.prod.outlook.com ([fe80::f035:2c20:5a61:7653%3]) with mapi id 15.20.1835.010; Mon, 29 Apr 2019 08:20:29 +0000 From: Igor Russkikh To: "dev@dpdk.org" CC: Pavel Belous , Igor Russkikh Thread-Topic: [PATCH 11/11] net/atlantic: extra err check Thread-Index: AQHU/mRn0n7WhPIpdESGRq7U+/6T1g== Date: Mon, 29 Apr 2019 08:20:28 +0000 Message-ID: <9fb9aada4b12d2a33ac59515afc9023b22430c5e.1556525874.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: HE1P190CA0016.EURP190.PROD.OUTLOOK.COM (2603:10a6:3:bc::26) 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: add54033-7f6c-4a0c-48fa-08d6cc7b89db x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(2017052603328)(7193020); SRVR:DM6PR11MB2841; x-ms-traffictypediagnostic: DM6PR11MB2841: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:346; x-forefront-prvs: 0022134A87 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(376002)(396003)(136003)(39840400004)(346002)(199004)(189003)(44832011)(99286004)(186003)(118296001)(478600001)(71200400001)(53936002)(6506007)(71190400001)(446003)(5660300002)(2351001)(14454004)(486006)(66556008)(73956011)(66946007)(64756008)(66476007)(66446008)(386003)(52116002)(316002)(11346002)(2616005)(7736002)(476003)(4744005)(72206003)(54906003)(305945005)(107886003)(81166006)(1730700003)(2501003)(36756003)(76176011)(81156014)(6486002)(3846002)(66066001)(102836004)(6916009)(97736004)(8936002)(86362001)(6116002)(6436002)(26005)(256004)(8676002)(50226002)(2906002)(25786009)(5640700003)(6512007)(68736007)(4326008); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR11MB2841; 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: BbOYIyqxyz7HqffbZw5PV8+yvqYZcg3xQ0lDAuXcrnrB0mYePZfyPjlHjHW8MMW9bLnGNfRXNY59f5o+nJv+c2gg2GLSKFxIRQWV6D95IJJEpWuoisBakn4VRHYSnNswdJ9f8ITvGDKQi4kUTsA3Ny+weuiT/XQ5mQBGN8uycukwYvYNygeRog8g+jq4e+J4R/ATyFFznEjaCxiigksFY85kI3XamI+drUTZMblJaPvTCTMpad3HWHAU186x4EO8cfEZAR8+FVSIF2YaLvCrn1VDx+opKwlCOKbLfFxCKGrGk6QjZisLX8JDyaW1xPyv14qDXRbXT996vmVUYhYj/lUxNjupoRjzP9bPaX6H1j/cJiIRCqOv0ADDLeAfMFlyznoJCEdF6klK+dMDN969cOWII4DEAaBZrFDbilNes10= MIME-Version: 1.0 X-OriginatorOrg: aquantia.com X-MS-Exchange-CrossTenant-Network-Message-Id: add54033-7f6c-4a0c-48fa-08d6cc7b89db X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Apr 2019 08:20:28.9740 (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: DM6PR11MB2841 Subject: [dpdk-dev] [PATCH 11/11] net/atlantic: extra err check 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" Found by coverity scan - dead code Coverity issue: 337665 Fixes: 7943ba05f67c ("net/atlantic: add link status and interrupt management") Signed-off-by: Igor Russkikh --- drivers/net/atlantic/atl_ethdev.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/net/atlantic/atl_ethdev.c b/drivers/net/atlantic/atl_ethdev.c index 6cc8d198041e..7611aebb5718 100644 --- a/drivers/net/atlantic/atl_ethdev.c +++ b/drivers/net/atlantic/atl_ethdev.c @@ -602,9 +602,6 @@ atl_dev_start(struct rte_eth_dev *dev) dev->data->dev_link.link_status = hw->aq_link_status.mbps != 0; - if (err) - goto error; - if (rte_intr_allow_others(intr_handle)) { /* check if lsc interrupt is enabled */ if (dev->data->dev_conf.intr_conf.lsc != 0)