proto_hdr defines a bit mask of the protocol sequence as RTE_PTYPE_*, The last RTE_PTYPE* in the mask indicates the split position.
To get the split position from hdr_proto, the order of judgement should be from inner to outer layer, so for tunneling packets the tunnel header should be placed at the end of the judgement condition. Fixes: 629dad3ef325 ("net/ice: support buffer split in scalar Rx") Signed-off-by: Yuan Wang <yuanx.w...@intel.com> --- drivers/net/ice/ice_rxtx.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c index 953ff217df..7a2d5829c0 100644 --- a/drivers/net/ice/ice_rxtx.c +++ b/drivers/net/ice/ice_rxtx.c @@ -324,13 +324,6 @@ ice_program_hw_rx_queue(struct ice_rx_queue *rxq) goto set_hsplit_finish; } - switch (proto_hdr & RTE_PTYPE_TUNNEL_MASK) { - case RTE_PTYPE_TUNNEL_GRENAT: - rx_ctx.dtype = ICE_RX_DTYPE_HEADER_SPLIT; - rx_ctx.hsplit_1 = ICE_RLAN_RX_HSPLIT_1_SPLIT_ALWAYS; - goto set_hsplit_finish; - } - switch (proto_hdr & RTE_PTYPE_INNER_L4_MASK) { case RTE_PTYPE_INNER_L4_TCP: case RTE_PTYPE_INNER_L4_UDP: @@ -358,6 +351,13 @@ ice_program_hw_rx_queue(struct ice_rx_queue *rxq) goto set_hsplit_finish; } + switch (proto_hdr & RTE_PTYPE_TUNNEL_MASK) { + case RTE_PTYPE_TUNNEL_GRENAT: + rx_ctx.dtype = ICE_RX_DTYPE_HEADER_SPLIT; + rx_ctx.hsplit_1 = ICE_RLAN_RX_HSPLIT_1_SPLIT_ALWAYS; + goto set_hsplit_finish; + } + PMD_DRV_LOG(ERR, "Buffer split protocol is not supported"); return -EINVAL; -- 2.25.1