Commit d1d5df46 authored by Jakub Kicinski's avatar Jakub Kicinski
Browse files

Merge branch 'intel-wired-lan-driver-updates-2025-10-01-idpf-ixgbe-ixgbevf'

Jacob Keller says:

====================
Intel Wired LAN Driver Updates 2025-10-01 (idpf, ixgbe, ixgbevf)

For idpf:
Milena fixes a memory leak in the idpf reset logic when the driver resets
with an outstanding Tx timestamp.

For ixgbe and ixgbevf:
Jedrzej fixes an issue with reporting link speed on E610 VFs.

Jedrzej also fixes the VF mailbox API incompatibilities caused by the
confusion with API v1.4, v1.5, and v1.6. The v1.4 API introduced IPSEC
offload, but this was only supported on Linux hosts. The v1.5 API
introduced a new mailbox API which is necessary to resolve issues on ESX
hosts. The v1.6 API introduced a new link management API for E610. Jedrzej
introduces a new v1.7 API with a feature negotiation which enables properly
checking if features such as IPSEC or the ESX mailbox APIs are supported.
This resolves issues with compatibility on different hosts, and aligns the
API across hosts instead of having Linux require custom mailbox API
versions for IPSEC offload.

Koichiro fixes a KASAN use-after-free bug in ixgbe_remove().
====================

Link: https://patch.msgid.link/20251009-jk-iwl-net-2025-10-01-v3-0-ef32a425b92a@intel.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents 21f4d45e 5feef67b
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -863,6 +863,9 @@ static void idpf_ptp_release_vport_tstamp(struct idpf_vport *vport)
		u64_stats_inc(&vport->tstamp_stats.flushed);

		list_del(&ptp_tx_tstamp->list_member);
		if (ptp_tx_tstamp->skb)
			consume_skb(ptp_tx_tstamp->skb);

		kfree(ptp_tx_tstamp);
	}
	u64_stats_update_end(&vport->tstamp_stats.stats_sync);
+1 −0
Original line number Diff line number Diff line
@@ -517,6 +517,7 @@ idpf_ptp_get_tstamp_value(struct idpf_vport *vport,
	shhwtstamps.hwtstamp = ns_to_ktime(tstamp);
	skb_tstamp_tx(ptp_tx_tstamp->skb, &shhwtstamps);
	consume_skb(ptp_tx_tstamp->skb);
	ptp_tx_tstamp->skb = NULL;

	list_add(&ptp_tx_tstamp->list_member,
		 &tx_tstamp_caps->latches_free);
+2 −1
Original line number Diff line number Diff line
@@ -12101,7 +12101,6 @@ static void ixgbe_remove(struct pci_dev *pdev)

	devl_port_unregister(&adapter->devlink_port);
	devl_unlock(adapter->devlink);
	devlink_free(adapter->devlink);

	ixgbe_stop_ipsec_offload(adapter);
	ixgbe_clear_interrupt_scheme(adapter);
@@ -12137,6 +12136,8 @@ static void ixgbe_remove(struct pci_dev *pdev)

	if (disable_dev)
		pci_disable_device(pdev);

	devlink_free(adapter->devlink);
}

/**
+15 −0
Original line number Diff line number Diff line
@@ -50,6 +50,9 @@ enum ixgbe_pfvf_api_rev {
	ixgbe_mbox_api_12,	/* API version 1.2, linux/freebsd VF driver */
	ixgbe_mbox_api_13,	/* API version 1.3, linux/freebsd VF driver */
	ixgbe_mbox_api_14,	/* API version 1.4, linux/freebsd VF driver */
	ixgbe_mbox_api_15,	/* API version 1.5, linux/freebsd VF driver */
	ixgbe_mbox_api_16,	/* API version 1.6, linux/freebsd VF driver */
	ixgbe_mbox_api_17,	/* API version 1.7, linux/freebsd VF driver */
	/* This value should always be last */
	ixgbe_mbox_api_unknown,	/* indicates that API version is not known */
};
@@ -86,6 +89,12 @@ enum ixgbe_pfvf_api_rev {

#define IXGBE_VF_GET_LINK_STATE 0x10 /* get vf link state */

/* mailbox API, version 1.6 VF requests */
#define IXGBE_VF_GET_PF_LINK_STATE	0x11 /* request PF to send link info */

/* mailbox API, version 1.7 VF requests */
#define IXGBE_VF_FEATURES_NEGOTIATE	0x12 /* get features supported by PF */

/* length of permanent address message returned from PF */
#define IXGBE_VF_PERMADDR_MSG_LEN 4
/* word in permanent address message with the current multicast type */
@@ -96,6 +105,12 @@ enum ixgbe_pfvf_api_rev {
#define IXGBE_VF_MBX_INIT_TIMEOUT 2000 /* number of retries on mailbox */
#define IXGBE_VF_MBX_INIT_DELAY   500  /* microseconds between retries */

/* features negotiated between PF/VF */
#define IXGBEVF_PF_SUP_IPSEC		BIT(0)
#define IXGBEVF_PF_SUP_ESX_MBX		BIT(1)

#define IXGBE_SUPPORTED_FEATURES	IXGBEVF_PF_SUP_IPSEC

struct ixgbe_hw;

int ixgbe_read_mbx(struct ixgbe_hw *, u32 *, u16, u16);
+79 −0
Original line number Diff line number Diff line
@@ -510,6 +510,8 @@ static int ixgbe_set_vf_lpe(struct ixgbe_adapter *adapter, u32 max_frame, u32 vf
		case ixgbe_mbox_api_12:
		case ixgbe_mbox_api_13:
		case ixgbe_mbox_api_14:
		case ixgbe_mbox_api_16:
		case ixgbe_mbox_api_17:
			/* Version 1.1 supports jumbo frames on VFs if PF has
			 * jumbo frames enabled which means legacy VFs are
			 * disabled
@@ -1046,6 +1048,8 @@ static int ixgbe_negotiate_vf_api(struct ixgbe_adapter *adapter,
	case ixgbe_mbox_api_12:
	case ixgbe_mbox_api_13:
	case ixgbe_mbox_api_14:
	case ixgbe_mbox_api_16:
	case ixgbe_mbox_api_17:
		adapter->vfinfo[vf].vf_api = api;
		return 0;
	default:
@@ -1072,6 +1076,8 @@ static int ixgbe_get_vf_queues(struct ixgbe_adapter *adapter,
	case ixgbe_mbox_api_12:
	case ixgbe_mbox_api_13:
	case ixgbe_mbox_api_14:
	case ixgbe_mbox_api_16:
	case ixgbe_mbox_api_17:
		break;
	default:
		return -1;
@@ -1112,6 +1118,8 @@ static int ixgbe_get_vf_reta(struct ixgbe_adapter *adapter, u32 *msgbuf, u32 vf)

	/* verify the PF is supporting the correct API */
	switch (adapter->vfinfo[vf].vf_api) {
	case ixgbe_mbox_api_17:
	case ixgbe_mbox_api_16:
	case ixgbe_mbox_api_14:
	case ixgbe_mbox_api_13:
	case ixgbe_mbox_api_12:
@@ -1145,6 +1153,8 @@ static int ixgbe_get_vf_rss_key(struct ixgbe_adapter *adapter,

	/* verify the PF is supporting the correct API */
	switch (adapter->vfinfo[vf].vf_api) {
	case ixgbe_mbox_api_17:
	case ixgbe_mbox_api_16:
	case ixgbe_mbox_api_14:
	case ixgbe_mbox_api_13:
	case ixgbe_mbox_api_12:
@@ -1174,6 +1184,8 @@ static int ixgbe_update_vf_xcast_mode(struct ixgbe_adapter *adapter,
		fallthrough;
	case ixgbe_mbox_api_13:
	case ixgbe_mbox_api_14:
	case ixgbe_mbox_api_16:
	case ixgbe_mbox_api_17:
		break;
	default:
		return -EOPNOTSUPP;
@@ -1244,6 +1256,8 @@ static int ixgbe_get_vf_link_state(struct ixgbe_adapter *adapter,
	case ixgbe_mbox_api_12:
	case ixgbe_mbox_api_13:
	case ixgbe_mbox_api_14:
	case ixgbe_mbox_api_16:
	case ixgbe_mbox_api_17:
		break;
	default:
		return -EOPNOTSUPP;
@@ -1254,6 +1268,65 @@ static int ixgbe_get_vf_link_state(struct ixgbe_adapter *adapter,
	return 0;
}

/**
 * ixgbe_send_vf_link_status - send link status data to VF
 * @adapter: pointer to adapter struct
 * @msgbuf: pointer to message buffers
 * @vf: VF identifier
 *
 * Reply for IXGBE_VF_GET_PF_LINK_STATE mbox command sending link status data.
 *
 * Return: 0 on success or -EOPNOTSUPP when operation is not supported.
 */
static int ixgbe_send_vf_link_status(struct ixgbe_adapter *adapter,
				     u32 *msgbuf, u32 vf)
{
	struct ixgbe_hw *hw = &adapter->hw;

	switch (adapter->vfinfo[vf].vf_api) {
	case ixgbe_mbox_api_16:
	case ixgbe_mbox_api_17:
		if (hw->mac.type != ixgbe_mac_e610)
			return -EOPNOTSUPP;
		break;
	default:
		return -EOPNOTSUPP;
	}
	/* Simply provide stored values as watchdog & link status events take
	 * care of its freshness.
	 */
	msgbuf[1] = adapter->link_speed;
	msgbuf[2] = adapter->link_up;

	return 0;
}

/**
 * ixgbe_negotiate_vf_features -  negotiate supported features with VF driver
 * @adapter: pointer to adapter struct
 * @msgbuf: pointer to message buffers
 * @vf: VF identifier
 *
 * Return: 0 on success or -EOPNOTSUPP when operation is not supported.
 */
static int ixgbe_negotiate_vf_features(struct ixgbe_adapter *adapter,
				       u32 *msgbuf, u32 vf)
{
	u32 features = msgbuf[1];

	switch (adapter->vfinfo[vf].vf_api) {
	case ixgbe_mbox_api_17:
		break;
	default:
		return -EOPNOTSUPP;
	}

	features &= IXGBE_SUPPORTED_FEATURES;
	msgbuf[1] = features;

	return 0;
}

static int ixgbe_rcv_msg_from_vf(struct ixgbe_adapter *adapter, u32 vf)
{
	u32 mbx_size = IXGBE_VFMAILBOX_SIZE;
@@ -1328,6 +1401,12 @@ static int ixgbe_rcv_msg_from_vf(struct ixgbe_adapter *adapter, u32 vf)
	case IXGBE_VF_IPSEC_DEL:
		retval = ixgbe_ipsec_vf_del_sa(adapter, msgbuf, vf);
		break;
	case IXGBE_VF_GET_PF_LINK_STATE:
		retval = ixgbe_send_vf_link_status(adapter, msgbuf, vf);
		break;
	case IXGBE_VF_FEATURES_NEGOTIATE:
		retval = ixgbe_negotiate_vf_features(adapter, msgbuf, vf);
		break;
	default:
		e_err(drv, "Unhandled Msg %8.8x\n", msgbuf[0]);
		retval = -EIO;
Loading