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 3472BA0542; Fri, 7 Feb 2020 14:43:19 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4EFFA1C0DB; Fri, 7 Feb 2020 14:43:18 +0100 (CET) Received: from mail-ua1-f67.google.com (mail-ua1-f67.google.com [209.85.222.67]) by dpdk.org (Postfix) with ESMTP id 678181C045 for ; Fri, 7 Feb 2020 14:43:17 +0100 (CET) Received: by mail-ua1-f67.google.com with SMTP id 59so869693uap.12 for ; Fri, 07 Feb 2020 05:43:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=geE+hhIoxrdAxu3FIfRf/wi5yAyT5n9mNzQv3cqphXA=; b=LYu43BB55ntZ9w4IGSQMpSkNXW1l6G4gLTfkrQXA731bi0G+511ZP3hOvAxC3ywtjs zKeao96no8RmqoNA36lszPsiUuEVI7W6EGzON0Lk0gtt62LjWhuCP3DGZ1N9cFff3FMB QUmeMV88BtCqa14LDRfHDE4GxvASrWkk4mptw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=geE+hhIoxrdAxu3FIfRf/wi5yAyT5n9mNzQv3cqphXA=; b=TLL7dEW68WX1h9VnP7luZ+XEtQGJrtb7NdIRKl6/HAFU4+W4EnMcjU/w8KNF91ARqi QjoPLjjZvZ8OpwSIor1HZo9eEq3NaihGdz0xEVsNio4jS+r8thbtKmcgUOzZbGsDHpgO EWAlFmp/eo5np1ImvhvXiROHk2KkyC3mPh1jVTMLCC0yyfTd1zQAmCZW0ma8rMssMsuQ R+m+PUBbIdUdWopQRZwJDKCmfrH5nnaiz6NmYxLVKaLA9Vxl2/KKapE+X1qYDM9QmkWW TndS4h9UAFlFMVDjAyswlriTtrME0N7VIUOCZFj6DxkSwlj7LWlKiJUfXWT/GzH9q9yb 8GwQ== X-Gm-Message-State: APjAAAUElXpTpQghRP/MhC82FWU6dHMtoOIWcQppdYWa4cwWCRpNW3UF hXPYY9EM58Fb9jpG7ZCUi6O/Uyb9tspDooeHBaYmuQ== X-Google-Smtp-Source: APXvYqwACsRa9G/E/cC9Inox3qt+Cb95habOlZim8vJirAEtM7qMscrDNORvHN5HJXb32y+fktGPLHEBtmo2I5/9v2U= X-Received: by 2002:a9f:2612:: with SMTP id 18mr4456865uag.76.1581082996359; Fri, 07 Feb 2020 05:43:16 -0800 (PST) MIME-Version: 1.0 References: <20200106083423.26600-1-somnath.kotur@broadcom.com> <20200206172500.GQ22738@platinum> In-Reply-To: <20200206172500.GQ22738@platinum> From: Somnath Kotur Date: Fri, 7 Feb 2020 19:13:04 +0530 Message-ID: To: Olivier Matz Cc: dev , Ferruh Yigit Content-Type: text/plain; charset="UTF-8" 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" Olivier, On Thu, Feb 6, 2020 at 10:55 PM Olivier Matz wrote: > > 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/ I'm not sure we are on the same page then, please see my response inline below > > 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. > While this is how it works currently, I'm wondering how will the application know if this was a double VLAN pkt, correct? Also when i look at options 5 and 7 I don't really see the difference in semantics between them ? Both seem to store the outer-vlan and inner-vlan in m->vlan_tci_outer and m->vlan_tci_inner respectively 7/ PKT_RX_VLAN | PKT_RX_QINQ | PKT_RX_QINQ_STRIPPED outer-vlan is removed from packet data m->vlan_tci_outer=outer-vlan m->vlan_tci=inner-vlan I was hoping that with the new interpretation of PKT_RX_QINQ_STRIPPED, it only meant that outer-vlan is removed from packet data and m->vlan_tci_outer = outer_vlan, while PKT_RX_QINQ implies it is a double-vlan pkt and PKT_RX_VLAN implies that pkt has VLAN associated with it? Not m->vlan_tci = inner-vlan Thanks Som > > 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