From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2AF90A0540; Thu, 6 Feb 2020 18:25:04 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7CC681C132; Thu, 6 Feb 2020 18:25:03 +0100 (CET) Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by dpdk.org (Postfix) with ESMTP id 514561C130 for ; Thu, 6 Feb 2020 18:25:02 +0100 (CET) Received: by mail-wm1-f65.google.com with SMTP id t23so875185wmi.1 for ; Thu, 06 Feb 2020 09:25:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=attLS0fI/oVEiAFQbKq5WgZX4c5T5AwHl5e31bsPqak=; b=CZTjFC+1+MSMWX9QFobYS8r08QGT1d6DWlfG8nEnH5/aHy77w7EPE5Iey3v7bfD1G9 BYLiNAbrtTHN4+4rUK1caHuEDXOv8Uplf9OOBAaHSdOTX4Sz9Z+NEpAzt3M/YiKvadRq fhabrfMddaQ0FwzeBDlWjq/6UhMnHEiMllGG2K+Tc8ShkRGV5TDNhRGGfIYOoIvxZCDY FeqjhzCsJ3QCnSwZIkjCstgOm2SwuzR0BqO4VhfO5ruKNQkgDvPG+SXAilAPElPyGaM7 6VQfhiAcsTlN7nNyNT0juNyodQul4U2FZ57AT1pvGFiFoS861o1Q/MdBNwG/F+iIG41V rI5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=attLS0fI/oVEiAFQbKq5WgZX4c5T5AwHl5e31bsPqak=; b=hXu11CgXq4iw7753OzNoFYXeLQAGscmdEMAh/rP3lTJvObu0usZKZ4WhkSHq0McXIh mAyONAl1IEPJmd7ZbCKuous9NdKwiHHkhkIwHpR3Ngqe715IxxgKl5G3p9oGeg7s6GFK RfW1OE/X7WD/V3cXLbXYE1Rqnr0mwvdPdgpdnu4Im17/lWg5UqsNJbya/hkvgBffeXpo XJqQNmP0p77G4Q4ijXkPjkgnJlJMOlP9dGDZNrS23ummc7t8hhST2djw9UDYSA9+SzWb eSK7ohE+p9d6u3b8p/KjyXvyosJbVdtGFOjcC3It96CuOwmir1MgDwm5zrk0uP+8Z8E7 IWKA== X-Gm-Message-State: APjAAAXXG+nGiVYliCfUwWIzf2F1Be9hQsVBlQ4Ll/zrM1WJxzC2WpHq cg81D8g2Ua+E/yI6HtMbPztoVA== X-Google-Smtp-Source: APXvYqwQ5PxS8w6yp52Y55EvijJW6l7KdoN6gvgwiaojtBBYlaMz0JeIANRiRSbzzmBPZTfUOH6HaQ== X-Received: by 2002:a1c:f009:: with SMTP id a9mr5656119wmb.73.1581009901906; Thu, 06 Feb 2020 09:25:01 -0800 (PST) Received: from 6wind.com (2a01cb0c0005a600345636f7e65ed1a0.ipv6.abo.wanadoo.fr. [2a01:cb0c:5:a600:3456:36f7:e65e:d1a0]) by smtp.gmail.com with ESMTPSA id r6sm5059612wrp.95.2020.02.06.09.25.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Feb 2020 09:25:01 -0800 (PST) Date: Thu, 6 Feb 2020 18:25:00 +0100 From: Olivier Matz To: Somnath Kotur Cc: dev@dpdk.org, ferruh.yigit@intel.com Message-ID: <20200206172500.GQ22738@platinum> References: <20200106083423.26600-1-somnath.kotur@broadcom.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200106083423.26600-1-somnath.kotur@broadcom.com> User-Agent: Mutt/1.10.1 (2018-07-13) Subject: Re: [dpdk-dev] [PATCH] mbuf: fix to update documentation of QinQ stripped bit interpretation 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" Hi Somnath, Sorry for the delay, please find some comments below. I suggest the following title instead: mbuf: extend meaning of QinQ stripped bit On Mon, Jan 06, 2020 at 02:04:23PM +0530, Somnath Kotur wrote: > Certain hardware may be able to strip and/or save only the outermost > VLAN instead of both the VLANs in the mbuf in a QinQ scenario. > To handle such cases, we could re-interpret setting of just > PKT_RX_QINQ_STRIPPED to indicate that only the outermost VLAN has > been stripped and saved in mbuf->vlan_tci_outer. To be sure we're on the same page: we are talking about case 7 of this link: http://inbox.dpdk.org/dev/20191227145041.GQ22738@platinum/ So, even if the inner vlan_tci is not stripped from packet data, it has to be saved in m->vlan_tci, because it is implied by PKT_RX_VLAN. >From the same link, the case where the driver only strips+saves the outer vlan without saving or stripping the inner one is case 3. > Only When both PKT_RX_QINQ_STRIPPED and PKT_RX_VLAN_STRIPPED are set, the 2 > VLANs have been stripped by the hardware and their TCI are saved in > mbuf->vlan_tci (inner) and mbuf->vlan_tci_outer (outer). > > Signed-off-by: Somnath Kotur > --- > lib/librte_mbuf/rte_mbuf_core.h | 15 +++++++++++---- > 1 file changed, 11 insertions(+), 4 deletions(-) > > diff --git a/lib/librte_mbuf/rte_mbuf_core.h b/lib/librte_mbuf/rte_mbuf_core.h > index 9a8557d..db1070b 100644 > --- a/lib/librte_mbuf/rte_mbuf_core.h > +++ b/lib/librte_mbuf/rte_mbuf_core.h > @@ -124,12 +124,19 @@ > #define PKT_RX_FDIR_FLX (1ULL << 14) > > /** > - * The 2 vlans have been stripped by the hardware and their tci are > - * saved in mbuf->vlan_tci (inner) and mbuf->vlan_tci_outer (outer). > + * The outer vlan has been stripped by the hardware and their tci are > + * saved in mbuf->vlan_tci_outer (outer). their tci are -> its tci is > * This can only happen if vlan stripping is enabled in the RX > * configuration of the PMD. > - * When PKT_RX_QINQ_STRIPPED is set, the flags (PKT_RX_VLAN | > - * PKT_RX_VLAN_STRIPPED | PKT_RX_QINQ) must also be set. > + * When PKT_RX_QINQ_STRIPPED is set, the flags (PKT_RX_VLAN | PKT_RX_QINQ) > + * must also be set. ok > + * When both PKT_RX_QINQ_STRIPPED and PKT_RX_VLAN_STRIPPED are set, the 2 vlans > + * have been stripped by the hardware and their tci are saved in > + * mbuf->vlan_tci (inner) and mbuf->vlan_tci_outer (outer). This is correct, but I'd use a bullet list to add another sentence: * - If both PKT_RX_QINQ_STRIPPED and PKT_RX_VLAN_STRIPPED are set, the 2 vlans * have been stripped by the hardware and their tci are saved in * mbuf->vlan_tci (inner) and mbuf->vlan_tci_outer (outer). * - If PKT_RX_QINQ_STRIPPED is set and PKT_RX_VLAN_STRIPPED is unset, only the * outer vlan is removed from packet data, but both tci are saved in * mbuf->vlan_tci (inner) and mbuf->vlan_tci_outer (outer). > + * This can only happen if vlan stripping is enabled in the RX configuration > + * of the PMD. The same exact sentence is above, this one can be removed. > + * When PKT_RX_QINQ_STRIPPED and PKT_RX_VLAN_STRIPPED are set, > + * (PKT_RX_VLAN | PKT_RX_QINQ) must also be set. This can be removed too as it is redundant with above sentence: * When PKT_RX_QINQ_STRIPPED is set, the flags (PKT_RX_VLAN | PKT_RX_QINQ) * must also be set. Thanks, Olivier