From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <3chas3@gmail.com> Received: from mail-qk1-f196.google.com (mail-qk1-f196.google.com [209.85.222.196]) by dpdk.org (Postfix) with ESMTP id 7A8BE2C19; Mon, 25 Mar 2019 16:05:50 +0100 (CET) Received: by mail-qk1-f196.google.com with SMTP id k130so5512194qke.3; Mon, 25 Mar 2019 08:05:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=F1Kr0mSg6tRe9Y6Uy1DpbJC+rLhjJTK7V+0WyWBLjzw=; b=PdzLW5mpIH3mFWrg/qyGdQMsMS8wlnGAQywCzXE+/diOiDofJFjK8Dhn7MzZOpCGoq Jd58n5P/ij3EwNsTXTWdvOFLWgnMMpndvPplFcDYcckhttSzHGCH4S3LX/sQoN33lpes DRWXWxyk9OcUE6HVVxe5x3mSPxY9mOAD53mJiy+6qAHY/8Dbxs5lrquwb/tMEokea2so Uq8loXj5KZ16b2dvn63b3/Oadp0RFOEf/grhbc6e8ZTh7zCMFgw92lGG80ncq8bInZ7B aqBuFTxqTpZmXLdpgXFKnw+RTCpBnyilxQwCeh2P4ePTUFvDhBT7KuUhjcuE4Od5QIjo g6Bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=F1Kr0mSg6tRe9Y6Uy1DpbJC+rLhjJTK7V+0WyWBLjzw=; b=uf+GXWKUeHWwJS0JSuy+/BHsb/xKoTQgxIcq4/zP72OYtFbnucSyBp+2jY5krC4KZW o1NfGNajIh1js1DeOPwMVNehB/asKI0h99kLZA9aWSu3NGdsXtH87eTN9xa58hLgNtxo kggbs31dk2ON/bHvvnn/v1VFSsGCg7ODduQm1TnUjckcLoofj7YAQHFc00kTqvANz+w8 IU/RZYFjqjDnm5l4BVfmKrnU9FPEfupoiqvzRB+vyA/XX2q7HyeVch19OfG0SwNfRPI6 S/twSVjJqwhXKBgLHeraTYoRFp/Aa4cnz8gUkUsOi4V8WGWnCYHtDY5EFKv+ciqwaVaF /e+w== X-Gm-Message-State: APjAAAULdPphpIg/HFwUaMvfX0KcwVuBYQdptLUTNv+zmf+URh+ak7LX P8KEM/4j7gdGbblhRP2IL3+j/ykw X-Google-Smtp-Source: APXvYqxpb8t9bC9M81X1KM2WaBpAJdMEXUuUtpVdNSgqR+BhYA6PfuXMEgLnzTK2MWmupbw2AvUkvQ== X-Received: by 2002:a05:620a:15b5:: with SMTP id f21mr20104312qkk.89.1553526349614; Mon, 25 Mar 2019 08:05:49 -0700 (PDT) Received: from monolith.fios-router.home (pool-96-255-82-34.washdc.fios.verizon.net. [96.255.82.34]) by smtp.gmail.com with ESMTPSA id s54sm2151053qtb.83.2019.03.25.08.05.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Mar 2019 08:05:48 -0700 (PDT) From: Chas Williams <3chas3@gmail.com> To: dev@dpdk.org Cc: olivier.matz@6wind.com, Bill Hong , stable@dpdk.org, Chas Williams Date: Mon, 25 Mar 2019 11:05:41 -0400 Message-Id: <20190325150541.12087-1-3chas3@gmail.com> X-Mailer: git-send-email 2.17.2 Subject: [dpdk-dev] [PATCH] net: fix Tx VLAN flag for offload emulation X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Mar 2019 15:05:50 -0000 From: Bill Hong A PMD might use rte_vlan_insert to implement Tx VLAN offload. Typically the PMD will insert the VLAN header in the transmit path and then attempt to send the packets. If this fails, the packets are returned to the application which may attempt to send these packets again. If the PKT_TX_VLAN flag is not cleared, the transmit path may attempt to insert the VLAN header again. Fixes: 47aa48b969f8 ("net: fix stripped VLAN flag for offload emulation"); Cc: stable@dpdk.org Signed-off-by: Bill Hong Signed-off-by: Chas Williams --- lib/librte_net/rte_ether.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_net/rte_ether.h b/lib/librte_net/rte_ether.h index c2c5e249f..e0d831113 100644 --- a/lib/librte_net/rte_ether.h +++ b/lib/librte_net/rte_ether.h @@ -408,7 +408,7 @@ static inline int rte_vlan_insert(struct rte_mbuf **m) vh = (struct vlan_hdr *) (nh + 1); vh->vlan_tci = rte_cpu_to_be_16((*m)->vlan_tci); - (*m)->ol_flags &= ~PKT_RX_VLAN_STRIPPED; + (*m)->ol_flags &= ~(PKT_RX_VLAN_STRIPPED | PKT_TX_VLAN); return 0; } -- 2.17.2 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id EF093A05D3 for ; Mon, 25 Mar 2019 16:05:53 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 60C84324D; Mon, 25 Mar 2019 16:05:52 +0100 (CET) Received: from mail-qk1-f196.google.com (mail-qk1-f196.google.com [209.85.222.196]) by dpdk.org (Postfix) with ESMTP id 7A8BE2C19; Mon, 25 Mar 2019 16:05:50 +0100 (CET) Received: by mail-qk1-f196.google.com with SMTP id k130so5512194qke.3; Mon, 25 Mar 2019 08:05:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=F1Kr0mSg6tRe9Y6Uy1DpbJC+rLhjJTK7V+0WyWBLjzw=; b=PdzLW5mpIH3mFWrg/qyGdQMsMS8wlnGAQywCzXE+/diOiDofJFjK8Dhn7MzZOpCGoq Jd58n5P/ij3EwNsTXTWdvOFLWgnMMpndvPplFcDYcckhttSzHGCH4S3LX/sQoN33lpes DRWXWxyk9OcUE6HVVxe5x3mSPxY9mOAD53mJiy+6qAHY/8Dbxs5lrquwb/tMEokea2so Uq8loXj5KZ16b2dvn63b3/Oadp0RFOEf/grhbc6e8ZTh7zCMFgw92lGG80ncq8bInZ7B aqBuFTxqTpZmXLdpgXFKnw+RTCpBnyilxQwCeh2P4ePTUFvDhBT7KuUhjcuE4Od5QIjo g6Bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=F1Kr0mSg6tRe9Y6Uy1DpbJC+rLhjJTK7V+0WyWBLjzw=; b=uf+GXWKUeHWwJS0JSuy+/BHsb/xKoTQgxIcq4/zP72OYtFbnucSyBp+2jY5krC4KZW o1NfGNajIh1js1DeOPwMVNehB/asKI0h99kLZA9aWSu3NGdsXtH87eTN9xa58hLgNtxo kggbs31dk2ON/bHvvnn/v1VFSsGCg7ODduQm1TnUjckcLoofj7YAQHFc00kTqvANz+w8 IU/RZYFjqjDnm5l4BVfmKrnU9FPEfupoiqvzRB+vyA/XX2q7HyeVch19OfG0SwNfRPI6 S/twSVjJqwhXKBgLHeraTYoRFp/Aa4cnz8gUkUsOi4V8WGWnCYHtDY5EFKv+ciqwaVaF /e+w== X-Gm-Message-State: APjAAAULdPphpIg/HFwUaMvfX0KcwVuBYQdptLUTNv+zmf+URh+ak7LX P8KEM/4j7gdGbblhRP2IL3+j/ykw X-Google-Smtp-Source: APXvYqxpb8t9bC9M81X1KM2WaBpAJdMEXUuUtpVdNSgqR+BhYA6PfuXMEgLnzTK2MWmupbw2AvUkvQ== X-Received: by 2002:a05:620a:15b5:: with SMTP id f21mr20104312qkk.89.1553526349614; Mon, 25 Mar 2019 08:05:49 -0700 (PDT) Received: from monolith.fios-router.home (pool-96-255-82-34.washdc.fios.verizon.net. [96.255.82.34]) by smtp.gmail.com with ESMTPSA id s54sm2151053qtb.83.2019.03.25.08.05.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Mar 2019 08:05:48 -0700 (PDT) From: Chas Williams <3chas3@gmail.com> To: dev@dpdk.org Cc: olivier.matz@6wind.com, Bill Hong , stable@dpdk.org, Chas Williams Date: Mon, 25 Mar 2019 11:05:41 -0400 Message-Id: <20190325150541.12087-1-3chas3@gmail.com> X-Mailer: git-send-email 2.17.2 Subject: [dpdk-dev] [PATCH] net: fix Tx VLAN flag for offload emulation X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Content-Type: text/plain; charset="UTF-8" Message-ID: <20190325150541.mhPfwUpanqBLcw-F-vGb4JrR2SoeMQ8KALGTH_hXDEM@z> From: Bill Hong A PMD might use rte_vlan_insert to implement Tx VLAN offload. Typically the PMD will insert the VLAN header in the transmit path and then attempt to send the packets. If this fails, the packets are returned to the application which may attempt to send these packets again. If the PKT_TX_VLAN flag is not cleared, the transmit path may attempt to insert the VLAN header again. Fixes: 47aa48b969f8 ("net: fix stripped VLAN flag for offload emulation"); Cc: stable@dpdk.org Signed-off-by: Bill Hong Signed-off-by: Chas Williams --- lib/librte_net/rte_ether.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_net/rte_ether.h b/lib/librte_net/rte_ether.h index c2c5e249f..e0d831113 100644 --- a/lib/librte_net/rte_ether.h +++ b/lib/librte_net/rte_ether.h @@ -408,7 +408,7 @@ static inline int rte_vlan_insert(struct rte_mbuf **m) vh = (struct vlan_hdr *) (nh + 1); vh->vlan_tci = rte_cpu_to_be_16((*m)->vlan_tci); - (*m)->ol_flags &= ~PKT_RX_VLAN_STRIPPED; + (*m)->ol_flags &= ~(PKT_RX_VLAN_STRIPPED | PKT_TX_VLAN); return 0; } -- 2.17.2