Skip to contentSkip to conversation

i40e: Limiting RSS queues to CPUs.

PATCH New Alice Michael 2 participants 13 messages Dec 19, 2018 – Dec 20, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/6 i40e: Limiting RSS queues to CPUs.

From: Aleksandr Loktionov <[email protected]>

Limiting RSS queues number to online CPUs number in order to avoid issues with creating misconfigured RSS queues.

---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/intel/i40e/i40e_main.c +1 -0
index 1e61c22c27f4..b4ae4ba84aa3 100644
@@ -11554,6 +11554,7 @@ int i40e_reconfig_rss_queues(struct i40e_pf *pf, int queue_count)
 	if (!(pf->flags & I40E_FLAG_RSS_ENABLED))
 		return 0;
 
+	queue_count = min_t(int, queue_count, num_online_cpus());
 	new_rss_size = min_t(int, queue_count, pf->rss_size_max);
 
 	if (queue_count != vsi->num_queue_pairs) {
Signature · 1 line
2.19.2
#1 lore raw

PATCH 2/6 i40e: Add support FEC configuration for Fortville 25G

From: Damian Dybek <[email protected]>

This patch adds support for setting/getting FEC configuration using ethtool options:
set/show-priv-flags rs-fec/base-r-fec set/show-fec off/rs/baser/auto for kernels version >= 4.14

---
 drivers/net/ethernet/intel/i40e/i40e.h        |   4 +
 .../net/ethernet/intel/i40e/i40e_ethtool.c    | 228 +++++++++++++++++-
 drivers/net/ethernet/intel/i40e/i40e_main.c   |  26 ++
 3 files changed, 256 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/i40e/i40e.h +4 -0
index 45bbd2d4910b..107edcf2cf19 100644
@@ -545,6 +545,8 @@ struct i40e_pf {
 #define I40E_FLAG_FD_SB_INACTIVE		BIT(22)
 #define I40E_FLAG_FD_SB_TO_CLOUD_FILTER		BIT(23)
 #define I40E_FLAG_DISABLE_FW_LLDP		BIT(24)
+#define I40E_FLAG_RS_FEC			BIT(25)
+#define I40E_FLAG_BASE_R_FEC			BIT(26)
 
 	struct i40e_client_instance *cinst;
 	bool stat_offsets_loaded;
@@ -1114,6 +1116,8 @@ i40e_status i40e_set_partition_bw_setting(struct i40e_pf *pf);
 i40e_status i40e_commit_partition_bw_setting(struct i40e_pf *pf);
 void i40e_print_link_message(struct i40e_vsi *vsi, bool isup);
 
+void i40e_set_fec_in_flags(u8 fec_cfg, u32 *flags);
+
 static inline bool i40e_enabled_xdp_vsi(struct i40e_vsi *vsi)
 {
 	return !!vsi->xdp_prog;
drivers/net/ethernet/intel/i40e/i40e_ethtool.c +226 -2

302 lines not on this page · raw message

drivers/net/ethernet/intel/i40e/i40e_main.c +26 -0
index b4ae4ba84aa3..c001e0279af3 100644
@@ -14500,6 +14500,29 @@ static int i40e_init_recovery_mode(struct i40e_pf *pf, struct i40e_hw *hw)
 	return err;
 }
 
+/**
+ * i40e_set_fec_in_flags - helper function for setting FEC options in flags
+ * @fec_cfg: FEC option to set in flags
+ * @flags: ptr to flags in which we set FEC option
+ **/
+void i40e_set_fec_in_flags(u8 fec_cfg, u32 *flags)
+{
+	if (fec_cfg & I40E_AQ_SET_FEC_AUTO)
+		*flags |= I40E_FLAG_RS_FEC | I40E_FLAG_BASE_R_FEC;
+	if ((fec_cfg & I40E_AQ_SET_FEC_REQUEST_RS) ||
+	    (fec_cfg & I40E_AQ_SET_FEC_ABILITY_RS)) {
+		*flags |= I40E_FLAG_RS_FEC;
+		*flags &= ~I40E_FLAG_BASE_R_FEC;
+	}
+	if ((fec_cfg & I40E_AQ_SET_FEC_REQUEST_KR) ||
+	    (fec_cfg & I40E_AQ_SET_FEC_ABILITY_KR)) {
+		*flags |= I40E_FLAG_BASE_R_FEC;
+		*flags &= ~I40E_FLAG_RS_FEC;
+	}
+	if (fec_cfg == 0)
+		*flags &= ~(I40E_FLAG_RS_FEC | I40E_FLAG_BASE_R_FEC);
+}
+
 /**
  * i40e_probe - Device initialization routine
  * @pdev: PCI device information struct
@@ -14997,6 +15020,9 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 			i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status));
 	pf->hw.phy.link_info.requested_speeds = abilities.link_speed;
 
+	/* set the FEC config due to the board capabilities */
+	i40e_set_fec_in_flags(abilities.fec_cfg_curr_mod_ext_info, &pf->flags);
+
 	/* get the supported phy types from the fw */
 	err = i40e_aq_get_phy_capabilities(hw, false, true, &abilities, NULL);
 	if (err)
Signature · 1 line
2.19.2
#2 lore raw

PATCH 2/6 i40e: Add support FEC configuration for Fortville 25G

Quoted 17 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On Behalf Of Alice Michael
Sent: Wednesday, December 19, 2018 6:46 AM
To: Michael, Alice <[email protected]>; intel-wired- lan at lists.osuosl.org
Cc: Damian Dybek <[email protected]>
Subject: [Intel-wired-lan] [next PATCH S1 2/6] i40e: Add support FEC configuration for Fortville 25G

From: Damian Dybek <[email protected]>

This patch adds support for setting/getting FEC configuration using ethtool options:
set/show-priv-flags rs-fec/base-r-fec
set/show-fec off/rs/baser/auto for kernels version >= 4.14

Quoted 6 lines
---
 drivers/net/ethernet/intel/i40e/i40e.h        |   4 +
 .../net/ethernet/intel/i40e/i40e_ethtool.c    | 228 +++++++++++++++++-
 drivers/net/ethernet/intel/i40e/i40e_main.c   |  26 ++
 3 files changed, 256 insertions(+), 2 deletions(-)
#3 lore raw

PATCH 3/6 i40e: Change unmatched function types

In reply to Alice Michael

From: Grzegorz Siwik <[email protected]>

Change of function declaration from int to u64 due to return type mismatch (u64).

---
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_ethtool.c +4 -4
index 1592b8244661..f86f129a5d24 100644
@@ -2370,7 +2370,7 @@ static int i40e_get_ts_info(struct net_device *dev,
 	return 0;
 }
 
-static int i40e_link_test(struct net_device *netdev, u64 *data)
+static u64 i40e_link_test(struct net_device *netdev, u64 *data)
 {
 	struct i40e_netdev_priv *np = netdev_priv(netdev);
 	struct i40e_pf *pf = np->vsi->back;
@@ -2393,7 +2393,7 @@ static int i40e_link_test(struct net_device *netdev, u64 *data)
 	return *data;
 }
 
-static int i40e_reg_test(struct net_device *netdev, u64 *data)
+static u64 i40e_reg_test(struct net_device *netdev, u64 *data)
 {
 	struct i40e_netdev_priv *np = netdev_priv(netdev);
 	struct i40e_pf *pf = np->vsi->back;
@@ -2404,7 +2404,7 @@ static int i40e_reg_test(struct net_device *netdev, u64 *data)
 	return *data;
 }
 
-static int i40e_eeprom_test(struct net_device *netdev, u64 *data)
+static u64 i40e_eeprom_test(struct net_device *netdev, u64 *data)
 {
 	struct i40e_netdev_priv *np = netdev_priv(netdev);
 	struct i40e_pf *pf = np->vsi->back;
@@ -2418,7 +2418,7 @@ static int i40e_eeprom_test(struct net_device *netdev, u64 *data)
 	return *data;
 }
 
-static int i40e_intr_test(struct net_device *netdev, u64 *data)
+static u64 i40e_intr_test(struct net_device *netdev, u64 *data)
 {
 	struct i40e_netdev_priv *np = netdev_priv(netdev);
 	struct i40e_pf *pf = np->vsi->back;
Signature · 1 line
2.19.2
#4 lore raw

PATCH 3/6 i40e: Change unmatched function types

Quoted 12 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On Behalf Of Alice Michael
Sent: Wednesday, December 19, 2018 6:46 AM
To: Michael, Alice <[email protected]>; intel-wired- lan at lists.osuosl.org
Cc: Siwik, Grzegorz <[email protected]>
Subject: [Intel-wired-lan] [next PATCH S1 3/6] i40e: Change unmatched function types

From: Grzegorz Siwik <[email protected]>

Quoted 7 lines

Change of function declaration from int to u64 due to return type mismatch (u64).

---
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
#5 lore raw

PATCH 4/6 i40e: check queue pairs num in config queues handler

In reply to Alice Michael

From: Sergey Nemov <[email protected]>

Check if num_queue_pairs number requested by VF is less than maximum possible value in VIRTCHNL_OP_CONFIG_VSI_QUEUES handler.

Also check if local_vf_id >= 0 in common handler since it is of int type and can potentially be negative.

---
 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +6 -1
index 2ac23ebfbf31..f62937045c5d 100644
@@ -2069,6 +2069,11 @@ static int i40e_vc_config_queues_msg(struct i40e_vf *vf, u8 *msg)
 		goto error_param;
 	}
 
+	if (qci->num_queue_pairs > I40E_MAX_VF_QUEUES) {
+		aq_ret = I40E_ERR_PARAM;
+		goto error_param;
+	}
+
 	for (i = 0; i < qci->num_queue_pairs; i++) {
 		qpi = &qci->qpair[i];
 
@@ -3656,7 +3661,7 @@ int i40e_vc_process_vf_msg(struct i40e_pf *pf, s16 vf_id, u32 v_opcode,
 	int ret;
 
 	pf->vf_aq_requests++;
-	if (local_vf_id >= pf->num_alloc_vfs)
+	if (local_vf_id < 0 || local_vf_id >= pf->num_alloc_vfs)
 		return -EINVAL;
 	vf = &(pf->vf[local_vf_id]);
 
Signature · 1 line
2.19.2
#6 lore raw

PATCH 4/6 i40e: check queue pairs num in config queues handler

Quoted 14 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On Behalf Of Alice Michael
Sent: Wednesday, December 19, 2018 6:46 AM
To: Michael, Alice <[email protected]>; intel-wired-
lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S1 4/6] i40e: check queue pairs num in config queues handler

From: Sergey Nemov <[email protected]>

Check if num_queue_pairs number requested by VF is less than maximum possible value in VIRTCHNL_OP_CONFIG_VSI_QUEUES handler.

Quoted 7 lines

Also check if local_vf_id >= 0 in common handler since it is of int type and can potentially be negative.

---
 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
#7 lore raw

PATCH 5/6 i40e: remove debugfs tx_timeout support

In reply to Alice Michael

From: Lihong Yang <[email protected]>

The tx_timeout command from debugfs was originally intended to support early silicon validation efforts. It is no longer needed. Thus remove it to avoid misuse of triggering tx_timeout through debugfs.

---
 .../net/ethernet/intel/i40e/i40e_debugfs.c    | 26 +------------------
 1 file changed, 1 insertion(+), 25 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_debugfs.c +1 -25
index a20d1cf058ad..c67d485d6f99 100644
@@ -1642,30 +1642,7 @@ static ssize_t i40e_dbg_netdev_ops_write(struct file *filp,
 		count = buf_tmp - i40e_dbg_netdev_ops_buf + 1;
 	}
 
-	if (strncmp(i40e_dbg_netdev_ops_buf, "tx_timeout", 10) == 0) {
-		cnt = sscanf(&i40e_dbg_netdev_ops_buf[11], "%i", &vsi_seid);
-		if (cnt != 1) {
-			dev_info(&pf->pdev->dev, "tx_timeout <vsi_seid>\n");
-			goto netdev_ops_write_done;
-		}
-		vsi = i40e_dbg_find_vsi(pf, vsi_seid);
-		if (!vsi) {
-			dev_info(&pf->pdev->dev,
-				 "tx_timeout: VSI %d not found\n", vsi_seid);
-		} else if (!vsi->netdev) {
-			dev_info(&pf->pdev->dev, "tx_timeout: no netdev for VSI %d\n",
-				 vsi_seid);
-		} else if (test_bit(__I40E_VSI_DOWN, vsi->state)) {
-			dev_info(&pf->pdev->dev, "tx_timeout: VSI %d not UP\n",
-				 vsi_seid);
-		} else if (rtnl_trylock()) {
-			vsi->netdev->netdev_ops->ndo_tx_timeout(vsi->netdev);
-			rtnl_unlock();
-			dev_info(&pf->pdev->dev, "tx_timeout called\n");
-		} else {
-			dev_info(&pf->pdev->dev, "Could not acquire RTNL - please try again\n");
-		}
-	} else if (strncmp(i40e_dbg_netdev_ops_buf, "change_mtu", 10) == 0) {
+	if (strncmp(i40e_dbg_netdev_ops_buf, "change_mtu", 10) == 0) {
 		int mtu;
 
 		cnt = sscanf(&i40e_dbg_netdev_ops_buf[11], "%i %i",
@@ -1733,7 +1710,6 @@ static ssize_t i40e_dbg_netdev_ops_write(struct file *filp,
 		dev_info(&pf->pdev->dev, "unknown command '%s'\n",
 			 i40e_dbg_netdev_ops_buf);
 		dev_info(&pf->pdev->dev, "available commands\n");
-		dev_info(&pf->pdev->dev, "  tx_timeout <vsi_seid>\n");
 		dev_info(&pf->pdev->dev, "  change_mtu <vsi_seid> <mtu>\n");
 		dev_info(&pf->pdev->dev, "  set_rx_mode <vsi_seid>\n");
 		dev_info(&pf->pdev->dev, "  napi <vsi_seid>\n");
Signature · 1 line
2.19.2
#8 lore raw

PATCH 5/6 i40e: remove debugfs tx_timeout support

Quoted 11 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On Behalf Of Alice Michael
Sent: Wednesday, December 19, 2018 6:46 AM
To: Michael, Alice <[email protected]>; intel-wired- lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S1 5/6] i40e: remove debugfs tx_timeout support

From: Lihong Yang <[email protected]>

Quoted 8 lines

The tx_timeout command from debugfs was originally intended to support early silicon validation efforts. It is no longer needed. Thus remove it to avoid misuse of triggering tx_timeout through debugfs.

---
 .../net/ethernet/intel/i40e/i40e_debugfs.c    | 26 +------------------
 1 file changed, 1 insertion(+), 25 deletions(-)
#9 lore raw

PATCH 6/6 i40e: update version number

In reply to Alice Michael
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +2 -2
index c001e0279af3..bae78c10a177 100644
@@ -26,8 +26,8 @@ static const char i40e_driver_string[] =
 #define DRV_KERN "-k"
 
 #define DRV_VERSION_MAJOR 2
-#define DRV_VERSION_MINOR 7
-#define DRV_VERSION_BUILD 6
+#define DRV_VERSION_MINOR 8
+#define DRV_VERSION_BUILD 10
 #define DRV_VERSION __stringify(DRV_VERSION_MAJOR) "." \
 	     __stringify(DRV_VERSION_MINOR) "." \
 	     __stringify(DRV_VERSION_BUILD)    DRV_KERN
Signature · 1 line
2.19.2
#10 lore raw

PATCH 6/6 i40e: update version number

Quoted 8 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On Behalf Of Alice Michael
Sent: Wednesday, December 19, 2018 6:46 AM
To: Michael, Alice <[email protected]>; intel-wired-
lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S1 6/6] i40e: update version number

Quoted 4 lines
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
#11 lore raw

PATCH 1/6 i40e: Limiting RSS queues to CPUs.

In reply to Alice Michael

ACK

-----Original Message-----
From: Michael, Alice
Sent: Wednesday, December 19, 2018 3:46 PM
To: Michael, Alice <[email protected]>; intel-wired-lan at lists.osuosl.org
Cc: Loktionov, Aleksandr <[email protected]>
Subject: [next PATCH S1 1/6] i40e: Limiting RSS queues to CPUs.

From: Aleksandr Loktionov <[email protected]>

Limiting RSS queues number to online CPUs number in order to avoid issues with creating misconfigured RSS queues.

---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/intel/i40e/i40e_main.c +1 -0
index 1e61c22c27f4..b4ae4ba84aa3 100644
@@ -11554,6 +11554,7 @@ int i40e_reconfig_rss_queues(struct i40e_pf *pf, int queue_count)
 	if (!(pf->flags & I40E_FLAG_RSS_ENABLED))
 		return 0;
 
+	queue_count = min_t(int, queue_count, num_online_cpus());
 	new_rss_size = min_t(int, queue_count, pf->rss_size_max);
 
 	if (queue_count != vsi->num_queue_pairs) {

--
2.19.2

--------------------------------------------------------------------

Intel Technology Poland sp. z o.o.
ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | Kapital zakladowy 200.000 PLN.

Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiekolwiek przegladanie lub rozpowszechnianie jest zabronione.
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by others is strictly prohibited.

#12 lore raw

PATCH 1/6 i40e: Limiting RSS queues to CPUs.

In reply to Alice Michael
Quoted 12 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On Behalf Of Alice Michael
Sent: Wednesday, December 19, 2018 6:46 AM
To: Michael, Alice <[email protected]>; intel-wired-
lan at lists.osuosl.org
Cc: Loktionov, Aleksandr <[email protected]>
Subject: [Intel-wired-lan] [next PATCH S1 1/6] i40e: Limiting RSS queues to CPUs.

From: Aleksandr Loktionov <[email protected]>

Quoted 7 lines

Limiting RSS queues number to online CPUs number in order to avoid issues with creating misconfigured RSS queues.

---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 1 +
 1 file changed, 1 insertion(+)