From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f195.google.com (mail-wr0-f195.google.com [209.85.128.195]) by dpdk.org (Postfix) with ESMTP id 41A507CAA for ; Fri, 27 Apr 2018 08:54:13 +0200 (CEST) Received: by mail-wr0-f195.google.com with SMTP id h3-v6so669287wrh.5 for ; Thu, 26 Apr 2018 23:54: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:content-transfer-encoding:in-reply-to :user-agent; bh=qvAdHoPVm51Tqy+jd0tfZTsVA3ljtf1QZ54Ioda5GGI=; b=byLkoTmDX3b+jr+f2tE1JrQpeusMfUyJB94k+UwGUdgZbESQ+umcM/tzLtco0z2mkO D9fwUXXz4fNjpZvD/uwlzVVmLEpZp891cT7DDVNQvpzwWz+wZuFJ5Yyb0lYnGJSO/Dle Y9h6ty+FosaAbYTQB21iJXswS4EUIQhx79SsV9L8WgdXT/D2rsjEK951SQ+PCqgQjTQi ee16s2UFkPnv4o1hAF8MxlDzuKkTx92RFTNHu3Ud/pvcZhNdT1+NFG+KR/Xdl9IEaoVh 0YzWD7Sf4nCXDlFcc7HhI/Z5HkI86lG0DcHijT/EdU4NTJMZNu4QA85KM+drw0I2dCDw CGoA== 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:content-transfer-encoding :in-reply-to:user-agent; bh=qvAdHoPVm51Tqy+jd0tfZTsVA3ljtf1QZ54Ioda5GGI=; b=L6AFa17tZvoyb3EpfookG1EzK5BoTBAqukGpjJ+kY8DLSQQKzo3lanxx6871iUhhfR H4sdUxh0oZcrM4FLXtlPpGlGEJShCEnS09R/ZgHDKyYk3NadNfTjenWABEmtud0Pf6u1 qlWjQhrHy55R6V8g/AOP0ZHPjjjPbLBQfz4Buv/+o5LhU9+mnnuqOxAW8KtFsA/uuElL wdBWAlcLvtpiiDi8WpRmZ/H8vJohSb/tRb/myN6zNJ69MaJ/quLuNLvgjLQHSI6x/d8s aC86ckaKMU8xViOuPCj/KHAtiz62J5PM0NzFUhNWvv5OjsO38FeJKVgWthwP2mAzubCO ektQ== X-Gm-Message-State: ALQs6tA8hnifSgiOY093DTuxl/nGzUsuUVHuLPBC1MmFoHc6IIdPix23 6RXr2n5FOSv9i41ouIxc7729 X-Google-Smtp-Source: AB8JxZr3tmRS15F5KrC98qPeqg1FxDaB/BsI1OFeECZbwu5vNt8/4mCkTWv2M81W2xeXuWLQt7nVvg== X-Received: by 2002:adf:d0cb:: with SMTP id z11-v6mr658708wrh.281.1524812052813; Thu, 26 Apr 2018 23:54:12 -0700 (PDT) Received: from laranjeiro-vm.dev.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id r200sm841861wmb.39.2018.04.26.23.54.11 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Apr 2018 23:54:12 -0700 (PDT) Date: Fri, 27 Apr 2018 08:55:06 +0200 From: =?iso-8859-1?Q?N=E9lio?= Laranjeiro To: Adrien Mazarguil Cc: Shahaf Shuler , dev@dpdk.org, stable@dpdk.org Message-ID: <20180427065506.hl4bfncfyw4nyd23@laranjeiro-vm.dev.6wind.com> References: <20180426161641.5788-1-adrien.mazarguil@6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180426161641.5788-1-adrien.mazarguil@6wind.com> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [dpdk-dev] [PATCH v1] net/mlx5: fix flow director rule deletion crash 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: Fri, 27 Apr 2018 06:54:13 -0000 On Thu, Apr 26, 2018 at 06:17:46PM +0200, Adrien Mazarguil wrote: > Flow director rules matching traffic properties above layer 2 do not > target a fixed hash Rx queue (HASH_RXQ_ETH), it actually depends on the > highest protocol layer specified by each flow rule. > > mlx5_fdir_filter_delete() makes this wrong assumption and causes a crash > when attempting to destroy flow rules with L3/L4 specifications. > > Fixes: 4c3e9bcdd52e ("net/mlx5: support flow director") > Cc: Nelio Laranjeiro > Cc: stable@dpdk.org > > Signed-off-by: Adrien Mazarguil Acked-by: Nelio Laranjeiro > --- > drivers/net/mlx5/mlx5_flow.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c > index 8f5fcf4d6..05def2b14 100644 > --- a/drivers/net/mlx5/mlx5_flow.c > +++ b/drivers/net/mlx5/mlx5_flow.c > @@ -3409,13 +3409,13 @@ mlx5_fdir_filter_delete(struct rte_eth_dev *dev, > if (parser.drop) { > struct ibv_flow_spec_action_drop *drop; > > - drop = (void *)((uintptr_t)parser.queue[HASH_RXQ_ETH].ibv_attr + > - parser.queue[HASH_RXQ_ETH].offset); > + drop = (void *)((uintptr_t)parser.queue[parser.layer].ibv_attr + > + parser.queue[parser.layer].offset); > *drop = (struct ibv_flow_spec_action_drop){ > .type = IBV_FLOW_SPEC_ACTION_DROP, > .size = sizeof(struct ibv_flow_spec_action_drop), > }; > - parser.queue[HASH_RXQ_ETH].ibv_attr->num_of_specs++; > + parser.queue[parser.layer].ibv_attr->num_of_specs++; > } > TAILQ_FOREACH(flow, &priv->flows, next) { > struct ibv_flow_attr *attr; > @@ -3426,8 +3426,8 @@ mlx5_fdir_filter_delete(struct rte_eth_dev *dev, > void *flow_spec; > unsigned int specs_n; > > - attr = parser.queue[HASH_RXQ_ETH].ibv_attr; > - flow_attr = flow->frxq[HASH_RXQ_ETH].ibv_attr; > + attr = parser.queue[parser.layer].ibv_attr; > + flow_attr = flow->frxq[parser.layer].ibv_attr; > /* Compare first the attributes. */ > if (memcmp(attr, flow_attr, sizeof(struct ibv_flow_attr))) > continue; > -- > 2.11.0 -- Nélio Laranjeiro 6WIND