You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
156 lines
5.9 KiB
156 lines
5.9 KiB
From 8095efeaaa3a8bf4eaddded46439374b45a4b38a Mon Sep 17 00:00:00 2001
|
|
From: Igor Russkikh <irusskik@redhat.com>
|
|
Date: Fri, 6 Nov 2020 18:38:05 -0500
|
|
Subject: [PATCH 108/139] [netdrv] net: atlantic: A2: flow control support
|
|
|
|
Message-id: <1604687916-15087-109-git-send-email-irusskik@redhat.com>
|
|
Patchwork-id: 338539
|
|
Patchwork-instance: patchwork
|
|
O-Subject: [RHEL8.4 BZ 1857861 108/139] net: atlantic: A2: flow control support
|
|
Bugzilla: 1857861
|
|
RH-Acked-by: David Arcari <darcari@redhat.com>
|
|
RH-Acked-by: John Linville <linville@redhat.com>
|
|
RH-Acked-by: Tony Camuso <tcamuso@redhat.com>
|
|
|
|
Bugzilla: http://bugzilla.redhat.com/1857861
|
|
|
|
commit 3e168de529b14edd13c6842ff7bd415f25672db8
|
|
Author: Igor Russkikh <irusskikh@marvell.com>
|
|
Date: Mon Jun 22 17:53:07 2020 +0300
|
|
|
|
net: atlantic: A2: flow control support
|
|
|
|
This patch adds flow control support on A2.
|
|
|
|
Co-developed-by: Dmitry Bogdanov <dbogdanov@marvell.com>
|
|
Signed-off-by: Dmitry Bogdanov <dbogdanov@marvell.com>
|
|
Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
|
|
Signed-off-by: David S. Miller <davem@davemloft.net>
|
|
|
|
Signed-off-by: Igor Russkikh <irusskik@redhat.com>
|
|
|
|
Cc: David Arcari <darcari@redhat.com>
|
|
Cc: Igor Russkikh <irusskik@redhat.com>
|
|
Signed-off-by: Jan Stancek <jstancek@redhat.com>
|
|
---
|
|
.../ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c | 2 +-
|
|
.../ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.h | 2 ++
|
|
.../ethernet/aquantia/atlantic/hw_atl2/hw_atl2.c | 3 ++
|
|
.../aquantia/atlantic/hw_atl2/hw_atl2_utils_fw.c | 36 ++++++++++++++++++++++
|
|
4 files changed, 42 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c
|
|
index 14d79f70cad7..8ed6fd845969 100644
|
|
--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c
|
|
+++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c
|
|
@@ -108,7 +108,7 @@ static int hw_atl_b0_hw_reset(struct aq_hw_s *self)
|
|
return err;
|
|
}
|
|
|
|
-static int hw_atl_b0_set_fc(struct aq_hw_s *self, u32 fc, u32 tc)
|
|
+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);
|
|
|
|
diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.h b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.h
|
|
index 30f468f2084d..bd9a6fb005c9 100644
|
|
--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.h
|
|
+++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.h
|
|
@@ -62,6 +62,8 @@ void hw_atl_b0_hw_init_rx_rss_ctrl1(struct aq_hw_s *self);
|
|
|
|
int hw_atl_b0_hw_mac_addr_set(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_start(struct aq_hw_s *self);
|
|
|
|
int hw_atl_b0_hw_irq_enable(struct aq_hw_s *self, u64 mask);
|
|
diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2.c b/drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2.c
|
|
index 239d077e21d7..c306c26e802b 100644
|
|
--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2.c
|
|
+++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2.c
|
|
@@ -181,6 +181,8 @@ static int hw_atl2_hw_qos_set(struct aq_hw_s *self)
|
|
|
|
threshold = (rx_buff_size * (1024U / 32U) * 50U) / 100U;
|
|
hw_atl_rpb_rx_buff_lo_threshold_per_tc_set(self, threshold, tc);
|
|
+
|
|
+ hw_atl_b0_set_fc(self, self->aq_nic_cfg->fc.req, tc);
|
|
}
|
|
|
|
/* QoS 802.1p priority -> TC mapping */
|
|
@@ -841,4 +843,5 @@ const struct aq_hw_ops hw_atl2_ops = {
|
|
.hw_get_hw_stats = hw_atl2_utils_get_hw_stats,
|
|
.hw_get_fw_version = hw_atl2_utils_get_fw_version,
|
|
.hw_set_offload = hw_atl_b0_hw_offload_set,
|
|
+ .hw_set_fc = hw_atl_b0_set_fc,
|
|
};
|
|
diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2_utils_fw.c b/drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2_utils_fw.c
|
|
index 9216517f6e65..0edcc0253b2e 100644
|
|
--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2_utils_fw.c
|
|
+++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2_utils_fw.c
|
|
@@ -190,6 +190,15 @@ static int aq_a2_fw_set_link_speed(struct aq_hw_s *self, u32 speed)
|
|
return hw_atl2_shared_buffer_finish_ack(self);
|
|
}
|
|
|
|
+static void aq_a2_fw_set_mpi_flow_control(struct aq_hw_s *self,
|
|
+ struct link_options_s *link_options)
|
|
+{
|
|
+ u32 flow_control = self->aq_nic_cfg->fc.req;
|
|
+
|
|
+ link_options->pause_rx = !!(flow_control & AQ_NIC_FC_RX);
|
|
+ link_options->pause_tx = !!(flow_control & AQ_NIC_FC_TX);
|
|
+}
|
|
+
|
|
static void aq_a2_fw_upd_eee_rate_bits(struct aq_hw_s *self,
|
|
struct link_options_s *link_options,
|
|
u32 eee_speeds)
|
|
@@ -213,6 +222,7 @@ static int aq_a2_fw_set_state(struct aq_hw_s *self,
|
|
link_options.link_up = 1U;
|
|
aq_a2_fw_upd_eee_rate_bits(self, &link_options,
|
|
self->aq_nic_cfg->eee_speeds);
|
|
+ aq_a2_fw_set_mpi_flow_control(self, &link_options);
|
|
break;
|
|
case MPI_DEINIT:
|
|
link_options.link_up = 0U;
|
|
@@ -363,6 +373,30 @@ static int aq_a2_fw_renegotiate(struct aq_hw_s *self)
|
|
return err;
|
|
}
|
|
|
|
+static int aq_a2_fw_set_flow_control(struct aq_hw_s *self)
|
|
+{
|
|
+ struct link_options_s link_options;
|
|
+
|
|
+ hw_atl2_shared_buffer_get(self, link_options, link_options);
|
|
+
|
|
+ aq_a2_fw_set_mpi_flow_control(self, &link_options);
|
|
+
|
|
+ hw_atl2_shared_buffer_write(self, link_options, link_options);
|
|
+
|
|
+ return hw_atl2_shared_buffer_finish_ack(self);
|
|
+}
|
|
+
|
|
+static u32 aq_a2_fw_get_flow_control(struct aq_hw_s *self, u32 *fcmode)
|
|
+{
|
|
+ struct link_status_s link_status;
|
|
+
|
|
+ hw_atl2_shared_buffer_read(self, link_status, link_status);
|
|
+
|
|
+ *fcmode = ((link_status.pause_rx) ? AQ_NIC_FC_RX : 0) |
|
|
+ ((link_status.pause_tx) ? AQ_NIC_FC_TX : 0);
|
|
+ return 0;
|
|
+}
|
|
+
|
|
u32 hw_atl2_utils_get_fw_version(struct aq_hw_s *self)
|
|
{
|
|
struct version_s version;
|
|
@@ -402,4 +436,6 @@ const struct aq_fw_ops aq_a2_fw_ops = {
|
|
.update_stats = aq_a2_fw_update_stats,
|
|
.set_eee_rate = aq_a2_fw_set_eee_rate,
|
|
.get_eee_rate = aq_a2_fw_get_eee_rate,
|
|
+ .set_flow_control = aq_a2_fw_set_flow_control,
|
|
+ .get_flow_control = aq_a2_fw_get_flow_control,
|
|
};
|
|
--
|
|
2.13.6
|
|
|