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 077E95680 for ; Fri, 8 Jul 2016 09:09:38 +0200 (CEST) Received: by mail-wm0-f42.google.com with SMTP id z126so6836207wme.0 for ; Fri, 08 Jul 2016 00:09:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=HnrE1+DUHlp1h661UvcKqW6csD+dlIvCkMYcaBNBRxE=; b=eoN8t8eR/33aae/Fzm7ONsY2mKLjf06MwM7UbvKm+FXBECtWvfmd2bI6mQhF4w0UkT cGo4lxBozgF9axBeOIeoVCa5prA/dUPNo3ndmnROYgthPMBIrrsEVwI3Jzm/YcYgCaHL JNdz3dYbt3fI0idjctBUe5AcjPNOSWL+g/bRHvkLudP8LlB5waldxRJoMYaXs+Z62Ybj xpmAiF09nfhxZ6Qd4aWlAO650wY02AsSMKaPPUhXkt3FynUlqxZXT+toCCs51FmZ97Wr XU0pST1GDANqCAHgo0AmcYbVk7QDQCM65I+RN8y587WtS8mNqCJdS7g518IlifVSwouM gmww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=HnrE1+DUHlp1h661UvcKqW6csD+dlIvCkMYcaBNBRxE=; b=OwEAXXlvNsUJ5lS9fgf9PDUFEdZeX2UfLnGxFqfjHRm8LSU6xY3udRiOqVvLxJj9QI /bFVjmKmWjANYenE1qRFGW3oLGwxrimcjBu9Y09G1PvAMTjE3PMehq5Gf0JXXXxRCkLu jQKCq3cK2GaK6hBeoWENxDluz2Q70banEAzWmAXjSGKBr4ZqdOZycZLLrSIFj+QlfhXZ dpy0R3LyDJS0naVhVpYhynA/vT6jEkiGZzchQwE9uwBbkgHnJJmbEsMPgLD1M9nIRyCK 1wK6cqqIzTu1S5xXg3UiXwIjnAqxnKiZHqBmT3/dKK6D4Tkmfgdk8KkyF5qXEkd3G8Dh xqJw== X-Gm-Message-State: ALyK8tIJhf8hbs0r29VmH1PG22/yvTxjvmzdDXuD3Bzq8Yq1zmNFSODb3NVx7QwCOPr4nSlw X-Received: by 10.28.209.13 with SMTP id i13mr1852777wmg.93.1467961777858; Fri, 08 Jul 2016 00:09:37 -0700 (PDT) Received: from 6wind.com (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by smtp.gmail.com with ESMTPSA id p76sm1547819wmd.10.2016.07.08.00.09.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Jul 2016 00:09:35 -0700 (PDT) Date: Fri, 8 Jul 2016 09:09:32 +0200 From: Adrien Mazarguil To: Maxime Leroy Cc: dev@dpdk.org Message-ID: <20160708070932.GY7621@6wind.com> Mail-Followup-To: Maxime Leroy , dev@dpdk.org References: <1467909285-896-1-git-send-email-maxime.leroy@6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1467909285-896-1-git-send-email-maxime.leroy@6wind.com> Subject: Re: [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: Fri, 08 Jul 2016 07:09:38 -0000 On Thu, Jul 07, 2016 at 06:34:45PM +0200, Maxime Leroy wrote: > 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 > Acked-by: Adrien Mazarguil -- Adrien Mazarguil 6WIND