From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by dpdk.org (Postfix) with ESMTP id CA98A8D38 for ; Wed, 25 Apr 2018 17:28:14 +0200 (CEST) Received: by mail-wm0-f67.google.com with SMTP id n10so7537869wmc.1 for ; Wed, 25 Apr 2018 08:28:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=dwT9gxcHhOwlSrwXuvrks+4/WCbgN3KlZY15gjzkS7c=; b=Jhd3sW6l2SbhLg9RVo6kTbnP8T6CUuBxZWB2VfxEwFJxh4jyGUSLXCWwlJAJGyzfyK USxlXGXGXacKfpbo7+yvhBwWoJ1bkoKN1lfHQErEUsU+K/MBVrp9Jd7F76Sz4dli2Ght NR9JD7QcPysMRK2lppaMiHOCUhjmUjv8Z6nzSevNQDSXcUihJbwU+gnHDIjDSVwSlamD tnakCGRYa/vpYgsNxv1gzf+N4XclKwnMr5/ItWMDKSkIkSpwWrtW5j4Co84giuKP1OWJ K+ESVfWAFe8c5iR6794hvw6dYV6tvnfVRcYD+YwoPt3jCxAnDFSymn8vXIK0uiguaM6m vt9w== 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; bh=dwT9gxcHhOwlSrwXuvrks+4/WCbgN3KlZY15gjzkS7c=; b=lPtU1DohpWHRzzNe1/EkoCmS2SEIS+EMphCsqKoLWVucOXeiEMcv06vMKt3NK2HGL4 yVEzc3Uuw4cio1zSIdd6kP6vkHMoRnWlr6ubSatuGwQkb7Ck+eX1RB/yG9jH2evNLkhs WoTRsJ4+qzEgNSdGxBNv476e3u5DCRDJ/ZBhAExR9JV6kMiq477Pr9fkaYoFL/kZmrWz EHUaX4N6IAYYN28VKVNEPp3H44PzomUTZgTAofiEA2Zz7/Uf463SKLK6g5huWKIOdUPK QLJfR9yEEHknffeEcvwKWk3qWhOxhZKqlGLEo7v6o1BCzJYiV9X9wFQyZlqdVct22kQn JyeA== X-Gm-Message-State: ALQs6tBf7VEicwGuXDJ6D4ZATGKe+ettmF3eZh5rw+g40znThwdAqnYq b6j1nLEijWunNmy6u7P2/UPDiw== X-Google-Smtp-Source: AB8JxZojxr3INwBn8sYYyI9nRRl09aDXU1ZDTM15Twc46aE28JfNb6KVnrU33b1Hfk0M/Z9VC9C93Q== X-Received: by 10.28.118.25 with SMTP id r25mr13427799wmc.5.1524670093603; Wed, 25 Apr 2018 08:28:13 -0700 (PDT) Received: from 6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id 16-v6sm9834423wrt.20.2018.04.25.08.28.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Apr 2018 08:28:12 -0700 (PDT) Date: Wed, 25 Apr 2018 17:27:58 +0200 From: Adrien Mazarguil To: Thomas Monjalon , Ferruh Yigit , dev@dpdk.org Cc: Wenzhuo Lu , Jingjing Wu , Ajit Khaparde , Somnath Kotur , John Daley , Hyong Youb Kim , Beilei Xing , Qi Zhang , Konstantin Ananyev , Nelio Laranjeiro , Yongseok Koh , Tomasz Duszynski , Dmitri Epshtein , Natalie Samsonov , Jianbo Liu , Andrew Rybchenko , Pascal Mazon Message-ID: <20180425151852.7676-12-adrien.mazarguil@6wind.com> References: <20180419100848.6178-1-adrien.mazarguil@6wind.com> <20180425151852.7676-1-adrien.mazarguil@6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180425151852.7676-1-adrien.mazarguil@6wind.com> X-Mailer: git-send-email 2.11.0 Subject: [dpdk-dev] [PATCH v6 11/16] ethdev: fix default VLAN TCI mask in flow API 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: Wed, 25 Apr 2018 15:28:15 -0000 VLAN TCI is a 16-bit field broken down as PCP (3b), DEI (1b) and VID (12b). The default mask used by PMDs for the VLAN pattern when one isn't provided by the application comprises the entire TCI, which is problematic because most devices only support VID matching. This forces applications to always provide a mask limited to the VID part in order to successfully apply a flow rule with a VLAN pattern item. Moreover, applications rarely want to match PCP and DEI intentionally. Given the above and since VID is what is commonly referred to when talking about VLAN, this commit excludes PCP and DEI from the default mask. Fixes: 6de5c0f1302c ("ethdev: define default item masks in flow API") Signed-off-by: Adrien Mazarguil Acked-by: Andrew Rybchenko Cc: Ferruh Yigit Cc: Thomas Monjalon Cc: Wenzhuo Lu Cc: Jingjing Wu Cc: Ajit Khaparde Cc: Somnath Kotur Cc: John Daley Cc: Hyong Youb Kim Cc: Beilei Xing Cc: Qi Zhang Cc: Konstantin Ananyev Cc: Nelio Laranjeiro Cc: Yongseok Koh Cc: Tomasz Duszynski Cc: Dmitri Epshtein Cc: Natalie Samsonov Cc: Jianbo Liu Cc: Andrew Rybchenko Cc: Pascal Mazon --- v6 changes: - Reworded patch title as a "fix" (not candidate for backports) since it addresses a flaw in the original API definition. - Updated API changes section in release notes. v3 changes: These changes were previously mistakenly made part of the previous patch ("ethdev: refine TPID handling in flow API") from which they were split following Andrew's rightful comment [1]. [1] http://dpdk.org/ml/archives/dev/2018-April/095870.html --- doc/guides/prog_guide/rte_flow.rst | 2 +- doc/guides/rel_notes/release_18_05.rst | 3 ++- lib/librte_ether/rte_flow.h | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst index fd317b48c..c62a80566 100644 --- a/doc/guides/prog_guide/rte_flow.rst +++ b/doc/guides/prog_guide/rte_flow.rst @@ -806,7 +806,7 @@ preceding pattern item. - ``tci``: tag control information. - ``inner_type``: inner EtherType or TPID. -- Default ``mask`` matches TCI only. +- Default ``mask`` matches the VID part of TCI only (lower 12 bits). Item: ``IPV4`` ^^^^^^^^^^^^^^ diff --git a/doc/guides/rel_notes/release_18_05.rst b/doc/guides/rel_notes/release_18_05.rst index a980a23ae..9aca8b4c8 100644 --- a/doc/guides/rel_notes/release_18_05.rst +++ b/doc/guides/rel_notes/release_18_05.rst @@ -264,7 +264,8 @@ API Changes (``func`` for RSS hash function to apply and ``level`` for the encapsulation level). * The VLAN pattern item (``struct rte_flow_item_vlan``) was modified to - include inner EtherType instead of outer TPID. + include inner EtherType instead of outer TPID. Its default mask was also + modified to cover the VID part (lower 12 bits) of TCI only. ABI Changes diff --git a/lib/librte_ether/rte_flow.h b/lib/librte_ether/rte_flow.h index 8e50384d0..513734dce 100644 --- a/lib/librte_ether/rte_flow.h +++ b/lib/librte_ether/rte_flow.h @@ -493,7 +493,7 @@ struct rte_flow_item_vlan { /** Default mask for RTE_FLOW_ITEM_TYPE_VLAN. */ #ifndef __cplusplus static const struct rte_flow_item_vlan rte_flow_item_vlan_mask = { - .tci = RTE_BE16(0xffff), + .tci = RTE_BE16(0x0fff), .inner_type = RTE_BE16(0x0000), }; #endif -- 2.11.0