diff options
authorMaxime Leroy <>2016-07-07 18:34:45 +0200
committerBruce Richardson <>2016-07-08 22:51:03 +0200
commit0ac64846254aa2ca12de1aaa1ccc292a75181af6 (patch)
parentce93d3c36db0fef12063bdfaf5030a23277e1fee (diff)
net/mlx5: fix packet type and offload flags on Rx
In mlx5 rx function, the packet_type and ol_flags mbuf fields are not properly initialized when no rx offload feature is enabled (checksum, l2 tun checksum, vlan_strip, crc). Thus, these fields can have a value different of 0 depending on their value when the mbuf was freed. This can result in an incorrect application behavior if invalid ol_flags/ptype are set, or memory corruptions if IND_ATTACHED_MBUF is set in ol_flags. Fixes: 081f7eae242e ("mlx5: process offload flags only when requested") Signed-off-by: Maxime Leroy <> Acked-by: Adrien Mazarguil <>
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
index 0c352f3..4132fd7 100644
--- a/drivers/net/mlx5/mlx5_rxtx.c
+++ b/drivers/net/mlx5/mlx5_rxtx.c
@@ -1599,6 +1599,8 @@ mlx5_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
pkt = seg;
assert(len >= (rxq->crc_present << 2));
/* Update packet information. */
+ pkt->packet_type = 0;
+ pkt->ol_flags = 0;
if (rxq->csum | rxq->csum_l2tun | rxq->vlan_strip |
rxq->crc_present) {
if (rxq->csum) {