Commit 86a0348d authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'ice-vf-resource-tracking'



Jacob Keller says:

====================
Intel Wired LAN Driver Updates 2023-10-19 (ice, igb, ixgbe)

This series contains improvements to the ice driver related to VF MSI-X
resource tracking, as well as other minor cleanups.

Dan fixes code in igb and ixgbe where the conversion to list_for_each_entry
failed to account for logic which assumed a NULL pointer after iteration.

Jacob makes ice_get_pf_c827_idx static, and refactors ice_find_netlist_node
based on feedback that got missed before the function merged.

Michal adds a switch rule to drop all traffic received by an inactive LAG
port. He also implements ops to allow individual control of MSI-X vectors
for SR-IOV VFs.

Przemek removes some unused fields in struct ice_flow_entry, and modifies
the ice driver to cache the VF PCI device inside struct ice_vf rather than
performing lookup at run time.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 20c6e05b a41654c3
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -554,6 +554,8 @@ struct ice_pf {
	 * MSIX vectors allowed on this PF.
	 */
	u16 sriov_base_vector;
	unsigned long *sriov_irq_bm;	/* bitmap to track irq usage */
	u16 sriov_irq_size;		/* size of the irq_bm bitmap */

	u16 ctrl_vsi_idx;		/* control VSI index in pf->vsi array */

+15 −15
Original line number Diff line number Diff line
@@ -473,41 +473,41 @@ ice_aq_get_netlist_node(struct ice_hw *hw, struct ice_aqc_get_link_topo *cmd,
 * @node_part_number: node part number to look for
 * @node_handle: output parameter if node found - optional
 *
 * Find and return the node handle for a given node type and part number in the
 * netlist. When found ICE_SUCCESS is returned, ICE_ERR_DOES_NOT_EXIST
 * otherwise. If node_handle provided, it would be set to found node handle.
 * Scan the netlist for a node handle of the given node type and part number.
 *
 * If node_handle is non-NULL it will be modified on function exit. It is only
 * valid if the function returns zero, and should be ignored on any non-zero
 * return value.
 *
 * Returns: 0 if the node is found, -ENOENT if no handle was found, and
 * a negative error code on failure to access the AQ.
 */
static int ice_find_netlist_node(struct ice_hw *hw, u8 node_type_ctx,
				 u8 node_part_number, u16 *node_handle)
{
	struct ice_aqc_get_link_topo cmd;
	u8 rec_node_part_number;
	u16 rec_node_handle;
	u8 idx;

	for (idx = 0; idx < ICE_MAX_NETLIST_SIZE; idx++) {
		struct ice_aqc_get_link_topo cmd = {};
		u8 rec_node_part_number;
		int status;

		memset(&cmd, 0, sizeof(cmd));

		cmd.addr.topo_params.node_type_ctx =
			(node_type_ctx << ICE_AQC_LINK_TOPO_NODE_TYPE_S);
			FIELD_PREP(ICE_AQC_LINK_TOPO_NODE_TYPE_M,
				   node_type_ctx);
		cmd.addr.topo_params.index = idx;

		status = ice_aq_get_netlist_node(hw, &cmd,
						 &rec_node_part_number,
						 &rec_node_handle);
						 node_handle);
		if (status)
			return status;

		if (rec_node_part_number == node_part_number) {
			if (node_handle)
				*node_handle = rec_node_handle;
		if (rec_node_part_number == node_part_number)
			return 0;
	}
	}

	return -ENOTBLK;
	return -ENOENT;
}

/**
+3 −3
Original line number Diff line number Diff line
@@ -73,7 +73,7 @@ ice_eswitch_br_ingress_rule_setup(struct ice_adv_rule_info *rule_info,
	rule_info->sw_act.vsi_handle = vf_vsi_idx;
	rule_info->sw_act.flag |= ICE_FLTR_RX;
	rule_info->sw_act.src = pf_id;
	rule_info->priority = 5;
	rule_info->priority = 2;
}

static void
@@ -84,7 +84,7 @@ ice_eswitch_br_egress_rule_setup(struct ice_adv_rule_info *rule_info,
	rule_info->sw_act.flag |= ICE_FLTR_TX;
	rule_info->flags_info.act = ICE_SINGLE_ACT_LAN_ENABLE;
	rule_info->flags_info.act_valid = true;
	rule_info->priority = 5;
	rule_info->priority = 2;
}

static int
@@ -207,7 +207,7 @@ ice_eswitch_br_guard_rule_create(struct ice_hw *hw, u16 vsi_idx,
	rule_info.allow_pass_l2 = true;
	rule_info.sw_act.vsi_handle = vsi_idx;
	rule_info.sw_act.fltr_act = ICE_NOP;
	rule_info.priority = 5;
	rule_info.priority = 2;

	err = ice_add_adv_rule(hw, list, lkups_cnt, &rule_info, rule);
	if (err)
+1 −4
Original line number Diff line number Diff line
@@ -1318,7 +1318,6 @@ ice_flow_rem_entry_sync(struct ice_hw *hw, enum ice_block __always_unused blk,

	list_del(&entry->l_entry);

	devm_kfree(ice_hw_to_dev(hw), entry->entry);
	devm_kfree(ice_hw_to_dev(hw), entry);

	return 0;
@@ -1645,10 +1644,8 @@ ice_flow_add_entry(struct ice_hw *hw, enum ice_block blk, u64 prof_id,
	*entry_h = ICE_FLOW_ENTRY_HNDL(e);

out:
	if (status && e) {
		devm_kfree(ice_hw_to_dev(hw), e->entry);
	if (status)
		devm_kfree(ice_hw_to_dev(hw), e);
	}

	return status;
}
+0 −3
Original line number Diff line number Diff line
@@ -350,11 +350,8 @@ struct ice_flow_entry {

	u64 id;
	struct ice_flow_prof *prof;
	/* Flow entry's content */
	void *entry;
	enum ice_flow_priority priority;
	u16 vsi_handle;
	u16 entry_sz;
};

#define ICE_FLOW_ENTRY_HNDL(e)	((u64)(uintptr_t)e)
Loading