patch 'net/ixgbe: fix shared PF pointer in representor' has been queued to stable release 24.11.7
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Thu Jun 11 15:19:51 CEST 2026
Hi,
FYI, your patch has been queued to stable release 24.11.7
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 06/13/26. So please
shout if anyone has objections.
Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.
Queued patches are on a temporary branch at:
https://github.com/bluca/dpdk-stable
This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/240b539288534b4b5ec7b87495e4ca2c6c8b2252
Thanks.
Luca Boccassi
---
>From 240b539288534b4b5ec7b87495e4ca2c6c8b2252 Mon Sep 17 00:00:00 2001
From: Anatoly Burakov <anatoly.burakov at intel.com>
Date: Thu, 30 Apr 2026 12:14:31 +0100
Subject: [PATCH] net/ixgbe: fix shared PF pointer in representor
[ upstream commit 31cb98b1f275cf78d9e8d7fb46ee4f38b59186fc ]
Currently, ixgbe representor private data stores a PF ethdev pointer.
That pointer is process local, but it is stored in shared memory, so a
secondary process can read an invalid pointer value.
Fix this by storing PF port id in representor private data and resolving
PF ethdev from rte_eth_devices[] in each process. Return -ENODEV when the
PF port is not valid.
This is not technically a bug in practice as using `rte_flow` from
secondary processes isn't supported, but we still shouldn't do that.
Fixes: cf80ba6e2038 ("net/ixgbe: add support for representor ports")
Signed-off-by: Anatoly Burakov <anatoly.burakov at intel.com>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
---
drivers/net/ixgbe/ixgbe_ethdev.c | 2 +-
drivers/net/ixgbe/ixgbe_ethdev.h | 2 +-
drivers/net/ixgbe/ixgbe_vf_representor.c | 63 ++++++++++++++++++------
3 files changed, 50 insertions(+), 17 deletions(-)
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index be2132e6b8..025e72d4ad 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -1820,7 +1820,7 @@ eth_ixgbe_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
representor.vf_id = eth_da.representor_ports[i];
representor.switch_domain_id = vfinfo->switch_domain_id;
- representor.pf_ethdev = pf_ethdev;
+ representor.pf_port_id = pf_ethdev->data->port_id;
/* representor port net_bdf_port */
snprintf(name, sizeof(name), "net_%s_representor_%d",
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.h b/drivers/net/ixgbe/ixgbe_ethdev.h
index c88805132d..4b5f6c1ff9 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.h
+++ b/drivers/net/ixgbe/ixgbe_ethdev.h
@@ -520,7 +520,7 @@ struct ixgbe_adapter {
struct ixgbe_vf_representor {
uint16_t vf_id;
uint16_t switch_domain_id;
- struct rte_eth_dev *pf_ethdev;
+ uint16_t pf_port_id;
};
int ixgbe_vf_representor_init(struct rte_eth_dev *ethdev, void *init_params);
diff --git a/drivers/net/ixgbe/ixgbe_vf_representor.c b/drivers/net/ixgbe/ixgbe_vf_representor.c
index bd528ff346..8533300ea1 100644
--- a/drivers/net/ixgbe/ixgbe_vf_representor.c
+++ b/drivers/net/ixgbe/ixgbe_vf_representor.c
@@ -13,14 +13,27 @@
#include "ixgbe_rxtx.h"
#include "rte_pmd_ixgbe.h"
+static struct rte_eth_dev *
+ixgbe_vf_representor_pf_get(const struct ixgbe_vf_representor *representor)
+{
+ if (!rte_eth_dev_is_valid_port(representor->pf_port_id))
+ return NULL;
+
+ return &rte_eth_devices[representor->pf_port_id];
+}
+
static int
ixgbe_vf_representor_link_update(struct rte_eth_dev *ethdev,
int wait_to_complete)
{
struct ixgbe_vf_representor *representor = ethdev->data->dev_private;
+ struct rte_eth_dev *pf_ethdev = ixgbe_vf_representor_pf_get(representor);
- return ixgbe_dev_link_update_share(representor->pf_ethdev,
+ if (pf_ethdev == NULL)
+ return -ENODEV;
+
+ return ixgbe_dev_link_update_share(pf_ethdev,
wait_to_complete, 0);
}
@@ -29,9 +42,13 @@ ixgbe_vf_representor_mac_addr_set(struct rte_eth_dev *ethdev,
struct rte_ether_addr *mac_addr)
{
struct ixgbe_vf_representor *representor = ethdev->data->dev_private;
+ struct rte_eth_dev *pf_ethdev = ixgbe_vf_representor_pf_get(representor);
+
+ if (pf_ethdev == NULL)
+ return -ENODEV;
return rte_pmd_ixgbe_set_vf_mac_addr(
- representor->pf_ethdev->data->port_id,
+ pf_ethdev->data->port_id,
representor->vf_id, mac_addr);
}
@@ -40,11 +57,14 @@ ixgbe_vf_representor_dev_infos_get(struct rte_eth_dev *ethdev,
struct rte_eth_dev_info *dev_info)
{
struct ixgbe_vf_representor *representor = ethdev->data->dev_private;
+ struct rte_eth_dev *pf_ethdev = ixgbe_vf_representor_pf_get(representor);
- struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(
- representor->pf_ethdev->data->dev_private);
+ if (pf_ethdev == NULL)
+ return -ENODEV;
- dev_info->device = representor->pf_ethdev->device;
+ struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(pf_ethdev->data->dev_private);
+
+ dev_info->device = pf_ethdev->device;
dev_info->min_rx_bufsize = 1024;
/**< Minimum size of RX buffer. */
@@ -70,11 +90,11 @@ ixgbe_vf_representor_dev_infos_get(struct rte_eth_dev *ethdev,
/**< Device TX offload capabilities. */
dev_info->speed_capa =
- representor->pf_ethdev->data->dev_link.link_speed;
+ pf_ethdev->data->dev_link.link_speed;
/**< Supported speeds bitmap (RTE_ETH_LINK_SPEED_). */
dev_info->switch_info.name =
- representor->pf_ethdev->device->name;
+ pf_ethdev->device->name;
dev_info->switch_info.domain_id = representor->switch_domain_id;
dev_info->switch_info.port_id = representor->vf_id;
@@ -123,10 +143,14 @@ ixgbe_vf_representor_vlan_filter_set(struct rte_eth_dev *ethdev,
uint16_t vlan_id, int on)
{
struct ixgbe_vf_representor *representor = ethdev->data->dev_private;
+ struct rte_eth_dev *pf_ethdev = ixgbe_vf_representor_pf_get(representor);
uint64_t vf_mask = 1ULL << representor->vf_id;
+ if (pf_ethdev == NULL)
+ return -ENODEV;
+
return rte_pmd_ixgbe_set_vf_vlan_filter(
- representor->pf_ethdev->data->port_id, vlan_id, vf_mask, on);
+ pf_ethdev->data->port_id, vlan_id, vf_mask, on);
}
static void
@@ -134,8 +158,12 @@ ixgbe_vf_representor_vlan_strip_queue_set(struct rte_eth_dev *ethdev,
__rte_unused uint16_t rx_queue_id, int on)
{
struct ixgbe_vf_representor *representor = ethdev->data->dev_private;
+ struct rte_eth_dev *pf_ethdev = ixgbe_vf_representor_pf_get(representor);
- rte_pmd_ixgbe_set_vf_vlan_stripq(representor->pf_ethdev->data->port_id,
+ if (pf_ethdev == NULL)
+ return;
+
+ rte_pmd_ixgbe_set_vf_vlan_stripq(pf_ethdev->data->port_id,
representor->vf_id, on);
}
@@ -175,6 +203,7 @@ int
ixgbe_vf_representor_init(struct rte_eth_dev *ethdev, void *init_params)
{
struct ixgbe_vf_representor *representor = ethdev->data->dev_private;
+ struct rte_eth_dev *pf_ethdev;
struct ixgbe_vf_info *vf_data;
struct rte_pci_device *pci_dev;
@@ -187,17 +216,21 @@ ixgbe_vf_representor_init(struct rte_eth_dev *ethdev, void *init_params)
((struct ixgbe_vf_representor *)init_params)->vf_id;
representor->switch_domain_id =
((struct ixgbe_vf_representor *)init_params)->switch_domain_id;
- representor->pf_ethdev =
- ((struct ixgbe_vf_representor *)init_params)->pf_ethdev;
+ representor->pf_port_id =
+ ((struct ixgbe_vf_representor *)init_params)->pf_port_id;
- pci_dev = RTE_ETH_DEV_TO_PCI(representor->pf_ethdev);
+ pf_ethdev = ixgbe_vf_representor_pf_get(representor);
+ if (pf_ethdev == NULL)
+ return -ENODEV;
+
+ pci_dev = RTE_ETH_DEV_TO_PCI(pf_ethdev);
if (representor->vf_id >= pci_dev->max_vfs)
return -ENODEV;
ethdev->data->dev_flags |= RTE_ETH_DEV_REPRESENTOR;
ethdev->data->representor_id = representor->vf_id;
- ethdev->data->backer_port_id = representor->pf_ethdev->data->port_id;
+ ethdev->data->backer_port_id = pf_ethdev->data->port_id;
/* Set representor device ops */
ethdev->dev_ops = &ixgbe_vf_representor_dev_ops;
@@ -214,13 +247,13 @@ ixgbe_vf_representor_init(struct rte_eth_dev *ethdev, void *init_params)
/* Reference VF mac address from PF data structure */
vf_data = *IXGBE_DEV_PRIVATE_TO_P_VFDATA(
- representor->pf_ethdev->data->dev_private);
+ pf_ethdev->data->dev_private);
ethdev->data->mac_addrs = (struct rte_ether_addr *)
vf_data[representor->vf_id].vf_mac_addresses;
/* Link state. Inherited from PF */
- link = &representor->pf_ethdev->data->dev_link;
+ link = &pf_ethdev->data->dev_link;
ethdev->data->dev_link.link_speed = link->link_speed;
ethdev->data->dev_link.link_duplex = link->link_duplex;
--
2.47.3
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2026-06-11 14:20:02.986010125 +0100
+++ 0042-net-ixgbe-fix-shared-PF-pointer-in-representor.patch 2026-06-11 14:20:01.222746177 +0100
@@ -1 +1 @@
-From 31cb98b1f275cf78d9e8d7fb46ee4f38b59186fc Mon Sep 17 00:00:00 2001
+From 240b539288534b4b5ec7b87495e4ca2c6c8b2252 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 31cb98b1f275cf78d9e8d7fb46ee4f38b59186fc ]
+
@@ -18 +19,0 @@
-Cc: stable at dpdk.org
@@ -23,3 +24,3 @@
- drivers/net/intel/ixgbe/ixgbe_ethdev.c | 2 +-
- drivers/net/intel/ixgbe/ixgbe_ethdev.h | 2 +-
- .../net/intel/ixgbe/ixgbe_vf_representor.c | 63 ++++++++++++++-----
+ drivers/net/ixgbe/ixgbe_ethdev.c | 2 +-
+ drivers/net/ixgbe/ixgbe_ethdev.h | 2 +-
+ drivers/net/ixgbe/ixgbe_vf_representor.c | 63 ++++++++++++++++++------
@@ -28,5 +29,5 @@
-diff --git a/drivers/net/intel/ixgbe/ixgbe_ethdev.c b/drivers/net/intel/ixgbe/ixgbe_ethdev.c
-index 9454cbee0a..5c95507d60 100644
---- a/drivers/net/intel/ixgbe/ixgbe_ethdev.c
-+++ b/drivers/net/intel/ixgbe/ixgbe_ethdev.c
-@@ -1818,7 +1818,7 @@ eth_ixgbe_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
+diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
+index be2132e6b8..025e72d4ad 100644
+--- a/drivers/net/ixgbe/ixgbe_ethdev.c
++++ b/drivers/net/ixgbe/ixgbe_ethdev.c
+@@ -1820,7 +1820,7 @@ eth_ixgbe_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
@@ -41,5 +42,5 @@
-diff --git a/drivers/net/intel/ixgbe/ixgbe_ethdev.h b/drivers/net/intel/ixgbe/ixgbe_ethdev.h
-index 38d476d309..1293ea49cb 100644
---- a/drivers/net/intel/ixgbe/ixgbe_ethdev.h
-+++ b/drivers/net/intel/ixgbe/ixgbe_ethdev.h
-@@ -518,7 +518,7 @@ struct ixgbe_adapter {
+diff --git a/drivers/net/ixgbe/ixgbe_ethdev.h b/drivers/net/ixgbe/ixgbe_ethdev.h
+index c88805132d..4b5f6c1ff9 100644
+--- a/drivers/net/ixgbe/ixgbe_ethdev.h
++++ b/drivers/net/ixgbe/ixgbe_ethdev.h
+@@ -520,7 +520,7 @@ struct ixgbe_adapter {
@@ -54,4 +55,4 @@
-diff --git a/drivers/net/intel/ixgbe/ixgbe_vf_representor.c b/drivers/net/intel/ixgbe/ixgbe_vf_representor.c
-index 901d80e406..52b43530c0 100644
---- a/drivers/net/intel/ixgbe/ixgbe_vf_representor.c
-+++ b/drivers/net/intel/ixgbe/ixgbe_vf_representor.c
+diff --git a/drivers/net/ixgbe/ixgbe_vf_representor.c b/drivers/net/ixgbe/ixgbe_vf_representor.c
+index bd528ff346..8533300ea1 100644
+--- a/drivers/net/ixgbe/ixgbe_vf_representor.c
++++ b/drivers/net/ixgbe/ixgbe_vf_representor.c
More information about the stable
mailing list