Skip to contentSkip to conversation

update i40e base code

PATCH Superseded Guinan Sun 4 participants 53 messages Jul 21, 2020 – Sep 4, 2020 Network drivers

lore
Share & tools
lore

Guinan Sun

author
#0 lore raw

cover update i40e base code

update i40e base code.

source code of i40e driver:
cid-i40e.2020.07.16.tar.gz dropped by the team which develop basic drivers for any i40e NIC.

changelog in ND share repo:
From fc99a1143d3f ("i40e-shared: FEC on/off support flag for X722") To 673ff35c1c73 ("i40e-shared: Add support for firmware lockdown")

The following commits are ignored.
ea2cd04e5db1 ("i40e-shared: do AQ calls without sleeping by default") 4eec86f12992 ("i40e-shared: Fix undeclared i40e_asq_send_command() function") 9d60cec99eb7 ("i40e-shared: Send rx ctl write command in atomic context") a204afdc1cad ("i40e-shared: Send uc/mc commands in atomic context") d22f8cb2a111 ("i40e-shared: Send commands in atomic context") 136a7d931a45 ("i40e-shared: Fix improper preprocessor conditional")

Guinan Sun (8):
net/i40e/base: enable FEC on/off flag setting for X722 net/i40e/base: add PTYPE definition net/i40e/base: enable new custom cloud filters net/i40e/base: update FVL FW API version to 1.11 net/i40e/base: check return value of DNL admin command net/i40e/base: add disable unused ports capability net/i40e/base: replace AQ command for NVM update net/i40e/base: update version

 drivers/net/i40e/base/README            |  2 +-
 drivers/net/i40e/base/i40e_adminq.c     |  6 +++
 drivers/net/i40e/base/i40e_adminq_cmd.h | 19 +++++++-
 drivers/net/i40e/base/i40e_common.c     | 61 +++++++++++++++----------
 drivers/net/i40e/base/i40e_prototype.h  |  6 ++-
 drivers/net/i40e/base/i40e_type.h       |  5 +-
 6 files changed, 70 insertions(+), 29 deletions(-)
Signature · 1 line
2.17.1
author
#1 lore raw

PATCH 1/8 net/i40e/base: enable FEC on/off flag setting for X722

Starting with API version 1.10 firmware for X722 devices has ability to change FEC settings in PHY. Code added in this patch checks API version and sets appropriate capability flag.

---
 drivers/net/i40e/base/i40e_adminq.c     | 6 ++++++
 drivers/net/i40e/base/i40e_adminq_cmd.h | 2 ++
 drivers/net/i40e/base/i40e_type.h       | 1 +
 3 files changed, 9 insertions(+)
drivers/net/i40e/base/i40e_adminq.c +6 -0
index c89e1fb3f..0da45f03e 100644
@@ -603,6 +603,12 @@ STATIC void i40e_set_hw_flags(struct i40e_hw *hw)
 		    (aq->api_maj_ver == 1 &&
 		     aq->api_min_ver >= I40E_MINOR_VER_GET_LINK_INFO_X722))
 			hw->flags |= I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE;
+
+		if (aq->api_maj_ver > 1 ||
+		    (aq->api_maj_ver == 1 &&
+		     aq->api_min_ver >= I40E_MINOR_VER_FW_REQUEST_FEC_X722))
+			hw->flags |= I40E_HW_FLAG_X722_FEC_REQUEST_CAPABLE;
+
 		/* fall through */
 	default:
 		break;
drivers/net/i40e/base/i40e_adminq_cmd.h +2 -0
index 1905167f5..f790183be 100644
@@ -25,6 +25,8 @@
 #define I40E_MINOR_VER_GET_LINK_INFO_X722 0x0009
 /* API version 1.6 for X722 devices adds ability to stop FW LLDP agent */
 #define I40E_MINOR_VER_FW_LLDP_STOPPABLE_X722 0x0006
+/* API version 1.10 for X722 devices adds ability to request FEC encoding */
+#define I40E_MINOR_VER_FW_REQUEST_FEC_X722 0x000A
 
 struct i40e_aq_desc {
 	__le16 flags;
drivers/net/i40e/base/i40e_type.h +1 -0
index 014a4c132..b5b5b928d 100644
@@ -745,6 +745,7 @@ struct i40e_hw {
 #define I40E_HW_FLAG_FW_LLDP_PERSISTENT     BIT_ULL(5)
 #define I40E_HW_FLAG_AQ_PHY_ACCESS_EXTENDED BIT_ULL(6)
 #define I40E_HW_FLAG_DROP_MODE		    BIT_ULL(7)
+#define I40E_HW_FLAG_X722_FEC_REQUEST_CAPABLE BIT_ULL(8)
 	u64 flags;
 
 	/* Used in set switch config AQ command */
Signature · 1 line
2.17.1
Acked-by on v1 1/8
#2 lore raw

Re: [dpdk-dev] [PATCH 1/8] net/i40e/base: enable FEC on/off flag setting for X722

Quoted 54 lines · Guinan Sun

Starting with API version 1.10 firmware for X722 devices has ability to change FEC settings in PHY. Code added in this patch checks API version and sets appropriate capability flag.

---
  drivers/net/i40e/base/i40e_adminq.c     | 6 ++++++
  drivers/net/i40e/base/i40e_adminq_cmd.h | 2 ++
  drivers/net/i40e/base/i40e_type.h       | 1 +
  3 files changed, 9 insertions(+)
drivers/net/i40e/base/i40e_adminq.c +6 -0
index c89e1fb3f..0da45f03e 100644
@@ -603,6 +603,12 @@ STATIC void i40e_set_hw_flags(struct i40e_hw *hw)
  		    (aq->api_maj_ver == 1 &&
  		     aq->api_min_ver >= I40E_MINOR_VER_GET_LINK_INFO_X722))
  			hw->flags |= I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE;
+
+		if (aq->api_maj_ver > 1 ||
+		    (aq->api_maj_ver == 1 &&
+		     aq->api_min_ver >= I40E_MINOR_VER_FW_REQUEST_FEC_X722))
+			hw->flags |= I40E_HW_FLAG_X722_FEC_REQUEST_CAPABLE;
+
  		/* fall through */
  	default:
  		break;
drivers/net/i40e/base/i40e_adminq_cmd.h +2 -0
index 1905167f5..f790183be 100644
@@ -25,6 +25,8 @@
  #define I40E_MINOR_VER_GET_LINK_INFO_X722 0x0009
  /* API version 1.6 for X722 devices adds ability to stop FW LLDP agent */
  #define I40E_MINOR_VER_FW_LLDP_STOPPABLE_X722 0x0006
+/* API version 1.10 for X722 devices adds ability to request FEC encoding */
+#define I40E_MINOR_VER_FW_REQUEST_FEC_X722 0x000A
 
  struct i40e_aq_desc {
  	__le16 flags;
drivers/net/i40e/base/i40e_type.h +1 -0
index 014a4c132..b5b5b928d 100644
@@ -745,6 +745,7 @@ struct i40e_hw {
  #define I40E_HW_FLAG_FW_LLDP_PERSISTENT     BIT_ULL(5)
  #define I40E_HW_FLAG_AQ_PHY_ACCESS_EXTENDED BIT_ULL(6)
  #define I40E_HW_FLAG_DROP_MODE		    BIT_ULL(7)
+#define I40E_HW_FLAG_X722_FEC_REQUEST_CAPABLE BIT_ULL(8)
  	u64 flags;
 
  	/* Used in set switch config AQ command */
author
#3 lore raw

PATCH 2/8 net/i40e/base: add PTYPE definition

In reply to Guinan Sun

Add I40E_RX_PTYPE_PARSER_ABORTED definition, so i40e driver will know opcode for parser aborted packets.
Without this definition driver would have to rely on magic numbers.

---
 drivers/net/i40e/base/i40e_type.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/i40e/base/i40e_type.h +2 -1
index b5b5b928d..0eeb55975 100644
@@ -961,7 +961,8 @@ enum i40e_rx_l2_ptype {
 	I40E_RX_PTYPE_GRENAT4_MAC_PAY3			= 58,
 	I40E_RX_PTYPE_GRENAT4_MACVLAN_IPV6_ICMP_PAY4	= 87,
 	I40E_RX_PTYPE_GRENAT6_MAC_PAY3			= 124,
-	I40E_RX_PTYPE_GRENAT6_MACVLAN_IPV6_ICMP_PAY4	= 153
+	I40E_RX_PTYPE_GRENAT6_MACVLAN_IPV6_ICMP_PAY4	= 153,
+	I40E_RX_PTYPE_PARSER_ABORTED			= 255
 };
 
 struct i40e_rx_ptype_decoded {
Signature · 1 line
2.17.1
Acked-by on v1 2/8
#4 lore raw

Re: [dpdk-dev] [PATCH 2/8] net/i40e/base: add PTYPE definition

Quoted 24 lines · Guinan Sun

Add I40E_RX_PTYPE_PARSER_ABORTED definition, so i40e driver will know opcode for parser aborted packets.
Without this definition driver would have to rely on magic numbers.

---
  drivers/net/i40e/base/i40e_type.h | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/i40e/base/i40e_type.h +2 -1
index b5b5b928d..0eeb55975 100644
@@ -961,7 +961,8 @@ enum i40e_rx_l2_ptype {
  	I40E_RX_PTYPE_GRENAT4_MAC_PAY3			= 58,
  	I40E_RX_PTYPE_GRENAT4_MACVLAN_IPV6_ICMP_PAY4	= 87,
  	I40E_RX_PTYPE_GRENAT6_MAC_PAY3			= 124,
-	I40E_RX_PTYPE_GRENAT6_MACVLAN_IPV6_ICMP_PAY4	= 153
+	I40E_RX_PTYPE_GRENAT6_MACVLAN_IPV6_ICMP_PAY4	= 153,
+	I40E_RX_PTYPE_PARSER_ABORTED			= 255
  };
 
  struct i40e_rx_ptype_decoded {
author
#5 lore raw

PATCH 3/8 net/i40e/base: enable new custom cloud filters

In reply to Guinan Sun

This patch adds the new filter types needed for custom cloud filters. These custom cloud filters will route traffic to VFs based on the dst IP for both tunneled and non-tunneled packets.

---
 drivers/net/i40e/base/i40e_adminq_cmd.h | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/i40e/base/i40e_adminq_cmd.h +2 -0
index f790183be..21f544840 100644
@@ -1406,6 +1406,8 @@ struct i40e_aqc_cloud_filters_element_data {
 #define I40E_AQC_ADD_CLOUD_FILTER_IMAC			0x000A
 #define I40E_AQC_ADD_CLOUD_FILTER_OMAC_TEN_ID_IMAC	0x000B
 #define I40E_AQC_ADD_CLOUD_FILTER_IIP			0x000C
+#define I40E_AQC_ADD_CLOUD_FILTER_OIP1			0x0010
+#define I40E_AQC_ADD_CLOUD_FILTER_OIP2			0x0012
 /* 0x000D reserved */
 /* 0x000E reserved */
 /* 0x000F reserved */
Signature · 1 line
2.17.1
#6 lore raw

Re: [dpdk-dev] [PATCH 3/8] net/i40e/base: enable new custom cloud filters

hi, guinan

This patch is just define some new types but not enable a feature, could the title to be "add new custom cloud filters types",

is it better and could eliminate some confuse?

Quoted 23 lines · Guinan Sun

This patch adds the new filter types needed for custom cloud filters. These custom cloud filters will route traffic to VFs based on the dst IP for both tunneled and non-tunneled packets.

---
  drivers/net/i40e/base/i40e_adminq_cmd.h | 2 ++
  1 file changed, 2 insertions(+)
drivers/net/i40e/base/i40e_adminq_cmd.h +2 -0
index f790183be..21f544840 100644
@@ -1406,6 +1406,8 @@ struct i40e_aqc_cloud_filters_element_data {
  #define I40E_AQC_ADD_CLOUD_FILTER_IMAC			0x000A
  #define I40E_AQC_ADD_CLOUD_FILTER_OMAC_TEN_ID_IMAC	0x000B
  #define I40E_AQC_ADD_CLOUD_FILTER_IIP			0x000C
+#define I40E_AQC_ADD_CLOUD_FILTER_OIP1			0x0010
+#define I40E_AQC_ADD_CLOUD_FILTER_OIP2			0x0012
  /* 0x000D reserved */
  /* 0x000E reserved */
  /* 0x000F reserved */
#7 lore raw

Re: [dpdk-dev] [PATCH 3/8] net/i40e/base: enable new custom cloud filters

Hi Jeff

Quoted 8 lines

-----Original Message-----
From: Guo, Jia
Sent: Monday, July 27, 2020 11:53 AM
To: Sun, GuinanX <[email protected]>; [email protected]
Cc: Xing, Beilei <[email protected]>; Ramamurthy, Harshitha <[email protected]>
Subject: Re: [PATCH 3/8] net/i40e/base: enable new custom cloud filters

Quoted 6 lines

hi, guinan

This patch is just define some new types but not enable a feature, could the title to be "add new custom cloud filters types",

is it better and could eliminate some confuse?

I agree with you.
Patch V2 will modify it.

Quoted 30 lines · Guinan Sun
Quoted 16 lines

This patch adds the new filter types needed for custom cloud filters. These custom cloud filters will route traffic to VFs based on the dst IP for both tunneled and non-tunneled packets.

---
  drivers/net/i40e/base/i40e_adminq_cmd.h | 2 ++
  1 file changed, 2 insertions(+)
drivers/net/i40e/base/i40e_adminq_cmd.h +0 -0
index f790183be..21f544840 100644

drivers/net/i40e/base/i40e_adminq_cmd.h struct i40e_aqc_cloud_filters_element_data { · line 1406

Quoted 1 line
drivers/net/i40e/base/i40e_adminq_cmd.h +0 -0
@@ -1406,6 +1406,8 @@ struct i40e_aqc_cloud_filters_element_data {
  #define I40E_AQC_ADD_CLOUD_FILTER_IMAC
	0x000A

drivers/net/i40e/base/i40e_adminq_cmd.h struct i40e_aqc_cloud_filters_element_data { · line 1407

Quoted 1 line
drivers/net/i40e/base/i40e_adminq_cmd.h +0 -0
  #define I40E_AQC_ADD_CLOUD_FILTER_OMAC_TEN_ID_IMAC
	0x000B

drivers/net/i40e/base/i40e_adminq_cmd.h struct i40e_aqc_cloud_filters_element_data { · line 1409

Quoted 2 lines
drivers/net/i40e/base/i40e_adminq_cmd.h +1 -0
  #define I40E_AQC_ADD_CLOUD_FILTER_IIP			0x000C
+#define I40E_AQC_ADD_CLOUD_FILTER_OIP1
	0x0010

drivers/net/i40e/base/i40e_adminq_cmd.h struct i40e_aqc_cloud_filters_element_data { · line 1410

Quoted 1 line
drivers/net/i40e/base/i40e_adminq_cmd.h +1 -0
+#define I40E_AQC_ADD_CLOUD_FILTER_OIP2
	0x0012
Quoted 3 lines
drivers/net/i40e/base/i40e_adminq_cmd.h +0 -0
  /* 0x000D reserved */
  /* 0x000E reserved */
  /* 0x000F reserved */
author
#8 lore raw

PATCH 4/8 net/i40e/base: update FVL FW API version to 1.11

In reply to Guinan Sun

Upcoming FVL FW increment API version to 1.11 due to new bit and new fields in the Replace Cloud Filters AQ command.

---
 drivers/net/i40e/base/i40e_adminq_cmd.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/i40e/base/i40e_adminq_cmd.h +1 -1
index 21f544840..e1018ed49 100644
@@ -13,7 +13,7 @@
 
 #define I40E_FW_API_VERSION_MAJOR	0x0001
 #define I40E_FW_API_VERSION_MINOR_X722	0x000A
-#define I40E_FW_API_VERSION_MINOR_X710	0x000A
+#define I40E_FW_API_VERSION_MINOR_X710	0x000B
 
 #define I40E_FW_MINOR_VERSION(_h) ((_h)->mac.type == I40E_MAC_XL710 ? \
 					I40E_FW_API_VERSION_MINOR_X710 : \
Signature · 1 line
2.17.1
author
#9 lore raw

PATCH 5/8 net/i40e/base: check return value of DNL admin command

In reply to Guinan Sun

Check return value of running DNL admin command.

---
 drivers/net/i40e/base/i40e_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/i40e/base/i40e_common.c +1 -1
index 46a0b7881..85c22849e 100644
@@ -7097,7 +7097,7 @@ enum i40e_status_code i40e_get_lpi_counters(struct i40e_hw *hw,
 				I40E_AQ_RUN_PHY_ACT_DNL_OPCODE_GET_EEE_STAT,
 				&cmd_status, tx_counter, rx_counter, NULL);
 
-		if (cmd_status != I40E_AQ_RUN_PHY_ACT_CMD_STAT_SUCC)
+		if (!retval && cmd_status != I40E_AQ_RUN_PHY_ACT_CMD_STAT_SUCC)
 			retval = I40E_ERR_ADMIN_QUEUE_ERROR;
 
 		return retval;
Signature · 1 line
2.17.1
#10 lore raw

Re: [dpdk-dev] [PATCH 5/8] net/i40e/base: check return value of DNL admin command

hi, guinan

Quoted 1 line · Guinan Sun

Check return value of running DNL admin command.

What is "DNL", I am not sure i know the reason it appear here, could you double check it?

Quoted 20 lines
---
  drivers/net/i40e/base/i40e_common.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/i40e/base/i40e_common.c +1 -1
index 46a0b7881..85c22849e 100644
@@ -7097,7 +7097,7 @@ enum i40e_status_code i40e_get_lpi_counters(struct i40e_hw *hw,
  				I40E_AQ_RUN_PHY_ACT_DNL_OPCODE_GET_EEE_STAT,
  				&cmd_status, tx_counter, rx_counter, NULL);
 
-		if (cmd_status != I40E_AQ_RUN_PHY_ACT_CMD_STAT_SUCC)
+		if (!retval && cmd_status != I40E_AQ_RUN_PHY_ACT_CMD_STAT_SUCC)
  			retval = I40E_ERR_ADMIN_QUEUE_ERROR;
 
  		return retval;
#11 lore raw

Re: [dpdk-dev] [PATCH 5/8] net/i40e/base: check return value of DNL admin command

Hi Jeff

Quoted 9 lines

-----Original Message-----
From: Guo, Jia
Sent: Monday, July 27, 2020 12:08 PM
To: Sun, GuinanX <[email protected]>; [email protected]
Cc: Xing, Beilei <[email protected]>; Ludkiewicz, Adam <[email protected]>
Subject: Re: [PATCH 5/8] net/i40e/base: check return value of DNL admin command

Quoted 9 lines

hi, guinan

Quoted 1 line · Guinan Sun

Check return value of running DNL admin command.

What is "DNL", I am not sure i know the reason it appear here, could you double check it?

Regarding what DNL stands for, I haven't found it in the code and datasheet.
It can be seen from the code change that the return value check operation of i40e_aq_run_phy_activity has been added. The description of this function is RUN DNL admin command.
So tile and commit log have made such changes.

Quoted 25 lines

Review

Quoted 9 lines
---
  drivers/net/i40e/base/i40e_common.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
(quoted diff) +0 -0

b/drivers/net/i40e/base/i40e_common.c

drivers/net/i40e/base/i40e_common.c enum i40e_status_code

Quoted 4 lines

index 46a0b7881..85c22849e 100644

drivers/net/i40e/base/i40e_common.c +0 -0
@@ -7097,7 +7097,7 @@ enum i40e_status_code

i40e_get_lpi_counters(struct i40e_hw *hw,

Quoted 1 line
	I40E_AQ_RUN_PHY_ACT_DNL_OPCODE_GET_EEE_STAT,

drivers/net/i40e/base/i40e_common.c

Quoted 4 lines

&cmd_status, tx_counter, rx_counter, NULL);

drivers/net/i40e/base/i40e_common.c +1 -1
-		if (cmd_status != I40E_AQ_RUN_PHY_ACT_CMD_STAT_SUCC)
+		if (!retval && cmd_status !=

I40E_AQ_RUN_PHY_ACT_CMD_STAT_SUCC)

Quoted 3 lines
  			retval = I40E_ERR_ADMIN_QUEUE_ERROR;

return retval;

#12 lore raw

Re: [dpdk-dev] [PATCH 5/8] net/i40e/base: check return value of DNL admin command

In reply to Jeff Guo

Hi, Jeff

Quoted 30 lines

-----Original Message-----
From: Sun, GuinanX
Sent: Monday, July 27, 2020 12:54 PM
To: Guo, Jia <[email protected]>; [email protected]
Cc: Xing, Beilei <[email protected]>; Ludkiewicz, Adam <[email protected]>
Subject: RE: [PATCH 5/8] net/i40e/base: check return value of DNL admin command

Hi Jeff

Quoted 9 lines

-----Original Message-----
From: Guo, Jia
Sent: Monday, July 27, 2020 12:08 PM
To: Sun, GuinanX <[email protected]>; [email protected]
Cc: Xing, Beilei <[email protected]>; Ludkiewicz, Adam <[email protected]>
Subject: Re: [PATCH 5/8] net/i40e/base: check return value of DNL admin command

Quoted 9 lines

hi, guinan

Quoted 1 line · Guinan Sun

Check return value of running DNL admin command.

What is "DNL", I am not sure i know the reason it appear here, could you double check it?

Quoted 5 lines

Regarding what DNL stands for, I haven't found it in the code and datasheet. It can be seen from the code change that the return value check operation of i40e_aq_run_phy_activity has been added.
The description of this function is RUN DNL admin command.
So tile and commit log have made such changes.

Sorry, I might have misunderstood it just now. I will double check for it and patch V2 will modify it.

Quoted 26 lines
Quoted 26 lines

Review

Quoted 10 lines
---
  drivers/net/i40e/base/i40e_common.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
(quoted diff) +0 -0

b/drivers/net/i40e/base/i40e_common.c

drivers/net/i40e/base/i40e_common.c enum i40e_status_code

Quoted 4 lines

index 46a0b7881..85c22849e 100644

drivers/net/i40e/base/i40e_common.c +0 -0
@@ -7097,7 +7097,7 @@ enum i40e_status_code

i40e_get_lpi_counters(struct i40e_hw *hw,

Quoted 1 line
	I40E_AQ_RUN_PHY_ACT_DNL_OPCODE_GET_EEE_STAT,

drivers/net/i40e/base/i40e_common.c

Quoted 4 lines

&cmd_status, tx_counter, rx_counter, NULL);

drivers/net/i40e/base/i40e_common.c +1 -1
-		if (cmd_status != I40E_AQ_RUN_PHY_ACT_CMD_STAT_SUCC)
+		if (!retval && cmd_status !=

I40E_AQ_RUN_PHY_ACT_CMD_STAT_SUCC)

Quoted 3 lines
  			retval = I40E_ERR_ADMIN_QUEUE_ERROR;

return retval;

author
#13 lore raw

PATCH 6/8 net/i40e/base: add disable unused ports capability

In reply to Guinan Sun

This patch adds support for "Disable Unused Ports" functionality.

---
 drivers/net/i40e/base/i40e_adminq_cmd.h | 1 +
 drivers/net/i40e/base/i40e_common.c     | 6 ++++++
 drivers/net/i40e/base/i40e_type.h       | 1 +
 3 files changed, 8 insertions(+)
drivers/net/i40e/base/i40e_adminq_cmd.h +1 -0
index e1018ed49..c7686b0d3 100644
@@ -440,6 +440,7 @@ struct i40e_aqc_list_capabilities_element_resp {
 #define I40E_AQ_CAP_ID_SDP		0x0062
 #define I40E_AQ_CAP_ID_MDIO		0x0063
 #define I40E_AQ_CAP_ID_WSR_PROT		0x0064
+#define I40E_AQ_CAP_ID_DIS_UNUSED_PORTS	0x0067
 #define I40E_AQ_CAP_ID_NVM_MGMT		0x0080
 #define I40E_AQ_CAP_ID_FLEX10		0x00F1
 #define I40E_AQ_CAP_ID_CEM		0x00F2
drivers/net/i40e/base/i40e_common.c +6 -0
index 85c22849e..65317f6c6 100644
@@ -4021,6 +4021,12 @@ STATIC void i40e_parse_discover_capabilities(struct i40e_hw *hw, void *buff,
 				   "HW Capability: wr_csr_prot = 0x%llX\n\n",
 				   (p->wr_csr_prot & 0xffff));
 			break;
+		case I40E_AQ_CAP_ID_DIS_UNUSED_PORTS:
+			p->dis_unused_ports = (bool)number;
+			i40e_debug(hw, I40E_DEBUG_INIT,
+				   "HW Capability: dis_unused_ports = %d\n\n",
+				   p->dis_unused_ports);
+			break;
 		case I40E_AQ_CAP_ID_NVM_MGMT:
 			if (number & I40E_NVM_MGMT_SEC_REV_DISABLED)
 				p->sec_rev_disabled = true;
drivers/net/i40e/base/i40e_type.h +1 -0
index 0eeb55975..cf4134583 100644
@@ -425,6 +425,7 @@ struct i40e_hw_capabilities {
 	u32 enabled_tcmap;
 	u32 maxtc;
 	u64 wr_csr_prot;
+	bool dis_unused_ports;
 	bool apm_wol_support;
 	enum i40e_acpi_programming_method acpi_prog_method;
 	bool proxy_support;
Signature · 1 line
2.17.1
#14 lore raw

Re: [dpdk-dev] [PATCH 6/8] net/i40e/base: add disable unused ports capability

hi, guinan

Quoted 1 line · Guinan Sun

This patch adds support for "Disable Unused Ports" functionality.

"This patch adds support for disabling unused ports" is enough for reader i think.

And use 2 verb is not good in title, "Support unused ports disabling" or other you want.

Quoted 14 lines
---
  drivers/net/i40e/base/i40e_adminq_cmd.h | 1 +
  drivers/net/i40e/base/i40e_common.c     | 6 ++++++
  drivers/net/i40e/base/i40e_type.h       | 1 +
  3 files changed, 8 insertions(+)
drivers/net/i40e/base/i40e_adminq_cmd.h +0 -0
index e1018ed49..c7686b0d3 100644

drivers/net/i40e/base/i40e_adminq_cmd.h struct i40e_aqc_list_capabilities_element_resp { · line 443

Quoted 4 lines
drivers/net/i40e/base/i40e_adminq_cmd.h +1 -0
@@ -440,6 +440,7 @@ struct i40e_aqc_list_capabilities_element_resp {
  #define I40E_AQ_CAP_ID_SDP		0x0062
  #define I40E_AQ_CAP_ID_MDIO		0x0063
  #define I40E_AQ_CAP_ID_WSR_PROT		0x0064
+#define I40E_AQ_CAP_ID_DIS_UNUSED_PORTS	0x0067

Please double check if it is "0x0066" or "0x0067", if it is conform, please add my ACK for this patch at next version.

Quoted 32 lines
drivers/net/i40e/base/i40e_adminq_cmd.h +0 -0
  #define I40E_AQ_CAP_ID_NVM_MGMT		0x0080
  #define I40E_AQ_CAP_ID_FLEX10		0x00F1
  #define I40E_AQ_CAP_ID_CEM		0x00F2
drivers/net/i40e/base/i40e_common.c +6 -0
index 85c22849e..65317f6c6 100644
@@ -4021,6 +4021,12 @@ STATIC void i40e_parse_discover_capabilities(struct i40e_hw *hw, void *buff,
  				   "HW Capability: wr_csr_prot = 0x%llX\n\n",
  				   (p->wr_csr_prot & 0xffff));
  			break;
+		case I40E_AQ_CAP_ID_DIS_UNUSED_PORTS:
+			p->dis_unused_ports = (bool)number;
+			i40e_debug(hw, I40E_DEBUG_INIT,
+				   "HW Capability: dis_unused_ports = %d\n\n",
+				   p->dis_unused_ports);
+			break;
  		case I40E_AQ_CAP_ID_NVM_MGMT:
  			if (number & I40E_NVM_MGMT_SEC_REV_DISABLED)
  				p->sec_rev_disabled = true;
drivers/net/i40e/base/i40e_type.h +1 -0
index 0eeb55975..cf4134583 100644
@@ -425,6 +425,7 @@ struct i40e_hw_capabilities {
  	u32 enabled_tcmap;
  	u32 maxtc;
  	u64 wr_csr_prot;
+	bool dis_unused_ports;
  	bool apm_wol_support;
  	enum i40e_acpi_programming_method acpi_prog_method;
  	bool proxy_support;
#15 lore raw

Re: [dpdk-dev] [PATCH 6/8] net/i40e/base: add disable unused ports capability

Hi Jeff

Quoted 10 lines

-----Original Message-----
From: Guo, Jia
Sent: Monday, July 27, 2020 12:25 PM
To: Sun, GuinanX <[email protected]>; [email protected]
Cc: Xing, Beilei <[email protected]>; Milosek, Damian <[email protected]>
Subject: Re: [PATCH 6/8] net/i40e/base: add disable unused ports capability

hi, guinan

Quoted 9 lines
Quoted 1 line · Guinan Sun

This patch adds support for "Disable Unused Ports" functionality.

"This patch adds support for disabling unused ports" is enough for reader i think.

And use 2 verb is not good in title, "Support unused ports disabling" or other you want.

I think you are right.
Patch V2 will modify it.

Quoted 61 lines

Review

Quoted 11 lines
---
  drivers/net/i40e/base/i40e_adminq_cmd.h | 1 +
  drivers/net/i40e/base/i40e_common.c     | 6 ++++++
  drivers/net/i40e/base/i40e_type.h       | 1 +
  3 files changed, 8 insertions(+)
(quoted diff) +0 -0

b/drivers/net/i40e/base/i40e_adminq_cmd.h

drivers/net/i40e/base/i40e_adminq_cmd.h struct i40e_aqc_list_capabilities_element_resp { · line 443

Quoted 8 lines

index e1018ed49..c7686b0d3 100644

drivers/net/i40e/base/i40e_adminq_cmd.h +1 -0
@@ -440,6 +440,7 @@ struct i40e_aqc_list_capabilities_element_resp {
  #define I40E_AQ_CAP_ID_SDP		0x0062
  #define I40E_AQ_CAP_ID_MDIO		0x0063
  #define I40E_AQ_CAP_ID_WSR_PROT		0x0064
+#define I40E_AQ_CAP_ID_DIS_UNUSED_PORTS	0x0067

Please double check if it is "0x0066" or "0x0067", if it is conform, please add my ACK for this patch at next version.

Review

Quoted 4 lines
drivers/net/i40e/base/i40e_adminq_cmd.h +0 -0
  #define I40E_AQ_CAP_ID_NVM_MGMT		0x0080
  #define I40E_AQ_CAP_ID_FLEX10		0x00F1
  #define I40E_AQ_CAP_ID_CEM		0x00F2
(quoted diff) +0 -0

b/drivers/net/i40e/base/i40e_common.c

drivers/net/i40e/base/i40e_common.c STATIC void

Quoted 4 lines

index 85c22849e..65317f6c6 100644

drivers/net/i40e/base/i40e_common.c +0 -0
@@ -4021,6 +4021,12 @@ STATIC void

i40e_parse_discover_capabilities(struct i40e_hw *hw, void *buff,

Review

Quoted 13 lines
drivers/net/i40e/base/i40e_common.c +6 -0
  				   "HW Capability: wr_csr_prot = 0x%llX\n\n",
  				   (p->wr_csr_prot & 0xffff));
  			break;
+		case I40E_AQ_CAP_ID_DIS_UNUSED_PORTS:
+			p->dis_unused_ports = (bool)number;
+			i40e_debug(hw, I40E_DEBUG_INIT,
+				   "HW Capability: dis_unused_ports = %d\n\n",
+				   p->dis_unused_ports);
+			break;
  		case I40E_AQ_CAP_ID_NVM_MGMT:
  			if (number & I40E_NVM_MGMT_SEC_REV_DISABLED)
  				p->sec_rev_disabled = true;
(quoted diff) +0 -0

b/drivers/net/i40e/base/i40e_type.h

Quoted 11 lines

index 0eeb55975..cf4134583 100644

drivers/net/i40e/base/i40e_type.h +1 -0
@@ -425,6 +425,7 @@ struct i40e_hw_capabilities {
  	u32 enabled_tcmap;
  	u32 maxtc;
  	u64 wr_csr_prot;
+	bool dis_unused_ports;
  	bool apm_wol_support;
  	enum i40e_acpi_programming_method acpi_prog_method;
  	bool proxy_support;
author
#16 lore raw

PATCH 7/8 net/i40e/base: replace AQ command for NVM update

In reply to Guinan Sun

Add AQ command "NVM update in process"
to replace the original AQ command "NVM progress".

---
 drivers/net/i40e/base/i40e_adminq_cmd.h | 12 +++++-
 drivers/net/i40e/base/i40e_common.c     | 53 +++++++++++++++----------
 drivers/net/i40e/base/i40e_prototype.h  |  6 ++-
 3 files changed, 46 insertions(+), 25 deletions(-)
drivers/net/i40e/base/i40e_adminq_cmd.h +11 -1
index c7686b0d3..0766e69a8 100644
@@ -240,7 +240,7 @@ enum i40e_admin_queue_opc {
 	i40e_aqc_opc_nvm_update			= 0x0703,
 	i40e_aqc_opc_nvm_config_read		= 0x0704,
 	i40e_aqc_opc_nvm_config_write		= 0x0705,
-	i40e_aqc_opc_nvm_progress		= 0x0706,
+	i40e_aqc_opc_nvm_update_in_process	= 0x0706,
 	i40e_aqc_opc_oem_post_update		= 0x0720,
 	i40e_aqc_opc_thermal_sensor		= 0x0721,
 
@@ -2400,6 +2400,16 @@ struct i40e_aqc_nvm_config_data_feature {
 
 I40E_CHECK_STRUCT_LEN(0x6, i40e_aqc_nvm_config_data_feature);
 
+/* NVM Update in Process (direct 0x0706) */
+struct i40e_aqc_nvm_update_in_process {
+	u8	command;
+#define I40E_AQ_UPDATE_FLOW_END			0x0
+#define I40E_AQ_UPDATE_FLOW_START		0x1
+	u8	reserved[15];
+};
+
+I40E_CHECK_CMD_LENGTH(i40e_aqc_nvm_update_in_process);
+
 struct i40e_aqc_nvm_config_data_immediate_field {
 	__le32 field_id;
 	__le32 field_value;
drivers/net/i40e/base/i40e_common.c +31 -22

65 lines not on this page · raw message

drivers/net/i40e/base/i40e_prototype.h +4 -2
index 91fa23491..9a89f3002 100644
@@ -254,8 +254,10 @@ enum i40e_status_code i40e_aq_update_nvm(struct i40e_hw *hw, u8 module_pointer,
 enum i40e_status_code i40e_aq_rearrange_nvm(struct i40e_hw *hw,
 				u8 rearrange_nvm,
 				struct i40e_asq_cmd_details *cmd_details);
-enum i40e_status_code i40e_aq_nvm_progress(struct i40e_hw *hw, u8 *progress,
-				struct i40e_asq_cmd_details *cmd_details);
+enum i40e_status_code
+i40e_aq_nvm_update_in_process(struct i40e_hw *hw,
+			      bool update_flow_state,
+			      struct i40e_asq_cmd_details *cmd_details);
 enum i40e_status_code i40e_aq_get_lldp_mib(struct i40e_hw *hw, u8 bridge_type,
 				u8 mib_type, void *buff, u16 buff_size,
 				u16 *local_len, u16 *remote_len,
Signature · 1 line
2.17.1
Acked-by on v1 7/8
#17 lore raw

Re: [dpdk-dev] [PATCH 7/8] net/i40e/base: replace AQ command for NVM update

Quoted 129 lines · Guinan Sun

Add AQ command "NVM update in process"
to replace the original AQ command "NVM progress".

---
  drivers/net/i40e/base/i40e_adminq_cmd.h | 12 +++++-
  drivers/net/i40e/base/i40e_common.c     | 53 +++++++++++++++----------
  drivers/net/i40e/base/i40e_prototype.h  |  6 ++-
  3 files changed, 46 insertions(+), 25 deletions(-)
drivers/net/i40e/base/i40e_adminq_cmd.h +11 -1
index c7686b0d3..0766e69a8 100644
@@ -240,7 +240,7 @@ enum i40e_admin_queue_opc {
  	i40e_aqc_opc_nvm_update			= 0x0703,
  	i40e_aqc_opc_nvm_config_read		= 0x0704,
  	i40e_aqc_opc_nvm_config_write		= 0x0705,
-	i40e_aqc_opc_nvm_progress		= 0x0706,
+	i40e_aqc_opc_nvm_update_in_process	= 0x0706,
  	i40e_aqc_opc_oem_post_update		= 0x0720,
  	i40e_aqc_opc_thermal_sensor		= 0x0721,
 
@@ -2400,6 +2400,16 @@ struct i40e_aqc_nvm_config_data_feature {
 
  I40E_CHECK_STRUCT_LEN(0x6, i40e_aqc_nvm_config_data_feature);
 
+/* NVM Update in Process (direct 0x0706) */
+struct i40e_aqc_nvm_update_in_process {
+	u8	command;
+#define I40E_AQ_UPDATE_FLOW_END			0x0
+#define I40E_AQ_UPDATE_FLOW_START		0x1
+	u8	reserved[15];
+};
+
+I40E_CHECK_CMD_LENGTH(i40e_aqc_nvm_update_in_process);
+
  struct i40e_aqc_nvm_config_data_immediate_field {
  	__le32 field_id;
  	__le32 field_value;
drivers/net/i40e/base/i40e_common.c +31 -22
index 65317f6c6..6c6fb4de4 100644
@@ -3686,6 +3686,37 @@ enum i40e_status_code i40e_aq_write_nvm_config(struct i40e_hw *hw,
  	return status;
  }
 
+/**
+ * i40e_aq_nvm_update_in_process
+ * @hw: pointer to the hw struct
+ * @update_flow_state: True indicates that update flow starts, false that ends
+ * @cmd_details: pointer to command details structure or NULL
+ *
+ * Indicate NVM update in process.
+ **/
+enum i40e_status_code
+i40e_aq_nvm_update_in_process(struct i40e_hw *hw,
+			      bool update_flow_state,
+			      struct i40e_asq_cmd_details *cmd_details)
+{
+	struct i40e_aq_desc desc;
+	struct i40e_aqc_nvm_update_in_process *cmd =
+		(struct i40e_aqc_nvm_update_in_process *)&desc.params.raw;
+	enum i40e_status_code status;
+
+	i40e_fill_default_direct_cmd_desc(&desc,
+					  i40e_aqc_opc_nvm_update_in_process);
+
+	cmd->command = I40E_AQ_UPDATE_FLOW_END;
+
+	if (update_flow_state)
+		cmd->command |= I40E_AQ_UPDATE_FLOW_START;
+
+	status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details);
+
+	return status;
+}
+
  /**
   * i40e_aq_oem_post_update - triggers an OEM specific flow after update
   * @hw: pointer to the hw struct
@@ -4257,28 +4288,6 @@ enum i40e_status_code i40e_aq_rearrange_nvm(struct i40e_hw *hw,
  	return status;
  }
 
-/**
- * i40e_aq_nvm_progress
- * @hw: pointer to the hw struct
- * @progress: pointer to progress returned from AQ
- * @cmd_details: pointer to command details structure or NULL
- *
- * Gets progress of flash rearrangement process
- **/
-enum i40e_status_code i40e_aq_nvm_progress(struct i40e_hw *hw, u8 *progress,
-				struct i40e_asq_cmd_details *cmd_details)
-{
-	enum i40e_status_code status;
-	struct i40e_aq_desc desc;
-
-	DEBUGFUNC("i40e_aq_nvm_progress");
-
-	i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_nvm_progress);
-	status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details);
-	*progress = desc.params.raw[0];
-	return status;
-}
-
  /**
   * i40e_aq_get_lldp_mib
   * @hw: pointer to the hw struct
drivers/net/i40e/base/i40e_prototype.h +4 -2
index 91fa23491..9a89f3002 100644
@@ -254,8 +254,10 @@ enum i40e_status_code i40e_aq_update_nvm(struct i40e_hw *hw, u8 module_pointer,
  enum i40e_status_code i40e_aq_rearrange_nvm(struct i40e_hw *hw,
  				u8 rearrange_nvm,
  				struct i40e_asq_cmd_details *cmd_details);
-enum i40e_status_code i40e_aq_nvm_progress(struct i40e_hw *hw, u8 *progress,
-				struct i40e_asq_cmd_details *cmd_details);
+enum i40e_status_code
+i40e_aq_nvm_update_in_process(struct i40e_hw *hw,
+			      bool update_flow_state,
+			      struct i40e_asq_cmd_details *cmd_details);
  enum i40e_status_code i40e_aq_get_lldp_mib(struct i40e_hw *hw, u8 bridge_type,
  				u8 mib_type, void *buff, u16 buff_size,
  				u16 *local_len, u16 *remote_len,
author
#18 lore raw

PATCH 8/8 net/i40e/base: update version

In reply to Guinan Sun

Update base code version in readme.

---
 drivers/net/i40e/base/README | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/i40e/base/README +1 -1
index 6baca4360..58174d472 100644
@@ -6,7 +6,7 @@ Intel® I40E driver
 ==================
 
 This directory contains source code of FreeBSD i40e driver of version
-cid-i40e.2020.03.04.tar.gz released by the team which develops
+cid-i40e.2020.07.16.tar.gz released by the team which develops
 basic drivers for any i40e NIC. The directory of base/ contains the
 original source package.
 This driver is valid for the product(s) listed below
Signature · 1 line
2.17.1
Acked-by on v1 8/8
#19 lore raw

Re: [dpdk-dev] [PATCH 8/8] net/i40e/base: update version

Quoted 20 lines · Guinan Sun

Update base code version in readme.

---
  drivers/net/i40e/base/README | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/i40e/base/README +1 -1
index 6baca4360..58174d472 100644
@@ -6,7 +6,7 @@ Intel® I40E driver
  ==================
 
  This directory contains source code of FreeBSD i40e driver of version
-cid-i40e.2020.03.04.tar.gz released by the team which develops
+cid-i40e.2020.07.16.tar.gz released by the team which develops
  basic drivers for any i40e NIC. The directory of base/ contains the
  original source package.
  This driver is valid for the product(s) listed below
author
#20 lore raw

v2 cover update i40e base code

In reply to Guinan Sun

update i40e base code.

source code of i40e driver:
cid-i40e.2020.07.16.tar.gz dropped by the team which develop basic drivers for any i40e NIC.

changelog in ND share repo:
From fc99a1143d3f ("i40e-shared: FEC on/off support flag for X722") To 673ff35c1c73 ("i40e-shared: Add support for firmware lockdown")

The following commits are ignored.
ea2cd04e5db1 ("i40e-shared: do AQ calls without sleeping by default") 4eec86f12992 ("i40e-shared: Fix undeclared i40e_asq_send_command() function") 9d60cec99eb7 ("i40e-shared: Send rx ctl write command in atomic context") a204afdc1cad ("i40e-shared: Send uc/mc commands in atomic context") d22f8cb2a111 ("i40e-shared: Send commands in atomic context") 136a7d931a45 ("i40e-shared: Fix improper preprocessor conditional")

Guinan Sun (8):
net/i40e/base: enable FEC on/off flag setting for X722 net/i40e/base: add PTYPE definition net/i40e/base: add new custom cloud filter types net/i40e/base: update FW API version to 1.11 net/i40e/base: fix possible uninitialized variable net/i40e/base: support unused ports disabling net/i40e/base: replace AQ command for NVM update net/i40e/base: update version

 drivers/net/i40e/base/README            |  2 +-
 drivers/net/i40e/base/i40e_adminq.c     |  6 +++
 drivers/net/i40e/base/i40e_adminq_cmd.h | 19 +++++++-
 drivers/net/i40e/base/i40e_common.c     | 61 +++++++++++++++----------
 drivers/net/i40e/base/i40e_prototype.h  |  6 ++-
 drivers/net/i40e/base/i40e_type.h       |  5 +-
 6 files changed, 70 insertions(+), 29 deletions(-)
Signature · 1 line
2.17.1
author
#21 lore raw

PATCH v2 1/8 net/i40e/base: enable FEC on/off flag setting for X722

Starting with API version 1.10 firmware for X722 devices has ability to change FEC settings in PHY. Code added in this patch checks API version and sets appropriate capability flag.

---
V2:
* Add Acked-by

---
 drivers/net/i40e/base/i40e_adminq.c     | 6 ++++++
 drivers/net/i40e/base/i40e_adminq_cmd.h | 2 ++
 drivers/net/i40e/base/i40e_type.h       | 1 +
 3 files changed, 9 insertions(+)
drivers/net/i40e/base/i40e_adminq.c +6 -0
index c89e1fb3f..0da45f03e 100644
@@ -603,6 +603,12 @@ STATIC void i40e_set_hw_flags(struct i40e_hw *hw)
 		    (aq->api_maj_ver == 1 &&
 		     aq->api_min_ver >= I40E_MINOR_VER_GET_LINK_INFO_X722))
 			hw->flags |= I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE;
+
+		if (aq->api_maj_ver > 1 ||
+		    (aq->api_maj_ver == 1 &&
+		     aq->api_min_ver >= I40E_MINOR_VER_FW_REQUEST_FEC_X722))
+			hw->flags |= I40E_HW_FLAG_X722_FEC_REQUEST_CAPABLE;
+
 		/* fall through */
 	default:
 		break;
drivers/net/i40e/base/i40e_adminq_cmd.h +2 -0
index 1905167f5..f790183be 100644
@@ -25,6 +25,8 @@
 #define I40E_MINOR_VER_GET_LINK_INFO_X722 0x0009
 /* API version 1.6 for X722 devices adds ability to stop FW LLDP agent */
 #define I40E_MINOR_VER_FW_LLDP_STOPPABLE_X722 0x0006
+/* API version 1.10 for X722 devices adds ability to request FEC encoding */
+#define I40E_MINOR_VER_FW_REQUEST_FEC_X722 0x000A
 
 struct i40e_aq_desc {
 	__le16 flags;
drivers/net/i40e/base/i40e_type.h +1 -0
index 014a4c132..b5b5b928d 100644
@@ -745,6 +745,7 @@ struct i40e_hw {
 #define I40E_HW_FLAG_FW_LLDP_PERSISTENT     BIT_ULL(5)
 #define I40E_HW_FLAG_AQ_PHY_ACCESS_EXTENDED BIT_ULL(6)
 #define I40E_HW_FLAG_DROP_MODE		    BIT_ULL(7)
+#define I40E_HW_FLAG_X722_FEC_REQUEST_CAPABLE BIT_ULL(8)
 	u64 flags;
 
 	/* Used in set switch config AQ command */
Signature · 1 line
2.17.1
author
#22 lore raw

PATCH v2 2/8 net/i40e/base: add PTYPE definition

In reply to Guinan Sun

Add I40E_RX_PTYPE_PARSER_ABORTED definition, so i40e driver will know opcode for parser aborted packets.
Without this definition driver would have to rely on magic numbers.

---
V2:
* Add Acked-by

---
 drivers/net/i40e/base/i40e_type.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/i40e/base/i40e_type.h +2 -1
index b5b5b928d..0eeb55975 100644
@@ -961,7 +961,8 @@ enum i40e_rx_l2_ptype {
 	I40E_RX_PTYPE_GRENAT4_MAC_PAY3			= 58,
 	I40E_RX_PTYPE_GRENAT4_MACVLAN_IPV6_ICMP_PAY4	= 87,
 	I40E_RX_PTYPE_GRENAT6_MAC_PAY3			= 124,
-	I40E_RX_PTYPE_GRENAT6_MACVLAN_IPV6_ICMP_PAY4	= 153
+	I40E_RX_PTYPE_GRENAT6_MACVLAN_IPV6_ICMP_PAY4	= 153,
+	I40E_RX_PTYPE_PARSER_ABORTED			= 255
 };
 
 struct i40e_rx_ptype_decoded {
Signature · 1 line
2.17.1
author
#23 lore raw

PATCH v2 3/8 net/i40e/base: add new custom cloud filter types

In reply to Guinan Sun

This patch adds the new filter types needed for custom cloud filters. These custom cloud filters will route traffic to VFs based on the dst IP for both tunneled and non-tunneled packets.

---
V2:
* Modify the title.

---
 drivers/net/i40e/base/i40e_adminq_cmd.h | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/i40e/base/i40e_adminq_cmd.h +2 -0
index f790183be..21f544840 100644
@@ -1406,6 +1406,8 @@ struct i40e_aqc_cloud_filters_element_data {
 #define I40E_AQC_ADD_CLOUD_FILTER_IMAC			0x000A
 #define I40E_AQC_ADD_CLOUD_FILTER_OMAC_TEN_ID_IMAC	0x000B
 #define I40E_AQC_ADD_CLOUD_FILTER_IIP			0x000C
+#define I40E_AQC_ADD_CLOUD_FILTER_OIP1			0x0010
+#define I40E_AQC_ADD_CLOUD_FILTER_OIP2			0x0012
 /* 0x000D reserved */
 /* 0x000E reserved */
 /* 0x000F reserved */
Signature · 1 line
2.17.1
Acked-by on v2 3/8
#24 lore raw

Re: [dpdk-dev] [PATCH v2 3/8] net/i40e/base: add new custom cloud filter types

Quoted 26 lines · Guinan Sun

This patch adds the new filter types needed for custom cloud filters. These custom cloud filters will route traffic to VFs based on the dst IP for both tunneled and non-tunneled packets.

---
V2:
* Modify the title.

---
  drivers/net/i40e/base/i40e_adminq_cmd.h | 2 ++
  1 file changed, 2 insertions(+)
drivers/net/i40e/base/i40e_adminq_cmd.h +2 -0
index f790183be..21f544840 100644
@@ -1406,6 +1406,8 @@ struct i40e_aqc_cloud_filters_element_data {
  #define I40E_AQC_ADD_CLOUD_FILTER_IMAC			0x000A
  #define I40E_AQC_ADD_CLOUD_FILTER_OMAC_TEN_ID_IMAC	0x000B
  #define I40E_AQC_ADD_CLOUD_FILTER_IIP			0x000C
+#define I40E_AQC_ADD_CLOUD_FILTER_OIP1			0x0010
+#define I40E_AQC_ADD_CLOUD_FILTER_OIP2			0x0012
  /* 0x000D reserved */
  /* 0x000E reserved */
  /* 0x000F reserved */
author
#25 lore raw

PATCH v2 4/8 net/i40e/base: update FW API version to 1.11

In reply to Guinan Sun

Upcoming FW increment API version to 1.11 due to new bit and new fields in the Replace Cloud Filters AQ command.

---
V2:
* Modify commit message.

---
 drivers/net/i40e/base/i40e_adminq_cmd.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/i40e/base/i40e_adminq_cmd.h +1 -1
index 21f544840..e1018ed49 100644
@@ -13,7 +13,7 @@
 
 #define I40E_FW_API_VERSION_MAJOR	0x0001
 #define I40E_FW_API_VERSION_MINOR_X722	0x000A
-#define I40E_FW_API_VERSION_MINOR_X710	0x000A
+#define I40E_FW_API_VERSION_MINOR_X710	0x000B
 
 #define I40E_FW_MINOR_VERSION(_h) ((_h)->mac.type == I40E_MAC_XL710 ? \
 					I40E_FW_API_VERSION_MINOR_X710 : \
Signature · 1 line
2.17.1
Acked-by on v2 4/8
#26 lore raw

Re: [dpdk-dev] [PATCH v2 4/8] net/i40e/base: update FW API version to 1.11

Quoted 25 lines · Guinan Sun

Upcoming FW increment API version to 1.11 due to new bit and new fields in the Replace Cloud Filters AQ command.

---
V2:
* Modify commit message.

---
  drivers/net/i40e/base/i40e_adminq_cmd.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/i40e/base/i40e_adminq_cmd.h +1 -1
index 21f544840..e1018ed49 100644
@@ -13,7 +13,7 @@
 
  #define I40E_FW_API_VERSION_MAJOR	0x0001
  #define I40E_FW_API_VERSION_MINOR_X722	0x000A
-#define I40E_FW_API_VERSION_MINOR_X710	0x000A
+#define I40E_FW_API_VERSION_MINOR_X710	0x000B
 
  #define I40E_FW_MINOR_VERSION(_h) ((_h)->mac.type == I40E_MAC_XL710 ? \
  					I40E_FW_API_VERSION_MINOR_X710 : \
author
#27 lore raw

PATCH v2 5/8 net/i40e/base: fix possible uninitialized variable

In reply to Guinan Sun

Fix possible uninitialized variable in i40e in the i40e_get_lpi_counters function.

Fixes 429bdc0cd967 ("net/i40e/base: add function to read LPI counters")

---
V2:
* Modify commit message.

---
 drivers/net/i40e/base/i40e_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/i40e/base/i40e_common.c +1 -1
index 46a0b7881..85c22849e 100644
@@ -7097,7 +7097,7 @@ enum i40e_status_code i40e_get_lpi_counters(struct i40e_hw *hw,
 				I40E_AQ_RUN_PHY_ACT_DNL_OPCODE_GET_EEE_STAT,
 				&cmd_status, tx_counter, rx_counter, NULL);
 
-		if (cmd_status != I40E_AQ_RUN_PHY_ACT_CMD_STAT_SUCC)
+		if (!retval && cmd_status != I40E_AQ_RUN_PHY_ACT_CMD_STAT_SUCC)
 			retval = I40E_ERR_ADMIN_QUEUE_ERROR;
 
 		return retval;
Signature · 1 line
2.17.1
Acked-by on v2 5/8
#28 lore raw

Re: [dpdk-dev] [PATCH v2 5/8] net/i40e/base: fix possible uninitialized variable

Quoted 28 lines · Guinan Sun

Fix possible uninitialized variable in i40e in the i40e_get_lpi_counters function.

Fixes 429bdc0cd967 ("net/i40e/base: add function to read LPI counters")

---
V2:
* Modify commit message.

---
  drivers/net/i40e/base/i40e_common.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/i40e/base/i40e_common.c +1 -1
index 46a0b7881..85c22849e 100644
@@ -7097,7 +7097,7 @@ enum i40e_status_code i40e_get_lpi_counters(struct i40e_hw *hw,
  				I40E_AQ_RUN_PHY_ACT_DNL_OPCODE_GET_EEE_STAT,
  				&cmd_status, tx_counter, rx_counter, NULL);
 
-		if (cmd_status != I40E_AQ_RUN_PHY_ACT_CMD_STAT_SUCC)
+		if (!retval && cmd_status != I40E_AQ_RUN_PHY_ACT_CMD_STAT_SUCC)
  			retval = I40E_ERR_ADMIN_QUEUE_ERROR;
 
  		return retval;
author
#29 lore raw

PATCH v2 6/8 net/i40e/base: support unused ports disabling

In reply to Guinan Sun

This patch adds support for disabling unused ports.

---
V2:
* Modifiy title and message

---
 drivers/net/i40e/base/i40e_adminq_cmd.h | 1 +
 drivers/net/i40e/base/i40e_common.c     | 6 ++++++
 drivers/net/i40e/base/i40e_type.h       | 1 +
 3 files changed, 8 insertions(+)
drivers/net/i40e/base/i40e_adminq_cmd.h +1 -0
index e1018ed49..c7686b0d3 100644
@@ -440,6 +440,7 @@ struct i40e_aqc_list_capabilities_element_resp {
 #define I40E_AQ_CAP_ID_SDP		0x0062
 #define I40E_AQ_CAP_ID_MDIO		0x0063
 #define I40E_AQ_CAP_ID_WSR_PROT		0x0064
+#define I40E_AQ_CAP_ID_DIS_UNUSED_PORTS	0x0067
 #define I40E_AQ_CAP_ID_NVM_MGMT		0x0080
 #define I40E_AQ_CAP_ID_FLEX10		0x00F1
 #define I40E_AQ_CAP_ID_CEM		0x00F2
drivers/net/i40e/base/i40e_common.c +6 -0
index 85c22849e..65317f6c6 100644
@@ -4021,6 +4021,12 @@ STATIC void i40e_parse_discover_capabilities(struct i40e_hw *hw, void *buff,
 				   "HW Capability: wr_csr_prot = 0x%llX\n\n",
 				   (p->wr_csr_prot & 0xffff));
 			break;
+		case I40E_AQ_CAP_ID_DIS_UNUSED_PORTS:
+			p->dis_unused_ports = (bool)number;
+			i40e_debug(hw, I40E_DEBUG_INIT,
+				   "HW Capability: dis_unused_ports = %d\n\n",
+				   p->dis_unused_ports);
+			break;
 		case I40E_AQ_CAP_ID_NVM_MGMT:
 			if (number & I40E_NVM_MGMT_SEC_REV_DISABLED)
 				p->sec_rev_disabled = true;
drivers/net/i40e/base/i40e_type.h +1 -0
index 0eeb55975..cf4134583 100644
@@ -425,6 +425,7 @@ struct i40e_hw_capabilities {
 	u32 enabled_tcmap;
 	u32 maxtc;
 	u64 wr_csr_prot;
+	bool dis_unused_ports;
 	bool apm_wol_support;
 	enum i40e_acpi_programming_method acpi_prog_method;
 	bool proxy_support;
Signature · 1 line
2.17.1
Acked-by on v2 6/8
#30 lore raw

Re: [dpdk-dev] [PATCH v2 6/8] net/i40e/base: support unused ports disabling

Quoted 54 lines · Guinan Sun

This patch adds support for disabling unused ports.

---
V2:
* Modifiy title and message

---
  drivers/net/i40e/base/i40e_adminq_cmd.h | 1 +
  drivers/net/i40e/base/i40e_common.c     | 6 ++++++
  drivers/net/i40e/base/i40e_type.h       | 1 +
  3 files changed, 8 insertions(+)
drivers/net/i40e/base/i40e_adminq_cmd.h +1 -0
index e1018ed49..c7686b0d3 100644
@@ -440,6 +440,7 @@ struct i40e_aqc_list_capabilities_element_resp {
  #define I40E_AQ_CAP_ID_SDP		0x0062
  #define I40E_AQ_CAP_ID_MDIO		0x0063
  #define I40E_AQ_CAP_ID_WSR_PROT		0x0064
+#define I40E_AQ_CAP_ID_DIS_UNUSED_PORTS	0x0067
  #define I40E_AQ_CAP_ID_NVM_MGMT		0x0080
  #define I40E_AQ_CAP_ID_FLEX10		0x00F1
  #define I40E_AQ_CAP_ID_CEM		0x00F2
drivers/net/i40e/base/i40e_common.c +6 -0
index 85c22849e..65317f6c6 100644
@@ -4021,6 +4021,12 @@ STATIC void i40e_parse_discover_capabilities(struct i40e_hw *hw, void *buff,
  				   "HW Capability: wr_csr_prot = 0x%llX\n\n",
  				   (p->wr_csr_prot & 0xffff));
  			break;
+		case I40E_AQ_CAP_ID_DIS_UNUSED_PORTS:
+			p->dis_unused_ports = (bool)number;
+			i40e_debug(hw, I40E_DEBUG_INIT,
+				   "HW Capability: dis_unused_ports = %d\n\n",
+				   p->dis_unused_ports);
+			break;
  		case I40E_AQ_CAP_ID_NVM_MGMT:
  			if (number & I40E_NVM_MGMT_SEC_REV_DISABLED)
  				p->sec_rev_disabled = true;
drivers/net/i40e/base/i40e_type.h +1 -0
index 0eeb55975..cf4134583 100644
@@ -425,6 +425,7 @@ struct i40e_hw_capabilities {
  	u32 enabled_tcmap;
  	u32 maxtc;
  	u64 wr_csr_prot;
+	bool dis_unused_ports;
  	bool apm_wol_support;
  	enum i40e_acpi_programming_method acpi_prog_method;
  	bool proxy_support;
author
#31 lore raw

PATCH v2 7/8 net/i40e/base: replace AQ command for NVM update

In reply to Guinan Sun

Add AQ command "NVM update in process"
to replace the original AQ command "NVM progress".

---
V2:
* Add Acked-by

---
 drivers/net/i40e/base/i40e_adminq_cmd.h | 12 +++++-
 drivers/net/i40e/base/i40e_common.c     | 53 +++++++++++++++----------
 drivers/net/i40e/base/i40e_prototype.h  |  6 ++-
 3 files changed, 46 insertions(+), 25 deletions(-)
drivers/net/i40e/base/i40e_adminq_cmd.h +11 -1
index c7686b0d3..0766e69a8 100644
@@ -240,7 +240,7 @@ enum i40e_admin_queue_opc {
 	i40e_aqc_opc_nvm_update			= 0x0703,
 	i40e_aqc_opc_nvm_config_read		= 0x0704,
 	i40e_aqc_opc_nvm_config_write		= 0x0705,
-	i40e_aqc_opc_nvm_progress		= 0x0706,
+	i40e_aqc_opc_nvm_update_in_process	= 0x0706,
 	i40e_aqc_opc_oem_post_update		= 0x0720,
 	i40e_aqc_opc_thermal_sensor		= 0x0721,
 
@@ -2400,6 +2400,16 @@ struct i40e_aqc_nvm_config_data_feature {
 
 I40E_CHECK_STRUCT_LEN(0x6, i40e_aqc_nvm_config_data_feature);
 
+/* NVM Update in Process (direct 0x0706) */
+struct i40e_aqc_nvm_update_in_process {
+	u8	command;
+#define I40E_AQ_UPDATE_FLOW_END			0x0
+#define I40E_AQ_UPDATE_FLOW_START		0x1
+	u8	reserved[15];
+};
+
+I40E_CHECK_CMD_LENGTH(i40e_aqc_nvm_update_in_process);
+
 struct i40e_aqc_nvm_config_data_immediate_field {
 	__le32 field_id;
 	__le32 field_value;
drivers/net/i40e/base/i40e_common.c +31 -22

65 lines not on this page · raw message

drivers/net/i40e/base/i40e_prototype.h +4 -2
index 91fa23491..9a89f3002 100644
@@ -254,8 +254,10 @@ enum i40e_status_code i40e_aq_update_nvm(struct i40e_hw *hw, u8 module_pointer,
 enum i40e_status_code i40e_aq_rearrange_nvm(struct i40e_hw *hw,
 				u8 rearrange_nvm,
 				struct i40e_asq_cmd_details *cmd_details);
-enum i40e_status_code i40e_aq_nvm_progress(struct i40e_hw *hw, u8 *progress,
-				struct i40e_asq_cmd_details *cmd_details);
+enum i40e_status_code
+i40e_aq_nvm_update_in_process(struct i40e_hw *hw,
+			      bool update_flow_state,
+			      struct i40e_asq_cmd_details *cmd_details);
 enum i40e_status_code i40e_aq_get_lldp_mib(struct i40e_hw *hw, u8 bridge_type,
 				u8 mib_type, void *buff, u16 buff_size,
 				u16 *local_len, u16 *remote_len,
Signature · 1 line
2.17.1
author
#32 lore raw

PATCH v2 8/8 net/i40e/base: update version

In reply to Guinan Sun

Update base code version in readme.

---
V2:
* Add Acked-by

---
 drivers/net/i40e/base/README | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/i40e/base/README +1 -1
index 6baca4360..58174d472 100644
@@ -6,7 +6,7 @@ Intel® I40E driver
 ==================
 
 This directory contains source code of FreeBSD i40e driver of version
-cid-i40e.2020.03.04.tar.gz released by the team which develops
+cid-i40e.2020.07.16.tar.gz released by the team which develops
 basic drivers for any i40e NIC. The directory of base/ contains the
 original source package.
 This driver is valid for the product(s) listed below
Signature · 1 line
2.17.1
Acked-by on the v2 series
#33 lore raw
In reply to Guinan Sun
Quoted 36 lines · Guinan Sun

update i40e base code.

source code of i40e driver:
cid-i40e.2020.07.16.tar.gz dropped by the team which develop basic drivers for any i40e NIC.

changelog in ND share repo:
From fc99a1143d3f ("i40e-shared: FEC on/off support flag for X722")
To 673ff35c1c73 ("i40e-shared: Add support for firmware lockdown")

The following commits are ignored.
ea2cd04e5db1 ("i40e-shared: do AQ calls without sleeping by default") 4eec86f12992 ("i40e-shared: Fix undeclared i40e_asq_send_command() function") 9d60cec99eb7 ("i40e-shared: Send rx ctl write command in atomic context") a204afdc1cad ("i40e-shared: Send uc/mc commands in atomic context") d22f8cb2a111 ("i40e-shared: Send commands in atomic context") 136a7d931a45 ("i40e-shared: Fix improper preprocessor conditional")

Guinan Sun (8):
net/i40e/base: enable FEC on/off flag setting for X722 net/i40e/base: add PTYPE definition net/i40e/base: add new custom cloud filter types net/i40e/base: update FW API version to 1.11 net/i40e/base: fix possible uninitialized variable net/i40e/base: support unused ports disabling net/i40e/base: replace AQ command for NVM update net/i40e/base: update version

  drivers/net/i40e/base/README            |  2 +-
  drivers/net/i40e/base/i40e_adminq.c     |  6 +++
  drivers/net/i40e/base/i40e_adminq_cmd.h | 19 +++++++-
  drivers/net/i40e/base/i40e_common.c     | 61 +++++++++++++++----------
  drivers/net/i40e/base/i40e_prototype.h  |  6 ++-
  drivers/net/i40e/base/i40e_type.h       |  5 +-
  6 files changed, 70 insertions(+), 29 deletions(-)
Applied
#34 lore raw
Quoted 9 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Jeff Guo
Sent: Tuesday, July 28, 2020 9:33 AM
To: Sun, GuinanX <[email protected]>; [email protected]
Cc: Xing, Beilei <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v2 0/8] update i40e base code

Quoted 41 lines
Quoted 38 lines · Guinan Sun

update i40e base code.

source code of i40e driver:
cid-i40e.2020.07.16.tar.gz dropped by the team which develop basic drivers for any i40e NIC.

changelog in ND share repo:
From fc99a1143d3f ("i40e-shared: FEC on/off support flag for X722")
To 673ff35c1c73 ("i40e-shared: Add support for firmware lockdown")

The following commits are ignored.
ea2cd04e5db1 ("i40e-shared: do AQ calls without sleeping by default") 4eec86f12992 ("i40e-shared: Fix undeclared i40e_asq_send_command() function")
9d60cec99eb7 ("i40e-shared: Send rx ctl write command in atomic context") a204afdc1cad ("i40e-shared: Send uc/mc commands in atomic context")
d22f8cb2a111 ("i40e-shared: Send commands in atomic context") 136a7d931a45 ("i40e-shared: Fix improper preprocessor conditional")

Guinan Sun (8):
net/i40e/base: enable FEC on/off flag setting for X722 net/i40e/base: add PTYPE definition net/i40e/base: add new custom cloud filter types net/i40e/base: update FW API version to 1.11 net/i40e/base: fix possible uninitialized variable net/i40e/base: support unused ports disabling net/i40e/base: replace AQ command for NVM update net/i40e/base: update version

  drivers/net/i40e/base/README            |  2 +-
  drivers/net/i40e/base/i40e_adminq.c     |  6 +++
  drivers/net/i40e/base/i40e_adminq_cmd.h | 19 +++++++-
  drivers/net/i40e/base/i40e_common.c     | 61 +++++++++++++++----------
  drivers/net/i40e/base/i40e_prototype.h  |  6 ++-
  drivers/net/i40e/base/i40e_type.h       |  5 +-
  6 files changed, 70 insertions(+), 29 deletions(-)

Applied to dpdk-next-net-intel.

Thanks
Qi

author
#35 lore raw

v3 cover update i40e base code

In reply to Guinan Sun

update i40e base code.

source code of i40e driver:
cid-i40e.2020.08.27.tar.gz dropped by the team which develop basic drivers for any i40e NIC.

changelog in ND share repo:
From fc99a1143d3f ("i40e-shared: FEC on/off support flag for X722")
To 1a82d59f0797 ("i40e-shared: Fix PHY configuration parameters when enabling EEE")

The following commits are ignored.
ea2cd04e5db1 ("i40e-shared: do AQ calls without sleeping by default") 4eec86f12992 ("i40e-shared: Fix undeclared i40e_asq_send_command() function") 9d60cec99eb7 ("i40e-shared: Send rx ctl write command in atomic context") a204afdc1cad ("i40e-shared: Send uc/mc commands in atomic context") d22f8cb2a111 ("i40e-shared: Send commands in atomic context") 136a7d931a45 ("i40e-shared: Fix improper preprocessor conditional") 5b7d5a698092 ("i40e-shared: use linux packing style") f16fa495c503 ("i40e-shared: Fix compilation issue with __packed")

Guinan Sun (15):
net/i40e/base: enable FEC on/off flag setting for X722 net/i40e/base: add PTYPE definition net/i40e/base: add new custom cloud filter types net/i40e/base: update FW API version to 1.12 net/i40e/base: fix possible uninitialized variable net/i40e/base: support unused ports disabling net/i40e/base: replace AQ command for NVM update net/i40e/base: add VLAN field for input set net/i40e/base: enable pipe monitor thresholds net/i40e/base: fix missing function header arguments net/i40e/base: add support for Minimum Rollback Revision net/i40e/base: fix Rx only mode for unicast promisc on VLAN net/i40e/base: add EEE LPI status check for X722 adapters net/i40e/base: fix PHY config param when enabling EEE net/i40e/base: update version

 drivers/net/i40e/base/README            |   2 +-
 drivers/net/i40e/base/i40e_adminq.c     |   6 +
 drivers/net/i40e/base/i40e_adminq_cmd.h |  41 ++++++-
 drivers/net/i40e/base/i40e_common.c     | 143 ++++++++++++++++++------
 drivers/net/i40e/base/i40e_dcb.c        |   4 +-
 drivers/net/i40e/base/i40e_prototype.h  |  10 +-
 drivers/net/i40e/base/i40e_register.h   |   3 +
 drivers/net/i40e/base/i40e_type.h       |   7 +-
 8 files changed, 172 insertions(+), 44 deletions(-)
Signature · 1 line
2.17.1
author
#36 lore raw

PATCH v3 1/15 net/i40e/base: enable FEC on/off flag setting for X722

Starting with API version 1.10 firmware for X722 devices has ability to change FEC settings in PHY. Code added in this patch checks API version and sets appropriate capability flag.

---
 drivers/net/i40e/base/i40e_adminq.c     | 6 ++++++
 drivers/net/i40e/base/i40e_adminq_cmd.h | 2 ++
 drivers/net/i40e/base/i40e_type.h       | 1 +
 3 files changed, 9 insertions(+)
drivers/net/i40e/base/i40e_adminq.c +6 -0
index c89e1fb3f..0da45f03e 100644
@@ -603,6 +603,12 @@ STATIC void i40e_set_hw_flags(struct i40e_hw *hw)
 		    (aq->api_maj_ver == 1 &&
 		     aq->api_min_ver >= I40E_MINOR_VER_GET_LINK_INFO_X722))
 			hw->flags |= I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE;
+
+		if (aq->api_maj_ver > 1 ||
+		    (aq->api_maj_ver == 1 &&
+		     aq->api_min_ver >= I40E_MINOR_VER_FW_REQUEST_FEC_X722))
+			hw->flags |= I40E_HW_FLAG_X722_FEC_REQUEST_CAPABLE;
+
 		/* fall through */
 	default:
 		break;
drivers/net/i40e/base/i40e_adminq_cmd.h +2 -0
index 1905167f5..f790183be 100644
@@ -25,6 +25,8 @@
 #define I40E_MINOR_VER_GET_LINK_INFO_X722 0x0009
 /* API version 1.6 for X722 devices adds ability to stop FW LLDP agent */
 #define I40E_MINOR_VER_FW_LLDP_STOPPABLE_X722 0x0006
+/* API version 1.10 for X722 devices adds ability to request FEC encoding */
+#define I40E_MINOR_VER_FW_REQUEST_FEC_X722 0x000A
 
 struct i40e_aq_desc {
 	__le16 flags;
drivers/net/i40e/base/i40e_type.h +1 -0
index 014a4c132..b5b5b928d 100644
@@ -745,6 +745,7 @@ struct i40e_hw {
 #define I40E_HW_FLAG_FW_LLDP_PERSISTENT     BIT_ULL(5)
 #define I40E_HW_FLAG_AQ_PHY_ACCESS_EXTENDED BIT_ULL(6)
 #define I40E_HW_FLAG_DROP_MODE		    BIT_ULL(7)
+#define I40E_HW_FLAG_X722_FEC_REQUEST_CAPABLE BIT_ULL(8)
 	u64 flags;
 
 	/* Used in set switch config AQ command */
Signature · 1 line
2.17.1
author
#37 lore raw

PATCH v3 2/15 net/i40e/base: add PTYPE definition

In reply to Guinan Sun

Add I40E_RX_PTYPE_PARSER_ABORTED definition, so i40e driver will know opcode for parser aborted packets.
Without this definition driver would have to rely on magic numbers.

---
 drivers/net/i40e/base/i40e_type.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/i40e/base/i40e_type.h +2 -1
index b5b5b928d..0eeb55975 100644
@@ -961,7 +961,8 @@ enum i40e_rx_l2_ptype {
 	I40E_RX_PTYPE_GRENAT4_MAC_PAY3			= 58,
 	I40E_RX_PTYPE_GRENAT4_MACVLAN_IPV6_ICMP_PAY4	= 87,
 	I40E_RX_PTYPE_GRENAT6_MAC_PAY3			= 124,
-	I40E_RX_PTYPE_GRENAT6_MACVLAN_IPV6_ICMP_PAY4	= 153
+	I40E_RX_PTYPE_GRENAT6_MACVLAN_IPV6_ICMP_PAY4	= 153,
+	I40E_RX_PTYPE_PARSER_ABORTED			= 255
 };
 
 struct i40e_rx_ptype_decoded {
Signature · 1 line
2.17.1
author
#38 lore raw

PATCH v3 3/15 net/i40e/base: add new custom cloud filter types

In reply to Guinan Sun

This patch adds the new filter types needed for custom cloud filters. These custom cloud filters will route traffic to VFs based on the dst IP for both tunneled and non-tunneled packets.

---
 drivers/net/i40e/base/i40e_adminq_cmd.h | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/i40e/base/i40e_adminq_cmd.h +2 -0
index f790183be..21f544840 100644
@@ -1406,6 +1406,8 @@ struct i40e_aqc_cloud_filters_element_data {
 #define I40E_AQC_ADD_CLOUD_FILTER_IMAC			0x000A
 #define I40E_AQC_ADD_CLOUD_FILTER_OMAC_TEN_ID_IMAC	0x000B
 #define I40E_AQC_ADD_CLOUD_FILTER_IIP			0x000C
+#define I40E_AQC_ADD_CLOUD_FILTER_OIP1			0x0010
+#define I40E_AQC_ADD_CLOUD_FILTER_OIP2			0x0012
 /* 0x000D reserved */
 /* 0x000E reserved */
 /* 0x000F reserved */
Signature · 1 line
2.17.1
author
#39 lore raw

PATCH v3 4/15 net/i40e/base: update FW API version to 1.12

In reply to Guinan Sun

Upcoming FW increment API version to 1.12 due to new bit and new fields in the Replace Cloud Filters AQ command.

---
 drivers/net/i40e/base/i40e_adminq_cmd.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/i40e/base/i40e_adminq_cmd.h +2 -2
index 21f544840..ba4b27f4d 100644
@@ -12,8 +12,8 @@
  */
 
 #define I40E_FW_API_VERSION_MAJOR	0x0001
-#define I40E_FW_API_VERSION_MINOR_X722	0x000A
-#define I40E_FW_API_VERSION_MINOR_X710	0x000A
+#define I40E_FW_API_VERSION_MINOR_X722	0x000B
+#define I40E_FW_API_VERSION_MINOR_X710	0x000C
 
 #define I40E_FW_MINOR_VERSION(_h) ((_h)->mac.type == I40E_MAC_XL710 ? \
 					I40E_FW_API_VERSION_MINOR_X710 : \
Signature · 1 line
2.17.1
author
#40 lore raw

PATCH v3 5/15 net/i40e/base: fix possible uninitialized variable

In reply to Guinan Sun

Fix possible uninitialized variable in i40e in the i40e_get_lpi_counters function.

Fixes 429bdc0cd967 ("net/i40e/base: add function to read LPI counters")
---
 drivers/net/i40e/base/i40e_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/i40e/base/i40e_common.c +1 -1
index 46a0b7881..85c22849e 100644
@@ -7097,7 +7097,7 @@ enum i40e_status_code i40e_get_lpi_counters(struct i40e_hw *hw,
 				I40E_AQ_RUN_PHY_ACT_DNL_OPCODE_GET_EEE_STAT,
 				&cmd_status, tx_counter, rx_counter, NULL);
 
-		if (cmd_status != I40E_AQ_RUN_PHY_ACT_CMD_STAT_SUCC)
+		if (!retval && cmd_status != I40E_AQ_RUN_PHY_ACT_CMD_STAT_SUCC)
 			retval = I40E_ERR_ADMIN_QUEUE_ERROR;
 
 		return retval;
Signature · 1 line
2.17.1
author
#41 lore raw

PATCH v3 6/15 net/i40e/base: support unused ports disabling

In reply to Guinan Sun

This patch adds support for disabling unused ports.

---
 drivers/net/i40e/base/i40e_adminq_cmd.h | 1 +
 drivers/net/i40e/base/i40e_common.c     | 6 ++++++
 drivers/net/i40e/base/i40e_type.h       | 1 +
 3 files changed, 8 insertions(+)
drivers/net/i40e/base/i40e_adminq_cmd.h +1 -0
index ba4b27f4d..439669ef9 100644
@@ -440,6 +440,7 @@ struct i40e_aqc_list_capabilities_element_resp {
 #define I40E_AQ_CAP_ID_SDP		0x0062
 #define I40E_AQ_CAP_ID_MDIO		0x0063
 #define I40E_AQ_CAP_ID_WSR_PROT		0x0064
+#define I40E_AQ_CAP_ID_DIS_UNUSED_PORTS	0x0067
 #define I40E_AQ_CAP_ID_NVM_MGMT		0x0080
 #define I40E_AQ_CAP_ID_FLEX10		0x00F1
 #define I40E_AQ_CAP_ID_CEM		0x00F2
drivers/net/i40e/base/i40e_common.c +6 -0
index 85c22849e..65317f6c6 100644
@@ -4021,6 +4021,12 @@ STATIC void i40e_parse_discover_capabilities(struct i40e_hw *hw, void *buff,
 				   "HW Capability: wr_csr_prot = 0x%llX\n\n",
 				   (p->wr_csr_prot & 0xffff));
 			break;
+		case I40E_AQ_CAP_ID_DIS_UNUSED_PORTS:
+			p->dis_unused_ports = (bool)number;
+			i40e_debug(hw, I40E_DEBUG_INIT,
+				   "HW Capability: dis_unused_ports = %d\n\n",
+				   p->dis_unused_ports);
+			break;
 		case I40E_AQ_CAP_ID_NVM_MGMT:
 			if (number & I40E_NVM_MGMT_SEC_REV_DISABLED)
 				p->sec_rev_disabled = true;
drivers/net/i40e/base/i40e_type.h +1 -0
index 0eeb55975..cf4134583 100644
@@ -425,6 +425,7 @@ struct i40e_hw_capabilities {
 	u32 enabled_tcmap;
 	u32 maxtc;
 	u64 wr_csr_prot;
+	bool dis_unused_ports;
 	bool apm_wol_support;
 	enum i40e_acpi_programming_method acpi_prog_method;
 	bool proxy_support;
Signature · 1 line
2.17.1
author
#42 lore raw

PATCH v3 7/15 net/i40e/base: replace AQ command for NVM update

In reply to Guinan Sun

Add AQ command "NVM update in process"
to replace the original AQ command "NVM progress".

---
 drivers/net/i40e/base/i40e_adminq_cmd.h | 12 +++++-
 drivers/net/i40e/base/i40e_common.c     | 53 +++++++++++++++----------
 drivers/net/i40e/base/i40e_prototype.h  |  6 ++-
 3 files changed, 46 insertions(+), 25 deletions(-)
drivers/net/i40e/base/i40e_adminq_cmd.h +11 -1
index 439669ef9..9ef01f371 100644
@@ -240,7 +240,7 @@ enum i40e_admin_queue_opc {
 	i40e_aqc_opc_nvm_update			= 0x0703,
 	i40e_aqc_opc_nvm_config_read		= 0x0704,
 	i40e_aqc_opc_nvm_config_write		= 0x0705,
-	i40e_aqc_opc_nvm_progress		= 0x0706,
+	i40e_aqc_opc_nvm_update_in_process	= 0x0706,
 	i40e_aqc_opc_oem_post_update		= 0x0720,
 	i40e_aqc_opc_thermal_sensor		= 0x0721,
 
@@ -2400,6 +2400,16 @@ struct i40e_aqc_nvm_config_data_feature {
 
 I40E_CHECK_STRUCT_LEN(0x6, i40e_aqc_nvm_config_data_feature);
 
+/* NVM Update in Process (direct 0x0706) */
+struct i40e_aqc_nvm_update_in_process {
+	u8	command;
+#define I40E_AQ_UPDATE_FLOW_END			0x0
+#define I40E_AQ_UPDATE_FLOW_START		0x1
+	u8	reserved[15];
+};
+
+I40E_CHECK_CMD_LENGTH(i40e_aqc_nvm_update_in_process);
+
 struct i40e_aqc_nvm_config_data_immediate_field {
 	__le32 field_id;
 	__le32 field_value;
drivers/net/i40e/base/i40e_common.c +31 -22

65 lines not on this page · raw message

drivers/net/i40e/base/i40e_prototype.h +4 -2
index 91fa23491..9a89f3002 100644
@@ -254,8 +254,10 @@ enum i40e_status_code i40e_aq_update_nvm(struct i40e_hw *hw, u8 module_pointer,
 enum i40e_status_code i40e_aq_rearrange_nvm(struct i40e_hw *hw,
 				u8 rearrange_nvm,
 				struct i40e_asq_cmd_details *cmd_details);
-enum i40e_status_code i40e_aq_nvm_progress(struct i40e_hw *hw, u8 *progress,
-				struct i40e_asq_cmd_details *cmd_details);
+enum i40e_status_code
+i40e_aq_nvm_update_in_process(struct i40e_hw *hw,
+			      bool update_flow_state,
+			      struct i40e_asq_cmd_details *cmd_details);
 enum i40e_status_code i40e_aq_get_lldp_mib(struct i40e_hw *hw, u8 bridge_type,
 				u8 mib_type, void *buff, u16 buff_size,
 				u16 *local_len, u16 *remote_len,
Signature · 1 line
2.17.1
author
#43 lore raw

PATCH v3 8/15 net/i40e/base: add VLAN field for input set

In reply to Guinan Sun

Add VLAN bit used during flow director programming, as a part of input set for HW.

---
 drivers/net/i40e/base/i40e_type.h | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/i40e/base/i40e_type.h +2 -0
index cf4134583..c8e7164e1 100644
@@ -1926,6 +1926,8 @@ struct i40e_lldp_variables {
 #define I40E_L4_DST_MASK		(0x1ULL << I40E_L4_DST_SHIFT)
 #define I40E_VERIFY_TAG_SHIFT		31
 #define I40E_VERIFY_TAG_MASK		(0x3ULL << I40E_VERIFY_TAG_SHIFT)
+#define I40E_VLAN_SRC_SHIFT		55
+#define I40E_VLAN_SRC_MASK		(0x1ULL << I40E_VLAN_SRC_SHIFT)
 
 #define I40E_FLEX_50_SHIFT		13
 #define I40E_FLEX_50_MASK		(0x1ULL << I40E_FLEX_50_SHIFT)
Signature · 1 line
2.17.1
author
#44 lore raw

PATCH v3 9/15 net/i40e/base: enable pipe monitor thresholds

In reply to Guinan Sun

Enable several registers and defines for software controlled DCB, particularly around the receive pipe monitor configuration which is necessary to help ports achieve the right throughput under load in several different configurations.

---
 drivers/net/i40e/base/i40e_register.h | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/i40e/base/i40e_register.h +3 -0
index ee4f333f9..ee443e9c9 100644
@@ -203,6 +203,9 @@
 #define I40E_VFCM_PE_ERRINFO1_RLU_ERROR_CNT_MASK  I40E_MASK(0xFF, I40E_VFCM_PE_ERRINFO1_RLU_ERROR_CNT_SHIFT)
 #define I40E_VFCM_PE_ERRINFO1_RLS_ERROR_CNT_SHIFT 24
 #define I40E_VFCM_PE_ERRINFO1_RLS_ERROR_CNT_MASK  I40E_MASK(0xFF, I40E_VFCM_PE_ERRINFO1_RLS_ERROR_CNT_SHIFT)
+#define I40E_PRT_SWR_PM_THR                 0x0026CD00 /* Reset: CORER */
+#define I40E_PRT_SWR_PM_THR_THRESHOLD_SHIFT 0
+#define I40E_PRT_SWR_PM_THR_THRESHOLD_MASK  I40E_MASK(0xFF, I40E_PRT_SWR_PM_THR_THRESHOLD_SHIFT)
 #define I40E_GLDCB_GENC              0x00083044 /* Reset: CORER */
 #define I40E_GLDCB_GENC_PCIRTT_SHIFT 0
 #define I40E_GLDCB_GENC_PCIRTT_MASK  I40E_MASK(0xFFFF, I40E_GLDCB_GENC_PCIRTT_SHIFT)
Signature · 1 line
2.17.1
author
#45 lore raw

PATCH v3 10/15 net/i40e/base: fix missing function header arguments

In reply to Guinan Sun

Some arguments in function headers were forgotten, and found by automated testing. Fix them by adding the argument descriptions.

Fixes 0d9d27bb8684 ("i40e/base: prepare local LLDP MIB in TLV")
---
 drivers/net/i40e/base/i40e_dcb.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/i40e/base/i40e_dcb.c +3 -1
index a07c61e67..a5f6dcfe4 100644
@@ -975,6 +975,7 @@ i40e_get_fw_lldp_status(struct i40e_hw *hw,
 	return ret;
 }
 
+
 /**
  * i40e_add_ieee_ets_tlv - Prepare ETS TLV in IEEE format
  * @tlv: Fill the ETS config data in IEEE format
@@ -1267,7 +1268,8 @@ enum i40e_status_code i40e_set_dcb_config(struct i40e_hw *hw)
 
 /**
  * i40e_dcb_config_to_lldp - Convert Dcbconfig to MIB format
- * @hw: pointer to the hw struct
+ * @lldpmib: pointer to mib to be output
+ * @miblen: pointer to u16 for length of lldpmib
  * @dcbcfg: store for LLDPDU data
  *
  * send DCB configuration to FW
Signature · 1 line
2.17.1
author
#46 lore raw

PATCH v3 11/15 net/i40e/base: add support for Minimum Rollback Revision

In reply to Guinan Sun

add support for Minimum Rollback Revision.

---
 drivers/net/i40e/base/i40e_adminq_cmd.h | 18 +++++++++++++++
 drivers/net/i40e/base/i40e_common.c     | 29 +++++++++++++++++++++++++
 drivers/net/i40e/base/i40e_prototype.h  |  4 ++++
 3 files changed, 51 insertions(+)
drivers/net/i40e/base/i40e_adminq_cmd.h +18 -0
index 9ef01f371..4db8cdd8c 100644
@@ -241,6 +241,7 @@ enum i40e_admin_queue_opc {
 	i40e_aqc_opc_nvm_config_read		= 0x0704,
 	i40e_aqc_opc_nvm_config_write		= 0x0705,
 	i40e_aqc_opc_nvm_update_in_process	= 0x0706,
+	i40e_aqc_opc_rollback_revision_update	= 0x0707,
 	i40e_aqc_opc_oem_post_update		= 0x0720,
 	i40e_aqc_opc_thermal_sensor		= 0x0721,
 
@@ -2419,6 +2420,23 @@ struct i40e_aqc_nvm_config_data_immediate_field {
 
 I40E_CHECK_STRUCT_LEN(0xc, i40e_aqc_nvm_config_data_immediate_field);
 
+/* Minimal Rollback Revision Update (direct 0x0707) */
+struct i40e_aqc_rollback_revision_update {
+	u8	optin_mode; /* bool */
+#define I40E_AQ_RREV_OPTIN_MODE			0x01
+	u8	module_selected;
+#define I40E_AQ_RREV_MODULE_PCIE_ANALOG		0
+#define I40E_AQ_RREV_MODULE_PHY_ANALOG		1
+#define I40E_AQ_RREV_MODULE_OPTION_ROM		2
+#define I40E_AQ_RREV_MODULE_EMP_IMAGE		3
+#define I40E_AQ_RREV_MODULE_PE_IMAGE		4
+	u8	reserved1[2];
+	u32	min_rrev;
+	u8	reserved2[8];
+};
+
+I40E_CHECK_CMD_LENGTH(i40e_aqc_rollback_revision_update);
+
 /* OEM Post Update (indirect 0x0720)
  * no command data struct used
  */
drivers/net/i40e/base/i40e_common.c +29 -0
index 6c6fb4de4..15f4e91a4 100644
@@ -3717,6 +3717,35 @@ i40e_aq_nvm_update_in_process(struct i40e_hw *hw,
 	return status;
 }
 
+/**
+ * i40e_aq_min_rollback_rev_update - triggers an ow after update
+ * @hw: pointer to the hw struct
+ * @mode: opt-in mode, 1b for single module update, 0b for bulk update
+ * @module: module to be updated. Ignored if mode is 0b
+ * @min_rrev: value of the new minimal version. Ignored if mode is 0b
+ * @cmd_details: pointer to command details structure or NULL
+ **/
+enum i40e_status_code
+i40e_aq_min_rollback_rev_update(struct i40e_hw *hw, u8 mode, u8 module,
+				u32 min_rrev,
+				struct i40e_asq_cmd_details *cmd_details)
+{
+	struct i40e_aq_desc desc;
+	struct i40e_aqc_rollback_revision_update *cmd =
+		(struct i40e_aqc_rollback_revision_update *)&desc.params.raw;
+	enum i40e_status_code status;
+
+	i40e_fill_default_direct_cmd_desc(&desc,
+		i40e_aqc_opc_rollback_revision_update);
+	cmd->optin_mode = mode;
+	cmd->module_selected = module;
+	cmd->min_rrev = min_rrev;
+
+	status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details);
+
+	return status;
+}
+
 /**
  * i40e_aq_oem_post_update - triggers an OEM specific flow after update
  * @hw: pointer to the hw struct
drivers/net/i40e/base/i40e_prototype.h +4 -0
index 9a89f3002..124222e47 100644
@@ -240,6 +240,10 @@ enum i40e_status_code i40e_aq_write_nvm_config(struct i40e_hw *hw,
 				u8 cmd_flags, void *data, u16 buf_size,
 				u16 element_count,
 				struct i40e_asq_cmd_details *cmd_details);
+enum i40e_status_code
+i40e_aq_min_rollback_rev_update(struct i40e_hw *hw, u8 mode, u8 module,
+				u32 min_rrev,
+				struct i40e_asq_cmd_details *cmd_details);
 enum i40e_status_code i40e_aq_oem_post_update(struct i40e_hw *hw,
 				void *buff, u16 buff_size,
 				struct i40e_asq_cmd_details *cmd_details);
Signature · 1 line
2.17.1
author
#47 lore raw

PATCH v3 12/15 net/i40e/base: fix Rx only mode for unicast promisc on VLAN

In reply to Guinan Sun

Set promiscuous mode to rx traffic only if VSI has VLANs configured. Rename misleading PROMISC_TX bit to proper name.
Added I40E_AQC_SET_VSI_PROMISC_RX_ONLY during VSI unicast promiscuous mode configuration with port VLAN.
Aligned unicast promiscuous with VLAN to the one without VLAN. Previously other VFs could listen to unicast tx traffic of other VFs.

Fixes 8db9e2a1b232 ("i40e: base driver")
---
 drivers/net/i40e/base/i40e_adminq_cmd.h |  2 +-
 drivers/net/i40e/base/i40e_common.c     | 36 +++++++++++++++++++------
 2 files changed, 29 insertions(+), 9 deletions(-)
drivers/net/i40e/base/i40e_adminq_cmd.h +1 -1
index 4db8cdd8c..d6402a691 100644
@@ -1222,7 +1222,7 @@ struct i40e_aqc_set_vsi_promiscuous_modes {
 #define I40E_AQC_SET_VSI_PROMISC_BROADCAST	0x04
 #define I40E_AQC_SET_VSI_DEFAULT		0x08
 #define I40E_AQC_SET_VSI_PROMISC_VLAN		0x10
-#define I40E_AQC_SET_VSI_PROMISC_TX		0x8000
+#define I40E_AQC_SET_VSI_PROMISC_RX_ONLY	0x8000
 	__le16	seid;
 #define I40E_AQC_VSI_PROM_CMD_SEID_MASK		0x3FF
 	__le16	vlan_tag;
drivers/net/i40e/base/i40e_common.c +28 -8
index 15f4e91a4..cd8b27e40 100644
@@ -2270,6 +2270,22 @@ enum i40e_status_code i40e_aq_set_phy_debug(struct i40e_hw *hw, u8 cmd_flags,
 	return status;
 }
 
+/**
+ * i40e_hw_ver_ge
+ * @hw: pointer to the hw struct
+ * @maj: api major value
+ * @min: api minor value
+ *
+ * Assert whether current HW api version is greater/equal than provided.
+ **/
+static bool i40e_hw_ver_ge(struct i40e_hw *hw, u16 maj, u16 min)
+{
+	if (hw->aq.api_maj_ver > maj ||
+	    (hw->aq.api_maj_ver == maj && hw->aq.api_min_ver >= min))
+		return true;
+	return false;
+}
+
 /**
  * i40e_aq_add_vsi
  * @hw: pointer to the hw struct
@@ -2395,18 +2411,16 @@ enum i40e_status_code i40e_aq_set_vsi_unicast_promiscuous(struct i40e_hw *hw,
 
 	if (set) {
 		flags |= I40E_AQC_SET_VSI_PROMISC_UNICAST;
-		if (rx_only_promisc &&
-		    (((hw->aq.api_maj_ver == 1) && (hw->aq.api_min_ver >= 5)) ||
-		     (hw->aq.api_maj_ver > 1)))
-			flags |= I40E_AQC_SET_VSI_PROMISC_TX;
+		if (rx_only_promisc && i40e_hw_ver_ge(hw, 1, 5))
+			flags |= I40E_AQC_SET_VSI_PROMISC_RX_ONLY;
 	}
 
 	cmd->promiscuous_flags = CPU_TO_LE16(flags);
 
 	cmd->valid_flags = CPU_TO_LE16(I40E_AQC_SET_VSI_PROMISC_UNICAST);
-	if (((hw->aq.api_maj_ver >= 1) && (hw->aq.api_min_ver >= 5)) ||
-	     (hw->aq.api_maj_ver > 1))
-		cmd->valid_flags |= CPU_TO_LE16(I40E_AQC_SET_VSI_PROMISC_TX);
+	if (i40e_hw_ver_ge(hw, 1, 5))
+		cmd->valid_flags |=
+			CPU_TO_LE16(I40E_AQC_SET_VSI_PROMISC_RX_ONLY);
 
 	cmd->seid = CPU_TO_LE16(seid);
 	status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details);
@@ -2538,11 +2552,17 @@ enum i40e_status_code i40e_aq_set_vsi_uc_promisc_on_vlan(struct i40e_hw *hw,
 	i40e_fill_default_direct_cmd_desc(&desc,
 					i40e_aqc_opc_set_vsi_promiscuous_modes);
 
-	if (enable)
+	if (enable) {
 		flags |= I40E_AQC_SET_VSI_PROMISC_UNICAST;
+		if (i40e_hw_ver_ge(hw, 1, 5))
+			flags |= I40E_AQC_SET_VSI_PROMISC_RX_ONLY;
+	}
 
 	cmd->promiscuous_flags = CPU_TO_LE16(flags);
 	cmd->valid_flags = CPU_TO_LE16(I40E_AQC_SET_VSI_PROMISC_UNICAST);
+	if (i40e_hw_ver_ge(hw, 1, 5))
+		cmd->valid_flags |=
+			CPU_TO_LE16(I40E_AQC_SET_VSI_PROMISC_RX_ONLY);
 	cmd->seid = CPU_TO_LE16(seid);
 	cmd->vlan_tag = CPU_TO_LE16(vid | I40E_AQC_SET_VSI_VLAN_VALID);
 
Signature · 1 line
2.17.1
author
#48 lore raw

PATCH v3 13/15 net/i40e/base: add EEE LPI status check for X722 adapters

In reply to Guinan Sun

Add reading LPI (low power idle) status for supported X722 devices. If adapter's PHY supports EEE in current mode (device ID + link speed), LPI status is read from PHY Clause 45 PCS status register.

---
 drivers/net/i40e/base/i40e_common.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)
drivers/net/i40e/base/i40e_common.c +12 -4
index cd8b27e40..073634278 100644
@@ -7098,15 +7098,23 @@ enum i40e_status_code i40e_get_phy_lpi_status(struct i40e_hw *hw,
 					      struct i40e_hw_port_stats *stat)
 {
 	enum i40e_status_code ret = I40E_SUCCESS;
+	bool eee_mrvl_phy;
+	bool eee_bcm_phy;
 	u32 val;
 
 	stat->rx_lpi_status = 0;
 	stat->tx_lpi_status = 0;
 
-	if ((hw->device_id == I40E_DEV_ID_10G_BASE_T_BC ||
-	     hw->device_id == I40E_DEV_ID_5G_BASE_T_BC) &&
-	    (hw->phy.link_info.link_speed == I40E_LINK_SPEED_2_5GB ||
-	     hw->phy.link_info.link_speed == I40E_LINK_SPEED_5GB)) {
+	eee_bcm_phy =
+		(hw->device_id == I40E_DEV_ID_10G_BASE_T_BC ||
+		 hw->device_id == I40E_DEV_ID_5G_BASE_T_BC) &&
+		(hw->phy.link_info.link_speed == I40E_LINK_SPEED_2_5GB ||
+		 hw->phy.link_info.link_speed == I40E_LINK_SPEED_5GB);
+	eee_mrvl_phy =
+		hw->device_id == I40E_DEV_ID_1G_BASE_T_X722;
+
+	if (eee_bcm_phy || eee_mrvl_phy) {
+		// read Clause 45 PCS Status 1 register
 		ret = i40e_aq_get_phy_register(hw,
 					       I40E_AQ_PHY_REG_ACCESS_EXTERNAL,
 					       I40E_BCM_PHY_PCS_STATUS1_PAGE,
Signature · 1 line
2.17.1
author
#49 lore raw

PATCH v3 14/15 net/i40e/base: fix PHY config param when enabling EEE

In reply to Guinan Sun

The i40e_enable_eee function did not copy phy_type_ext field from current PHY configuration retrieved with Get PHY Abilities AQ. It caused a misconfiguration of the PHY on devices supporting 2.5 and 5G speeds and prevented establishing link when only those speeds were selected for advertisement.

Fixes c61bcb0fe1b0 ("net/i40e/base: support Energy Efficient Ethernet")
---
 drivers/net/i40e/base/i40e_common.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/i40e/base/i40e_common.c +1 -0
index 073634278..e62d63c68 100644
@@ -6449,6 +6449,7 @@ enum i40e_status_code i40e_enable_eee(struct i40e_hw *hw, bool enable)
 
 	/* Cache current configuration */
 	config.phy_type = abilities.phy_type;
+	config.phy_type_ext = abilities.phy_type_ext;
 	config.link_speed = abilities.link_speed;
 	config.abilities = abilities.abilities |
 			   I40E_AQ_PHY_ENABLE_ATOMIC_LINK;
Signature · 1 line
2.17.1
author
#50 lore raw

PATCH v3 15/15 net/i40e/base: update version

In reply to Guinan Sun

Update base code version in readme.

---
 drivers/net/i40e/base/README | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/i40e/base/README +1 -1
index 6baca4360..6af299311 100644
@@ -6,7 +6,7 @@ Intel® I40E driver
 ==================
 
 This directory contains source code of FreeBSD i40e driver of version
-cid-i40e.2020.03.04.tar.gz released by the team which develops
+cid-i40e.2020.08.27.tar.gz released by the team which develops
 basic drivers for any i40e NIC. The directory of base/ contains the
 original source package.
 This driver is valid for the product(s) listed below
Signature · 1 line
2.17.1
#51 lore raw
In reply to Guinan Sun
Quoted 9 lines · Guinan Sun

update i40e base code.

source code of i40e driver:
cid-i40e.2020.08.27.tar.gz dropped by the team which develop basic drivers for any i40e NIC.

changelog in ND share repo:
From fc99a1143d3f ("i40e-shared: FEC on/off support flag for X722")
To 1a82d59f0797 ("i40e-shared: Fix PHY configuration parameters when enabling EEE")

Hi Guinan,

The v2 of this patch has been merged to next-net-intel and pulled by next-net, it is now in the next-net repo.

I can see v3 is slightly newer version, I didn't check the details but does it can you make updates as incremental set on top of latest head (v2 of this set)?

Quoted 27 lines

The following commits are ignored.
ea2cd04e5db1 ("i40e-shared: do AQ calls without sleeping by default") 4eec86f12992 ("i40e-shared: Fix undeclared i40e_asq_send_command() function") 9d60cec99eb7 ("i40e-shared: Send rx ctl write command in atomic context") a204afdc1cad ("i40e-shared: Send uc/mc commands in atomic context") d22f8cb2a111 ("i40e-shared: Send commands in atomic context") 136a7d931a45 ("i40e-shared: Fix improper preprocessor conditional") 5b7d5a698092 ("i40e-shared: use linux packing style") f16fa495c503 ("i40e-shared: Fix compilation issue with __packed")

Guinan Sun (15):
net/i40e/base: enable FEC on/off flag setting for X722 net/i40e/base: add PTYPE definition net/i40e/base: add new custom cloud filter types net/i40e/base: update FW API version to 1.12 net/i40e/base: fix possible uninitialized variable net/i40e/base: support unused ports disabling net/i40e/base: replace AQ command for NVM update net/i40e/base: add VLAN field for input set net/i40e/base: enable pipe monitor thresholds net/i40e/base: fix missing function header arguments net/i40e/base: add support for Minimum Rollback Revision net/i40e/base: fix Rx only mode for unicast promisc on VLAN net/i40e/base: add EEE LPI status check for X722 adapters net/i40e/base: fix PHY config param when enabling EEE net/i40e/base: update version

<...>

#52 lore raw

Hi Ferruh

Quoted 19 lines

-----Original Message-----
From: Ferruh Yigit [mailto:[email protected]]
Sent: Thursday, September 3, 2020 10:31 PM
To: Sun, GuinanX <[email protected]>; [email protected]
Cc: Xing, Beilei <[email protected]>; Guo, Jia <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v3 00/15] update i40e base code

Quoted 10 lines · Guinan Sun

update i40e base code.

source code of i40e driver:
cid-i40e.2020.08.27.tar.gz dropped by the team which develop basic drivers for any i40e NIC.

changelog in ND share repo:
From fc99a1143d3f ("i40e-shared: FEC on/off support flag for X722") To 1a82d59f0797 ("i40e-shared: Fix PHY configuration parameters when enabling EEE")

Quoted 8 lines

Hi Guinan,

The v2 of this patch has been merged to next-net-intel and pulled by next- net, it is now in the next-net repo.

I can see v3 is slightly newer version, I didn't check the details but does it can you make updates as incremental set on top of latest head (v2 of this set)?

I have synced with zhangqi.
The patch status has been changed to superseded. The share code of the new drop will send a new version.

Quoted 34 lines
Quoted 32 lines

The following commits are ignored.
ea2cd04e5db1 ("i40e-shared: do AQ calls without sleeping by default") 4eec86f12992 ("i40e-shared: Fix undeclared i40e_asq_send_command() function")
9d60cec99eb7 ("i40e-shared: Send rx ctl write command in atomic context") a204afdc1cad ("i40e-shared: Send uc/mc commands in atomic context")
d22f8cb2a111 ("i40e-shared: Send commands in atomic context") 136a7d931a45 ("i40e-shared: Fix improper preprocessor conditional") 5b7d5a698092 ("i40e-shared: use linux packing style") f16fa495c503 ("i40e-shared: Fix compilation issue with __packed")

Guinan Sun (15):
net/i40e/base: enable FEC on/off flag setting for X722 net/i40e/base: add PTYPE definition net/i40e/base: add new custom cloud filter types net/i40e/base: update FW API version to 1.12 net/i40e/base: fix possible uninitialized variable net/i40e/base: support unused ports disabling net/i40e/base: replace AQ command for NVM update net/i40e/base: add VLAN field for input set net/i40e/base: enable pipe monitor thresholds net/i40e/base: fix missing function header arguments net/i40e/base: add support for Minimum Rollback Revision net/i40e/base: fix Rx only mode for unicast promisc on VLAN net/i40e/base: add EEE LPI status check for X722 adapters net/i40e/base: fix PHY config param when enabling EEE net/i40e/base: update version

<...>