From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2373BA0549; Thu, 16 Jul 2020 16:25:12 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7E3781BF8E; Thu, 16 Jul 2020 16:24:25 +0200 (CEST) Received: from git-send-mailer.rdmz.labs.mlnx (unknown [37.142.13.130]) by dpdk.org (Postfix) with ESMTP id 349121BFA4 for ; Thu, 16 Jul 2020 16:24:20 +0200 (CEST) From: Bing Zhao To: orika@mellanox.com, viacheslavo@mellanox.com Cc: rasland@mellanox.com, matan@mellanox.com, dev@dpdk.org, netanelg@mellanox.com Date: Thu, 16 Jul 2020 22:23:45 +0800 Message-Id: <1594909426-64843-7-git-send-email-bingz@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1594909426-64843-1-git-send-email-bingz@mellanox.com> References: <1594907399-63329-1-git-send-email-bingz@mellanox.com> <1594909426-64843-1-git-send-email-bingz@mellanox.com> Subject: [dpdk-dev] [PATCH v3 6/7] net/mlx5: add eCPRI flex parser capacity check 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" If the NIC or the FW does not support the dynamic flex parser, it will return error when trying to create the parser for eCRPI. Then it is hard to know the detail error reason of the failure. Before creating the parser node and the following usage of the parser, the capacity bit saved in the HCA_CAP could be used to confirm if the dynamic flex parser is supported. If no, an error will be returned directly with ENOTSUP to prevent the following steps to be executed. Signed-off-by: Bing Zhao --- v3: fix the wrong member name in the private structure. --- drivers/net/mlx5/mlx5.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index aec0173..137bb5c 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -636,6 +636,11 @@ mlx5_flex_parser_ecpri_alloc(struct rte_eth_dev *dev) uint32_t ids[8]; int ret; + if (!priv->config.hca_attr.parse_graph_flex_node) { + DRV_LOG(ERR, "Dynamic flex parser is not supported " + "for device %s.", priv->dev_data->name); + return -ENOTSUP; + } node.header_length_mode = MLX5_GRAPH_NODE_LEN_FIXED; /* 8 bytes now: 4B common header + 4B message body header. */ node.header_length_base_value = 0x8; -- 2.5.5