* [PATCH] net/mlx5: fix flex item availability
@ 2022-03-02 11:06 Gregory Etelson
2022-03-07 10:41 ` Raslan Darawsheh
0 siblings, 1 reply; 2+ messages in thread
From: Gregory Etelson @ 2022-03-02 11:06 UTC (permalink / raw)
To: dev; +Cc: getelson, matan, rasland, stable, Viacheslav Ovsiienko
Flex item availability is restricted to Blue Field 2 and Blue Field 3
PF ports.
The patch validates port type compliance before proceeding to
flex item creation.
Cc: stable@dpdk.org
Fixes: db25cadc0887 ("net/mlx5: add flex item operations")
Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
drivers/common/mlx5/linux/mlx5_common_os.h | 1 +
drivers/net/mlx5/mlx5_flow.c | 17 +++++++++++++++++
2 files changed, 18 insertions(+)
diff --git a/drivers/common/mlx5/linux/mlx5_common_os.h b/drivers/common/mlx5/linux/mlx5_common_os.h
index a85f3b5f3c..27f1192205 100644
--- a/drivers/common/mlx5/linux/mlx5_common_os.h
+++ b/drivers/common/mlx5/linux/mlx5_common_os.h
@@ -9,6 +9,7 @@
#include <malloc.h>
#include <rte_pci.h>
+#include <rte_bus_pci.h>
#include <rte_debug.h>
#include <rte_atomic.h>
#include <rte_log.h>
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index a690e2d337..ebff2c6409 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -10619,10 +10619,27 @@ mlx5_flow_flex_item_create(struct rte_eth_dev *dev,
struct rte_flow_error *error)
{
static const char err_msg[] = "flex item creation unsupported";
+ struct mlx5_priv *priv = dev->data->dev_private;
struct rte_flow_attr attr = { .transfer = 0 };
const struct mlx5_flow_driver_ops *fops =
flow_get_drv_ops(flow_get_drv_type(dev, &attr));
+ if (!priv->pci_dev) {
+ rte_flow_error_set(error, ENOTSUP,
+ RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,
+ "create flex item on PF only");
+ return NULL;
+ }
+ switch (priv->pci_dev->id.device_id) {
+ case PCI_DEVICE_ID_MELLANOX_CONNECTX6DXBF:
+ case PCI_DEVICE_ID_MELLANOX_CONNECTX7BF:
+ break;
+ default:
+ rte_flow_error_set(error, ENOTSUP,
+ RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,
+ "flex item available on Blue Field ports only");
+ return NULL;
+ }
if (!fops->item_create) {
DRV_LOG(ERR, "port %u %s.", dev->data->port_id, err_msg);
rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ACTION,
--
2.34.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* RE: [PATCH] net/mlx5: fix flex item availability
2022-03-02 11:06 [PATCH] net/mlx5: fix flex item availability Gregory Etelson
@ 2022-03-07 10:41 ` Raslan Darawsheh
0 siblings, 0 replies; 2+ messages in thread
From: Raslan Darawsheh @ 2022-03-07 10:41 UTC (permalink / raw)
To: Gregory Etelson, dev; +Cc: Matan Azrad, stable, Slava Ovsiienko
Hi,
> -----Original Message-----
> From: Gregory Etelson <getelson@nvidia.com>
> Sent: Wednesday, March 2, 2022 1:07 PM
> To: dev@dpdk.org
> Cc: Gregory Etelson <getelson@nvidia.com>; Matan Azrad
> <matan@nvidia.com>; Raslan Darawsheh <rasland@nvidia.com>;
> stable@dpdk.org; Slava Ovsiienko <viacheslavo@nvidia.com>
> Subject: [PATCH] net/mlx5: fix flex item availability
>
> Flex item availability is restricted to Blue Field 2 and Blue Field 3 PF ports.
>
> The patch validates port type compliance before proceeding to flex item
> creation.
>
> Cc: stable@dpdk.org
>
> Fixes: db25cadc0887 ("net/mlx5: add flex item operations")
>
> Signed-off-by: Gregory Etelson <getelson@nvidia.com>
> Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Patch applied to next-net-mlx,
Kindest regards,
Raslan Darawsheh
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-03-07 10:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-02 11:06 [PATCH] net/mlx5: fix flex item availability Gregory Etelson
2022-03-07 10:41 ` Raslan Darawsheh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).