@@ -41,6 +41,8 @@ typedef union {
uint32_t parsed_l2:1; /**< L2 parsed */
uint32_t parsed_all:1;/**< Parsing complete */
+ uint32_t flow_hash:1; /**< Flow hash present */
+
uint32_t l2:1; /**< known L2 protocol present */
uint32_t l3:1; /**< known L3 protocol present */
uint32_t l4:1; /**< known L4 protocol present */
@@ -149,7 +151,6 @@ typedef struct {
odp_pktio_t input;
- uint32_t has_hash:1; /**< Flow hash present */
uint32_t flow_hash; /**< Flow hash value */
odp_crypto_generic_op_result_t op_result; /**< Result for crypto */
@@ -453,7 +453,7 @@ void odp_packet_flow_hash_set(odp_packet_t pkt, uint32_t flow_hash)
odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt);
pkt_hdr->flow_hash = flow_hash;
- pkt_hdr->has_hash = 1;
+ pkt_hdr->input_flags.flow_hash = 1;
}
int odp_packet_is_segmented(odp_packet_t pkt)
@@ -176,7 +176,7 @@ int odp_packet_has_flow_hash(odp_packet_t pkt)
{
odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt);
- return pkt_hdr->has_hash;
+ return pkt_hdr->input_flags.flow_hash;
}
odp_packet_color_t odp_packet_color(odp_packet_t pkt)
@@ -335,5 +335,5 @@ void odp_packet_has_flow_hash_clr(odp_packet_t pkt)
{
odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt);
- pkt_hdr->has_hash = 0;
+ pkt_hdr->input_flags.flow_hash = 0;
}
@@ -701,10 +701,8 @@ static inline int mbuf_to_pkt(pktio_entry_t *pktio_entry,
pkt_hdr->input = pktio_entry->s.handle;
- if (mbuf->ol_flags & PKT_RX_RSS_HASH) {
- pkt_hdr->has_hash = 1;
- pkt_hdr->flow_hash = mbuf->hash.rss;
- }
+ if (mbuf->ol_flags & PKT_RX_RSS_HASH)
+ odp_packet_flow_hash_set(pkt, mbuf->hash.rss);
pkt_table[nb_pkts++] = pkt;
}
Move flow_hash present flag to the same location as all the other packet input and protocol flags. Signed-off-by: Matias Elo <matias.elo@nokia.com> --- platform/linux-generic/include/odp_packet_internal.h | 3 ++- platform/linux-generic/odp_packet.c | 2 +- platform/linux-generic/odp_packet_flags.c | 4 ++-- platform/linux-generic/pktio/dpdk.c | 6 ++---- 4 files changed, 7 insertions(+), 8 deletions(-)