From: Pavan Nikhilesh <pbhagavat...@marvell.com>

Since most of the drivers overwrite the info structure passed
from the common layer it is not possible to set defaults in
``rte_event_dev_info_get`` API.
Initialize default max_profiles_per_port in the driver layer.

Fixes: 162aa4e1b479 ("eventdev: introduce link profiles")

Signed-off-by: Pavan Nikhilesh <pbhagavat...@marvell.com>
---
Please squash to 162aa4e1b479

 drivers/event/dlb2/dlb2.c                  | 1 +
 drivers/event/dpaa/dpaa_eventdev.c         | 1 +
 drivers/event/dpaa2/dpaa2_eventdev.c       | 2 +-
 drivers/event/dsw/dsw_evdev.c              | 1 +
 drivers/event/octeontx/ssovf_evdev.c       | 2 +-
 drivers/event/opdl/opdl_evdev.c            | 1 +
 drivers/event/skeleton/skeleton_eventdev.c | 1 +
 drivers/event/sw/sw_evdev.c                | 1 +
 lib/eventdev/rte_eventdev.c                | 1 -
 9 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/event/dlb2/dlb2.c b/drivers/event/dlb2/dlb2.c
index cf2764364f..e645f7595a 100644
--- a/drivers/event/dlb2/dlb2.c
+++ b/drivers/event/dlb2/dlb2.c
@@ -79,6 +79,7 @@ static struct rte_event_dev_info evdev_dlb2_default_info = {
                          RTE_EVENT_DEV_CAP_RUNTIME_PORT_LINK |
                          RTE_EVENT_DEV_CAP_MULTIPLE_QUEUE_PORT |
                          RTE_EVENT_DEV_CAP_MAINTENANCE_FREE),
+       .max_profiles_per_port = 1,
 };

 struct process_local_port_data
diff --git a/drivers/event/dpaa/dpaa_eventdev.c 
b/drivers/event/dpaa/dpaa_eventdev.c
index 4b3d16735b..f615da3813 100644
--- a/drivers/event/dpaa/dpaa_eventdev.c
+++ b/drivers/event/dpaa/dpaa_eventdev.c
@@ -359,6 +359,7 @@ dpaa_event_dev_info_get(struct rte_eventdev *dev,
                RTE_EVENT_DEV_CAP_NONSEQ_MODE |
                RTE_EVENT_DEV_CAP_CARRY_FLOW_ID |
                RTE_EVENT_DEV_CAP_MAINTENANCE_FREE;
+       dev_info->max_profiles_per_port = 1;
 }

 static int
diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c 
b/drivers/event/dpaa2/dpaa2_eventdev.c
index fa1a1ade80..ffc5550f85 100644
--- a/drivers/event/dpaa2/dpaa2_eventdev.c
+++ b/drivers/event/dpaa2/dpaa2_eventdev.c
@@ -411,7 +411,7 @@ dpaa2_eventdev_info_get(struct rte_eventdev *dev,
                RTE_EVENT_DEV_CAP_QUEUE_ALL_TYPES |
                RTE_EVENT_DEV_CAP_CARRY_FLOW_ID |
                RTE_EVENT_DEV_CAP_MAINTENANCE_FREE;
-
+       dev_info->max_profiles_per_port = 1;
 }

 static int
diff --git a/drivers/event/dsw/dsw_evdev.c b/drivers/event/dsw/dsw_evdev.c
index 6c5cde2468..785c12f61f 100644
--- a/drivers/event/dsw/dsw_evdev.c
+++ b/drivers/event/dsw/dsw_evdev.c
@@ -218,6 +218,7 @@ dsw_info_get(struct rte_eventdev *dev __rte_unused,
                .max_event_port_dequeue_depth = DSW_MAX_PORT_DEQUEUE_DEPTH,
                .max_event_port_enqueue_depth = DSW_MAX_PORT_ENQUEUE_DEPTH,
                .max_num_events = DSW_MAX_EVENTS,
+               .max_profiles_per_port = 1,
                .event_dev_cap = RTE_EVENT_DEV_CAP_BURST_MODE|
                RTE_EVENT_DEV_CAP_DISTRIBUTED_SCHED|
                RTE_EVENT_DEV_CAP_NONSEQ_MODE|
diff --git a/drivers/event/octeontx/ssovf_evdev.c 
b/drivers/event/octeontx/ssovf_evdev.c
index 650266b996..0eb9358981 100644
--- a/drivers/event/octeontx/ssovf_evdev.c
+++ b/drivers/event/octeontx/ssovf_evdev.c
@@ -158,7 +158,7 @@ ssovf_info_get(struct rte_eventdev *dev, struct 
rte_event_dev_info *dev_info)
                                        RTE_EVENT_DEV_CAP_NONSEQ_MODE |
                                        RTE_EVENT_DEV_CAP_CARRY_FLOW_ID |
                                        RTE_EVENT_DEV_CAP_MAINTENANCE_FREE;
-
+       dev_info->max_profiles_per_port = 1;
 }

 static int
diff --git a/drivers/event/opdl/opdl_evdev.c b/drivers/event/opdl/opdl_evdev.c
index 9ce8b39b60..dd25749654 100644
--- a/drivers/event/opdl/opdl_evdev.c
+++ b/drivers/event/opdl/opdl_evdev.c
@@ -378,6 +378,7 @@ opdl_info_get(struct rte_eventdev *dev, struct 
rte_event_dev_info *info)
                .event_dev_cap = RTE_EVENT_DEV_CAP_BURST_MODE |
                                 RTE_EVENT_DEV_CAP_CARRY_FLOW_ID |
                                 RTE_EVENT_DEV_CAP_MAINTENANCE_FREE,
+               .max_profiles_per_port = 1,
        };

        *info = evdev_opdl_info;
diff --git a/drivers/event/skeleton/skeleton_eventdev.c 
b/drivers/event/skeleton/skeleton_eventdev.c
index 8513b9a013..dc9b131641 100644
--- a/drivers/event/skeleton/skeleton_eventdev.c
+++ b/drivers/event/skeleton/skeleton_eventdev.c
@@ -104,6 +104,7 @@ skeleton_eventdev_info_get(struct rte_eventdev *dev,
                                        RTE_EVENT_DEV_CAP_EVENT_QOS |
                                        RTE_EVENT_DEV_CAP_CARRY_FLOW_ID |
                                        RTE_EVENT_DEV_CAP_MAINTENANCE_FREE;
+       dev_info->max_profiles_per_port = 1;
 }

 static int
diff --git a/drivers/event/sw/sw_evdev.c b/drivers/event/sw/sw_evdev.c
index cfd659d774..6d1816b76d 100644
--- a/drivers/event/sw/sw_evdev.c
+++ b/drivers/event/sw/sw_evdev.c
@@ -609,6 +609,7 @@ sw_info_get(struct rte_eventdev *dev, struct 
rte_event_dev_info *info)
                                RTE_EVENT_DEV_CAP_NONSEQ_MODE |
                                RTE_EVENT_DEV_CAP_CARRY_FLOW_ID |
                                RTE_EVENT_DEV_CAP_MAINTENANCE_FREE),
+                       .max_profiles_per_port = 1,
        };

        *info = evdev_sw_info;
diff --git a/lib/eventdev/rte_eventdev.c b/lib/eventdev/rte_eventdev.c
index 5ee8bd665b..95373bbaad 100644
--- a/lib/eventdev/rte_eventdev.c
+++ b/lib/eventdev/rte_eventdev.c
@@ -96,7 +96,6 @@ rte_event_dev_info_get(uint8_t dev_id, struct 
rte_event_dev_info *dev_info)
                return -EINVAL;

        memset(dev_info, 0, sizeof(struct rte_event_dev_info));
-       dev_info->max_profiles_per_port = 1;

        if (*dev->dev_ops->dev_infos_get == NULL)
                return -ENOTSUP;
--
2.25.1

Reply via email to