diff options
author | Petri Savolainen <petri.savolainen@nokia.com> | 2023-05-26 16:40:04 +0300 |
---|---|---|
committer | Petri Savolainen <petri.savolainen@nokia.com> | 2023-06-09 11:29:47 +0300 |
commit | 1780ca3164e97ab734048f813b6c75b57a163ad9 (patch) | |
tree | bc28007b01e2981270aac695415cffa4ec0fd648 /platform | |
parent | 5db00aaa7e8b66bedc1a376e4a475a0f743582db (diff) |
linux-gen: packet: implement free control functions
Implement the new free control meta-data functions. Packet
metadata can be set, but all pktios will ignore it as there
is no support yet.
Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Diffstat (limited to 'platform')
-rw-r--r-- | platform/linux-generic/include/odp/api/plat/packet_inline_types.h | 7 | ||||
-rw-r--r-- | platform/linux-generic/odp_packet.c | 20 |
2 files changed, 24 insertions, 3 deletions
diff --git a/platform/linux-generic/include/odp/api/plat/packet_inline_types.h b/platform/linux-generic/include/odp/api/plat/packet_inline_types.h index 6773b73ad..5186efed0 100644 --- a/platform/linux-generic/include/odp/api/plat/packet_inline_types.h +++ b/platform/linux-generic/include/odp/api/plat/packet_inline_types.h @@ -123,7 +123,7 @@ typedef union { uint32_t all_flags; struct { - uint32_t reserved1: 6; + uint32_t reserved1: 5; /* * Init flags @@ -142,6 +142,7 @@ typedef union { uint32_t l4_chksum: 1; /* L4 chksum override */ uint32_t ts_set: 1; /* Set Tx timestamp */ uint32_t tx_compl: 1; /* Tx completion event requested */ + uint32_t free_ctrl: 1; /* Don't free option */ uint32_t tx_aging: 1; /* Packet aging at Tx requested */ uint32_t shaper_len_adj: 8; /* Adjustment for traffic mgr */ @@ -159,8 +160,8 @@ typedef union { /* Flag groups */ struct { - uint32_t reserved2: 6; - uint32_t other: 19; /* All other flags */ + uint32_t reserved2: 5; + uint32_t other: 20; /* All other flags */ uint32_t error: 7; /* All error flags */ } all; diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c index 7a047df1a..cabb9fed5 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -2261,6 +2261,26 @@ int odp_packet_tx_compl_done(odp_pktio_t pktio, uint32_t compl_id) return -1; } +void odp_packet_free_ctrl_set(odp_packet_t pkt, odp_packet_free_ctrl_t ctrl) +{ + odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); + + if (ctrl == ODP_PACKET_FREE_CTRL_DONT_FREE) + pkt_hdr->p.flags.free_ctrl = 1; + else + pkt_hdr->p.flags.free_ctrl = 0; +} + +odp_packet_free_ctrl_t odp_packet_free_ctrl(odp_packet_t pkt) +{ + odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); + + if (pkt_hdr->p.flags.free_ctrl) + return ODP_PACKET_FREE_CTRL_DONT_FREE; + + return ODP_PACKET_FREE_CTRL_DISABLED; +} + odp_packet_reass_status_t odp_packet_reass_status(odp_packet_t pkt) { |