All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 0/7][pull request] 40GbE Intel Wired LAN Driver Updates 2022-01-06
@ 2022-01-06 21:32 Tony Nguyen
  2022-01-06 21:32 ` [PATCH net-next 1/7] i40e: Add ensurance of MacVlan resources for every trusted VF Tony Nguyen
                   ` (6 more replies)
  0 siblings, 7 replies; 11+ messages in thread
From: Tony Nguyen @ 2022-01-06 21:32 UTC (permalink / raw)
  To: davem, kuba; +Cc: Tony Nguyen, netdev, sassmann

This series contains updates to i40e and iavf drivers.

Karen limits per VF MAC filters so that one VF does not consume all
filters and adds bookkeeping of VF VLAN filters to properly remove them
for PF trunking for i40e.

Jedrzej reduces busy wait time for admin queue calls for i40e.

Mateusz updates firmware versions to reflect new supported NVM images
and renames an error to remove non-inclusive language for i40e.

Yang Li fixes a set but not used warning for i40e.

Jason Wang removes an unneeded variable for iavf.

The following are changes since commit 710ad98c363a66a0cd8526465426c5c5f8377ee0:
  veth: Do not record rx queue hint in veth_xmit
and are available in the git repository at:
  git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue 40GbE

Jason Wang (1):
  iavf: remove an unneeded variable

Jedrzej Jagielski (1):
  i40e: Minimize amount of busy-waiting during AQ send

Karen Sornek (2):
  i40e: Add ensurance of MacVlan resources for every trusted VF
  i40e: Add placeholder for ndo set VLANs

Mateusz Palczewski (2):
  i40e: Update FW API version
  i40e: Remove non-inclusive language

Yang Li (1):
  i40e: remove variables set but not used

 drivers/net/ethernet/intel/i40e/i40e_adminq.c |  29 +++-
 .../net/ethernet/intel/i40e/i40e_adminq_cmd.h |   4 +-
 drivers/net/ethernet/intel/i40e/i40e_common.c |  15 +-
 .../net/ethernet/intel/i40e/i40e_prototype.h  |  14 +-
 drivers/net/ethernet/intel/i40e/i40e_status.h |   2 +-
 .../ethernet/intel/i40e/i40e_virtchnl_pf.c    | 130 ++++++++++++++++--
 .../ethernet/intel/i40e/i40e_virtchnl_pf.h    |  10 ++
 drivers/net/ethernet/intel/iavf/iavf_adminq.c |   4 +-
 8 files changed, 168 insertions(+), 40 deletions(-)

-- 
2.31.1


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

* [PATCH net-next 1/7] i40e: Add ensurance of MacVlan resources for every trusted VF
  2022-01-06 21:32 [PATCH net-next 0/7][pull request] 40GbE Intel Wired LAN Driver Updates 2022-01-06 Tony Nguyen
@ 2022-01-06 21:32 ` Tony Nguyen
  2022-01-06 21:32 ` [PATCH net-next 2/7] i40e: Add placeholder for ndo set VLANs Tony Nguyen
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 11+ messages in thread
From: Tony Nguyen @ 2022-01-06 21:32 UTC (permalink / raw)
  To: davem, kuba
  Cc: Karen Sornek, netdev, anthony.l.nguyen, sassmann,
	Przemyslaw Patynowski, Tony Brelinski

From: Karen Sornek <karen.sornek@intel.com>

Trusted VF can use up every resource available, leaving nothing
to other trusted VFs.
Introduce define, which calculates MacVlan resources available based
on maximum available MacVlan resources, bare minimum for each VF and
number of currently allocated VFs.

Signed-off-by: Przemyslaw Patynowski <przemyslawx.patynowski@intel.com>
Signed-off-by: Karen Sornek <karen.sornek@intel.com>
Tested-by: Tony Brelinski <tony.brelinski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 .../ethernet/intel/i40e/i40e_virtchnl_pf.c    | 34 ++++++++++++++++---
 1 file changed, 29 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
index 048f1678ab8a..b785d09c19f8 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
@@ -2704,12 +2704,21 @@ static int i40e_vc_get_stats_msg(struct i40e_vf *vf, u8 *msg)
 				      (u8 *)&stats, sizeof(stats));
 }
 
+#define I40E_MAX_MACVLAN_PER_HW 3072
+#define I40E_MAX_MACVLAN_PER_PF(num_ports) (I40E_MAX_MACVLAN_PER_HW /	\
+	(num_ports))
 /* If the VF is not trusted restrict the number of MAC/VLAN it can program
  * MAC filters: 16 for multicast, 1 for MAC, 1 for broadcast
  */
 #define I40E_VC_MAX_MAC_ADDR_PER_VF (16 + 1 + 1)
 #define I40E_VC_MAX_VLAN_PER_VF 16
 
+#define I40E_VC_MAX_MACVLAN_PER_TRUSTED_VF(vf_num, num_ports)		\
+({	typeof(vf_num) vf_num_ = (vf_num);				\
+	typeof(num_ports) num_ports_ = (num_ports);			\
+	((I40E_MAX_MACVLAN_PER_PF(num_ports_) - vf_num_ *		\
+	I40E_VC_MAX_MAC_ADDR_PER_VF) / vf_num_) +			\
+	I40E_VC_MAX_MAC_ADDR_PER_VF; })
 /**
  * i40e_check_vf_permission
  * @vf: pointer to the VF info
@@ -2734,6 +2743,7 @@ static inline int i40e_check_vf_permission(struct i40e_vf *vf,
 {
 	struct i40e_pf *pf = vf->pf;
 	struct i40e_vsi *vsi = pf->vsi[vf->lan_vsi_idx];
+	struct i40e_hw *hw = &pf->hw;
 	int mac2add_cnt = 0;
 	int i;
 
@@ -2775,12 +2785,26 @@ static inline int i40e_check_vf_permission(struct i40e_vf *vf,
 	 * number of addresses. Check to make sure that the additions do not
 	 * push us over the limit.
 	 */
-	if (!test_bit(I40E_VIRTCHNL_VF_CAP_PRIVILEGE, &vf->vf_caps) &&
-	    (i40e_count_filters(vsi) + mac2add_cnt) >
+	if (!test_bit(I40E_VIRTCHNL_VF_CAP_PRIVILEGE, &vf->vf_caps)) {
+		if ((i40e_count_filters(vsi) + mac2add_cnt) >
 		    I40E_VC_MAX_MAC_ADDR_PER_VF) {
-		dev_err(&pf->pdev->dev,
-			"Cannot add more MAC addresses, VF is not trusted, switch the VF to trusted to add more functionality\n");
-		return -EPERM;
+			dev_err(&pf->pdev->dev,
+				"Cannot add more MAC addresses, VF is not trusted, switch the VF to trusted to add more functionality\n");
+			return -EPERM;
+		}
+	/* If this VF is trusted, it can use more resources than untrusted.
+	 * However to ensure that every trusted VF has appropriate number of
+	 * resources, divide whole pool of resources per port and then across
+	 * all VFs.
+	 */
+	} else {
+		if ((i40e_count_filters(vsi) + mac2add_cnt) >
+		    I40E_VC_MAX_MACVLAN_PER_TRUSTED_VF(pf->num_alloc_vfs,
+						       hw->num_ports)) {
+			dev_err(&pf->pdev->dev,
+				"Cannot add more MAC addresses, trusted VF exhausted it's resources\n");
+			return -EPERM;
+		}
 	}
 	return 0;
 }
-- 
2.31.1


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

* [PATCH net-next 2/7] i40e: Add placeholder for ndo set VLANs
  2022-01-06 21:32 [PATCH net-next 0/7][pull request] 40GbE Intel Wired LAN Driver Updates 2022-01-06 Tony Nguyen
  2022-01-06 21:32 ` [PATCH net-next 1/7] i40e: Add ensurance of MacVlan resources for every trusted VF Tony Nguyen
@ 2022-01-06 21:32 ` Tony Nguyen
  2022-01-07  4:32   ` Jakub Kicinski
  2022-01-06 21:32 ` [PATCH net-next 3/7] i40e: Minimize amount of busy-waiting during AQ send Tony Nguyen
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 11+ messages in thread
From: Tony Nguyen @ 2022-01-06 21:32 UTC (permalink / raw)
  To: davem, kuba
  Cc: Karen Sornek, netdev, anthony.l.nguyen, sassmann,
	Przemyslaw Patynowski, Konrad Jankowski

From: Karen Sornek <karen.sornek@intel.com>

VLANs set by ndo, were not accounted.
Implement placeholder, by which driver can account VLANs set by
ndo. Ensure that once PF changes trunk, every guest filter
is removed from the list 'vm_vlan_list'.
Implement logic for deletion/addition of guest(from VM) filters.

Signed-off-by: Przemyslaw Patynowski <przemyslawx.patynowski@intel.com>
Signed-off-by: Karen Sornek <karen.sornek@intel.com>
Tested-by: Konrad Jankowski <konrad0.jankowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 .../ethernet/intel/i40e/i40e_virtchnl_pf.c    | 96 +++++++++++++++++--
 .../ethernet/intel/i40e/i40e_virtchnl_pf.h    | 10 ++
 2 files changed, 98 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
index b785d09c19f8..1c7eb9766876 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
@@ -986,6 +986,79 @@ static void i40e_disable_vf_mappings(struct i40e_vf *vf)
 	i40e_flush(hw);
 }
 
+/**
+ * i40e_add_vmvlan_to_list
+ * @vf: pointer to the VF info
+ * @vfl:  pointer to the VF VLAN tag filters list
+ * @vlan_idx: vlan_id index in VLAN tag filters list
+ *
+ * add VLAN tag into the VLAN list for VM
+ **/
+static i40e_status
+i40e_add_vmvlan_to_list(struct i40e_vf *vf,
+			struct virtchnl_vlan_filter_list *vfl,
+			u16 vlan_idx)
+{
+	struct i40e_vm_vlan *vlan_elem;
+
+	vlan_elem = kzalloc(sizeof(*vlan_elem), GFP_KERNEL);
+	if (!vlan_elem)
+		return I40E_ERR_NO_MEMORY;
+	vlan_elem->vlan = vfl->vlan_id[vlan_idx];
+	vlan_elem->vsi_id = vfl->vsi_id;
+	INIT_LIST_HEAD(&vlan_elem->list);
+	vf->num_vlan++;
+	list_add(&vlan_elem->list, &vf->vm_vlan_list);
+	return 0;
+}
+
+/**
+ * i40e_del_vmvlan_from_list
+ * @vsi: pointer to the VSI structure
+ * @vf: pointer to the VF info
+ * @vlan: VLAN tag to be removed from the list
+ *
+ * delete VLAN tag from the VLAN list for VM
+ **/
+static void i40e_del_vmvlan_from_list(struct i40e_vsi *vsi,
+				      struct i40e_vf *vf, u16 vlan)
+{
+	struct i40e_vm_vlan *entry, *tmp;
+
+	list_for_each_entry_safe(entry, tmp, &vf->vm_vlan_list, list) {
+		if (vlan == entry->vlan) {
+			i40e_vsi_kill_vlan(vsi, vlan);
+			vf->num_vlan--;
+			list_del(&entry->list);
+			kfree(entry);
+			break;
+		}
+	}
+}
+
+/**
+ * i40e_free_vmvlan_list
+ * @vsi: pointer to the VSI structure
+ * @vf: pointer to the VF info
+ *
+ * remove whole list of VLAN tags for VM
+ **/
+static void i40e_free_vmvlan_list(struct i40e_vsi *vsi, struct i40e_vf *vf)
+{
+	struct i40e_vm_vlan *entry, *tmp;
+
+	if (list_empty(&vf->vm_vlan_list))
+		return;
+
+	list_for_each_entry_safe(entry, tmp, &vf->vm_vlan_list, list) {
+		if (vsi)
+			i40e_vsi_kill_vlan(vsi, entry->vlan);
+		list_del(&entry->list);
+		kfree(entry);
+	}
+	vf->num_vlan = 0;
+}
+
 /**
  * i40e_free_vf_res
  * @vf: pointer to the VF info
@@ -1061,6 +1134,9 @@ static void i40e_free_vf_res(struct i40e_vf *vf)
 		wr32(hw, reg_idx, reg);
 		i40e_flush(hw);
 	}
+
+	i40e_free_vmvlan_list(NULL, vf);
+
 	/* reset some of the state variables keeping track of the resources */
 	vf->num_queue_pairs = 0;
 	clear_bit(I40E_VF_STATE_MC_PROMISC, &vf->vf_states);
@@ -1766,6 +1842,7 @@ int i40e_alloc_vfs(struct i40e_pf *pf, u16 num_alloc_vfs)
 
 		set_bit(I40E_VF_STATE_PRE_ENABLE, &vfs[i].vf_states);
 
+		INIT_LIST_HEAD(&vfs[i].vm_vlan_list);
 	}
 	pf->num_alloc_vfs = num_alloc_vfs;
 
@@ -2969,12 +3046,13 @@ static int i40e_vc_add_vlan_msg(struct i40e_vf *vf, u8 *msg)
 	struct i40e_pf *pf = vf->pf;
 	struct i40e_vsi *vsi = NULL;
 	i40e_status aq_ret = 0;
-	int i;
+	u16 i;
 
-	if ((vf->num_vlan >= I40E_VC_MAX_VLAN_PER_VF) &&
+	if ((vf->num_vlan + vfl->num_elements > I40E_VC_MAX_VLAN_PER_VF) &&
 	    !test_bit(I40E_VIRTCHNL_VF_CAP_PRIVILEGE, &vf->vf_caps)) {
 		dev_err(&pf->pdev->dev,
 			"VF is not trusted, switch the VF to trusted to add more VLAN addresses\n");
+		aq_ret = I40E_ERR_CONFIG;
 		goto error_param;
 	}
 	if (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states) ||
@@ -2998,11 +3076,14 @@ static int i40e_vc_add_vlan_msg(struct i40e_vf *vf, u8 *msg)
 	}
 
 	i40e_vlan_stripping_enable(vsi);
+
 	for (i = 0; i < vfl->num_elements; i++) {
-		/* add new VLAN filter */
 		int ret = i40e_vsi_add_vlan(vsi, vfl->vlan_id[i]);
-		if (!ret)
-			vf->num_vlan++;
+		if (!ret && vfl->vlan_id[i]) {
+			aq_ret = i40e_add_vmvlan_to_list(vf, vfl, i);
+			if (aq_ret)
+				goto error_param;
+		}
 
 		if (test_bit(I40E_VF_STATE_UC_PROMISC, &vf->vf_states))
 			i40e_aq_set_vsi_uc_promisc_on_vlan(&pf->hw, vsi->seid,
@@ -3040,7 +3121,7 @@ static int i40e_vc_remove_vlan_msg(struct i40e_vf *vf, u8 *msg)
 	struct i40e_pf *pf = vf->pf;
 	struct i40e_vsi *vsi = NULL;
 	i40e_status aq_ret = 0;
-	int i;
+	u16 i;
 
 	if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE) ||
 	    !i40e_vc_isvalid_vsi_id(vf, vfl->vsi_id)) {
@@ -3063,8 +3144,7 @@ static int i40e_vc_remove_vlan_msg(struct i40e_vf *vf, u8 *msg)
 	}
 
 	for (i = 0; i < vfl->num_elements; i++) {
-		i40e_vsi_kill_vlan(vsi, vfl->vlan_id[i]);
-		vf->num_vlan--;
+		i40e_del_vmvlan_from_list(vsi, vf, vfl->vlan_id[i]);
 
 		if (test_bit(I40E_VF_STATE_UC_PROMISC, &vf->vf_states))
 			i40e_aq_set_vsi_uc_promisc_on_vlan(&pf->hw, vsi->seid,
diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h
index 49575a640a84..182604bd9a24 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h
@@ -62,6 +62,13 @@ struct i40evf_channel {
 	u64 max_tx_rate; /* bandwidth rate allocation for VSIs */
 };
 
+/* used for VLAN list 'vm_vlan_list' by VM for trusted and untrusted VF */
+struct i40e_vm_vlan {
+	struct list_head list;
+	s16 vlan;
+	u16 vsi_id;
+};
+
 /* VF information structure */
 struct i40e_vf {
 	struct i40e_pf *pf;
@@ -103,6 +110,9 @@ struct i40e_vf {
 	bool spoofchk;
 	u16 num_vlan;
 
+	/* VLAN list created by VM for trusted and untrusted VF */
+	struct list_head vm_vlan_list;
+
 	/* ADq related variables */
 	bool adq_enabled; /* flag to enable adq */
 	u8 num_tc;
-- 
2.31.1


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

* [PATCH net-next 3/7] i40e: Minimize amount of busy-waiting during AQ send
  2022-01-06 21:32 [PATCH net-next 0/7][pull request] 40GbE Intel Wired LAN Driver Updates 2022-01-06 Tony Nguyen
  2022-01-06 21:32 ` [PATCH net-next 1/7] i40e: Add ensurance of MacVlan resources for every trusted VF Tony Nguyen
  2022-01-06 21:32 ` [PATCH net-next 2/7] i40e: Add placeholder for ndo set VLANs Tony Nguyen
@ 2022-01-06 21:32 ` Tony Nguyen
  2022-01-06 21:32 ` [PATCH net-next 4/7] i40e: Update FW API version Tony Nguyen
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 11+ messages in thread
From: Tony Nguyen @ 2022-01-06 21:32 UTC (permalink / raw)
  To: davem, kuba
  Cc: Jedrzej Jagielski, netdev, anthony.l.nguyen, sassmann,
	Dawid Lukwinski, Tony Brelinski

From: Jedrzej Jagielski <jedrzej.jagielski@intel.com>

The i40e_asq_send_command will now use a non blocking usleep_range if
possible (non-atomic context), instead of busy-waiting udelay. The
usleep_range function uses hrtimers to provide better performance and
removes the negative impact of busy-waiting in time-critical
environments.

1. Rename i40e_asq_send_command to i40e_asq_send_command_atomic
   and add 5th parameter to inform if called from an atomic context.
   Call inside usleep_range (if non-atomic) or udelay (if atomic).

2. Change i40e_asq_send_command to invoke
   i40e_asq_send_command_atomic(..., false).

3. Change two functions:
    - i40e_aq_set_vsi_uc_promisc_on_vlan
    - i40e_aq_set_vsi_mc_promisc_on_vlan
   to explicitly use i40e_asq_send_command_atomic(..., true)
   instead of i40e_asq_send_command, as they use spinlocks and do some
   work in an atomic context.
   All other calls to i40e_asq_send_command remain unchanged.

Signed-off-by: Dawid Lukwinski <dawid.lukwinski@intel.com>
Signed-off-by: Jedrzej Jagielski <jedrzej.jagielski@intel.com>
Tested-by: Tony Brelinski <tony.brelinski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_adminq.c | 29 ++++++++++++++-----
 drivers/net/ethernet/intel/i40e/i40e_common.c |  6 ++--
 .../net/ethernet/intel/i40e/i40e_prototype.h  | 14 +++++----
 3 files changed, 35 insertions(+), 14 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_adminq.c b/drivers/net/ethernet/intel/i40e/i40e_adminq.c
index 593912b17609..7abef88801fb 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_adminq.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_adminq.c
@@ -769,21 +769,22 @@ static bool i40e_asq_done(struct i40e_hw *hw)
 }
 
 /**
- *  i40e_asq_send_command - send command to Admin Queue
+ *  i40e_asq_send_command_atomic - send command to Admin Queue
  *  @hw: pointer to the hw struct
  *  @desc: prefilled descriptor describing the command (non DMA mem)
  *  @buff: buffer to use for indirect commands
  *  @buff_size: size of buffer for indirect commands
  *  @cmd_details: pointer to command details structure
+ *  @is_atomic_context: is the function called in an atomic context?
  *
  *  This is the main send command driver routine for the Admin Queue send
  *  queue.  It runs the queue, cleans the queue, etc
  **/
-i40e_status i40e_asq_send_command(struct i40e_hw *hw,
-				struct i40e_aq_desc *desc,
-				void *buff, /* can be NULL */
-				u16  buff_size,
-				struct i40e_asq_cmd_details *cmd_details)
+i40e_status
+i40e_asq_send_command_atomic(struct i40e_hw *hw, struct i40e_aq_desc *desc,
+			     void *buff, /* can be NULL */ u16  buff_size,
+			     struct i40e_asq_cmd_details *cmd_details,
+			     bool is_atomic_context)
 {
 	i40e_status status = 0;
 	struct i40e_dma_mem *dma_buff = NULL;
@@ -910,7 +911,12 @@ i40e_status i40e_asq_send_command(struct i40e_hw *hw,
 			 */
 			if (i40e_asq_done(hw))
 				break;
-			udelay(50);
+
+			if (is_atomic_context)
+				udelay(50);
+			else
+				usleep_range(40, 60);
+
 			total_delay += 50;
 		} while (total_delay < hw->aq.asq_cmd_timeout);
 	}
@@ -967,6 +973,15 @@ i40e_status i40e_asq_send_command(struct i40e_hw *hw,
 	return status;
 }
 
+i40e_status
+i40e_asq_send_command(struct i40e_hw *hw, struct i40e_aq_desc *desc,
+		      void *buff, /* can be NULL */ u16  buff_size,
+		      struct i40e_asq_cmd_details *cmd_details)
+{
+	return i40e_asq_send_command_atomic(hw, desc, buff, buff_size,
+					    cmd_details, false);
+}
+
 /**
  *  i40e_fill_default_direct_cmd_desc - AQ descriptor helper function
  *  @desc:     pointer to the temp descriptor (non DMA mem)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c
index b4d3fed0d2f2..f81a674c8d40 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_common.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_common.c
@@ -2073,7 +2073,8 @@ enum i40e_status_code i40e_aq_set_vsi_mc_promisc_on_vlan(struct i40e_hw *hw,
 	cmd->seid = cpu_to_le16(seid);
 	cmd->vlan_tag = cpu_to_le16(vid | I40E_AQC_SET_VSI_VLAN_VALID);
 
-	status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details);
+	status = i40e_asq_send_command_atomic(hw, &desc, NULL, 0,
+					      cmd_details, true);
 
 	return status;
 }
@@ -2114,7 +2115,8 @@ enum i40e_status_code i40e_aq_set_vsi_uc_promisc_on_vlan(struct i40e_hw *hw,
 	cmd->seid = cpu_to_le16(seid);
 	cmd->vlan_tag = cpu_to_le16(vid | I40E_AQC_SET_VSI_VLAN_VALID);
 
-	status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details);
+	status = i40e_asq_send_command_atomic(hw, &desc, NULL, 0,
+					      cmd_details, true);
 
 	return status;
 }
diff --git a/drivers/net/ethernet/intel/i40e/i40e_prototype.h b/drivers/net/ethernet/intel/i40e/i40e_prototype.h
index aaea297640e0..9241b6005ad3 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_prototype.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_prototype.h
@@ -22,11 +22,15 @@ void i40e_adminq_init_ring_data(struct i40e_hw *hw);
 i40e_status i40e_clean_arq_element(struct i40e_hw *hw,
 					     struct i40e_arq_event_info *e,
 					     u16 *events_pending);
-i40e_status i40e_asq_send_command(struct i40e_hw *hw,
-				struct i40e_aq_desc *desc,
-				void *buff, /* can be NULL */
-				u16  buff_size,
-				struct i40e_asq_cmd_details *cmd_details);
+i40e_status
+i40e_asq_send_command(struct i40e_hw *hw, struct i40e_aq_desc *desc,
+		      void *buff, /* can be NULL */ u16  buff_size,
+		      struct i40e_asq_cmd_details *cmd_details);
+i40e_status
+i40e_asq_send_command_atomic(struct i40e_hw *hw, struct i40e_aq_desc *desc,
+			     void *buff, /* can be NULL */ u16  buff_size,
+			     struct i40e_asq_cmd_details *cmd_details,
+			     bool is_atomic_context);
 
 /* debug function for adminq */
 void i40e_debug_aq(struct i40e_hw *hw, enum i40e_debug_mask mask,
-- 
2.31.1


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

* [PATCH net-next 4/7] i40e: Update FW API version
  2022-01-06 21:32 [PATCH net-next 0/7][pull request] 40GbE Intel Wired LAN Driver Updates 2022-01-06 Tony Nguyen
                   ` (2 preceding siblings ...)
  2022-01-06 21:32 ` [PATCH net-next 3/7] i40e: Minimize amount of busy-waiting during AQ send Tony Nguyen
@ 2022-01-06 21:32 ` Tony Nguyen
  2022-01-06 21:32 ` [PATCH net-next 5/7] i40e: Remove non-inclusive language Tony Nguyen
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 11+ messages in thread
From: Tony Nguyen @ 2022-01-06 21:32 UTC (permalink / raw)
  To: davem, kuba
  Cc: Mateusz Palczewski, netdev, anthony.l.nguyen, sassmann,
	Sylwester Dziedziuch, Gurucharan G

From: Mateusz Palczewski <mateusz.palczewski@intel.com>

Update FW API versions to the newest supported NVM images.

Signed-off-by: Sylwester Dziedziuch <sylwesterx.dziedziuch@intel.com>
Signed-off-by: Mateusz Palczewski <mateusz.palczewski@intel.com>
Tested-by: Gurucharan G <gurucharanx.g@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h b/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h
index 140b677f114d..60f9e0a6aaca 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h
@@ -11,8 +11,8 @@
  */
 
 #define I40E_FW_API_VERSION_MAJOR	0x0001
-#define I40E_FW_API_VERSION_MINOR_X722	0x0009
-#define I40E_FW_API_VERSION_MINOR_X710	0x0009
+#define I40E_FW_API_VERSION_MINOR_X722	0x000C
+#define I40E_FW_API_VERSION_MINOR_X710	0x000F
 
 #define I40E_FW_MINOR_VERSION(_h) ((_h)->mac.type == I40E_MAC_XL710 ? \
 					I40E_FW_API_VERSION_MINOR_X710 : \
-- 
2.31.1


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

* [PATCH net-next 5/7] i40e: Remove non-inclusive language
  2022-01-06 21:32 [PATCH net-next 0/7][pull request] 40GbE Intel Wired LAN Driver Updates 2022-01-06 Tony Nguyen
                   ` (3 preceding siblings ...)
  2022-01-06 21:32 ` [PATCH net-next 4/7] i40e: Update FW API version Tony Nguyen
@ 2022-01-06 21:32 ` Tony Nguyen
  2022-01-06 21:33 ` [PATCH net-next 6/7] i40e: remove variables set but not used Tony Nguyen
  2022-01-06 21:33 ` [PATCH net-next 7/7] iavf: remove an unneeded variable Tony Nguyen
  6 siblings, 0 replies; 11+ messages in thread
From: Tony Nguyen @ 2022-01-06 21:32 UTC (permalink / raw)
  To: davem, kuba
  Cc: Mateusz Palczewski, netdev, anthony.l.nguyen, sassmann,
	Aleksandr Loktionov

From: Mateusz Palczewski <mateusz.palczewski@intel.com>

Remove non-inclusive language from the driver.

Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Mateusz Palczewski <mateusz.palczewski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_common.c | 4 ++--
 drivers/net/ethernet/intel/i40e/i40e_status.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c
index f81a674c8d40..56cb2c62e52d 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_common.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_common.c
@@ -154,8 +154,8 @@ const char *i40e_stat_str(struct i40e_hw *hw, i40e_status stat_err)
 		return "I40E_ERR_INVALID_MAC_ADDR";
 	case I40E_ERR_DEVICE_NOT_SUPPORTED:
 		return "I40E_ERR_DEVICE_NOT_SUPPORTED";
-	case I40E_ERR_MASTER_REQUESTS_PENDING:
-		return "I40E_ERR_MASTER_REQUESTS_PENDING";
+	case I40E_ERR_PRIMARY_REQUESTS_PENDING:
+		return "I40E_ERR_PRIMARY_REQUESTS_PENDING";
 	case I40E_ERR_INVALID_LINK_SETTINGS:
 		return "I40E_ERR_INVALID_LINK_SETTINGS";
 	case I40E_ERR_AUTONEG_NOT_COMPLETE:
diff --git a/drivers/net/ethernet/intel/i40e/i40e_status.h b/drivers/net/ethernet/intel/i40e/i40e_status.h
index 77be0702d07c..db3714a65dc7 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_status.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_status.h
@@ -18,7 +18,7 @@ enum i40e_status_code {
 	I40E_ERR_ADAPTER_STOPPED		= -9,
 	I40E_ERR_INVALID_MAC_ADDR		= -10,
 	I40E_ERR_DEVICE_NOT_SUPPORTED		= -11,
-	I40E_ERR_MASTER_REQUESTS_PENDING	= -12,
+	I40E_ERR_PRIMARY_REQUESTS_PENDING	= -12,
 	I40E_ERR_INVALID_LINK_SETTINGS		= -13,
 	I40E_ERR_AUTONEG_NOT_COMPLETE		= -14,
 	I40E_ERR_RESET_FAILED			= -15,
-- 
2.31.1


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

* [PATCH net-next 6/7] i40e: remove variables set but not used
  2022-01-06 21:32 [PATCH net-next 0/7][pull request] 40GbE Intel Wired LAN Driver Updates 2022-01-06 Tony Nguyen
                   ` (4 preceding siblings ...)
  2022-01-06 21:32 ` [PATCH net-next 5/7] i40e: Remove non-inclusive language Tony Nguyen
@ 2022-01-06 21:33 ` Tony Nguyen
  2022-01-06 21:33 ` [PATCH net-next 7/7] iavf: remove an unneeded variable Tony Nguyen
  6 siblings, 0 replies; 11+ messages in thread
From: Tony Nguyen @ 2022-01-06 21:33 UTC (permalink / raw)
  To: davem, kuba
  Cc: Yang Li, netdev, anthony.l.nguyen, sassmann, Abaci Robot, Gurucharan G

From: Yang Li <yang.lee@linux.alibaba.com>

The code that uses variables pe_cntx_size and pe_filt_size
has been removed, so they should be removed as well.

Eliminate the following clang warnings:
drivers/net/ethernet/intel/i40e/i40e_common.c:4139:20:
warning: variable 'pe_filt_size' set but not used.
drivers/net/ethernet/intel/i40e/i40e_common.c:4139:6:
warning: variable 'pe_cntx_size' set but not used.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Tested-by: Gurucharan G <gurucharanx.g@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_common.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c
index 56cb2c62e52d..9ddeb015eb7e 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_common.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_common.c
@@ -4138,7 +4138,6 @@ static i40e_status i40e_validate_filter_settings(struct i40e_hw *hw,
 				struct i40e_filter_control_settings *settings)
 {
 	u32 fcoe_cntx_size, fcoe_filt_size;
-	u32 pe_cntx_size, pe_filt_size;
 	u32 fcoe_fmax;
 	u32 val;
 
@@ -4182,8 +4181,6 @@ static i40e_status i40e_validate_filter_settings(struct i40e_hw *hw,
 	case I40E_HASH_FILTER_SIZE_256K:
 	case I40E_HASH_FILTER_SIZE_512K:
 	case I40E_HASH_FILTER_SIZE_1M:
-		pe_filt_size = I40E_HASH_FILTER_BASE_SIZE;
-		pe_filt_size <<= (u32)settings->pe_filt_num;
 		break;
 	default:
 		return I40E_ERR_PARAM;
@@ -4200,8 +4197,6 @@ static i40e_status i40e_validate_filter_settings(struct i40e_hw *hw,
 	case I40E_DMA_CNTX_SIZE_64K:
 	case I40E_DMA_CNTX_SIZE_128K:
 	case I40E_DMA_CNTX_SIZE_256K:
-		pe_cntx_size = I40E_DMA_CNTX_BASE_SIZE;
-		pe_cntx_size <<= (u32)settings->pe_cntx_num;
 		break;
 	default:
 		return I40E_ERR_PARAM;
-- 
2.31.1


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

* [PATCH net-next 7/7] iavf: remove an unneeded variable
  2022-01-06 21:32 [PATCH net-next 0/7][pull request] 40GbE Intel Wired LAN Driver Updates 2022-01-06 Tony Nguyen
                   ` (5 preceding siblings ...)
  2022-01-06 21:33 ` [PATCH net-next 6/7] i40e: remove variables set but not used Tony Nguyen
@ 2022-01-06 21:33 ` Tony Nguyen
  6 siblings, 0 replies; 11+ messages in thread
From: Tony Nguyen @ 2022-01-06 21:33 UTC (permalink / raw)
  To: davem, kuba; +Cc: Jason Wang, netdev, anthony.l.nguyen, sassmann

From: Jason Wang <wangborong@cdjrlc.com>

The variable `ret_code' used for returning is never changed in function
`iavf_shutdown_adminq'. So that it can be removed and just return its
initial value 0 at the end of `iavf_shutdown_adminq' function.

Signed-off-by: Jason Wang <wangborong@cdjrlc.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/iavf/iavf_adminq.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/intel/iavf/iavf_adminq.c b/drivers/net/ethernet/intel/iavf/iavf_adminq.c
index 9fa3fa99b4c2..cd4e6a22d0f9 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_adminq.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_adminq.c
@@ -551,15 +551,13 @@ enum iavf_status iavf_init_adminq(struct iavf_hw *hw)
  **/
 enum iavf_status iavf_shutdown_adminq(struct iavf_hw *hw)
 {
-	enum iavf_status ret_code = 0;
-
 	if (iavf_check_asq_alive(hw))
 		iavf_aq_queue_shutdown(hw, true);
 
 	iavf_shutdown_asq(hw);
 	iavf_shutdown_arq(hw);
 
-	return ret_code;
+	return 0;
 }
 
 /**
-- 
2.31.1


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

* Re: [PATCH net-next 2/7] i40e: Add placeholder for ndo set VLANs
  2022-01-06 21:32 ` [PATCH net-next 2/7] i40e: Add placeholder for ndo set VLANs Tony Nguyen
@ 2022-01-07  4:32   ` Jakub Kicinski
  2022-01-07 17:16     ` Nguyen, Anthony L
  0 siblings, 1 reply; 11+ messages in thread
From: Jakub Kicinski @ 2022-01-07  4:32 UTC (permalink / raw)
  To: Tony Nguyen
  Cc: davem, Karen Sornek, netdev, sassmann, Przemyslaw Patynowski,
	Konrad Jankowski

On Thu,  6 Jan 2022 13:32:56 -0800 Tony Nguyen wrote:
> From: Karen Sornek <karen.sornek@intel.com>
> 
> VLANs set by ndo, were not accounted.
> Implement placeholder, by which driver can account VLANs set by
> ndo. Ensure that once PF changes trunk, every guest filter
> is removed from the list 'vm_vlan_list'.
> Implement logic for deletion/addition of guest(from VM) filters.

I could not understand what this change is achieving from reading this.

> +/**
> + * i40e_add_vmvlan_to_list
> + * @vf: pointer to the VF info
> + * @vfl:  pointer to the VF VLAN tag filters list
> + * @vlan_idx: vlan_id index in VLAN tag filters list
> + *
> + * add VLAN tag into the VLAN list for VM
> + **/
> +static i40e_status
> +i40e_add_vmvlan_to_list(struct i40e_vf *vf,
> +			struct virtchnl_vlan_filter_list *vfl,
> +			u16 vlan_idx)
> +{
> +	struct i40e_vm_vlan *vlan_elem;
> +
> +	vlan_elem = kzalloc(sizeof(*vlan_elem), GFP_KERNEL);
> +	if (!vlan_elem)
> +		return I40E_ERR_NO_MEMORY;
> +	vlan_elem->vlan = vfl->vlan_id[vlan_idx];
> +	vlan_elem->vsi_id = vfl->vsi_id;
> +	INIT_LIST_HEAD(&vlan_elem->list);
> +	vf->num_vlan++;
> +	list_add(&vlan_elem->list, &vf->vm_vlan_list);
> +	return 0;

Why not call i40e_vsi_add_vlan() here?

i40e_del_vmvlan_from_list() calls i40e_vsi_kill_vlan(), the functions
are not symmetric.

> +}
> +
> +/**
> + * i40e_del_vmvlan_from_list
> + * @vsi: pointer to the VSI structure
> + * @vf: pointer to the VF info
> + * @vlan: VLAN tag to be removed from the list
> + *
> + * delete VLAN tag from the VLAN list for VM
> + **/
> +static void i40e_del_vmvlan_from_list(struct i40e_vsi *vsi,
> +				      struct i40e_vf *vf, u16 vlan)
> +{
> +	struct i40e_vm_vlan *entry, *tmp;
> +
> +	list_for_each_entry_safe(entry, tmp, &vf->vm_vlan_list, list) {
> +		if (vlan == entry->vlan) {
> +			i40e_vsi_kill_vlan(vsi, vlan);
> +			vf->num_vlan--;
> +			list_del(&entry->list);
> +			kfree(entry);
> +			break;
> +		}
> +	}
> +}
> +
> +/**
> + * i40e_free_vmvlan_list
> + * @vsi: pointer to the VSI structure
> + * @vf: pointer to the VF info
> + *
> + * remove whole list of VLAN tags for VM
> + **/
> +static void i40e_free_vmvlan_list(struct i40e_vsi *vsi, struct i40e_vf *vf)
> +{
> +	struct i40e_vm_vlan *entry, *tmp;
> +
> +	if (list_empty(&vf->vm_vlan_list))
> +		return;
> +
> +	list_for_each_entry_safe(entry, tmp, &vf->vm_vlan_list, list) {
> +		if (vsi)

This function is only called with vsi = NULL AFAICT.

Please remove all dead code.

> +			i40e_vsi_kill_vlan(vsi, entry->vlan);
> +		list_del(&entry->list);
> +		kfree(entry);
> +	}
> +	vf->num_vlan = 0;
> +}
> +
>  /**
>   * i40e_free_vf_res
>   * @vf: pointer to the VF info


> @@ -2969,12 +3046,13 @@ static int i40e_vc_add_vlan_msg(struct i40e_vf *vf, u8 *msg)
>  	struct i40e_pf *pf = vf->pf;
>  	struct i40e_vsi *vsi = NULL;
>  	i40e_status aq_ret = 0;
> -	int i;
> +	u16 i;
>  
> -	if ((vf->num_vlan >= I40E_VC_MAX_VLAN_PER_VF) &&
> +	if ((vf->num_vlan + vfl->num_elements > I40E_VC_MAX_VLAN_PER_VF) &&
>  	    !test_bit(I40E_VIRTCHNL_VF_CAP_PRIVILEGE, &vf->vf_caps)) {
>  		dev_err(&pf->pdev->dev,
>  			"VF is not trusted, switch the VF to trusted to add more VLAN addresses\n");
> +		aq_ret = I40E_ERR_CONFIG;

seems unrelated

>  		goto error_param;
>  	}
>  	if (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states) ||

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

* Re: [PATCH net-next 2/7] i40e: Add placeholder for ndo set VLANs
  2022-01-07  4:32   ` Jakub Kicinski
@ 2022-01-07 17:16     ` Nguyen, Anthony L
  2022-01-07 17:28       ` Jakub Kicinski
  0 siblings, 1 reply; 11+ messages in thread
From: Nguyen, Anthony L @ 2022-01-07 17:16 UTC (permalink / raw)
  To: kuba
  Cc: Sornek, Karen, sassmann, davem, netdev, Patynowski, PrzemyslawX,
	Jankowski, Konrad0

On Thu, 2022-01-06 at 20:32 -0800, Jakub Kicinski wrote:
> On Thu,  6 Jan 2022 13:32:56 -0800 Tony Nguyen wrote:
> > From: Karen Sornek <karen.sornek@intel.com>
> > 
> > VLANs set by ndo, were not accounted.
> > Implement placeholder, by which driver can account VLANs set by
> > ndo. Ensure that once PF changes trunk, every guest filter
> > is removed from the list 'vm_vlan_list'.
> > Implement logic for deletion/addition of guest(from VM) filters.
> 
> I could not understand what this change is achieving from reading
> this.
> 

Hi Jakub,

The author is currently out on holiday. I'm going to drop this from the
series so the other patches can make it before net-next closes. She'll
respond and/or make changes when she returns.

Thanks,
Tony



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

* Re: [PATCH net-next 2/7] i40e: Add placeholder for ndo set VLANs
  2022-01-07 17:16     ` Nguyen, Anthony L
@ 2022-01-07 17:28       ` Jakub Kicinski
  0 siblings, 0 replies; 11+ messages in thread
From: Jakub Kicinski @ 2022-01-07 17:28 UTC (permalink / raw)
  To: Nguyen, Anthony L
  Cc: Sornek, Karen, sassmann, davem, netdev, Patynowski, PrzemyslawX,
	Jankowski, Konrad0

On Fri, 7 Jan 2022 17:16:33 +0000 Nguyen, Anthony L wrote:
> On Thu, 2022-01-06 at 20:32 -0800, Jakub Kicinski wrote:
> > On Thu,  6 Jan 2022 13:32:56 -0800 Tony Nguyen wrote:  
> > > From: Karen Sornek <karen.sornek@intel.com>
> > > 
> > > VLANs set by ndo, were not accounted.
> > > Implement placeholder, by which driver can account VLANs set by
> > > ndo. Ensure that once PF changes trunk, every guest filter
> > > is removed from the list 'vm_vlan_list'.
> > > Implement logic for deletion/addition of guest(from VM) filters.  
> > 
> > I could not understand what this change is achieving from reading
> > this.
> >   
> The author is currently out on holiday. I'm going to drop this from the
> series so the other patches can make it before net-next closes. She'll
> respond and/or make changes when she returns.

SG! The rest of the patches LGTM, thanks!

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

end of thread, other threads:[~2022-01-07 17:28 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-06 21:32 [PATCH net-next 0/7][pull request] 40GbE Intel Wired LAN Driver Updates 2022-01-06 Tony Nguyen
2022-01-06 21:32 ` [PATCH net-next 1/7] i40e: Add ensurance of MacVlan resources for every trusted VF Tony Nguyen
2022-01-06 21:32 ` [PATCH net-next 2/7] i40e: Add placeholder for ndo set VLANs Tony Nguyen
2022-01-07  4:32   ` Jakub Kicinski
2022-01-07 17:16     ` Nguyen, Anthony L
2022-01-07 17:28       ` Jakub Kicinski
2022-01-06 21:32 ` [PATCH net-next 3/7] i40e: Minimize amount of busy-waiting during AQ send Tony Nguyen
2022-01-06 21:32 ` [PATCH net-next 4/7] i40e: Update FW API version Tony Nguyen
2022-01-06 21:32 ` [PATCH net-next 5/7] i40e: Remove non-inclusive language Tony Nguyen
2022-01-06 21:33 ` [PATCH net-next 6/7] i40e: remove variables set but not used Tony Nguyen
2022-01-06 21:33 ` [PATCH net-next 7/7] iavf: remove an unneeded variable Tony Nguyen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.