From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by dpdk.org (Postfix) with ESMTP id 497721BF37 for ; Thu, 5 Jul 2018 21:24:13 +0200 (CEST) Received: by mail-wr1-f65.google.com with SMTP id j33-v6so1930663wrj.5 for ; Thu, 05 Jul 2018 12:24:13 -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=2wW9hck5TwL2FWfQPNVOGig32AtWCC3LlfHSMlWf5rs=; b=SLk/7+1+RhsXbtbK5dgcqK83KiX9SxqXwTPPoMc/kqFxk8lL+Kkz16H2O802DXNYxO fv0SVFEwxEi9vhGjwNoGnPXhBqpllqakazMHJxXRdBCI/ycxk2yF0lQRZjN/u/tgCjwM 3dLCnjPSYm/9HTNfppu3lGfKQLzLCQR4RT3jOKgclZuk6Nu+wFKSGnEMIT6xXcj2NuAB SkFy3J+qPrFTisdneL7vjWtMA6k2R9O7hYqAhwbx6mChDyxd3DYGSiKjaJNSPb4VY/Hj QrD/wTXkZEwRjvHwOfR0kbGztT0LNpI0CeQqVqQQJaC7RSgLsBc9JItgvKQzguWmbYE1 IvWw== 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=2wW9hck5TwL2FWfQPNVOGig32AtWCC3LlfHSMlWf5rs=; b=e+vr76FDh3WTBjsv0/4vonze65plvvMAZJS/fxTPgyex7Ut26UFEitTt42kfquNzZf vsqHa/2QTHhf7q9lkgS/NjKjBFFHmIhmmrizQTmH8VNEq0kOvU+su0ooLRGmtlMW0ewj Gl6gzjH4vSxwLzz7KY0g87c/anwS8E57bwRwDWaBGPkHVdIAEFFUjl7Zjtq/0GqrBp5S IN9onJOUAq+kKGfN4ylB35TZZadasfBQtwmTtbTVtFyhIfAZ4j7IQzSUZl0P/SA5htxR n0iVJr6OK2zE4MkL80ANRFP1fdubdgoLwtxWC/InYrk15IZzhShNWGMFo/istCo10Pup ZK+A== X-Gm-Message-State: APt69E0zOaEpMMF5EL+yF4PObkIlqimUZD37yvIKI6OoBK+kUFd5q2vG Byz85vS9mZXTQm/6hFUFNVZEVw== X-Google-Smtp-Source: AAOMgpfLaM+S/gr8gQLE/ob1sL80u/ERebuPYq62BwprTZaQ8OMTpWjEFnU9cg1uTIneD/b+2l8mtw== X-Received: by 2002:adf:a9f0:: with SMTP id b103-v6mr5293015wrd.271.1530818653038; Thu, 05 Jul 2018 12:24: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 f76-v6sm7445661wme.30.2018.07.05.12.24.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Jul 2018 12:24:12 -0700 (PDT) Date: Thu, 5 Jul 2018 21:23:55 +0200 From: Adrien Mazarguil To: Andrew Rybchenko Cc: dev@dpdk.org, stable@dpdk.org Message-ID: <20180705192355.GQ4025@6wind.com> References: <1530285811-2907-1-git-send-email-arybchenko@solarflare.com> <20180705111449.GL4025@6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180705111449.GL4025@6wind.com> Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH] net/sfc: cut non VLAN ID bits from TCI X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 19:24:13 -0000 On Thu, Jul 05, 2018 at 01:14:49PM +0200, Adrien Mazarguil wrote: > On Fri, Jun 29, 2018 at 04:23:31PM +0100, Andrew Rybchenko wrote: > > TCI may contain PCP or DEI bits. Matching of these bits is not > > supported, but the bits still may be set in specification value and > > not covered by mask. So, these bits should be ignored. > > > > Fixes: 894080975e1e ("net/sfc: support VLAN in flow API filters") > > Cc: stable@dpdk.org > > > > Signed-off-by: Andrew Rybchenko > > Reviewed-by: Roman Zhukov > > > > --- > > drivers/net/sfc/sfc_flow.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/net/sfc/sfc_flow.c b/drivers/net/sfc/sfc_flow.c > > index 5613d59a9..18387415e 100644 > > --- a/drivers/net/sfc/sfc_flow.c > > +++ b/drivers/net/sfc/sfc_flow.c > > @@ -371,7 +371,8 @@ sfc_flow_parse_vlan(const struct rte_flow_item *item, > > * the outer tag and the next matches the inner tag. > > */ > > if (mask->tci == supp_mask.tci) { > > - vid = rte_bswap16(spec->tci); > > + /* Apply mask to keep VID only */ > > + vid = rte_bswap16(spec->tci & mask->tci); > > > > if (!(efx_spec->efs_match_flags & > > EFX_FILTER_MATCH_OUTER_VID)) { > > I think there is an issue with this patch when spec->mask is user-provided, > PMDs have to trust it. They must not simply ignore bits they cannot handle > but explicitly reject the flow rule for correctness. > > Most devices cannot match PCP and DEI, this is why the default TCI mask was > modified in v18.05 by commit 0730ab674cb1 ("ethdev: fix default VLAN TCI > mask in flow API") to cover the VID part only. > > I wrote a helper for mlx5 to help with such basic sanity checks on pattern > items in a generic(ish) fashion, maybe you could reuse something. Have a > look at mlx5_nl_flow_item_mask() [1]. > > [1] "net/mlx5: add L2-L4 pattern items to switch flow rules" > https://mails.dpdk.org/archives/dev/2018-June/105579.html Seems like I misread the original patch and PMD code, both are in fact correct. Please ignore my previous comment, sorry for the noise! -- Adrien Mazarguil 6WIND