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 AFF09A0093; Wed, 20 May 2020 03:34:07 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 37BD01D17A; Wed, 20 May 2020 03:34:07 +0200 (CEST) Received: from mail-pl1-f193.google.com (mail-pl1-f193.google.com [209.85.214.193]) by dpdk.org (Postfix) with ESMTP id 74C7B1D156 for ; Wed, 20 May 2020 03:34:05 +0200 (CEST) Received: by mail-pl1-f193.google.com with SMTP id u22so650685plq.12 for ; Tue, 19 May 2020 18:34:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=4snbpe2MfrUe1f253KxW4KTDBzznAyzT3ckyXZ1XvYA=; b=ouZsehhB62F4YRs0LMZhQZ6BEZa1gNenXpoXhwFhqMrPCNdxsF5u6E2nv1CKtELB0A VYxsubJdtSbHcs3ia/ixCUsrGjvZsTdVWoJnnuNxy3LTG0ZSsq7weOg/5Kt4dalG7q5O A4jnn6vRNrpBBGRL8l1DIw/l/1j+KsKPdbhl2P3df6lwJmlvceDZdByJlWjOzkBgymat TrqkymsRsbYMWoZoMeMLPTL36jKeeg4imOlLmEyY83G+NxA88If6pOnq+i6hjsTLT5+w kG+I1MDETAg7FbfU27Pm65BO1VHWzNjavYmKN+1JQISDT0J6fYqBFmrZpCsvbdDGTkEy xIVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=4snbpe2MfrUe1f253KxW4KTDBzznAyzT3ckyXZ1XvYA=; b=Y7djrcYxM9OlJkknCqztC0IU6+Oz3FxZB3pdesEWltgRqZ7lav8T+yzRRt2JpBl108 FLB0NseshVV1CHwjNBHQYyiq2g3nY+z16uyP7dJU86DIu09iPYNVQf6o02ZftJNmPQv+ TxsYc3cIDKoQ0qIeHh7ThoDCBtLgszLEFvyhRzSlGmBBGtdG3Ml3pTCH8RVdYJwFKyZm okxG/S/cWXC90Md0nN7XBrzbmP3QjakvZuCoQJPOJWw1VyLgD4WbzIX3rDNcElgQn2GX +fgTe+OBxdnsGC39QjboweRuUmCyZA3P6HdrdYAKqcdAyj2yxHFUSQhY4LdmfAilxIKF bCMA== X-Gm-Message-State: AOAM5304yAJfoRC4L5VX/LSnrr4ujem7YHOi/xaYuG9TmEBN17DxRFOb Gi4DHGzztRfKq6l9O8jLabU= X-Google-Smtp-Source: ABdhPJwuSeUj2bBsLUdBsyDutwu7hi6iGUwB6OChQjQTMaxWuwfIk+9nkJpaC/nVr3MNpJABnGVu1w== X-Received: by 2002:a17:902:d208:: with SMTP id t8mr2287858ply.324.1589938444490; Tue, 19 May 2020 18:34:04 -0700 (PDT) Received: from localhost.localdomain ([203.100.54.194]) by smtp.gmail.com with ESMTPSA id w83sm603874pfc.34.2020.05.19.18.34.02 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 May 2020 18:34:03 -0700 (PDT) From: xiangxia.m.yue@gmail.com To: viacheslavo@mellanox.com, dev@dpdk.org Cc: Tonghao Zhang Date: Wed, 20 May 2020 09:33:28 +0800 Message-Id: <20200520013328.98838-1-xiangxia.m.yue@gmail.com> X-Mailer: git-send-email 2.15.0 Subject: [dpdk-dev] [PATCH dpdk-dev] net/mlx5: check the reg available for metadata action 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" From: Tonghao Zhang If user don't set the dv_xmeta_en to 1 or 2, in the flow_dv_convert_action_set_meta function: * flow_dv_get_metadata_reg may return the REG_NONE, when MLX5_METADATA_FDB enabled for metadata set action. * reg_to_field(REG_NONE) return MLX5_MODI_OUT_NONE which is invalid. The rdma-core calltrace: dr_action_create_modify_action dr_actions_convert_modify_header dr_action_modify_sw_to_hw dr_action_modify_sw_to_hw_set dr_ste_get_modify_hdr_hw_field sw_field [MLX5_MODI_OUT_NONE 4095] should not > ste_ctx->modify_hdr_field_arr_sz [92] As doc[1] says: | dv_xmeta_en 0, this is default value, defines the legacy mode, | the MARK and META related actions and items operate only within | NIC Tx and NIC Rx steering domains, no MARK and META information | crosses the domain boundaries. This patch add check for that case to warn that not supported. [1] - http://doc.dpdk.org/guides-20.02/nics/mlx5.html Signed-off-by: Tonghao Zhang --- drivers/net/mlx5/mlx5_flow_dv.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index e4818319507c..dfcaf90eda11 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -1251,6 +1251,12 @@ flow_dv_convert_action_set_meta if (reg < 0) return reg; + + if (reg == REG_NONE) + return rte_flow_error_set(error, ENOTSUP, + RTE_FLOW_ERROR_TYPE_ITEM, + NULL, "unavailable " + "metadata register"); /* * In datapath code there is no endianness * coversions for perfromance reasons, all -- 2.26.1