From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 72AA7567F for ; Thu, 22 Jun 2017 13:11:18 +0200 (CEST) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Jun 2017 04:11:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,373,1493708400"; d="scan'208";a="100423432" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.220.91]) ([10.237.220.91]) by orsmga004.jf.intel.com with ESMTP; 22 Jun 2017 04:11:16 -0700 To: Shachar Beiser , dev@dpdk.org Cc: Adrien Mazarguil , Nelio Laranjeiro References: <4233196997a3d8aba05b16a130ccc87f27f076bf.1498046009.git.shacharbe@mellanox.com> From: Ferruh Yigit Message-ID: <38d3b7b2-7ff5-c2c4-fc80-c3ce4aff299d@intel.com> Date: Thu, 22 Jun 2017 12:11:15 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <4233196997a3d8aba05b16a130ccc87f27f076bf.1498046009.git.shacharbe@mellanox.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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: Thu, 22 Jun 2017 11:11:19 -0000 On 6/21/2017 12:55 PM, 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); Is using "struct ibv_exp_flow_spec_action_drop" here required HAVE_VERBS_IBV_EXP_FLOW_SPEC_ACTION_DROP check? > 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); >