From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f41.google.com (mail-wm0-f41.google.com [74.125.82.41]) by dpdk.org (Postfix) with ESMTP id CCC84374 for ; Mon, 26 Jun 2017 14:28:54 +0200 (CEST) Received: by mail-wm0-f41.google.com with SMTP id i127so6235409wma.0 for ; Mon, 26 Jun 2017 05:28:54 -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=ZwVQOU99BQXSN1l8XepBNgqEH912WKbU1I9juEZEFfs=; b=0u34eetTK0SETk7JSHdgUWc1UfEIWFWtS7LeilWGsvhkIIPlMCl39C+5Gg10w6SuLl a1owrWXWIAJVO9aikJTL3ag/hMPT7Vdjifjqk+GiFTvPAmmdsRMeu7WM1ipUh9aBYclR ldRUWZX6/10sQBzf/B9Y11spdsDVzNZ39yzljDN00n15mfJUhVst8WhH1uysJaXEp0bH efMrb/8daSym21deJm4Gtu6HirHxb2+LvBAwWgivHc8xGowTQTobglyl0Pq5cF5nS81Y sFTETr5QTr+Koq+hEGpSOk6BSKbG4eY9KRo5f2R2tstVRbs1dUJ2RkQScBYGDqSDplcN n67A== 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=ZwVQOU99BQXSN1l8XepBNgqEH912WKbU1I9juEZEFfs=; b=E+6GReGrJd68PyPRUPQOvLQCyrnacmo3qzsyUG5gDsMZeDPMu8LKhrUY4BHej/pGHm paElneDDiTzKXVf1t55WQ/zwRY4+WJH9Ly8WQbURTq/QXEfi/BTBJ+BNBLThSUxo+dBU r7TeDLxJwcfER8ymhyZyb70u1v8E/o6dT+JQDtQehX4NQXxB+1Xqq957aHhQSn5/5YiD ODU0aameleyk2tdJ98Z1iSm8e5Nuz2VtReviTp+S828mU0MSt+JFEAlUN5riIIw+YJpw OqJvG4f0qp+X4PvncXKWX57hy+2wh4w5jDeZKFw4pdOmFIjRPSHbCamHtte0dPKAfui/ GG8w== X-Gm-Message-State: AKS2vOx8SLH9aAHryG8Xxb0HHk01s7kPqbDGgTcD1L4nXy9OBypDUZHU jECJ5R1+NWiKwL22pcyRMQ== X-Received: by 10.28.182.137 with SMTP id g131mr3794433wmf.95.1498480134419; Mon, 26 Jun 2017 05:28:54 -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 u80sm14835301wrb.1.2017.06.26.05.28.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Jun 2017 05:28:53 -0700 (PDT) Date: Mon, 26 Jun 2017 14:28:46 +0200 From: =?iso-8859-1?Q?N=E9lio?= Laranjeiro To: Shachar Beiser Cc: dev@dpdk.org, Adrien Mazarguil Message-ID: <20170626122846.GB3093@autoinstall.dev.6wind.com> References: <4233196997a3d8aba05b16a130ccc87f27f076bf.1498046009.git.shacharbe@mellanox.com> <09f627ea8059ff7fd490ea1120e5c68137fa4944.1498376886.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: <09f627ea8059ff7fd490ea1120e5c68137fa4944.1498376886.git.shacharbe@mellanox.com> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-dev] [PATCH v2] 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: Mon, 26 Jun 2017 12:28:55 -0000 On Sun, Jun 25, 2017 at 07:55:01AM +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 | 10 +++++++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > > diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c > index 12893c6..86be929 100644 > --- a/drivers/net/mlx5/mlx5_flow.c > +++ b/drivers/net/mlx5/mlx5_flow.c > @@ -580,6 +580,10 @@ struct mlx5_flow_action { > } > if (action->mark && !flow->ibv_attr && !action->drop) > flow->offset += sizeof(struct ibv_exp_flow_spec_action_tag); > +#ifdef HAVE_VERBS_IBV_EXP_FLOW_SPEC_ACTION_DROP > + if (!flow->ibv_attr && action->drop) > + flow->offset += sizeof(struct ibv_exp_flow_spec_action_drop); > +#endif > if (!action->queue && !action->drop) { > rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_HANDLE, > NULL, "no valid action"); > @@ -1011,9 +1015,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 +1024,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 -- Nélio Laranjeiro 6WIND