diff options
author | Zoltan Kiss <zoltan.kiss@linaro.org> | 2016-04-01 17:44:04 +0100 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2016-04-07 17:16:06 +0300 |
commit | 8b87bcf374aafe2d22bbb8f2ce7ffd9ed2ae10e3 (patch) | |
tree | 842dad1b4a0fe271691c826af60b76eef9a680c0 /platform/linux-generic/include/odp_packet_io_internal.h | |
parent | 55887ead48fa8396098e51b6275d984b8d8b52d0 (diff) |
linux-generic: packet_io: fix state handling
The current two state doesn't tell odp_pktio_close() whether the device has ever
been started, which is important to decide whether it should flush anything or
not.
The new OPENED state only happen after odp_pktio_open(), after a start -> stop
transition it goes to a STOPPED state. Both valid for configuration, so instead
of "== STATE_STOPPED", check "!= STATE_STARTED".
Signed-off-by: Zoltan Kiss <zoltan.kiss@linaro.org>
Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'platform/linux-generic/include/odp_packet_io_internal.h')
-rw-r--r-- | platform/linux-generic/include/odp_packet_io_internal.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/platform/linux-generic/include/odp_packet_io_internal.h b/platform/linux-generic/include/odp_packet_io_internal.h index 76367688d..cca5c39db 100644 --- a/platform/linux-generic/include/odp_packet_io_internal.h +++ b/platform/linux-generic/include/odp_packet_io_internal.h @@ -89,8 +89,10 @@ struct pktio_entry { pkt_tap_t pkt_tap; /**< using TAP for IO */ }; enum { - STATE_START = 0, - STATE_STOP + STATE_OPENED = 0, /**< After open() */ + STATE_STARTED, /**< After start() */ + STATE_STOPPED /**< Same as OPENED, but only happens + after STARTED */ } state; classifier_t cls; /**< classifier linked with this pktio*/ odp_pktio_stats_t stats; /**< statistic counters for pktio */ |