From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f42.google.com (mail-wm0-f42.google.com [74.125.82.42]) by dpdk.org (Postfix) with ESMTP id DC4631C52 for ; Thu, 7 Jul 2016 18:35:30 +0200 (CEST) Received: by mail-wm0-f42.google.com with SMTP id n127so23238502wme.1 for ; Thu, 07 Jul 2016 09:35:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id; bh=zCKMXoAkwXLndmTnRBzDYfLYV12i1F0IbWpapD0FFNA=; b=h/rVDI/hoRsKfkyJ0wti0gR3u3SjyvPga7P6wXZyr4gI/psl6GNcP0bkt/6XHtI1z0 2qIHpGnSkAVWXcU7Nc0JkvyUbbz1PECWuDPTuOq+PIdb9PAK5IfSpbFEcuPJPUZ2Sk2h Cumz/QveAsybTIHYXYV8wAi0ftd0cymO9z9ObcJANnEgMe29rByVMmbj1xfgwnZw+dmW ErVORX7Q7W5RqxgWfjOozVd6RwFa+3lQbMrgZdKCU8ZQuBpomKd1R3EmHFh81tWV/GRk hodmQzg+fszqICN14RST1YKtvZpj+CJx608CXP1WtYBSYxCdPOjPq4T4rMGLEs3zbO2d EwEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=zCKMXoAkwXLndmTnRBzDYfLYV12i1F0IbWpapD0FFNA=; b=TTPbQ3l5T0IVSDL1AJL2qmxDf7chqzQOy2Dej471j5VCtscgQAxGJwwAtAvAFGEo1y oJKghvkeQhVImFhcL0SPC1wWzQ9Z00JkMisYpHLx8gDsMdvxd+eeya6B0Cx+faFaA4Uv Z/YPY7E0MMnC7FlNApe6yYzNVQl/rJkn5YB/ARxKbu2Kg33u8+pyJF2r6mIv6lHXWUop 3fDyP1+cOMGAPNC/qEO+0uE0IvE3V13zaP2psAaXQOsfiWu2poFob8te/GrgRjeLFBwd Qk92eTMSRbbFitDJDxwddNiYrzT/WjGckzmvEOfMwXoj3/UsjXvxLx0Ahh5L+82tXi96 uMnQ== X-Gm-Message-State: ALyK8tJI1GcU0vRN/ZET40kbMuol8MCpEptniKeCbZKI+GtjbJu4X8Jz7rbMb9W6U0WblDsM X-Received: by 10.28.169.69 with SMTP id s66mr3913687wme.78.1467909330484; Thu, 07 Jul 2016 09:35:30 -0700 (PDT) Received: from bolet.dev.6wind.com. (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by smtp.gmail.com with ESMTPSA id ib10sm5501425wjb.31.2016.07.07.09.35.29 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 07 Jul 2016 09:35:29 -0700 (PDT) From: Maxime Leroy To: dev@dpdk.org Date: Thu, 7 Jul 2016 18:34:45 +0200 Message-Id: <1467909285-896-1-git-send-email-maxime.leroy@6wind.com> X-Mailer: git-send-email 2.1.4 Subject: [dpdk-dev] [PATCH] net/mlx5: fix packet type and offload flags in Rx X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jul 2016 16:35:31 -0000 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 --- drivers/net/mlx5/mlx5_rxtx.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c index 0c352f3f..4132fd74 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) { -- 2.1.4