From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f182.google.com (mail-wr0-f182.google.com [209.85.128.182]) by dpdk.org (Postfix) with ESMTP id 85E7037A0 for ; Wed, 21 Jun 2017 15:02:08 +0200 (CEST) Received: by mail-wr0-f182.google.com with SMTP id 77so134222275wrb.1 for ; Wed, 21 Jun 2017 06:02:08 -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=iWtwopbvQJsFD5Zjv0Eu3pPAwqIS8TVC0aPD8z9+5ek=; b=zWdupABsAI3q9GYSLZrO29OUIDKbxLadexQ7stqvM2LeT/XqiqKfoDIVgUKPBBes1r sKWt5onUeV0IhlVMlMfaLbGha/VKCkMTxsz8GT0OR9dR3T9/tRmg2ofXtE1V9yDx9Hcb xXy9URp1B8dh3fw2VHRH99pFLu1O0M4pRadAVxI/IloF9qJxkJvdcRYSzTKsavxDRDPn 83s1LbHzsQ4jAm85uPf9/Zvyw85jAGI783OPHxKAweXcyyoAbrJtpVp7Qk6tTZt5KGZH 9h+LJjmmsvZBCd3rtF9dXTT0bU7cv7jA5qum/bJgUj8ulPla6xqC60k9AleWHOnTaQQG GQzg== 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=iWtwopbvQJsFD5Zjv0Eu3pPAwqIS8TVC0aPD8z9+5ek=; b=EDxwC9svTmNQg/8Bi/iZJKXKcdfYhsuOiq3iJVSK85djhhCCB6omQRSJobgPKCoJq3 RzQttjbI/fwthUaaE4NpkP+eSjtl2ljVUMYVrtnu+wX8VnPWFx4Fzj52dOq4gdiKtRPW 2EqeDUvguAKe3shIh1WcvVuST0PdR+SMxDyx3cOyOTvdletxsUeMznqRCjEaezHVrBJl NSRSpb+ejHXGoI0qjwEby3FDB7IemwV7QM7iM8e+gWja7T37WuKsSRuSH9SWLJ5f5ky0 SYYrBALjEdKiY/wwCE1fd9Ul8aLN5Lsih5CJiShxBz2qWOA4QUCdhNLm+0nr9yedU1wB WMPw== X-Gm-Message-State: AKS2vOxHN3eS91W18d+U0lfTwFVJrwnftjBTyCiK4eKhx3OM1hXk82+C Y2vMeEx4CFi8OczbVb8kUw== X-Received: by 10.28.69.67 with SMTP id s64mr6768887wma.100.1498050128109; Wed, 21 Jun 2017 06:02:08 -0700 (PDT) Received: from autoinstall.dev.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id l127sm9702764wml.26.2017.06.21.06.02.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Jun 2017 06:02:07 -0700 (PDT) Date: Wed, 21 Jun 2017 15:02:00 +0200 From: =?iso-8859-1?Q?N=E9lio?= Laranjeiro To: Shachar Beiser , Ferruh Yigit Cc: dev@dpdk.org, Adrien Mazarguil Message-ID: <20170621130200.GI3093@autoinstall.dev.6wind.com> References: <4233196997a3d8aba05b16a130ccc87f27f076bf.1498046009.git.shacharbe@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4233196997a3d8aba05b16a130ccc87f27f076bf.1498046009.git.shacharbe@mellanox.com> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-dev] [PATCH] net/mlx5: fix drop action seg fault 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, 21 Jun 2017 13:02:08 -0000 On Wed, Jun 21, 2017 at 11:55:58AM +0000, Shachar Beiser wrote: > Missing room in flow allocation to store the drop specification. > Changing flow without storing the change in rte_flow. > Fixes: 88c77dedfbb0 ("net/mlx5: implement drop action in hardware classifier") > > Signed-off-by: Shachar Beiser > --- > drivers/net/mlx5/mlx5_flow.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > > diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c > index 12893c6..cad3d16 100644 > --- a/drivers/net/mlx5/mlx5_flow.c > +++ b/drivers/net/mlx5/mlx5_flow.c > @@ -580,6 +580,8 @@ struct mlx5_flow_action { > } > if (action->mark && !flow->ibv_attr && !action->drop) > flow->offset += sizeof(struct ibv_exp_flow_spec_action_tag); > + if (!flow->ibv_attr && action->drop) > + flow->offset += sizeof(struct ibv_exp_flow_spec_action_drop); > if (!action->queue && !action->drop) { > rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_HANDLE, > NULL, "no valid action"); > @@ -1011,9 +1013,6 @@ struct mlx5_flow_action { > return NULL; > } > rte_flow->drop = 1; > - rte_flow->ibv_attr = flow->ibv_attr; > - if (!priv->started) > - return rte_flow; > #ifdef HAVE_VERBS_IBV_EXP_FLOW_SPEC_ACTION_DROP > drop = (void *)((uintptr_t)flow->ibv_attr + flow->offset); > *drop = (struct ibv_exp_flow_spec_action_drop){ > @@ -1023,6 +1022,9 @@ struct mlx5_flow_action { > ++flow->ibv_attr->num_of_specs; > flow->offset += sizeof(struct ibv_exp_flow_spec_action_drop); > #endif > + rte_flow->ibv_attr = flow->ibv_attr; > + if (!priv->started) > + return rte_flow; > rte_flow->qp = priv->flow_drop_queue->qp; > rte_flow->ibv_flow = ibv_exp_create_flow(rte_flow->qp, > rte_flow->ibv_attr); > -- > 1.8.3.1 Acked-by: Nelio Laranjeiro Ferruh, this patch is fixing an issue of a patch only present in your master-net branch, the fixline sha1 will be wrong. Thanks, -- Nélio Laranjeiro 6WIND