aboutsummaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorMatias Elo <matias.elo@nokia.com>2023-05-05 09:42:53 +0300
committerMatias Elo <matias.elo@nokia.com>2023-05-09 13:03:07 +0300
commit554283317b9683071b4943c60da8bc6d319335fb (patch)
tree5a16a2545d5d60e1939da0436183e65a7de3209c /platform
parentd16710c38e3f0e91ee0a6cd8f5e1fc7d1ab6d9ae (diff)
linux-gen: pktio: detect pending stop operations
Previously, if a stop operation was still pending for a scheduled pktio device when odp_pktio_start() was called, the input queues were added again to scheduler's internal queues causing random behaviour. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
Diffstat (limited to 'platform')
-rw-r--r--platform/linux-generic/odp_packet_io.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c
index b5c94ba19..a8dc058a7 100644
--- a/platform/linux-generic/odp_packet_io.c
+++ b/platform/linux-generic/odp_packet_io.c
@@ -652,6 +652,13 @@ int odp_pktio_start(odp_pktio_t hdl)
_ODP_ERR("Already started\n");
return -1;
}
+
+ if (entry->state == PKTIO_STATE_STOP_PENDING) {
+ unlock_entry(entry);
+ _ODP_ERR("Scheduled pktio stop pending\n");
+ return -1;
+ }
+
entry->parse_layer = pktio_cls_enabled(entry) ?
ODP_PROTO_LAYER_ALL :
entry->config.parser.layer;