patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH 18.11 00/10] Aquantia atlantic bugfixes
@ 2019-05-18  9:47 Igor Russkikh
  2019-05-18  9:47 ` [dpdk-stable] [PATCH 18.11 01/10] net/atlantic: enable broadcast traffic Igor Russkikh
                   ` (10 more replies)
  0 siblings, 11 replies; 13+ messages in thread
From: Igor Russkikh @ 2019-05-18  9:47 UTC (permalink / raw)
  To: stable, ktraynor; +Cc: Pavel Belous, Igor Russkikh

This patchset contains various bugfixes found during verification
and integration testing.

Most notable is eeprom access cleanup, fix for broadcast filter,
flow control logic tracking, some code style cleanups.

Backported patchset

https://patches.dpdk.org/cover/53130/

to 18.11 stable

Igor Russkikh (5):
  net/atlantic: enable broadcast traffic
  net/atlantic: extra line at eof
  net/atlantic: fix max eeprom size
  net/atlantic: validity check for eeprom dev address
  net/atlantic: fix link configuration

Pavel Belous (5):
  net/atlantic: error handling for mailbox access
  net/atlantic: eeprom get/set should consider offset
  net/atlantic: bad logic with offsets talking with firmware
  net/atlantic: flow control settings synchronization on rx
  net/atlantic: use capability bits to detect eeprom access

 drivers/net/atlantic/atl_ethdev.c             | 102 +++++++++-----
 drivers/net/atlantic/atl_rxtx.c               |   1 -
 drivers/net/atlantic/atl_types.h              |   9 +-
 drivers/net/atlantic/hw_atl/hw_atl_b0.c       |   8 ++
 drivers/net/atlantic/hw_atl/hw_atl_b0.h       |   2 +
 drivers/net/atlantic/hw_atl/hw_atl_utils.c    |  14 +-
 drivers/net/atlantic/hw_atl/hw_atl_utils.h    |  16 +--
 .../net/atlantic/hw_atl/hw_atl_utils_fw2x.c   | 130 +++++++++++++-----
 8 files changed, 193 insertions(+), 89 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [dpdk-stable] [PATCH 18.11 01/10] net/atlantic: enable broadcast traffic
  2019-05-18  9:47 [dpdk-stable] [PATCH 18.11 00/10] Aquantia atlantic bugfixes Igor Russkikh
@ 2019-05-18  9:47 ` Igor Russkikh
  2019-05-18  9:47 ` [dpdk-stable] [PATCH 18.11 02/10] net/atlantic: extra line at eof Igor Russkikh
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: Igor Russkikh @ 2019-05-18  9:47 UTC (permalink / raw)
  To: stable, ktraynor; +Cc: Pavel Belous, Igor Russkikh, Pavel Belous

Broadcast was not correctly and fully initialized

Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
Fixes: 7906661edac6 ("net/atlantic: add b0 hardware layer")
Cc: stable@dpdk.org
Signed-off-by: Pavel Belous <Pavel.Belous@aquantia.com>
---
 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 9400e0edb999..93738ec06abb 100644
--- a/drivers/net/atlantic/hw_atl/hw_atl_b0.c
+++ b/drivers/net/atlantic/hw_atl/hw_atl_b0.c
@@ -290,6 +290,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);
 
-- 
2.17.1


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [dpdk-stable] [PATCH 18.11 02/10] net/atlantic: extra line at eof
  2019-05-18  9:47 [dpdk-stable] [PATCH 18.11 00/10] Aquantia atlantic bugfixes Igor Russkikh
  2019-05-18  9:47 ` [dpdk-stable] [PATCH 18.11 01/10] net/atlantic: enable broadcast traffic Igor Russkikh
@ 2019-05-18  9:47 ` Igor Russkikh
  2019-05-18  9:47 ` [dpdk-stable] [PATCH 18.11 03/10] net/atlantic: error handling for mailbox access Igor Russkikh
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: Igor Russkikh @ 2019-05-18  9:47 UTC (permalink / raw)
  To: stable, ktraynor; +Cc: Pavel Belous, Igor Russkikh, Pavel Belous

Remove extra empty line at EOF

Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: Pavel Belous <Pavel.Belous@aquantia.com>
---
 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 fd909476c45f..68c100d6c20e 100644
--- a/drivers/net/atlantic/atl_rxtx.c
+++ b/drivers/net/atlantic/atl_rxtx.c
@@ -1354,4 +1354,3 @@ atl_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 
 	return nb_tx;
 }
-
-- 
2.17.1


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [dpdk-stable] [PATCH 18.11 03/10] net/atlantic: error handling for mailbox access
  2019-05-18  9:47 [dpdk-stable] [PATCH 18.11 00/10] Aquantia atlantic bugfixes Igor Russkikh
  2019-05-18  9:47 ` [dpdk-stable] [PATCH 18.11 01/10] net/atlantic: enable broadcast traffic Igor Russkikh
  2019-05-18  9:47 ` [dpdk-stable] [PATCH 18.11 02/10] net/atlantic: extra line at eof Igor Russkikh
@ 2019-05-18  9:47 ` Igor Russkikh
  2019-05-18  9:47 ` [dpdk-stable] [PATCH 18.11 04/10] net/atlantic: eeprom get/set should consider offset Igor Russkikh
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: Igor Russkikh @ 2019-05-18  9:47 UTC (permalink / raw)
  To: stable, ktraynor; +Cc: Pavel Belous, Pavel Belous, Igor Russkikh

From: Pavel Belous <Pavel.Belous@aquantia.com>

Add error handling for mailbox access.

Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: Pavel Belous <Pavel.Belous@aquantia.com>
---
 drivers/net/atlantic/hw_atl/hw_atl_utils.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/atlantic/hw_atl/hw_atl_utils.c b/drivers/net/atlantic/hw_atl/hw_atl_utils.c
index f11093a50404..63f333608dfc 100644
--- a/drivers/net/atlantic/hw_atl/hw_atl_utils.c
+++ b/drivers/net/atlantic/hw_atl/hw_atl_utils.c
@@ -306,6 +306,11 @@ int hw_atl_utils_fw_downld_dwords(struct aq_hw_s *self, u32 a,
 							   HW_ATL_MIF_CMD)),
 				       1, 1000U);
 
+		if (err) {
+			err = -ETIMEDOUT;
+			goto err_exit;
+		}
+
 		*(p++) = aq_hw_read_reg(self, HW_ATL_MIF_VAL);
 		a += 4;
 	}
-- 
2.17.1


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [dpdk-stable] [PATCH 18.11 04/10] net/atlantic: eeprom get/set should consider offset
  2019-05-18  9:47 [dpdk-stable] [PATCH 18.11 00/10] Aquantia atlantic bugfixes Igor Russkikh
                   ` (2 preceding siblings ...)
  2019-05-18  9:47 ` [dpdk-stable] [PATCH 18.11 03/10] net/atlantic: error handling for mailbox access Igor Russkikh
@ 2019-05-18  9:47 ` Igor Russkikh
  2019-05-18  9:47 ` [dpdk-stable] [PATCH 18.11 05/10] net/atlantic: fix max eeprom size Igor Russkikh
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: Igor Russkikh @ 2019-05-18  9:47 UTC (permalink / raw)
  To: stable, ktraynor; +Cc: Pavel Belous, Igor Russkikh, Pavel Belous

From: Pavel Belous <pavel.belous@aquantia.com>

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 <igor.russkikh@aquantia.com>
Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
Signed-off-by: Pavel Belous <Pavel.Belous@aquantia.com>
---
 drivers/net/atlantic/atl_ethdev.c             |  20 +++-
 drivers/net/atlantic/atl_types.h              |   6 +-
 drivers/net/atlantic/hw_atl/hw_atl_utils.h    |  16 +--
 .../net/atlantic/hw_atl/hw_atl_utils_fw2x.c   | 109 +++++++++++++-----
 4 files changed, 104 insertions(+), 47 deletions(-)

diff --git a/drivers/net/atlantic/atl_ethdev.c b/drivers/net/atlantic/atl_ethdev.c
index 5bc04f55cc21..6b289702d849 100644
--- a/drivers/net/atlantic/atl_ethdev.c
+++ b/drivers/net/atlantic/atl_ethdev.c
@@ -1106,28 +1106,40 @@ static int
 atl_dev_get_eeprom(struct rte_eth_dev *dev, struct rte_dev_eeprom_info *eeprom)
 {
 	struct aq_hw_s *hw = ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	int dev_addr = SMBUS_DEVICE_ID;
 
 	if (hw->aq_fw_ops->get_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;
 
-	return hw->aq_fw_ops->get_eeprom(hw, eeprom->data, eeprom->length);
+	if (eeprom->magic)
+		dev_addr = eeprom->magic;
+
+	return hw->aq_fw_ops->get_eeprom(hw, dev_addr, eeprom->data,
+					 eeprom->length, eeprom->offset);
 }
 
 static int
 atl_dev_set_eeprom(struct rte_eth_dev *dev, struct rte_dev_eeprom_info *eeprom)
 {
 	struct aq_hw_s *hw = ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	int dev_addr = SMBUS_DEVICE_ID;
 
 	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;
 
-	return hw->aq_fw_ops->set_eeprom(hw, eeprom->data, eeprom->length);
+	if (eeprom->magic)
+		dev_addr = eeprom->magic;
+
+	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 3d90f6caefc2..96622745d495 100644
--- a/drivers/net/atlantic/atl_types.h
+++ b/drivers/net/atlantic/atl_types.h
@@ -137,9 +137,11 @@ struct aq_fw_ops {
 
 	int (*led_control)(struct aq_hw_s *self, u32 mode);
 
-	int (*get_eeprom)(struct aq_hw_s *self, u32 *data, u32 len);
+	int (*get_eeprom)(struct aq_hw_s *self, int dev_addr,
+			u32 *data, u32 len, u32 offset);
 
-	int (*set_eeprom)(struct aq_hw_s *self, u32 *data, u32 len);
+	int (*set_eeprom)(struct aq_hw_s *self, int dev_addr,
+			u32 *data, u32 len, u32 offset);
 };
 
 struct atl_sw_stats {
diff --git a/drivers/net/atlantic/hw_atl/hw_atl_utils.h b/drivers/net/atlantic/hw_atl/hw_atl_utils.h
index 5f3f70847310..b1f03f42e8b8 100644
--- a/drivers/net/atlantic/hw_atl/hw_atl_utils.h
+++ b/drivers/net/atlantic/hw_atl/hw_atl_utils.h
@@ -336,15 +336,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;
@@ -389,8 +382,6 @@ enum hal_atl_utils_fw_state_e {
 #define HAL_ATLANTIC_UTILS_FW_MSG_OFFLOAD_DEL  10U
 #define HAL_ATLANTIC_UTILS_FW_MSG_CABLE_DIAG   13U // 0xd
 
-#define SMBUS_READ_REQUEST BIT(13)
-#define SMBUS_WRITE_REQUEST BIT(14)
 #define SMBUS_DEVICE_ID 0x50
 
 enum hw_atl_fw2x_rate {
@@ -414,6 +405,9 @@ enum hw_atl_fw2x_caps_lo {
 	CAPS_LO_2P5GBASET_FD,
 	CAPS_LO_5GBASET_FD,
 	CAPS_LO_10GBASET_FD,
+	CAPS_LO_AUTONEG,
+	CAPS_LO_SMBUS_READ,
+	CAPS_LO_SMBUS_WRITE,
 };
 
 enum hw_atl_fw2x_caps_hi {
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 6841d9bce39c..e0fb850c9aac 100644
--- a/drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c
+++ b/drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c
@@ -484,38 +484,42 @@ static int aq_fw2x_led_control(struct aq_hw_s *self, u32 mode)
 	return 0;
 }
 
-static int aq_fw2x_get_eeprom(struct aq_hw_s *self, u32 *data, u32 len)
+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.device_id = SMBUS_DEVICE_ID;
-	request.address = 0;
+	request.msg_id = 0;
+	request.device_id = dev_addr;
+	request.address = offset;
 	request.length = len;
 
 	/* Write SMBUS request to cfg memory */
 	err = hw_atl_utils_fw_upload_dwords(self, self->rpc_addr,
 				(u32 *)(void *)&request,
-				RTE_ALIGN(sizeof(request), sizeof(u32)));
+				sizeof(request) / sizeof(u32));
 
 	if (err < 0)
 		return err;
 
-	/* Toggle 0x368.SMBUS_READ_REQUEST bit */
+	/* Toggle 0x368.CAPS_LO_SMBUS_READ bit */
 	mpi_opts = aq_hw_read_reg(self, HW_ATL_FW2X_MPI_CONTROL_ADDR);
-	mpi_opts ^= SMBUS_READ_REQUEST;
+	mpi_opts ^= BIT(CAPS_LO_SMBUS_READ);
 
 	aq_hw_write_reg(self, HW_ATL_FW2X_MPI_CONTROL_ADDR, mpi_opts);
 
 	/* Wait until REQUEST_BIT matched in 0x370 */
 
 	AQ_HW_WAIT_FOR((aq_hw_read_reg(self, HW_ATL_FW2X_MPI_STATE_ADDR) &
-		SMBUS_READ_REQUEST) == (mpi_opts & SMBUS_READ_REQUEST),
+		BIT(CAPS_LO_SMBUS_READ)) == (mpi_opts & BIT(CAPS_LO_SMBUS_READ)),
 		10U, 10000U);
 
 	if (err < 0)
@@ -523,64 +527,106 @@ static int aq_fw2x_get_eeprom(struct aq_hw_s *self, u32 *data, u32 len)
 
 	err = hw_atl_utils_fw_downld_dwords(self, self->rpc_addr + sizeof(u32),
 			&result,
-			RTE_ALIGN(sizeof(result), sizeof(u32)));
+			sizeof(result) / sizeof(u32));
 
 	if (err < 0)
 		return err;
 
-	if (result == 0) {
+	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 (err < 0)
+			return err;
+	}
+
+	if (bytes_remains) {
+		u32 val = 0;
+
 		err = hw_atl_utils_fw_downld_dwords(self,
-				self->rpc_addr + sizeof(u32) * 2,
-				data,
-				RTE_ALIGN(len, sizeof(u32)));
+			self->rpc_addr + (sizeof(u32) * 2) +
+			(num_dwords * sizeof(u32)),
+			&val,
+			1);
 
 		if (err < 0)
 			return err;
+
+		rte_memcpy((u8 *)data + len - bytes_remains,
+			&val, bytes_remains);
 	}
 
 	return 0;
 }
 
 
-static int aq_fw2x_set_eeprom(struct aq_hw_s *self, u32 *data, u32 len)
+static int aq_fw2x_set_eeprom(struct aq_hw_s *self, int dev_addr,
+				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.device_id = SMBUS_DEVICE_ID;
-	request.address = 0;
+	request.msg_id = 0;
+	request.device_id = dev_addr;
+	request.address = offset;
 	request.length = len;
 
 	/* Write SMBUS request to cfg memory */
 	err = hw_atl_utils_fw_upload_dwords(self, self->rpc_addr,
 				(u32 *)(void *)&request,
-				RTE_ALIGN(sizeof(request), sizeof(u32)));
+				sizeof(request) / sizeof(u32));
 
 	if (err < 0)
 		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);
 
-	/* Toggle 0x368.SMBUS_WRITE_REQUEST bit */
+		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);
-	mpi_opts ^= SMBUS_WRITE_REQUEST;
+	mpi_opts ^= BIT(CAPS_LO_SMBUS_WRITE);
 
 	aq_hw_write_reg(self, HW_ATL_FW2X_MPI_CONTROL_ADDR, mpi_opts);
 
 	/* Wait until REQUEST_BIT matched in 0x370 */
 	AQ_HW_WAIT_FOR((aq_hw_read_reg(self, HW_ATL_FW2X_MPI_STATE_ADDR) &
-		SMBUS_WRITE_REQUEST) == (mpi_opts & SMBUS_WRITE_REQUEST),
+		BIT(CAPS_LO_SMBUS_WRITE)) == (mpi_opts & BIT(CAPS_LO_SMBUS_WRITE)),
 		10U, 10000U);
 
 	if (err < 0)
@@ -589,11 +635,14 @@ static int aq_fw2x_set_eeprom(struct aq_hw_s *self, u32 *data, u32 len)
 	/* Read status of write operation */
 	err = hw_atl_utils_fw_downld_dwords(self, self->rpc_addr + sizeof(u32),
 				&result,
-				RTE_ALIGN(sizeof(result), sizeof(u32)));
+				sizeof(result) / sizeof(u32));
 
 	if (err < 0)
 		return err;
 
+	if (result)
+		return -EIO;
+
 	return 0;
 }
 
-- 
2.17.1


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [dpdk-stable] [PATCH 18.11 05/10] net/atlantic: fix max eeprom size
  2019-05-18  9:47 [dpdk-stable] [PATCH 18.11 00/10] Aquantia atlantic bugfixes Igor Russkikh
                   ` (3 preceding siblings ...)
  2019-05-18  9:47 ` [dpdk-stable] [PATCH 18.11 04/10] net/atlantic: eeprom get/set should consider offset Igor Russkikh
@ 2019-05-18  9:47 ` Igor Russkikh
  2019-05-18  9:47 ` [dpdk-stable] [PATCH 18.11 06/10] net/atlantic: validity check for eeprom dev address Igor Russkikh
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: Igor Russkikh @ 2019-05-18  9:47 UTC (permalink / raw)
  To: stable, ktraynor; +Cc: Pavel Belous, Igor Russkikh, Pavel Belous

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 <igor.russkikh@aquantia.com>
Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
cc: stable@dpdk.org
Signed-off-by: Pavel Belous <Pavel.Belous@aquantia.com>
---
 drivers/net/atlantic/atl_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/atlantic/atl_ethdev.c b/drivers/net/atlantic/atl_ethdev.c
index 6b289702d849..be48ebe9354b 100644
--- a/drivers/net/atlantic/atl_ethdev.c
+++ b/drivers/net/atlantic/atl_ethdev.c
@@ -174,6 +174,8 @@ static struct rte_pci_driver rte_atl_pmd = {
 			| DEV_TX_OFFLOAD_TCP_TSO \
 			| 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,
@@ -1094,8 +1096,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)
 {
-- 
2.17.1


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [dpdk-stable] [PATCH 18.11 06/10] net/atlantic: validity check for eeprom dev address
  2019-05-18  9:47 [dpdk-stable] [PATCH 18.11 00/10] Aquantia atlantic bugfixes Igor Russkikh
                   ` (4 preceding siblings ...)
  2019-05-18  9:47 ` [dpdk-stable] [PATCH 18.11 05/10] net/atlantic: fix max eeprom size Igor Russkikh
@ 2019-05-18  9:47 ` Igor Russkikh
  2019-05-18  9:47 ` [dpdk-stable] [PATCH 18.11 07/10] net/atlantic: bad logic with offsets talking with firmware Igor Russkikh
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: Igor Russkikh @ 2019-05-18  9:47 UTC (permalink / raw)
  To: stable, ktraynor; +Cc: Pavel Belous, Igor Russkikh, Pavel Belous

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 <igor.russkikh@aquantia.com>
Signed-off-by: Pavel Belous <Pavel.Belous@aquantia.com>
---
 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 be48ebe9354b..45230d2f7cbe 100644
--- a/drivers/net/atlantic/atl_ethdev.c
+++ b/drivers/net/atlantic/atl_ethdev.c
@@ -1115,6 +1115,9 @@ atl_dev_get_eeprom(struct rte_eth_dev *dev, struct rte_dev_eeprom_info *eeprom)
 	    eeprom->data == NULL)
 		return -EINVAL;
 
+	if (eeprom->magic > 0x7F)
+		return -EINVAL;
+
 	if (eeprom->magic)
 		dev_addr = eeprom->magic;
 
@@ -1135,6 +1138,9 @@ atl_dev_set_eeprom(struct rte_eth_dev *dev, struct rte_dev_eeprom_info *eeprom)
 	    eeprom->data == NULL)
 		return -EINVAL;
 
+	if (eeprom->magic > 0x7F)
+		return -EINVAL;
+
 	if (eeprom->magic)
 		dev_addr = eeprom->magic;
 
-- 
2.17.1


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [dpdk-stable] [PATCH 18.11 07/10] net/atlantic: bad logic with offsets talking with firmware
  2019-05-18  9:47 [dpdk-stable] [PATCH 18.11 00/10] Aquantia atlantic bugfixes Igor Russkikh
                   ` (5 preceding siblings ...)
  2019-05-18  9:47 ` [dpdk-stable] [PATCH 18.11 06/10] net/atlantic: validity check for eeprom dev address Igor Russkikh
@ 2019-05-18  9:47 ` Igor Russkikh
  2019-05-18  9:47 ` [dpdk-stable] [PATCH 18.11 08/10] net/atlantic: flow control settings synchronization on rx Igor Russkikh
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: Igor Russkikh @ 2019-05-18  9:47 UTC (permalink / raw)
  To: stable, ktraynor; +Cc: Pavel Belous, Igor Russkikh, Pavel Belous

From: Pavel Belous <pavel.belous@aquantia.com>

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 <igor.russkikh@aquantia.com>
Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
Signed-off-by: Pavel Belous <Pavel.Belous@aquantia.com>
---
 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 63f333608dfc..648a45cc4eff 100644
--- a/drivers/net/atlantic/hw_atl/hw_atl_utils.c
+++ b/drivers/net/atlantic/hw_atl/hw_atl_utils.c
@@ -333,12 +333,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,
-- 
2.17.1


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [dpdk-stable] [PATCH 18.11 08/10] net/atlantic: flow control settings synchronization on rx
  2019-05-18  9:47 [dpdk-stable] [PATCH 18.11 00/10] Aquantia atlantic bugfixes Igor Russkikh
                   ` (6 preceding siblings ...)
  2019-05-18  9:47 ` [dpdk-stable] [PATCH 18.11 07/10] net/atlantic: bad logic with offsets talking with firmware Igor Russkikh
@ 2019-05-18  9:47 ` Igor Russkikh
  2019-05-18  9:47 ` [dpdk-stable] [PATCH 18.11 09/10] net/atlantic: use capability bits to detect eeprom access Igor Russkikh
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: Igor Russkikh @ 2019-05-18  9:47 UTC (permalink / raw)
  To: stable, ktraynor; +Cc: Pavel Belous, Igor Russkikh, Pavel Belous

From: Pavel Belous <pavel.belous@aquantia.com>

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 <igor.russkikh@aquantia.com>
Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
Signed-off-by: Pavel Belous <Pavel.Belous@aquantia.com>
---
 drivers/net/atlantic/atl_ethdev.c             | 25 +++++++++++++++----
 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(+), 5 deletions(-)

diff --git a/drivers/net/atlantic/atl_ethdev.c b/drivers/net/atlantic/atl_ethdev.c
index 45230d2f7cbe..572ce564053e 100644
--- a/drivers/net/atlantic/atl_ethdev.c
+++ b/drivers/net/atlantic/atl_ethdev.c
@@ -881,6 +881,7 @@ atl_dev_link_update(struct rte_eth_dev *dev, int wait __rte_unused)
 	struct atl_interrupt *intr =
 		ATL_DEV_PRIVATE_TO_INTR(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;
@@ -917,6 +918,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);
+	}
+
 	return 0;
 }
 
@@ -1178,16 +1188,21 @@ 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_nic_cfg->flow_control == 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 (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) && (fc & 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_TX)
 		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 96622745d495..83170856d003 100644
--- a/drivers/net/atlantic/atl_types.h
+++ b/drivers/net/atlantic/atl_types.h
@@ -133,6 +133,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 93738ec06abb..c679db361108 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 e0fb850c9aac..54d6765a148d 100644
--- a/drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c
+++ b/drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c
@@ -462,7 +462,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)
 {
@@ -660,6 +668,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,
-- 
2.17.1


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [dpdk-stable] [PATCH 18.11 09/10] net/atlantic: use capability bits to detect eeprom access
  2019-05-18  9:47 [dpdk-stable] [PATCH 18.11 00/10] Aquantia atlantic bugfixes Igor Russkikh
                   ` (7 preceding siblings ...)
  2019-05-18  9:47 ` [dpdk-stable] [PATCH 18.11 08/10] net/atlantic: flow control settings synchronization on rx Igor Russkikh
@ 2019-05-18  9:47 ` Igor Russkikh
  2019-05-18  9:47 ` [dpdk-stable] [PATCH 18.11 10/10] net/atlantic: fix link configuration Igor Russkikh
  2019-05-20 16:20 ` [dpdk-stable] [PATCH 18.11 00/10] Aquantia atlantic bugfixes Kevin Traynor
  10 siblings, 0 replies; 13+ messages in thread
From: Igor Russkikh @ 2019-05-18  9:47 UTC (permalink / raw)
  To: stable, ktraynor; +Cc: Pavel Belous, Igor Russkikh, Pavel Belous

From: Pavel Belous <pavel.belous@aquantia.com>

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 <igor.russkikh@aquantia.com>
Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
Signed-off-by: Pavel Belous <Pavel.Belous@aquantia.com>
---
 drivers/net/atlantic/atl_types.h                |  2 ++
 drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c | 12 +++++++++---
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/drivers/net/atlantic/atl_types.h b/drivers/net/atlantic/atl_types.h
index 83170856d003..c53d5896902c 100644
--- a/drivers/net/atlantic/atl_types.h
+++ b/drivers/net/atlantic/atl_types.h
@@ -94,6 +94,8 @@ struct aq_hw_s {
 	struct hw_atl_stats_s last_stats;
 	struct aq_stats_s curr_stats;
 
+	u32 caps_lo;
+
 	u64 speed;
 	unsigned int chip_features;
 	u32 fw_ver_actual;
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 54d6765a148d..7bf300998cf4 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 {
@@ -62,6 +61,7 @@ static int aq_fw2x_set_state(struct aq_hw_s *self,
 static int aq_fw2x_init(struct aq_hw_s *self)
 {
 	int err = 0;
+	struct hw_aq_atl_utils_mbox mbox;
 
 	/* check 10 times by 1ms */
 	AQ_HW_WAIT_FOR(0U != (self->mbox_addr =
@@ -70,6 +70,12 @@ static int aq_fw2x_init(struct aq_hw_s *self)
 	AQ_HW_WAIT_FOR(0U != (self->rpc_addr =
 		       aq_hw_read_reg(self, HW_ATL_FW2X_MPI_RPC_ADDR)),
 		       1000U, 100U);
+
+	/* Read caps */
+	hw_atl_utils_mpi_read_stats(self, &mbox);
+
+	self->caps_lo = mbox.info.caps_lo;
+
 	return err;
 }
 
@@ -502,7 +508,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;
@@ -580,7 +586,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;
-- 
2.17.1


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [dpdk-stable] [PATCH 18.11 10/10] net/atlantic: fix link configuration
  2019-05-18  9:47 [dpdk-stable] [PATCH 18.11 00/10] Aquantia atlantic bugfixes Igor Russkikh
                   ` (8 preceding siblings ...)
  2019-05-18  9:47 ` [dpdk-stable] [PATCH 18.11 09/10] net/atlantic: use capability bits to detect eeprom access Igor Russkikh
@ 2019-05-18  9:47 ` Igor Russkikh
  2019-05-20 16:20 ` [dpdk-stable] [PATCH 18.11 00/10] Aquantia atlantic bugfixes Kevin Traynor
  10 siblings, 0 replies; 13+ messages in thread
From: Igor Russkikh @ 2019-05-18  9:47 UTC (permalink / raw)
  To: stable, ktraynor; +Cc: Pavel Belous, Igor Russkikh, Pavel Belous

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.

Fixes: 7943ba05f67c ("net/atlantic: add link status and interrupt management")
Cc: stable@dpdk.org

Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: Pavel Belous <Pavel.Belous@aquantia.com>
---
 drivers/net/atlantic/atl_ethdev.c | 47 +++++++++++++------------------
 1 file changed, 20 insertions(+), 27 deletions(-)

diff --git a/drivers/net/atlantic/atl_ethdev.c b/drivers/net/atlantic/atl_ethdev.c
index 572ce564053e..dc6668fa5582 100644
--- a/drivers/net/atlantic/atl_ethdev.c
+++ b/drivers/net/atlantic/atl_ethdev.c
@@ -467,8 +467,6 @@ atl_dev_start(struct rte_eth_dev *dev)
 	struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
 	struct rte_intr_handle *intr_handle = &pci_dev->intr_handle;
 	uint32_t intr_vector = 0;
-	uint32_t *link_speeds;
-	uint32_t speed = 0;
 	int status;
 	int err;
 
@@ -545,6 +543,8 @@ atl_dev_start(struct rte_eth_dev *dev)
 		goto error;
 	}
 
+	err = atl_dev_set_link_up(dev);
+
 	err = hw->aq_fw_ops->update_link_status(hw);
 
 	if (err)
@@ -552,29 +552,6 @@ atl_dev_start(struct rte_eth_dev *dev)
 
 	dev->data->dev_link.link_status = hw->aq_link_status.mbps != 0;
 
-	link_speeds = &dev->data->dev_conf.link_speeds;
-
-	speed = 0x0;
-
-	if (*link_speeds == ETH_LINK_SPEED_AUTONEG) {
-		speed = hw->aq_nic_cfg->link_speed_msk;
-	} else {
-		if (*link_speeds & ETH_LINK_SPEED_10G)
-			speed |= AQ_NIC_RATE_10G;
-		if (*link_speeds & ETH_LINK_SPEED_5G)
-			speed |= AQ_NIC_RATE_5G;
-		if (*link_speeds & ETH_LINK_SPEED_1G)
-			speed |= AQ_NIC_RATE_1G;
-		if (*link_speeds & ETH_LINK_SPEED_2_5G)
-			speed |=  AQ_NIC_RATE_2G5;
-		if (*link_speeds & ETH_LINK_SPEED_100M)
-			speed |= AQ_NIC_RATE_100M;
-	}
-
-	err = hw->aq_fw_ops->set_link_speed(hw, speed);
-	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)
@@ -659,9 +636,25 @@ static int
 atl_dev_set_link_up(struct rte_eth_dev *dev)
 {
 	struct aq_hw_s *hw = ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	uint32_t link_speeds = dev->data->dev_conf.link_speeds;
+	uint32_t speed_mask = 0;
+
+	if (link_speeds == ETH_LINK_SPEED_AUTONEG) {
+		speed_mask = hw->aq_nic_cfg->link_speed_msk;
+	} else {
+		if (link_speeds & ETH_LINK_SPEED_10G)
+			speed_mask |= AQ_NIC_RATE_10G;
+		if (link_speeds & ETH_LINK_SPEED_5G)
+			speed_mask |= AQ_NIC_RATE_5G;
+		if (link_speeds & ETH_LINK_SPEED_1G)
+			speed_mask |= AQ_NIC_RATE_1G;
+		if (link_speeds & ETH_LINK_SPEED_2_5G)
+			speed_mask |=  AQ_NIC_RATE_2G5;
+		if (link_speeds & ETH_LINK_SPEED_100M)
+			speed_mask |= AQ_NIC_RATE_100M;
+	}
 
-	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);
 }
 
 /*
-- 
2.17.1


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [dpdk-stable] [PATCH 18.11 00/10] Aquantia atlantic bugfixes
  2019-05-18  9:47 [dpdk-stable] [PATCH 18.11 00/10] Aquantia atlantic bugfixes Igor Russkikh
                   ` (9 preceding siblings ...)
  2019-05-18  9:47 ` [dpdk-stable] [PATCH 18.11 10/10] net/atlantic: fix link configuration Igor Russkikh
@ 2019-05-20 16:20 ` Kevin Traynor
  2019-05-21  8:57   ` Igor Russkikh
  10 siblings, 1 reply; 13+ messages in thread
From: Kevin Traynor @ 2019-05-20 16:20 UTC (permalink / raw)
  To: Igor Russkikh, stable; +Cc: Pavel Belous

On 18/05/2019 10:47, Igor Russkikh wrote:
> This patchset contains various bugfixes found during verification
> and integration testing.
> 
> Most notable is eeprom access cleanup, fix for broadcast filter,
> flow control logic tracking, some code style cleanups.
> 
> Backported patchset
> 
> https://patches.dpdk.org/cover/53130/
> 
> to 18.11 stable
> 

Hi Igor, some of these patches won't apply, can you rebase against the
latest on dpdk-stable 18.11 branch.

Kevin.

> Igor Russkikh (5):
>   net/atlantic: enable broadcast traffic
>   net/atlantic: extra line at eof
>   net/atlantic: fix max eeprom size
>   net/atlantic: validity check for eeprom dev address
>   net/atlantic: fix link configuration
> 
> Pavel Belous (5):
>   net/atlantic: error handling for mailbox access
>   net/atlantic: eeprom get/set should consider offset
>   net/atlantic: bad logic with offsets talking with firmware
>   net/atlantic: flow control settings synchronization on rx
>   net/atlantic: use capability bits to detect eeprom access
> 
>  drivers/net/atlantic/atl_ethdev.c             | 102 +++++++++-----
>  drivers/net/atlantic/atl_rxtx.c               |   1 -
>  drivers/net/atlantic/atl_types.h              |   9 +-
>  drivers/net/atlantic/hw_atl/hw_atl_b0.c       |   8 ++
>  drivers/net/atlantic/hw_atl/hw_atl_b0.h       |   2 +
>  drivers/net/atlantic/hw_atl/hw_atl_utils.c    |  14 +-
>  drivers/net/atlantic/hw_atl/hw_atl_utils.h    |  16 +--
>  .../net/atlantic/hw_atl/hw_atl_utils_fw2x.c   | 130 +++++++++++++-----
>  8 files changed, 193 insertions(+), 89 deletions(-)
> 


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [dpdk-stable] [PATCH 18.11 00/10] Aquantia atlantic bugfixes
  2019-05-20 16:20 ` [dpdk-stable] [PATCH 18.11 00/10] Aquantia atlantic bugfixes Kevin Traynor
@ 2019-05-21  8:57   ` Igor Russkikh
  0 siblings, 0 replies; 13+ messages in thread
From: Igor Russkikh @ 2019-05-21  8:57 UTC (permalink / raw)
  To: Kevin Traynor, stable; +Cc: Pavel Belous


>> Backported patchset
>>
>> https://patches.dpdk.org/cover/53130/
>>
>> to 18.11 stable
>>
> 
> Hi Igor, some of these patches won't apply, can you rebase against the
> latest on dpdk-stable 18.11 branch.

Hi Kevin,

Sorry, indeed I forgot to use 18-11 tip branch.
Just rebased and resent v2.

Regards,
  Igor

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2019-05-21  8:57 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-18  9:47 [dpdk-stable] [PATCH 18.11 00/10] Aquantia atlantic bugfixes Igor Russkikh
2019-05-18  9:47 ` [dpdk-stable] [PATCH 18.11 01/10] net/atlantic: enable broadcast traffic Igor Russkikh
2019-05-18  9:47 ` [dpdk-stable] [PATCH 18.11 02/10] net/atlantic: extra line at eof Igor Russkikh
2019-05-18  9:47 ` [dpdk-stable] [PATCH 18.11 03/10] net/atlantic: error handling for mailbox access Igor Russkikh
2019-05-18  9:47 ` [dpdk-stable] [PATCH 18.11 04/10] net/atlantic: eeprom get/set should consider offset Igor Russkikh
2019-05-18  9:47 ` [dpdk-stable] [PATCH 18.11 05/10] net/atlantic: fix max eeprom size Igor Russkikh
2019-05-18  9:47 ` [dpdk-stable] [PATCH 18.11 06/10] net/atlantic: validity check for eeprom dev address Igor Russkikh
2019-05-18  9:47 ` [dpdk-stable] [PATCH 18.11 07/10] net/atlantic: bad logic with offsets talking with firmware Igor Russkikh
2019-05-18  9:47 ` [dpdk-stable] [PATCH 18.11 08/10] net/atlantic: flow control settings synchronization on rx Igor Russkikh
2019-05-18  9:47 ` [dpdk-stable] [PATCH 18.11 09/10] net/atlantic: use capability bits to detect eeprom access Igor Russkikh
2019-05-18  9:47 ` [dpdk-stable] [PATCH 18.11 10/10] net/atlantic: fix link configuration Igor Russkikh
2019-05-20 16:20 ` [dpdk-stable] [PATCH 18.11 00/10] Aquantia atlantic bugfixes Kevin Traynor
2019-05-21  8:57   ` Igor Russkikh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).