aboutsummaryrefslogtreecommitdiff
path: root/platform/linux-generic/odp_packet_flags.c
diff options
context:
space:
mode:
Diffstat (limited to 'platform/linux-generic/odp_packet_flags.c')
-rw-r--r--platform/linux-generic/odp_packet_flags.c46
1 files changed, 45 insertions, 1 deletions
diff --git a/platform/linux-generic/odp_packet_flags.c b/platform/linux-generic/odp_packet_flags.c
index dbc313748..3537aa903 100644
--- a/platform/linux-generic/odp_packet_flags.c
+++ b/platform/linux-generic/odp_packet_flags.c
@@ -129,6 +129,51 @@ int odp_packet_has_flow_hash(odp_packet_t pkt)
return pkt_hdr->has_hash;
}
+odp_packet_color_t odp_packet_color(odp_packet_t pkt)
+{
+ retflag(pkt, input_flags.color);
+}
+
+void odp_packet_color_set(odp_packet_t pkt, odp_packet_color_t color)
+{
+ odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt);
+
+ if (packet_parse_not_complete(pkt_hdr))
+ packet_parse_full(pkt_hdr);
+
+ pkt_hdr->input_flags.color = color;
+}
+
+odp_bool_t odp_packet_drop_eligible(odp_packet_t pkt)
+{
+ odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt);
+
+ if (packet_parse_not_complete(pkt_hdr))
+ packet_parse_full(pkt_hdr);
+
+ return !pkt_hdr->input_flags.nodrop;
+}
+
+void odp_packet_drop_eligible_set(odp_packet_t pkt, odp_bool_t drop)
+{
+ setflag(pkt, input_flags.nodrop, !drop);
+}
+
+int8_t odp_packet_shaper_len_adjust(odp_packet_t pkt)
+{
+ retflag(pkt, output_flags.shaper_len_adj);
+}
+
+void odp_packet_shaper_len_adjust_set(odp_packet_t pkt, int8_t adj)
+{
+ odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt);
+
+ if (packet_parse_not_complete(pkt_hdr))
+ packet_parse_full(pkt_hdr);
+
+ pkt_hdr->output_flags.shaper_len_adj = adj;
+}
+
/* Set Input Flags */
void odp_packet_has_l2_set(odp_packet_t pkt, int val)
@@ -222,4 +267,3 @@ void odp_packet_has_flow_hash_clr(odp_packet_t pkt)
pkt_hdr->has_hash = 0;
}
-