From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id 510E67D14; Fri, 5 May 2017 00:36:31 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id B5FAA207BF; Thu, 4 May 2017 18:36:30 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Thu, 04 May 2017 18:36:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=OmlGuu6EUMfb/Nu tI7uVUgGTxUvureNFghm2iNaiG0U=; b=SUpeXpEF+WluEV+FF4ruVua+qL/QIkK YR7OrOMZhlJCzmtR1iRQrbVQt+4rzq0tOgE52TW/Xld/dbasmHuWXyJ+4UcmI9RT kNo5afDbhbeBIulOTm7eJbFFjjkrelgpuXfn5UtHaUINpe2OfiHB/YCLvHv4apiE jCWJIBvzPb5U= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= fm1; bh=OmlGuu6EUMfb/NutI7uVUgGTxUvureNFghm2iNaiG0U=; b=StaK8/P5 cYjFMo90UN/rv9eTMs4NS2gtWdZOFc1iLbUM7Ve2Y3V3sNJltP8Ka1y/VHaFlhjx aJ2k66N8I8wsyAJ9xNJJEiI1DFgNiAVf+FOmbMgE3w1B0sJDIZbY23xbTn7Q6HSA sWTnEF3dkr81bR08XHw7QFtXVW2W1PNRJG9znt99xG3MRz9of2E1UbxNTJ6pZ8tU btzdycLkS0pLRszGX5RN6p7PJwzZKgrQzDVeBDlPn3DHP4QtS7Pycqla9ReO6PNe lyIvoLbGI5YFQy5Jgvz6WF87JHpSSwVUfyKySNTMtnISaKoGF2omKCwXP8U54XEO qEloj4fENUVfQQ== X-ME-Sender: X-Sasl-enc: T6Ai5WuZniAPjna3+fDFCc+4JiP0UkHThsy7aj9V7Q1U 1493937390 Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id EA9B42415E; Thu, 4 May 2017 18:36:29 -0400 (EDT) From: Thomas Monjalon To: =?UTF-8?q?Micha=C5=82=20Miros=C5=82aw?= Cc: dev@dpdk.org, olivier.matz@6wind.com, =?UTF-8?q?Micha=C5=82=20Miros=C5=82aw?= , stable@dpdk.org Date: Fri, 5 May 2017 00:36:13 +0200 Message-Id: <20170504223613.24431-1-thomas@monjalon.net> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20170504093041.503dcd8c@glumotte.dev.6wind.com> References: <20170504093041.503dcd8c@glumotte.dev.6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] [PATCH v2] net: fix stripped VLAN flag for offload emulation X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 May 2017 22:36:31 -0000 From: Michał Mirosław Apply the new flag PKT_RX_VLAN_STRIPPED to the software emulation case (currently only for virtio and af_packet). Fixes: b37b528d957c ("mbuf: add new Rx flags for stripped VLAN") Cc: stable@dpdk.org Signed-off-by: Michał Mirosław Signed-off-by: Thomas Monjalon --- v2: add explanations and update rte_vlan_insert() --- lib/librte_net/rte_ether.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/librte_net/rte_ether.h b/lib/librte_net/rte_ether.h index ff3d06540..5edf66c3f 100644 --- a/lib/librte_net/rte_ether.h +++ b/lib/librte_net/rte_ether.h @@ -357,7 +357,7 @@ static inline int rte_vlan_strip(struct rte_mbuf *m) return -1; struct vlan_hdr *vh = (struct vlan_hdr *)(eh + 1); - m->ol_flags |= PKT_RX_VLAN_PKT; + m->ol_flags |= PKT_RX_VLAN_PKT | PKT_RX_VLAN_STRIPPED; m->vlan_tci = rte_be_to_cpu_16(vh->vlan_tci); /* Copy ether header over rather than moving whole packet */ @@ -407,6 +407,8 @@ 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; + return 0; } -- 2.12.2