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 57FE91B483 for ; Thu, 5 Jul 2018 13:15:07 +0200 (CEST) Received: by mail-wr1-f65.google.com with SMTP id c13-v6so925229wrt.1 for ; Thu, 05 Jul 2018 04:15:07 -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=85ts2WUvvoI3H/Ua9SkQkZQcKMbcgfflRAyY5F0SHSQ=; b=B2a6T9Ae/57P3VN20ll0gyrQjbc+ObmVfegb68ZdukwkoHU2hwVM5Tfi5knjijQWjM a21EYpu+3cJs+Az85Dk0RVyv0c2ljgpvxYOAhVTRM+sxrVYrq4oPAC0UpJAwYx2rXug1 UIQEKNA379sR5LQl0hsQxqJcEnlk6uaOjI0wCUgQhYkq2z52Jdw9WXUrigUcNAkeQpLL HBGzow3Vwaw8DFxQioQgj5AWuTKdB6rJD9qipUdofbY86HbRGHAZhMaNzI98uuXUl3WB 1YBLPpiNf8GHDpaIRuBy9rLiVGsVECcK8O7bQpHH4Aeyl/EwQ1lGsg4LJWBPoAb5AuAo 5eiA== 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=85ts2WUvvoI3H/Ua9SkQkZQcKMbcgfflRAyY5F0SHSQ=; b=QhIRxLoOAPHkw+GF0uKbUxSvqUf4B4y7c8Lc9qgtPuUN9suMjxu2myFBpcTLZ0+IXe fLVANBi+6K9ZlrMSZy1ufzQsIZuznNMDKhc/dkHgJAOtXfTIRn33D5+Hlt8artLSNv85 VG/eornPhDzTI103SreP1gBWKv/opPBU0R61ZvhX6TRZS9c6RPY9j2MFbf9KXduU/Cxc fa8GfDMBOsqFe7TVe/0Yih2I2EpL7XCeZhxvGOkaEKkRRqSNJoDpuSxm2o5TCuYLhANo DWWFX/pxCa0ogmYXs6HEgCAx8zg2NUIvFv0IZVAB+H3IWRdjx+AM4pJnlEeAZj1GWrh9 dEAQ== X-Gm-Message-State: APt69E1K7kJ0ppytIS+Y6HkDFeDrxGyof98w7hbWWQ6j3+oiKEzzLFyu rBiDXITMf201R50LOs4XxxmRdQ== X-Google-Smtp-Source: AAOMgpeTXoPhZ9iAJipQExIcwjySdGZaictDSd2R8AZ3qF92x2AEXswRmG17RQZFACF1PerMEulKVA== X-Received: by 2002:adf:ac66:: with SMTP id v93-v6mr4139919wrc.7.1530789307120; Thu, 05 Jul 2018 04:15:07 -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 x15-v6sm10060275wme.24.2018.07.05.04.15.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Jul 2018 04:15:06 -0700 (PDT) Date: Thu, 5 Jul 2018 13:14:49 +0200 From: Adrien Mazarguil To: Andrew Rybchenko Cc: dev@dpdk.org, stable@dpdk.org Message-ID: <20180705111449.GL4025@6wind.com> References: <1530285811-2907-1-git-send-email-arybchenko@solarflare.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1530285811-2907-1-git-send-email-arybchenko@solarflare.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 11:15:07 -0000 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 -- Adrien Mazarguil 6WIND