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.
139 lines
5.7 KiB
139 lines
5.7 KiB
From 1f902bdd64264c973b08200d6156e0ac63bcfe8b Mon Sep 17 00:00:00 2001
|
|
From: Igor Russkikh <irusskik@redhat.com>
|
|
Date: Fri, 6 Nov 2020 18:36:22 -0500
|
|
Subject: [PATCH 005/139] [netdrv] net: aquantia: added vlan offload related
|
|
macros and functions
|
|
|
|
Message-id: <1604687916-15087-6-git-send-email-irusskik@redhat.com>
|
|
Patchwork-id: 338431
|
|
Patchwork-instance: patchwork
|
|
O-Subject: [RHEL8.4 BZ 1857861 005/139] net: aquantia: added vlan offload related macros and functions
|
|
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 161dea83f1c7304403ceb66645f3acda47f997da
|
|
Author: Igor Russkikh <Igor.Russkikh@aquantia.com>
|
|
Date: Wed Jun 26 12:35:42 2019 +0000
|
|
|
|
net: aquantia: added vlan offload related macros and functions
|
|
|
|
Register declaration macros required to work with vlan offload mode.
|
|
|
|
Tested-by: Nikita Danilov <ndanilov@aquantia.com>
|
|
Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.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>
|
|
---
|
|
.../aquantia/atlantic/hw_atl/hw_atl_b0_internal.h | 7 +++++++
|
|
.../net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.c | 16 ++++++++++++++++
|
|
.../net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.h | 5 +++++
|
|
.../aquantia/atlantic/hw_atl/hw_atl_llh_internal.h | 18 ++++++++++++++++++
|
|
4 files changed, 46 insertions(+)
|
|
|
|
diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0_internal.h b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0_internal.h
|
|
index e4ba2ccf9830..808d8cd4252a 100644
|
|
--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0_internal.h
|
|
+++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0_internal.h
|
|
@@ -107,10 +107,17 @@
|
|
#define HW_ATL_B0_RXD_NCEA0 (0x1)
|
|
|
|
#define HW_ATL_B0_RXD_WB_STAT_RSSTYPE (0x0000000F)
|
|
+#define HW_ATL_B0_RXD_WB_STAT_RSSTYPE_SHIFT (0x0)
|
|
#define HW_ATL_B0_RXD_WB_STAT_PKTTYPE (0x00000FF0)
|
|
+#define HW_ATL_B0_RXD_WB_STAT_PKTTYPE_SHIFT (0x4)
|
|
#define HW_ATL_B0_RXD_WB_STAT_RXCTRL (0x00180000)
|
|
+#define HW_ATL_B0_RXD_WB_STAT_RXCTRL_SHIFT (0x13)
|
|
#define HW_ATL_B0_RXD_WB_STAT_SPLHDR (0x00200000)
|
|
#define HW_ATL_B0_RXD_WB_STAT_HDRLEN (0xFFC00000)
|
|
+#define HW_ATL_B0_RXD_WB_STAT_HDRLEN_SHIFT (0x16)
|
|
+
|
|
+#define HW_ATL_B0_RXD_WB_PKTTYPE_VLAN BIT(5)
|
|
+#define HW_ATL_B0_RXD_WB_PKTTYPE_VLAN_DOUBLE BIT(6)
|
|
|
|
#define HW_ATL_B0_RXD_WB_STAT2_DD (0x0001)
|
|
#define HW_ATL_B0_RXD_WB_STAT2_EOP (0x0002)
|
|
diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.c b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.c
|
|
index 451529069f28..1149812ae463 100644
|
|
--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.c
|
|
+++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.c
|
|
@@ -1004,6 +1004,22 @@ void hw_atl_rpo_rx_desc_vlan_stripping_set(struct aq_hw_s *aq_hw,
|
|
rx_desc_vlan_stripping);
|
|
}
|
|
|
|
+void hw_atl_rpo_outer_vlan_tag_mode_set(void *context,
|
|
+ u32 outervlantagmode)
|
|
+{
|
|
+ aq_hw_write_reg_bit(context, HW_ATL_RPO_OUTER_VL_INS_MODE_ADR,
|
|
+ HW_ATL_RPO_OUTER_VL_INS_MODE_MSK,
|
|
+ HW_ATL_RPO_OUTER_VL_INS_MODE_SHIFT,
|
|
+ outervlantagmode);
|
|
+}
|
|
+
|
|
+u32 hw_atl_rpo_outer_vlan_tag_mode_get(void *context)
|
|
+{
|
|
+ return aq_hw_read_reg_bit(context, HW_ATL_RPO_OUTER_VL_INS_MODE_ADR,
|
|
+ HW_ATL_RPO_OUTER_VL_INS_MODE_MSK,
|
|
+ HW_ATL_RPO_OUTER_VL_INS_MODE_SHIFT);
|
|
+}
|
|
+
|
|
void hw_atl_rpo_tcp_udp_crc_offload_en_set(struct aq_hw_s *aq_hw,
|
|
u32 tcp_udp_crc_offload_en)
|
|
{
|
|
diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.h b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.h
|
|
index 34b42ce43512..0c37abbabca5 100644
|
|
--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.h
|
|
+++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.h
|
|
@@ -488,6 +488,11 @@ void hw_atl_rpo_rx_desc_vlan_stripping_set(struct aq_hw_s *aq_hw,
|
|
u32 rx_desc_vlan_stripping,
|
|
u32 descriptor);
|
|
|
|
+void hw_atl_rpo_outer_vlan_tag_mode_set(void *context,
|
|
+ u32 outervlantagmode);
|
|
+
|
|
+u32 hw_atl_rpo_outer_vlan_tag_mode_get(void *context);
|
|
+
|
|
/* set tcp/udp checksum offload enable */
|
|
void hw_atl_rpo_tcp_udp_crc_offload_en_set(struct aq_hw_s *aq_hw,
|
|
u32 tcp_udp_crc_offload_en);
|
|
diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh_internal.h b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh_internal.h
|
|
index fc1446f737bb..c3febcdfa92e 100644
|
|
--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh_internal.h
|
|
+++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh_internal.h
|
|
@@ -1383,6 +1383,24 @@
|
|
/* default value of bitfield l4_chk_en */
|
|
#define HW_ATL_RPOL4CHK_EN_DEFAULT 0x0
|
|
|
|
+/* RX outer_vl_ins_mode Bitfield Definitions
|
|
+ * Preprocessor definitions for the bitfield "outer_vl_ins_mode".
|
|
+ * PORT="pif_rpo_outer_vl_mode_i"
|
|
+ */
|
|
+
|
|
+/* Register address for bitfield outer_vl_ins_mode */
|
|
+#define HW_ATL_RPO_OUTER_VL_INS_MODE_ADR 0x00005580
|
|
+/* Bitmask for bitfield outer_vl_ins_mode */
|
|
+#define HW_ATL_RPO_OUTER_VL_INS_MODE_MSK 0x00000004
|
|
+/* Inverted bitmask for bitfield outer_vl_ins_mode */
|
|
+#define HW_ATL_RPO_OUTER_VL_INS_MODE_MSKN 0xFFFFFFFB
|
|
+/* Lower bit position of bitfield outer_vl_ins_mode */
|
|
+#define HW_ATL_RPO_OUTER_VL_INS_MODE_SHIFT 2
|
|
+/* Width of bitfield outer_vl_ins_mode */
|
|
+#define HW_ATL_RPO_OUTER_VL_INS_MODE_WIDTH 1
|
|
+/* Default value of bitfield outer_vl_ins_mode */
|
|
+#define HW_ATL_RPO_OUTER_VL_INS_MODE_DEFAULT 0x0
|
|
+
|
|
/* rx reg_res_dsbl bitfield definitions
|
|
* preprocessor definitions for the bitfield "reg_res_dsbl".
|
|
* port="pif_rx_reg_res_dsbl_i"
|
|
--
|
|
2.13.6
|
|
|