From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f47.google.com (mail-pa0-f47.google.com [209.85.220.47]) by dpdk.org (Postfix) with ESMTP id D6AF73979 for ; Fri, 20 Nov 2015 17:35:14 +0100 (CET) Received: by pacdm15 with SMTP id dm15so121010803pac.3 for ; Fri, 20 Nov 2015 08:35:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=/iTHBhgoMksh0H9BJJkWhHqNX4ZDT+uspIS65/tUxQM=; b=A0hkemflBulGzMnSFDqNWBXfX2/z8OGHwCTn8DRuYZym//NFma5//+k1Kzz6kq+tKK dQoY/ReD2p0z8Ieeay/jDsyXYJURXG+8X10Vy3KP3G5VuOMYPqIAPemkIhhgGgl6/KWI OF3hmFVHt57t57M2MIatjaFJqAI3pfKwiDFAh3wsQ1xn6oLMsjk8kZTv9Whe1eYXI3Xh +d7HfrRYdO8hB7LlvZtm2TpEIJUi8zGfnURGmOPoJkpT5WpaGlJvfCWRKkZxQOpjLpEC flBzHlikTBSwSh7A5Urdpth+9nd7dql+FAyBdY2RK2kEDYhsUMTVU28JYeRp1wXveEOA OblQ== 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:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=/iTHBhgoMksh0H9BJJkWhHqNX4ZDT+uspIS65/tUxQM=; b=J3QJ7G1KaIMBYy3Eh1geXjUZvQjZgPpX5R2kJGZuqdiWLVGd3/S9RZlETLpMPNWZrf xosoJ0QXmQpZhNQuhp4SpiIo/1Gr6zlyZ/pZzikwlwEORYXy3o4waV95LHQVEUsHDFF9 oQEnXYOx0oQ5l4clqR01HifBD8ZMVXF4oeXCtPrYHFa76RpUqf18fB6VUBnx/v2oSAAO JEPAbOb4QER+8HzA734Y6SCsb45pUJXTEqa+TYtHG2kRAdZ59tkfLOG6p9Ftc+UermrH piv5ctQybq2ETDd0OdYsC80pbPRlyjGbR14KRPl7kYUS+2cHNbIy+TCSsHmZn23bUQ// VT8A== X-Gm-Message-State: ALoCoQnEMfHOCDDfV1EaexR266z9Zv7jZOp9CMXh9Ps7lvCK04dnppDWh2WQONqYBceL3hUM9PzO X-Received: by 10.68.91.162 with SMTP id cf2mr20697455pbb.34.1448037314219; Fri, 20 Nov 2015 08:35:14 -0800 (PST) Received: from xeon-e3 (static-50-53-82-155.bvtn.or.frontiernet.net. [50.53.82.155]) by smtp.gmail.com with ESMTPSA id dq4sm307575pbb.50.2015.11.20.08.35.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 Nov 2015 08:35:14 -0800 (PST) Date: Fri, 20 Nov 2015 08:35:27 -0800 From: Stephen Hemminger To: Shaopeng He Message-ID: <20151120083527.64ffd576@xeon-e3> In-Reply-To: <1448028587-7718-1-git-send-email-shaopeng.he@intel.com> References: <1448000935-29391-1-git-send-email-shaopeng.he@intel.com> <1448028587-7718-1-git-send-email-shaopeng.he@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v3] fm10k: fix wrong VLAN value in RX mbuf 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, 20 Nov 2015 16:35:15 -0000 On Fri, 20 Nov 2015 22:09:47 +0800 Shaopeng He wrote: > vlan_tci should be copied from RX descriptor to mbuf, > and flag PKT_RX_VLAN_PKT should be set for every RX packet, > this patch fixes this issue. > Packets in fm10k device always carry at least one VLAN tag. > For those packets coming in without VLAN tag, > the port default VLAN tag will be used. > So in fm10k, always PKT_RX_VLAN_PKT flag is set and vlan_tci > is valid for each RX packet's mbuf. > > Signed-off-by: Shaopeng He > --- > ChangeLog: > > v3: > * move flag PKT_RX_VLAN_PKT logic together with vlan_tci > * reword comments > > v2: > * change flag PKT_RX_VLAN_PKT to always set > * preserve the priority bits in vlan_tci > > drivers/net/fm10k/fm10k_rxtx.c | 21 ++++++++++++++++++--- > 1 file changed, 18 insertions(+), 3 deletions(-) > > diff --git a/drivers/net/fm10k/fm10k_rxtx.c b/drivers/net/fm10k/fm10k_rxtx.c > index 1bac28d..e958865 100644 > --- a/drivers/net/fm10k/fm10k_rxtx.c > +++ b/drivers/net/fm10k/fm10k_rxtx.c > @@ -104,9 +104,6 @@ rx_desc_to_ol_flags(struct rte_mbuf *m, const union fm10k_rx_desc *d) > (FM10K_RXD_STATUS_L4CS | FM10K_RXD_STATUS_L4E))) > m->ol_flags |= PKT_RX_L4_CKSUM_BAD; > > - if (d->d.staterr & FM10K_RXD_STATUS_VEXT) > - m->ol_flags |= PKT_RX_VLAN_PKT; > - > if (unlikely(d->d.staterr & FM10K_RXD_STATUS_HBO)) > m->ol_flags |= PKT_RX_HBUF_OVERFLOW; > > @@ -146,6 +143,15 @@ fm10k_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, > #endif > > mbuf->hash.rss = desc.d.rss; > + /** > + * Packets in fm10k device always carry at least one VLAN tag. > + * For those packets coming in without VLAN tag, > + * the port default VLAN tag will be used. > + * So, always PKT_RX_VLAN_PKT flag is set and vlan_tci > + * is valid for each RX packet's mbuf. > + */ > + mbuf->ol_flags |= PKT_RX_VLAN_PKT; > + mbuf->vlan_tci = desc.w.vlan; > > rx_pkts[count] = mbuf; > if (++next_dd == q->nb_desc) { > @@ -292,6 +298,15 @@ fm10k_recv_scattered_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, > rx_desc_to_ol_flags(first_seg, &desc); > #endif > first_seg->hash.rss = desc.d.rss; > + /** > + * Packets in fm10k device always carry at least one VLAN tag. > + * For those packets coming in without VLAN tag, > + * the port default VLAN tag will be used. > + * So, always PKT_RX_VLAN_PKT flag is set and vlan_tci > + * is valid for each RX packet's mbuf. > + */ > + mbuf->ol_flags |= PKT_RX_VLAN_PKT; > + first_seg->vlan_tci = desc.w.vlan; > > /* Prefetch data of first segment, if configured to do so. */ > rte_packet_prefetch((char *)first_seg->buf_addr + Looks good thanks. Acked-by: Stephen Hemminger