From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f194.google.com (mail-wr0-f194.google.com [209.85.128.194]) by dpdk.org (Postfix) with ESMTP id 8E4851AFEC for ; Mon, 16 Apr 2018 18:23:04 +0200 (CEST) Received: by mail-wr0-f194.google.com with SMTP id d1so27710760wrj.13 for ; Mon, 16 Apr 2018 09:23:04 -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=+yd9ln5aftRi7OQ1QlFzHSR4duyBH0XuAEbe9gD8WdA=; b=mWIf3mTihJ9sV03dEnQMvsoM5PEtcGR+SSg6AhNq6KcWnD2nJyM4ZsqfZoawaGcctX /CiD/n91o6Q0xOjnTxmk5t9AU54Zlkgwkj0zjNi4S5GFUNRJsqvfavzMyaaduj/U2RAZ lGn8rDx7zQRdNDhtujS4nI/rgteDsp1sTJmf7d/wcVr56QPcRz9PDEbWDcePGkTBeM09 TfPWkq6ynncWEXSZuWrhnrKJRSlGtoB1YwDUpm4ekldt+HOtvb7WbvsZJI2moPtsaqAS iNcyUzCZVgaJ/e4pm/hgGSwVWVhJvOliRHtTr7ZtpP6kq4zyPbBrJ1BdeL8Kd7iGrjsK srWQ== 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=+yd9ln5aftRi7OQ1QlFzHSR4duyBH0XuAEbe9gD8WdA=; b=MXLXp2lVN43Gll8ZWpzleL81wCSnITfbHhPA23Ruk4+Jv4dLxsi1UQ9/42/AXm7vuG bvYLgaLesXEPhQEgXrXPTZC9NL/vG/u1wdICKm8Z4NtJGGlN5m8tcr/s14QGgm3+hGGy wcZZ+Z8Vqmr24ExaVxGdY7ZbBbB99riJwqrer2mH6sZFtevglKvgh7ZIOOx9V/d0/YeO tuKvnKiDIpmbxjr8oThp1uLIVubGNzCl+W00b3gDZisXsDZPCGjtR6z4jlg/HfYHC7jN LXG2Y4yj7enEEGSB971cY/JTGBzUvhCmPR763sStENhAnTordilZ9Wt4IMN3V8ZPX3OL Nv5Q== X-Gm-Message-State: ALQs6tBmdGBVRZwZdnTQfL/P1+ywWGqhe5ESfAZUDryT6m3mVFv9modv dTQB5NSlxqQ2ZQNu9JRSrp3pEQ== X-Google-Smtp-Source: AIpwx4+RNTIUlyybcGwEuTv1EKJ51Xo7FwK2Ulg3NMKL0ub/EftccTHkPnqdYEjBbZnoxfyZJZ3v7g== X-Received: by 10.223.175.228 with SMTP id y36mr2150770wrd.107.1523895784329; Mon, 16 Apr 2018 09:23:04 -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 44sm6885629wrl.83.2018.04.16.09.23.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Apr 2018 09:23:03 -0700 (PDT) Date: Mon, 16 Apr 2018 18:22:50 +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: <20180416150525.2817-12-adrien.mazarguil@6wind.com> References: <20180410162022.9101-1-adrien.mazarguil@6wind.com> <20180416150525.2817-1-adrien.mazarguil@6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180416150525.2817-1-adrien.mazarguil@6wind.com> X-Mailer: git-send-email 2.11.0 Subject: [dpdk-dev] [PATCH v4 11/16] ethdev: limit 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: Mon, 16 Apr 2018 16:23:04 -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. 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 --- 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 +- lib/librte_ether/rte_flow.h | 2 +- 2 files changed, 2 insertions(+), 2 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/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