From patchwork Fri Apr 24 19:45:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 11508965 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1BC6914B4 for ; Fri, 24 Apr 2020 19:45:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F2255215A4 for ; Fri, 24 Apr 2020 19:45:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="HsyywK38" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729244AbgDXTpx (ORCPT ); Fri, 24 Apr 2020 15:45:53 -0400 Received: from mail-eopbgr70047.outbound.protection.outlook.com ([40.107.7.47]:44128 "EHLO EUR04-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728950AbgDXTpw (ORCPT ); Fri, 24 Apr 2020 15:45:52 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nr3fRjSfx4aCJBf2MvDkbIZMo3TSX+gygbRp28SC1A+fx66x7Nq7OLGPLJB4Kif84vXhZLP0r6ak1vaf7IyUviEVJvUj8mpbR23+MLSZOqY9ozAmQSs42rOFQllgST8FTSRxfCd+hFYIxrErAB+/1sBDh/1uqc5VEqJIbCsdXH1AwVVExL9KGqGfmdFWXSStPBhBYmvI/Du4GTRAoAUdaqdwxI7c9bdujBO5RCTmVSwKZaYM1FUkAmF6GsaKB66LIYRWHbQSLl30ScrIQN3RglQmBpRoQsYWDm1Hoc68MgrDTUqfqx3CqW2HyQTNGAZmI6spK8FCXNlEnzBMbpohlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XqUvvy5MWNmr29zJjHwXw8sd/ZteGvOkJmvs5glZtaY=; b=Oj+wEbcibUTyU52uNKRR14heOKmyTWhuEYeDfBRmiVkpzAPy6Hb9fks5VJ1XxMXWh8NQp8ap11yG6c7Qc+Al2E97g6tReIzEdUwPE/WAKdiiuvyOIS4v52M6ZUComBG+5pZJK4FzVYkwrIYoE77HaAf7ZGpnlTBT7sggX9575xTTMqidvLQ1tr7v1e5zAwOGhVDTNNCVb/nkSEmOkyDg2a5rhB7qF6KDuPCyeKyazjTHmTKr50kQzeCIuS2k/uElIen4KUT9nMOaDFsV+X+Q+2/kiVgJarabJY98Xn0+1XSYSTEu9G0p7BaBwOKDz0DKng4QYlCyitSmC5WwMeeh9Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XqUvvy5MWNmr29zJjHwXw8sd/ZteGvOkJmvs5glZtaY=; b=HsyywK38pmqbDlW8EvBN8hwT9Ol8SWB8wAZazRXJ46nfRLzr5/LJNBZUZUtv9qxDtJpE9j8wvLWyyUEMYEiWv5Z5CS1/KLbNe+2s4URgfDXzLMCtEl1L/rRMQU7pBissN59OC7FxraESHvUWgSxtwSgi+SVRCINaP642w6VUSjs= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=saeedm@mellanox.com; Received: from VI1PR05MB5102.eurprd05.prod.outlook.com (2603:10a6:803:5e::23) by VI1PR05MB5072.eurprd05.prod.outlook.com (2603:10a6:803:61::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.29; Fri, 24 Apr 2020 19:45:43 +0000 Received: from VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::9d19:a564:b84e:7c19]) by VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::9d19:a564:b84e:7c19%7]) with mapi id 15.20.2937.020; Fri, 24 Apr 2020 19:45:43 +0000 From: Saeed Mahameed To: Saeed Mahameed , Leon Romanovsky Cc: netdev@vger.kernel.org, linux-rdma@vger.kernel.org, Huy Nguyen , Raed Salem Subject: [PATCH mlx5-next 1/9] net/mlx5: Add support for COPY steering action Date: Fri, 24 Apr 2020 12:45:02 -0700 Message-Id: <20200424194510.11221-2-saeedm@mellanox.com> X-Mailer: git-send-email 2.25.3 In-Reply-To: <20200424194510.11221-1-saeedm@mellanox.com> References: <20200424194510.11221-1-saeedm@mellanox.com> X-ClientProxiedBy: BYAPR06CA0016.namprd06.prod.outlook.com (2603:10b6:a03:d4::29) To VI1PR05MB5102.eurprd05.prod.outlook.com (2603:10a6:803:5e::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from smtp.office365.com (73.15.39.150) by BYAPR06CA0016.namprd06.prod.outlook.com (2603:10b6:a03:d4::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Fri, 24 Apr 2020 19:45:32 +0000 X-Mailer: git-send-email 2.25.3 X-Originating-IP: [73.15.39.150] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 5f5a58f5-5cb9-4264-b456-08d7e8880e0e X-MS-TrafficTypeDiagnostic: VI1PR05MB5072:|VI1PR05MB5072: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:288; X-Forefront-PRVS: 03838E948C X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR05MB5102.eurprd05.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(10009020)(4636009)(39860400002)(136003)(396003)(376002)(366004)(346002)(6506007)(26005)(2616005)(8936002)(8676002)(316002)(6636002)(36756003)(6666004)(66946007)(66556008)(52116002)(81156014)(478600001)(107886003)(66476007)(6512007)(956004)(5660300002)(110136005)(4326008)(1076003)(54906003)(16526019)(186003)(2906002)(6486002)(86362001)(450100002)(54420400002);DIR:OUT;SFP:1101; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: a8VIzas+y3ofKESrjRTIP4XHUmOUYM3/azKdO45p6u5ao02X8DDIfHwOtRi9LZIsz9GtK2Tg6HWHaWp9iYGeX49NLuKXSo2Xbw9nzCP3kLfFQv5EV/zRrrBGZRNSJP9p23jQImcboghUu2h/PNzihGFPYP514yURaK9Alj/j49Nfi02n2TCHuHhL+TrFnlX5iBnzP5HMw8Mr85SmPc7jIqXXMJmOuPaJ5QhJspJ5txCQ5mV2pjB/2QRjgFsVYHmxbxkjAwCQ+Rb10j1/xWG6EQNkrXBNW1L4tVlRp3tI/XlhefHEKjD7GPTijUD+y1F4LlpolvafWgNLoITv4LJJgTpsApJ0hzPqHYvbnvbXpwIZwlsuKaWVbZ73A+cahFg6bGOpcl0ObO3+zTCg059kRwibQinUMUmcen/ZYjaW+b3z9P2yblr6RYqeNhUSe5h3Zo+AGrvg0jp2+rQ1ex5l2eO83ibHGahyzKFiCbBrikEIi6o374TE3t5JUPdCpgQw X-MS-Exchange-AntiSpam-MessageData: oI0oOmYsqidlBF0TF4n5JoUomKaMqimwJOGvAdiVwst6txK5uLp0ifzOHFdjWPJZqplH0E5SvyP5+tObvC/RM5D0la1aqdsNVI3wPg+OMVi4FjwmeLwuF6if8CVGeaAr37jni3aZ0iCwGXG5kGYH9w== X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5f5a58f5-5cb9-4264-b456-08d7e8880e0e X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Apr 2020 19:45:34.7334 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: DgVZ9hNc5gCO42RFdm16mw1ceeQrdH2jh1xc8WHar7FqbSbFzapUC2treEeM+YxA2iSZe4QOOt8l6WVOB0iKVQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB5072 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Huy Nguyen Add COPY type to modify_header action. IPsec feature is the first feature that needs COPY steering action. Signed-off-by: Huy Nguyen Signed-off-by: Raed Salem Signed-off-by: Saeed Mahameed Acked-by: Leon Romanovsky --- drivers/infiniband/hw/mlx5/flow.c | 4 ++-- drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 6 +++--- drivers/net/ethernet/mellanox/mlx5/core/esw/chains.c | 2 +- .../net/ethernet/mellanox/mlx5/core/eswitch_offloads.c | 4 ++-- drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/steering/fs_dr.c | 2 +- include/linux/mlx5/mlx5_ifc.h | 8 ++++---- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/infiniband/hw/mlx5/flow.c b/drivers/infiniband/hw/mlx5/flow.c index 862b7bf3e646..69cb7e6e8955 100644 --- a/drivers/infiniband/hw/mlx5/flow.c +++ b/drivers/infiniband/hw/mlx5/flow.c @@ -427,7 +427,7 @@ static int UVERBS_HANDLER(MLX5_IB_METHOD_FLOW_ACTION_CREATE_MODIFY_HEADER)( num_actions = uverbs_attr_ptr_get_array_size( attrs, MLX5_IB_ATTR_CREATE_MODIFY_HEADER_ACTIONS_PRM, - MLX5_UN_SZ_BYTES(set_action_in_add_action_in_auto)); + MLX5_UN_SZ_BYTES(set_add_copy_action_in_auto)); if (num_actions < 0) return num_actions; @@ -648,7 +648,7 @@ DECLARE_UVERBS_NAMED_METHOD( UA_MANDATORY), UVERBS_ATTR_PTR_IN(MLX5_IB_ATTR_CREATE_MODIFY_HEADER_ACTIONS_PRM, UVERBS_ATTR_MIN_SIZE(MLX5_UN_SZ_BYTES( - set_action_in_add_action_in_auto)), + set_add_copy_action_in_auto)), UA_MANDATORY, UA_ALLOC_AND_COPY), UVERBS_ATTR_CONST_IN(MLX5_IB_ATTR_CREATE_MODIFY_HEADER_FT_TYPE, diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c index ad3e3a65d403..91464f70a3fa 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c @@ -385,7 +385,7 @@ mlx5_tc_ct_entry_create_nat(struct mlx5_tc_ct_priv *ct_priv, char *modact; int err, i; - action_size = MLX5_UN_SZ_BYTES(set_action_in_add_action_in_auto); + action_size = MLX5_UN_SZ_BYTES(set_add_copy_action_in_auto); flow_action_for_each(i, act, flow_action) { switch (act->id) { diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c index 88c0e460e995..12c5ca5b93ca 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c @@ -61,7 +61,7 @@ #include "lib/geneve.h" #include "diag/en_tc_tracepoint.h" -#define MLX5_MH_ACT_SZ MLX5_UN_SZ_BYTES(set_action_in_add_action_in_auto) +#define MLX5_MH_ACT_SZ MLX5_UN_SZ_BYTES(set_add_copy_action_in_auto) struct mlx5_nic_flow_attr { u32 action; @@ -2660,7 +2660,7 @@ static int offload_pedit_fields(struct mlx5e_priv *priv, set_vals = &hdrs[0].vals; add_vals = &hdrs[1].vals; - action_size = MLX5_UN_SZ_BYTES(set_action_in_add_action_in_auto); + action_size = MLX5_UN_SZ_BYTES(set_add_copy_action_in_auto); for (i = 0; i < ARRAY_SIZE(fields); i++) { bool skip; @@ -2793,7 +2793,7 @@ int alloc_mod_hdr_actions(struct mlx5_core_dev *mdev, if (mod_hdr_acts->num_actions < mod_hdr_acts->max_actions) return 0; - action_size = MLX5_UN_SZ_BYTES(set_action_in_add_action_in_auto); + action_size = MLX5_UN_SZ_BYTES(set_add_copy_action_in_auto); max_hw_actions = mlx5e_flow_namespace_max_modify_action(mdev, namespace); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/esw/chains.c b/drivers/net/ethernet/mellanox/mlx5/core/esw/chains.c index 029001040737..d5bf908dfecd 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/esw/chains.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/esw/chains.c @@ -274,7 +274,7 @@ mlx5_esw_chains_destroy_fdb_table(struct mlx5_eswitch *esw, static int create_fdb_chain_restore(struct fdb_chain *fdb_chain) { - char modact[MLX5_UN_SZ_BYTES(set_action_in_add_action_in_auto)]; + char modact[MLX5_UN_SZ_BYTES(set_add_copy_action_in_auto)]; struct mlx5_eswitch *esw = fdb_chain->esw; struct mlx5_modify_hdr *mod_hdr; u32 index; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c index dc098bb58973..703f307c5967 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c @@ -1490,7 +1490,7 @@ static void esw_destroy_restore_table(struct mlx5_eswitch *esw) static int esw_create_restore_table(struct mlx5_eswitch *esw) { - u8 modact[MLX5_UN_SZ_BYTES(set_action_in_add_action_in_auto)] = {}; + u8 modact[MLX5_UN_SZ_BYTES(set_add_copy_action_in_auto)] = {}; int inlen = MLX5_ST_SZ_BYTES(create_flow_group_in); struct mlx5_flow_table_attr ft_attr = {}; struct mlx5_core_dev *dev = esw->dev; @@ -1900,7 +1900,7 @@ static int esw_vport_ingress_prio_tag_config(struct mlx5_eswitch *esw, static int esw_vport_add_ingress_acl_modify_metadata(struct mlx5_eswitch *esw, struct mlx5_vport *vport) { - u8 action[MLX5_UN_SZ_BYTES(set_action_in_add_action_in_auto)] = {}; + u8 action[MLX5_UN_SZ_BYTES(set_add_copy_action_in_auto)] = {}; struct mlx5_flow_act flow_act = {}; int err = 0; u32 key; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.c b/drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.c index 304d1e4f0541..1a8e826ac86b 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.c @@ -791,7 +791,7 @@ static int mlx5_cmd_modify_header_alloc(struct mlx5_flow_root_namespace *ns, return -EOPNOTSUPP; } - actions_size = MLX5_UN_SZ_BYTES(set_action_in_add_action_in_auto) * num_actions; + actions_size = MLX5_UN_SZ_BYTES(set_add_copy_action_in_auto) * num_actions; inlen = MLX5_ST_SZ_BYTES(alloc_modify_header_context_in) + actions_size; in = kzalloc(inlen, GFP_KERNEL); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/fs_dr.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/fs_dr.c index 3b3f5b9d4f95..8887b2440c7d 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/fs_dr.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/fs_dr.c @@ -576,7 +576,7 @@ static int mlx5_cmd_dr_modify_header_alloc(struct mlx5_flow_root_namespace *ns, struct mlx5dr_action *action; size_t actions_sz; - actions_sz = MLX5_UN_SZ_BYTES(set_action_in_add_action_in_auto) * + actions_sz = MLX5_UN_SZ_BYTES(set_add_copy_action_in_auto) * num_actions; action = mlx5dr_action_create_modify_header(dr_domain, 0, actions_sz, diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h index 6fa24918eade..3ad2c51ccde9 100644 --- a/include/linux/mlx5/mlx5_ifc.h +++ b/include/linux/mlx5/mlx5_ifc.h @@ -5670,9 +5670,9 @@ struct mlx5_ifc_copy_action_in_bits { u8 reserved_at_38[0x8]; }; -union mlx5_ifc_set_action_in_add_action_in_auto_bits { - struct mlx5_ifc_set_action_in_bits set_action_in; - struct mlx5_ifc_add_action_in_bits add_action_in; +union mlx5_ifc_set_add_copy_action_in_auto_bits { + struct mlx5_ifc_set_action_in_bits set_action_in; + struct mlx5_ifc_add_action_in_bits add_action_in; struct mlx5_ifc_copy_action_in_bits copy_action_in; u8 reserved_at_0[0x40]; }; @@ -5746,7 +5746,7 @@ struct mlx5_ifc_alloc_modify_header_context_in_bits { u8 reserved_at_68[0x10]; u8 num_of_actions[0x8]; - union mlx5_ifc_set_action_in_add_action_in_auto_bits actions[0]; + union mlx5_ifc_set_add_copy_action_in_auto_bits actions[0]; }; struct mlx5_ifc_dealloc_modify_header_context_out_bits { From patchwork Fri Apr 24 19:45:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 11508967 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AAA0A1575 for ; Fri, 24 Apr 2020 19:45:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8EAD3215A4 for ; Fri, 24 Apr 2020 19:45:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="F2lzBWqE" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728659AbgDXTp5 (ORCPT ); Fri, 24 Apr 2020 15:45:57 -0400 Received: from mail-eopbgr70047.outbound.protection.outlook.com ([40.107.7.47]:44128 "EHLO EUR04-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729280AbgDXTp5 (ORCPT ); Fri, 24 Apr 2020 15:45:57 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NIxBew0zoh6enU9CjQPQQ1pWUfz4FyZBLK3l2OBFLNQ9iZjESKwIJ3eRnmhPqK7zU/iDzTrmPPCOPRHUtDIHx9oIzoXyV0KpKUDzOGbPBnUiBtkEvFiPW0qgua2gPSuV3Rq1HEwZXXwMnKnEutRvNJglS4FH2eSsI+tqP3rtgfcgm0B3wTjhEdhu7Doz+F12fWAxsM7QL/FgcIeQcrdm9SX9ZS13XQt045sIma/qOMAG558T8R30b/bwSF3uehDCONPgSCxt1OY2+Z+oRSXhEYirzn43jh2hgtEKrPLAZfXbYNRRNPSidMlw+q4XjlO+aANgTL7XbYnkKXd5bSwqoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=m0cH4XQk4iwRnZUkS/ep2nOAZmRlqtcPjC9Bk9ZJKxA=; b=Qv4fqw34SbNyEp1/sONiBiY40VqAjTXyUjIRGBQcx5/FiHy/q9r0yCy7H+YYWJLegI8HUUd484TW14He/XQxoYGTiqP8yU94KCwRZfKmt2I0ULpVuOqWgtPHWw/RHNycrzANqj3i/LIwJeqiwXp4GO/C74oWeVerD6XOQe2UY7kybYz80xbO4W3UZiNu6BKe8Dh7OLXI3lBuZgsA1kDAKPlLDTFwe/gXAWROmOfxnLsqOvkCJShDsVpr8PX1Zy0Phkuihtw9BxaiDWyL3QqV4kixxfo8u0kZ634HJOclH+I5djN4f++TomWA9wfJXFVosTemp0D27b9cnjM1atu51w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=m0cH4XQk4iwRnZUkS/ep2nOAZmRlqtcPjC9Bk9ZJKxA=; b=F2lzBWqECqMokv6VoCnFnpZo4xRyCZmKLODaiTy8M9cej5arxn2WUFJjRZYojOeWRIFZCZBF63VPVdcAhHycwNqLaXPDHF7yyUNAfYi27iop5e/xikznWiSQ+G7oyX/YSRomWrSGOwqFzL2zwUTmDHphT2Kfqq+dLZb8TyruvGk= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=saeedm@mellanox.com; Received: from VI1PR05MB5102.eurprd05.prod.outlook.com (2603:10a6:803:5e::23) by VI1PR05MB5072.eurprd05.prod.outlook.com (2603:10a6:803:61::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.29; Fri, 24 Apr 2020 19:45:46 +0000 Received: from VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::9d19:a564:b84e:7c19]) by VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::9d19:a564:b84e:7c19%7]) with mapi id 15.20.2937.020; Fri, 24 Apr 2020 19:45:46 +0000 From: Saeed Mahameed To: Saeed Mahameed , Leon Romanovsky Cc: netdev@vger.kernel.org, linux-rdma@vger.kernel.org, Raed Salem , Tariq Toukan Subject: [PATCH mlx5-next 2/9] net/mlx5: Introduce IPsec Connect-X offload hardware bits and structures Date: Fri, 24 Apr 2020 12:45:03 -0700 Message-Id: <20200424194510.11221-3-saeedm@mellanox.com> X-Mailer: git-send-email 2.25.3 In-Reply-To: <20200424194510.11221-1-saeedm@mellanox.com> References: <20200424194510.11221-1-saeedm@mellanox.com> X-ClientProxiedBy: BYAPR06CA0016.namprd06.prod.outlook.com (2603:10b6:a03:d4::29) To VI1PR05MB5102.eurprd05.prod.outlook.com (2603:10a6:803:5e::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from smtp.office365.com (73.15.39.150) by BYAPR06CA0016.namprd06.prod.outlook.com (2603:10b6:a03:d4::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Fri, 24 Apr 2020 19:45:35 +0000 X-Mailer: git-send-email 2.25.3 X-Originating-IP: [73.15.39.150] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: c86110e8-b952-41fe-823d-08d7e8880fa4 X-MS-TrafficTypeDiagnostic: VI1PR05MB5072:|VI1PR05MB5072: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:741; X-Forefront-PRVS: 03838E948C X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR05MB5102.eurprd05.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(10009020)(4636009)(39860400002)(136003)(396003)(376002)(366004)(346002)(6506007)(26005)(2616005)(8936002)(8676002)(316002)(6636002)(36756003)(6666004)(66946007)(66556008)(52116002)(81156014)(478600001)(107886003)(66476007)(6512007)(956004)(5660300002)(110136005)(4326008)(1076003)(54906003)(16526019)(186003)(2906002)(6486002)(86362001)(450100002)(54420400002);DIR:OUT;SFP:1101; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Xf92jTQ4oFyfM/RtLIjJPiH875IuW6wpvsMeRyQwecgvB+DYKIN6+tVNIxZeRSVVGNoHSdl1Xjoo80TfvP4f4gRfitko/VzRJ/lFa4lB8Ls8nbmCFE8f41Zwwffj1TsgmP0AeuNFG9hYv2c8SfbPjfai6URWUrzwRslXKczefay5binDStOIJO2JP9SCiG/vzx3Pbp1ZefIWv6yxcBUrDKZSenItRts+o9GyA81NUpcfrwwgR3rDBh0zsdmI4StpC4qpUNxrgdsTYyTVCgIHHM3ZNaYmfNsOUj+H7Ys62tkV+2FnyL0esQ4RRKlW9mr9ZIO6w+mQrvDjg5mkJQVtiVLS8tiOn3CLHMn5vlZybkaDhyY6+TesA8/NwwOUn5XtLAVwCqnKzOL5jxBhgUx3tPgnednkqRJUR6SDbsAHKD62RxCwuoedI8W9GKIWji6q0WrsepP9Ex1XE5cpUtVjMhA03pGEoojhRHNOCQN6TY6nNc60sOqUBkuPcJn2eZnp X-MS-Exchange-AntiSpam-MessageData: wmRDm3hsRgEvmFp8kq6nR0FIBXdwObKG7bjNTrDn9rsnr6VWkLVIvq7YjxERzjyRXU1otU3NhPIRl82IO+CKFBnlUHQ0kuvk3odiYSrbaPNE9WJpzzIFl4ktBDVO8xzQWUi98BwcHpaIeQBBYE45ag== X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: c86110e8-b952-41fe-823d-08d7e8880fa4 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Apr 2020 19:45:37.3559 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: iy72ctykHj5sysmsEtMResGHGNUHuYfTskjS3/+qwe7tjLrVNaYMvT472pByxGdI9nZ+QZFSVD0Cqn2XL5t09g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB5072 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Raed Salem Add IPsec offload related IFC structs, layouts and enumerations. Signed-off-by: Raed Salem Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed --- include/linux/mlx5/device.h | 4 ++ include/linux/mlx5/mlx5_ifc.h | 78 +++++++++++++++++++++++++++++++++-- 2 files changed, 79 insertions(+), 3 deletions(-) diff --git a/include/linux/mlx5/device.h b/include/linux/mlx5/device.h index 2b90097a6cf9..7b57877e501e 100644 --- a/include/linux/mlx5/device.h +++ b/include/linux/mlx5/device.h @@ -1107,6 +1107,7 @@ enum mlx5_cap_type { MLX5_CAP_TLS, MLX5_CAP_VDPA_EMULATION = 0x13, MLX5_CAP_DEV_EVENT = 0x14, + MLX5_CAP_IPSEC, /* NUM OF CAP Types */ MLX5_CAP_NUM }; @@ -1324,6 +1325,9 @@ enum mlx5_qcam_feature_groups { MLX5_GET64(device_virtio_emulation_cap, \ (mdev)->caps.hca_cur[MLX5_CAP_VDPA_EMULATION], cap) +#define MLX5_CAP_IPSEC(mdev, cap)\ + MLX5_GET(ipsec_cap, (mdev)->caps.hca_cur[MLX5_CAP_IPSEC], cap) + enum { MLX5_CMD_STAT_OK = 0x0, MLX5_CMD_STAT_INT_ERR = 0x1, diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h index 3ad2c51ccde9..cf971d341189 100644 --- a/include/linux/mlx5/mlx5_ifc.h +++ b/include/linux/mlx5/mlx5_ifc.h @@ -886,7 +886,8 @@ struct mlx5_ifc_per_protocol_networking_offload_caps_bits { u8 tunnel_stateless_vxlan_gpe[0x1]; u8 tunnel_stateless_ipv4_over_vxlan[0x1]; u8 tunnel_stateless_ip_over_ip[0x1]; - u8 reserved_at_2a[0x6]; + u8 insert_trailer[0x1]; + u8 reserved_at_2b[0x5]; u8 max_vxlan_udp_ports[0x8]; u8 reserved_at_38[0x6]; u8 max_geneve_opt_len[0x1]; @@ -1100,6 +1101,23 @@ struct mlx5_ifc_tls_cap_bits { u8 reserved_at_20[0x7e0]; }; +struct mlx5_ifc_ipsec_cap_bits { + u8 ipsec_full_offload[0x1]; + u8 ipsec_crypto_offload[0x1]; + u8 ipsec_esn[0x1]; + u8 ipsec_crypto_esp_aes_gcm_256_encrypt[0x1]; + u8 ipsec_crypto_esp_aes_gcm_128_encrypt[0x1]; + u8 ipsec_crypto_esp_aes_gcm_256_decrypt[0x1]; + u8 ipsec_crypto_esp_aes_gcm_128_decrypt[0x1]; + u8 reserved_at_7[0x4]; + u8 log_max_ipsec_offload[0x5]; + u8 reserved_at_10[0x10]; + + u8 min_log_ipsec_full_replay_window[0x8]; + u8 max_log_ipsec_full_replay_window[0x8]; + u8 reserved_at_30[0x7d0]; +}; + enum { MLX5_WQ_TYPE_LINKED_LIST = 0x0, MLX5_WQ_TYPE_CYCLIC = 0x1, @@ -1464,7 +1482,8 @@ struct mlx5_ifc_cmd_hca_cap_bits { u8 reserved_at_460[0x3]; u8 log_max_uctx[0x5]; - u8 reserved_at_468[0x3]; + u8 reserved_at_468[0x2]; + u8 ipsec_offload[0x1]; u8 log_max_umem[0x5]; u8 max_num_eqs[0x10]; @@ -4143,7 +4162,8 @@ enum { MLX5_SET_FTE_MODIFY_ENABLE_MASK_ACTION = 0x0, MLX5_SET_FTE_MODIFY_ENABLE_MASK_FLOW_TAG = 0x1, MLX5_SET_FTE_MODIFY_ENABLE_MASK_DESTINATION_LIST = 0x2, - MLX5_SET_FTE_MODIFY_ENABLE_MASK_FLOW_COUNTERS = 0x3 + MLX5_SET_FTE_MODIFY_ENABLE_MASK_FLOW_COUNTERS = 0x3, + MLX5_SET_FTE_MODIFY_ENABLE_MASK_IPSEC_OBJ_ID = 0x4 }; struct mlx5_ifc_set_fte_out_bits { @@ -10468,10 +10488,62 @@ struct mlx5_ifc_affiliated_event_header_bits { enum { MLX5_HCA_CAP_GENERAL_OBJECT_TYPES_ENCRYPTION_KEY = BIT(0xc), + MLX5_HCA_CAP_GENERAL_OBJECT_TYPES_IPSEC = BIT(0x13), }; enum { MLX5_GENERAL_OBJECT_TYPES_ENCRYPTION_KEY = 0xc, + MLX5_GENERAL_OBJECT_TYPES_IPSEC = 0x13, +}; + +enum { + MLX5_IPSEC_OBJECT_ICV_LEN_16B, + MLX5_IPSEC_OBJECT_ICV_LEN_12B, + MLX5_IPSEC_OBJECT_ICV_LEN_8B, +}; + +struct mlx5_ifc_ipsec_obj_bits { + u8 modify_field_select[0x40]; + u8 full_offload[0x1]; + u8 reserved_at_41[0x1]; + u8 esn_en[0x1]; + u8 esn_overlap[0x1]; + u8 reserved_at_44[0x2]; + u8 icv_length[0x2]; + u8 reserved_at_48[0x4]; + u8 aso_return_reg[0x4]; + u8 reserved_at_50[0x10]; + + u8 esn_msb[0x20]; + + u8 reserved_at_80[0x8]; + u8 dekn[0x18]; + + u8 salt[0x20]; + + u8 implicit_iv[0x40]; + + u8 reserved_at_100[0x700]; +}; + +struct mlx5_ifc_create_ipsec_obj_in_bits { + struct mlx5_ifc_general_obj_in_cmd_hdr_bits general_obj_in_cmd_hdr; + struct mlx5_ifc_ipsec_obj_bits ipsec_object; +}; + +enum { + MLX5_MODIFY_IPSEC_BITMASK_ESN_OVERLAP = BIT(0), + MLX5_MODIFY_IPSEC_BITMASK_ESN_MSB = BIT(1), +}; + +struct mlx5_ifc_query_ipsec_obj_out_bits { + struct mlx5_ifc_general_obj_out_cmd_hdr_bits general_obj_out_cmd_hdr; + struct mlx5_ifc_ipsec_obj_bits ipsec_object; +}; + +struct mlx5_ifc_modify_ipsec_obj_in_bits { + struct mlx5_ifc_general_obj_in_cmd_hdr_bits general_obj_in_cmd_hdr; + struct mlx5_ifc_ipsec_obj_bits ipsec_object; }; struct mlx5_ifc_encryption_key_obj_bits { From patchwork Fri Apr 24 19:45:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 11508969 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A2B901575 for ; Fri, 24 Apr 2020 19:46:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7FFBF215A4 for ; Fri, 24 Apr 2020 19:46:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="suoX3i9t" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729330AbgDXTqC (ORCPT ); Fri, 24 Apr 2020 15:46:02 -0400 Received: from mail-eopbgr70047.outbound.protection.outlook.com ([40.107.7.47]:44128 "EHLO EUR04-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729175AbgDXTqC (ORCPT ); Fri, 24 Apr 2020 15:46:02 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FWqaGzKhYkBjuZw2Zk3U1xHfum0iQ7EJgRQ38A3kgvGMLsorLhhBwjaFyUjzHLVsQNTcrhlf8/MRaSSgblExKjw60ERjR+H5rHVUBc3/GE8mAcOOmJ9xVqvvckd9qNdCryQ2RTtxRxyAGrRVlu0+amBsgsppxNanNzbqoIXQhFw6y/4yslGul0z020llByZKQ8giQbNEwz629u4hCXLy2E6NTx0A0H6W8vzt3Z9urk5lE4tD7tig74mCeqFAobTmtOpJv6uxAZp+szS36O8LPndkSP2wZtzpxcKuGOBjlQRHShy5Kal/HUeTx/2Qg2W4+KMlnm4NGK8X4qHYYjQUIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ku1q8tuB8ZbsGaXmq85ZSceQYsHpXfnUibrTe+fPvvE=; b=BKg6MiJCf+vCUfZN8VC7kfQ3JcDKi0jwwoZ4PBLrXZD2RfxZwNyitV3hW+sUf5C6vTsziPIn6ubCg6rZH6O0jyptZwndsrpEy9E9OdIlY1p133T40+0wpqSbqjIurOCVxAe3BAeYJZPep/7H9BiZt6/iAbr8c/DcFbqa79VBDEy1WrYjkYTEWQv0RoF+qjUTZl6shgeucgSkFWpNH/yap3AtZQcCYRYVu3TcydXrJfXYP1o8nxPG6glpW6AMukWBysABR8b+YmO0YYpfRSS5yI6pCDAJB0OBi0gbBnUWU/Ra3h9cZk3k6tHU9cUVDHDW5+CR4oKvmfrw6aVqv3OuCA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ku1q8tuB8ZbsGaXmq85ZSceQYsHpXfnUibrTe+fPvvE=; b=suoX3i9tvGWsUgzrT3XC7Bh/WSZaXIbgyTOg7ap+TTFDldol0pRxYz9Ry421pVhZD/3jekOi6TXZb0C5X1wCUu/P6MKJ4rCaOOamumhFS5cfKwYUeRevN5l7i/2+fqS53GnHX1ympIMgY2amzu/BP1FsZerV5IQJzJXFb93ZtdU= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=saeedm@mellanox.com; Received: from VI1PR05MB5102.eurprd05.prod.outlook.com (2603:10a6:803:5e::23) by VI1PR05MB5072.eurprd05.prod.outlook.com (2603:10a6:803:61::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.29; Fri, 24 Apr 2020 19:45:47 +0000 Received: from VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::9d19:a564:b84e:7c19]) by VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::9d19:a564:b84e:7c19%7]) with mapi id 15.20.2937.020; Fri, 24 Apr 2020 19:45:47 +0000 From: Saeed Mahameed To: Saeed Mahameed , Leon Romanovsky Cc: netdev@vger.kernel.org, linux-rdma@vger.kernel.org, Erez Shitrit , Ariel Levkovich Subject: [PATCH mlx5-next 3/9] net/mlx5: Use aligned variable while allocating ICM memory Date: Fri, 24 Apr 2020 12:45:04 -0700 Message-Id: <20200424194510.11221-4-saeedm@mellanox.com> X-Mailer: git-send-email 2.25.3 In-Reply-To: <20200424194510.11221-1-saeedm@mellanox.com> References: <20200424194510.11221-1-saeedm@mellanox.com> X-ClientProxiedBy: BYAPR06CA0016.namprd06.prod.outlook.com (2603:10b6:a03:d4::29) To VI1PR05MB5102.eurprd05.prod.outlook.com (2603:10a6:803:5e::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from smtp.office365.com (73.15.39.150) by BYAPR06CA0016.namprd06.prod.outlook.com (2603:10b6:a03:d4::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Fri, 24 Apr 2020 19:45:38 +0000 X-Mailer: git-send-email 2.25.3 X-Originating-IP: [73.15.39.150] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 2198baca-4a97-4213-020d-08d7e888113a X-MS-TrafficTypeDiagnostic: VI1PR05MB5072:|VI1PR05MB5072: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2887; X-Forefront-PRVS: 03838E948C X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR05MB5102.eurprd05.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(10009020)(4636009)(39860400002)(136003)(396003)(376002)(366004)(346002)(6506007)(26005)(2616005)(8936002)(8676002)(316002)(6636002)(36756003)(6666004)(66946007)(66556008)(52116002)(81156014)(478600001)(107886003)(66476007)(6512007)(956004)(5660300002)(110136005)(4326008)(1076003)(54906003)(16526019)(186003)(2906002)(6486002)(86362001)(450100002)(54420400002);DIR:OUT;SFP:1101; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3HE97+seu3u2C8M75YXbe6OGL+fx5gMEOGW1nwPTC4QtbqzUQ3/YXaqD6zryQPi6ymFrYiWsEq7AcNzF4n6zxscfSk5n6YRe8E6RRxoUC918aNCZPu5BhvivNrent79qH/D6p5eocX3Ir05okbiivIF0BQj+DZfVV7XCv5wTfTCfsROL4vwWh6R6D49preqdsNL4H3SIoN5ru52Cjz3GQ9vIluFNQfFdlW2hbKyi95CmywKKeOjiNMtl11D1IkvQXrDtpTHiotwxqMTAnjSFcLVoOduRaTXq9pAhVvGZod6jmtgTGq/u1OuSjAcMC/iFWiwNuq+VMwZkXRgYKLFqIl33eCmlQnWYUNH6g163IALOm3/yPONXelc3inzhvCB28neF5Smv5UEzPfOvOclilwZUKUBo1YPkMveufPy4HnqSKCi+B5CnvZafJ672fMt94ciVO3olwDDaubVo6rC4kOvP4kOGJgGta8fRDGlHhE98wpaioCuuF2J+qOMGd9eK X-MS-Exchange-AntiSpam-MessageData: hxQjr51cSlthcxJITAVfnip+xkA2rlAvcCYQnxlXOI6gDJo3lDjpjDjFjSTa+WruF6bnzt1MKFIHJUZwDHcNkvb069q3XNbv5+sNVUt+LMsmVWUnYDXzP2y5NSWUk7XXryUGrYacw3U7YJX//8MptQ== X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2198baca-4a97-4213-020d-08d7e888113a X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Apr 2020 19:45:40.7479 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 5PKNaUh5psbB/mmy718OtvwaKXre2bV0Bnbr4pi5Y+UJGDemOg9jELUCptxGrdkRzWIAwOMPwsNo/kX853IF7Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB5072 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Erez Shitrit The alignment value is part of the input structure, so use it and spare extra memory allocation when is not needed. Now, using the new ability when allocating icm for Direct-Rule insertion. Signed-off-by: Ariel Levkovich Signed-off-by: Erez Shitrit Signed-off-by: Saeed Mahameed --- drivers/infiniband/hw/mlx5/main.c | 2 +- .../net/ethernet/mellanox/mlx5/core/lib/dm.c | 15 ++++-- .../mellanox/mlx5/core/steering/dr_icm_pool.c | 53 +++++++++---------- include/linux/mlx5/driver.h | 3 +- 4 files changed, 38 insertions(+), 35 deletions(-) diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c index f10675213115..65e0e24d463b 100644 --- a/drivers/infiniband/hw/mlx5/main.c +++ b/drivers/infiniband/hw/mlx5/main.c @@ -2444,7 +2444,7 @@ static int handle_alloc_dm_sw_icm(struct ib_ucontext *ctx, act_size = roundup_pow_of_two(act_size); dm->size = act_size; - err = mlx5_dm_sw_icm_alloc(dev, type, act_size, + err = mlx5_dm_sw_icm_alloc(dev, type, act_size, attr->alignment, to_mucontext(ctx)->devx_uid, &dm->dev_addr, &dm->icm_dm.obj_id); if (err) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/dm.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/dm.c index 6cbccba56f70..3d5e57ff558c 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/lib/dm.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/dm.c @@ -90,7 +90,8 @@ void mlx5_dm_cleanup(struct mlx5_core_dev *dev) } int mlx5_dm_sw_icm_alloc(struct mlx5_core_dev *dev, enum mlx5_sw_icm_type type, - u64 length, u16 uid, phys_addr_t *addr, u32 *obj_id) + u64 length, u32 log_alignment, u16 uid, + phys_addr_t *addr, u32 *obj_id) { u32 num_blocks = DIV_ROUND_UP_ULL(length, MLX5_SW_ICM_BLOCK_SIZE(dev)); u32 out[MLX5_ST_SZ_DW(general_obj_out_cmd_hdr)] = {}; @@ -99,6 +100,7 @@ int mlx5_dm_sw_icm_alloc(struct mlx5_core_dev *dev, enum mlx5_sw_icm_type type, unsigned long *block_map; u64 icm_start_addr; u32 log_icm_size; + u64 align_mask; u32 max_blocks; u64 block_idx; void *sw_icm; @@ -136,11 +138,14 @@ int mlx5_dm_sw_icm_alloc(struct mlx5_core_dev *dev, enum mlx5_sw_icm_type type, return -EOPNOTSUPP; max_blocks = BIT(log_icm_size - MLX5_LOG_SW_ICM_BLOCK_SIZE(dev)); + + if (log_alignment < MLX5_LOG_SW_ICM_BLOCK_SIZE(dev)) + log_alignment = MLX5_LOG_SW_ICM_BLOCK_SIZE(dev); + align_mask = BIT(log_alignment - MLX5_LOG_SW_ICM_BLOCK_SIZE(dev)) - 1; + spin_lock(&dm->lock); - block_idx = bitmap_find_next_zero_area(block_map, - max_blocks, - 0, - num_blocks, 0); + block_idx = bitmap_find_next_zero_area(block_map, max_blocks, 0, + num_blocks, align_mask); if (block_idx < max_blocks) bitmap_set(block_map, diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_icm_pool.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_icm_pool.c index 30d2d7376f56..cc33515b9aba 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_icm_pool.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_icm_pool.c @@ -95,13 +95,12 @@ static int dr_icm_create_dm_mkey(struct mlx5_core_dev *mdev, } static struct mlx5dr_icm_mr * -dr_icm_pool_mr_create(struct mlx5dr_icm_pool *pool, - enum mlx5_sw_icm_type type, - size_t align_base) +dr_icm_pool_mr_create(struct mlx5dr_icm_pool *pool) { struct mlx5_core_dev *mdev = pool->dmn->mdev; + enum mlx5_sw_icm_type dm_type; struct mlx5dr_icm_mr *icm_mr; - size_t align_diff; + size_t log_align_base; int err; icm_mr = kvzalloc(sizeof(*icm_mr), GFP_KERNEL); @@ -111,14 +110,22 @@ dr_icm_pool_mr_create(struct mlx5dr_icm_pool *pool, icm_mr->pool = pool; INIT_LIST_HEAD(&icm_mr->mr_list); - icm_mr->dm.type = type; - - /* 2^log_biggest_table * entry-size * double-for-alignment */ icm_mr->dm.length = mlx5dr_icm_pool_chunk_size_to_byte(pool->max_log_chunk_sz, - pool->icm_type) * 2; + pool->icm_type); + + if (pool->icm_type == DR_ICM_TYPE_STE) { + dm_type = MLX5_SW_ICM_TYPE_STEERING; + log_align_base = ilog2(icm_mr->dm.length); + } else { + dm_type = MLX5_SW_ICM_TYPE_HEADER_MODIFY; + /* Align base is 64B */ + log_align_base = ilog2(DR_ICM_MODIFY_HDR_ALIGN_BASE); + } + icm_mr->dm.type = dm_type; - err = mlx5_dm_sw_icm_alloc(mdev, icm_mr->dm.type, icm_mr->dm.length, 0, - &icm_mr->dm.addr, &icm_mr->dm.obj_id); + err = mlx5_dm_sw_icm_alloc(mdev, icm_mr->dm.type, icm_mr->dm.length, + log_align_base, 0, &icm_mr->dm.addr, + &icm_mr->dm.obj_id); if (err) { mlx5dr_err(pool->dmn, "Failed to allocate SW ICM memory, err (%d)\n", err); goto free_icm_mr; @@ -137,15 +144,18 @@ dr_icm_pool_mr_create(struct mlx5dr_icm_pool *pool, icm_mr->icm_start_addr = icm_mr->dm.addr; - /* align_base is always a power of 2 */ - align_diff = icm_mr->icm_start_addr & (align_base - 1); - if (align_diff) - icm_mr->used_length = align_base - align_diff; + if (icm_mr->icm_start_addr & (BIT(log_align_base) - 1)) { + mlx5dr_err(pool->dmn, "Failed to get Aligned ICM mem (asked: %zu)\n", + log_align_base); + goto free_mkey; + } list_add_tail(&icm_mr->mr_list, &pool->icm_mr_list); return icm_mr; +free_mkey: + mlx5_core_destroy_mkey(mdev, &icm_mr->mkey); free_dm: mlx5_dm_sw_icm_dealloc(mdev, icm_mr->dm.type, icm_mr->dm.length, 0, icm_mr->dm.addr, icm_mr->dm.obj_id); @@ -200,24 +210,11 @@ static int dr_icm_chunks_create(struct mlx5dr_icm_bucket *bucket) struct mlx5dr_icm_pool *pool = bucket->pool; struct mlx5dr_icm_mr *icm_mr = NULL; struct mlx5dr_icm_chunk *chunk; - enum mlx5_sw_icm_type dm_type; - size_t align_base; int i, err = 0; mr_req_size = bucket->num_of_entries * bucket->entry_size; mr_row_size = mlx5dr_icm_pool_chunk_size_to_byte(pool->max_log_chunk_sz, pool->icm_type); - - if (pool->icm_type == DR_ICM_TYPE_STE) { - dm_type = MLX5_SW_ICM_TYPE_STEERING; - /* Align base is the biggest chunk size / row size */ - align_base = mr_row_size; - } else { - dm_type = MLX5_SW_ICM_TYPE_HEADER_MODIFY; - /* Align base is 64B */ - align_base = DR_ICM_MODIFY_HDR_ALIGN_BASE; - } - mutex_lock(&pool->mr_mutex); if (!list_empty(&pool->icm_mr_list)) { icm_mr = list_last_entry(&pool->icm_mr_list, @@ -228,7 +225,7 @@ static int dr_icm_chunks_create(struct mlx5dr_icm_bucket *bucket) } if (!icm_mr || mr_free_size < mr_row_size) { - icm_mr = dr_icm_pool_mr_create(pool, dm_type, align_base); + icm_mr = dr_icm_pool_mr_create(pool); if (!icm_mr) { err = -ENOMEM; goto out_err; diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h index b60e5ab7906b..b46537a81703 100644 --- a/include/linux/mlx5/driver.h +++ b/include/linux/mlx5/driver.h @@ -1080,7 +1080,8 @@ int mlx5_lag_query_cong_counters(struct mlx5_core_dev *dev, struct mlx5_uars_page *mlx5_get_uars_page(struct mlx5_core_dev *mdev); void mlx5_put_uars_page(struct mlx5_core_dev *mdev, struct mlx5_uars_page *up); int mlx5_dm_sw_icm_alloc(struct mlx5_core_dev *dev, enum mlx5_sw_icm_type type, - u64 length, u16 uid, phys_addr_t *addr, u32 *obj_id); + u64 length, u32 log_alignment, u16 uid, + phys_addr_t *addr, u32 *obj_id); int mlx5_dm_sw_icm_dealloc(struct mlx5_core_dev *dev, enum mlx5_sw_icm_type type, u64 length, u16 uid, phys_addr_t addr, u32 obj_id); From patchwork Fri Apr 24 19:45:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 11508971 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 773C11575 for ; Fri, 24 Apr 2020 19:46:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5ADFF215A4 for ; Fri, 24 Apr 2020 19:46:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="hK/ufS9u" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729356AbgDXTqG (ORCPT ); Fri, 24 Apr 2020 15:46:06 -0400 Received: from mail-eopbgr70047.outbound.protection.outlook.com ([40.107.7.47]:44128 "EHLO EUR04-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729198AbgDXTqG (ORCPT ); Fri, 24 Apr 2020 15:46:06 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=O/3y9xrtZArRlNv5JoNYjf4WWBR6KBaa7FHwc0MpghLaWu8ZEUEm7BKnTRdqxr35ZNnX0M9pPdIxlINJwQJMKryJiO82NF79FoibD/g38ehe8qM0ZjJU3qSU64tLLLEYlKd+Ywsbte963P92im8BmEnqYSDOUOvY99qjM1lG9SCcOqrkSoNDLORk1NAAxiFKJna0646vSZnbnprCXhEgj8UFYrcF7fS4Q3mSD42208VLe4GhJ+iKhDgNJO/5tI2gXQ17JbwvnpY7TZb+ptSOLaWQdNocVTY9vp9hsuc6yioVwH6B67txHlq/Kc1N53T5m2cYFm1eygU1k3tMGWLMyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OEJrN/PGhkkaW7cznEmpb9iFURoRRIwSXxuJC9jmBYg=; b=UTTWTvFoITpdKa6hQ/Cr0s35nAnh/0omoKMfKHDZaAuiP1qiRWbkFHG+I32JJy7Fg2xckgfEeUCAbsuwvCWKclFF64ZDitGWnvhNiNhx/zf3kxxtp9wyQN1eMgSPn5cz+ZMRK3EhA6mvdpoTjADjkqFB2NR4HgrOS2Z1wLbYKf+rMeUKyfWLEhw0Gu08izNrVqS7zKVGQ/pohDatpg/lgdmu9PHxE/hnA0nVli9vp+xXgi5LELquk+e5dfzpPnjTudDGjXVJz4mkiNWt02UBmC8UUpAMqKndxY6gXfIPsBawlHcAGhn9BrjKyWXLPikdLL9gne4a9I6XZN6KliCZNw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OEJrN/PGhkkaW7cznEmpb9iFURoRRIwSXxuJC9jmBYg=; b=hK/ufS9uHG7yoBgHDyZWSvg3RHs5zP+g8TrQu8X0Q+EYwBHqSAhNCqhZ5FoJgeH0BuJSXGHJnMGSJ2O58nCxT29rtYS7ZJdBICtSSQ8PqcQSXyg1G3H9rkg9rGFt0PEj3qA0rFxx0rg0//1beccS9xkd7cpjirbykkoaXEidpPw= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=saeedm@mellanox.com; Received: from VI1PR05MB5102.eurprd05.prod.outlook.com (2603:10a6:803:5e::23) by VI1PR05MB5072.eurprd05.prod.outlook.com (2603:10a6:803:61::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.29; Fri, 24 Apr 2020 19:45:50 +0000 Received: from VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::9d19:a564:b84e:7c19]) by VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::9d19:a564:b84e:7c19%7]) with mapi id 15.20.2937.020; Fri, 24 Apr 2020 19:45:50 +0000 From: Saeed Mahameed To: Saeed Mahameed , Leon Romanovsky Cc: netdev@vger.kernel.org, linux-rdma@vger.kernel.org, Raed Salem , Huy Nguyen , Tariq Toukan Subject: [PATCH mlx5-next 4/9] net/mlx5: Refactor imm_inval_pkey field in cqe struct Date: Fri, 24 Apr 2020 12:45:05 -0700 Message-Id: <20200424194510.11221-5-saeedm@mellanox.com> X-Mailer: git-send-email 2.25.3 In-Reply-To: <20200424194510.11221-1-saeedm@mellanox.com> References: <20200424194510.11221-1-saeedm@mellanox.com> X-ClientProxiedBy: BYAPR06CA0016.namprd06.prod.outlook.com (2603:10b6:a03:d4::29) To VI1PR05MB5102.eurprd05.prod.outlook.com (2603:10a6:803:5e::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from smtp.office365.com (73.15.39.150) by BYAPR06CA0016.namprd06.prod.outlook.com (2603:10b6:a03:d4::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Fri, 24 Apr 2020 19:45:41 +0000 X-Mailer: git-send-email 2.25.3 X-Originating-IP: [73.15.39.150] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 521f87ba-a410-4561-a483-08d7e888130e X-MS-TrafficTypeDiagnostic: VI1PR05MB5072:|VI1PR05MB5072: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-Forefront-PRVS: 03838E948C X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR05MB5102.eurprd05.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(10009020)(4636009)(39860400002)(136003)(396003)(376002)(366004)(346002)(6506007)(26005)(2616005)(8936002)(8676002)(316002)(6636002)(36756003)(6666004)(66946007)(66556008)(52116002)(81156014)(478600001)(107886003)(66476007)(6512007)(956004)(5660300002)(110136005)(4326008)(1076003)(54906003)(16526019)(186003)(2906002)(6486002)(86362001)(450100002)(54420400002);DIR:OUT;SFP:1101; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ImGWngsCg17ScigdB0oITEz5wFvOomdO2XDaKbH9TGDQTJj4qrXP4HWY8cOi0rkGMcLzZG728lggr20wshs4S2pBOcFcakeGR0ebg+boJTVvmii6fL3hfud5k36/LWFgloEuaMsZ1kINTjtG+RbR2ydON+M2tVI0jRkYrbcFgftsI/8xg9LdS6MGTIrkuLgZRryerN8KKeMYosaKr2rb5fLduaUdqAIz7hj56rQ6L8Lskxu5mnqc9i9R4dw4VUBVME7mDK3NaF41VtRhO33D55eTmrqI8dKz6IatLYW9xpP9vv7FkIB2oCBL3XkRPiVpiv06d5/nUyZ8j0UFasf6KZVjPSKAcmxZCfFMcnvSa0JAw4rEwi8sbtMaElc6Kj0+MHn87yPZMg0UFtEmDfVlVNmfgrHDdYWO3PHmO7FD2Q7eZifF7WUuWgqc5NJ4RK4DalLjdmtQZrOfx4bMlJ4O/BuqUJZu2xIZLZ7JuLeECs3JAYGwvr0Oc/aCcrBwnm3m X-MS-Exchange-AntiSpam-MessageData: No2y8KXFJlOy9TIlEkypLil0pePM3daiMQAIlHe1sqkuYF4fhKfUlRTp6b+jDhugqK28pHCukYTStdQGOq9AUggs8j/7QLosJrtCwVYbxpvSGsq53E6AgNrQR5eZeGH0ospAQpStBw9SUgJGaagfTw== X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 521f87ba-a410-4561-a483-08d7e888130e X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Apr 2020 19:45:43.7462 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: NB99qC6BGLWoKHTyQMuoYzlKbJnCD4bfAjXqBQM2JzPPz9DYBQRBoQWrGn21ysuMl3a5DZ+/ShS04AO0g/vAGQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB5072 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Raed Salem The imm_inval_pkey field can hold four different types of data, depends on the usage, the data could be one of the below: - Immediate field of the received message - Invalidate rkey - Pkey of the packet - Flow table metadata Current implementation doesn't reflect the intended usage of the field at usage time. Reflect the different types by replace this field with a union, modify code where this field is used to reflect its intended usage. Signed-off-by: Raed Salem Reviewed-by: Huy Nguyen Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed --- drivers/infiniband/hw/mlx5/cq.c | 8 ++++---- drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 2 +- include/linux/mlx5/device.h | 7 ++++++- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/infiniband/hw/mlx5/cq.c b/drivers/infiniband/hw/mlx5/cq.c index 32c05730dfe9..0c18cb6a2f14 100644 --- a/drivers/infiniband/hw/mlx5/cq.c +++ b/drivers/infiniband/hw/mlx5/cq.c @@ -202,7 +202,7 @@ static void handle_responder(struct ib_wc *wc, struct mlx5_cqe64 *cqe, case MLX5_CQE_RESP_WR_IMM: wc->opcode = IB_WC_RECV_RDMA_WITH_IMM; wc->wc_flags = IB_WC_WITH_IMM; - wc->ex.imm_data = cqe->imm_inval_pkey; + wc->ex.imm_data = cqe->immediate; break; case MLX5_CQE_RESP_SEND: wc->opcode = IB_WC_RECV; @@ -214,12 +214,12 @@ static void handle_responder(struct ib_wc *wc, struct mlx5_cqe64 *cqe, case MLX5_CQE_RESP_SEND_IMM: wc->opcode = IB_WC_RECV; wc->wc_flags = IB_WC_WITH_IMM; - wc->ex.imm_data = cqe->imm_inval_pkey; + wc->ex.imm_data = cqe->immediate; break; case MLX5_CQE_RESP_SEND_INV: wc->opcode = IB_WC_RECV; wc->wc_flags = IB_WC_WITH_INVALIDATE; - wc->ex.invalidate_rkey = be32_to_cpu(cqe->imm_inval_pkey); + wc->ex.invalidate_rkey = be32_to_cpu(cqe->inval_rkey); break; } wc->src_qp = be32_to_cpu(cqe->flags_rqpn) & 0xffffff; @@ -227,7 +227,7 @@ static void handle_responder(struct ib_wc *wc, struct mlx5_cqe64 *cqe, g = (be32_to_cpu(cqe->flags_rqpn) >> 28) & 3; wc->wc_flags |= g ? IB_WC_GRH : 0; if (unlikely(is_qp1(qp->ibqp.qp_type))) { - u16 pkey = be32_to_cpu(cqe->imm_inval_pkey) & 0xffff; + u16 pkey = be32_to_cpu(cqe->pkey) & 0xffff; ib_find_cached_pkey(&dev->ib_dev, qp->port, pkey, &wc->pkey_index); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c index 12c5ca5b93ca..5b632434866f 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c @@ -4891,7 +4891,7 @@ bool mlx5e_tc_rep_update_skb(struct mlx5_cqe64 *cqe, reg_c0 = (be32_to_cpu(cqe->sop_drop_qpn) & MLX5E_TC_FLOW_ID_MASK); if (reg_c0 == MLX5_FS_DEFAULT_FLOW_TAG) reg_c0 = 0; - reg_c1 = be32_to_cpu(cqe->imm_inval_pkey); + reg_c1 = be32_to_cpu(cqe->ft_metadata); if (!reg_c0) return true; diff --git a/include/linux/mlx5/device.h b/include/linux/mlx5/device.h index 7b57877e501e..746e17473d72 100644 --- a/include/linux/mlx5/device.h +++ b/include/linux/mlx5/device.h @@ -767,7 +767,12 @@ struct mlx5_cqe64 { u8 l4_l3_hdr_type; __be16 vlan_info; __be32 srqn; /* [31:24]: lro_num_seg, [23:0]: srqn */ - __be32 imm_inval_pkey; + union { + __be32 immediate; + __be32 inval_rkey; + __be32 pkey; + __be32 ft_metadata; + }; u8 rsvd40[4]; __be32 byte_cnt; __be32 timestamp_h; From patchwork Fri Apr 24 19:45:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 11508973 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CDE081575 for ; Fri, 24 Apr 2020 19:46:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B0531215A4 for ; Fri, 24 Apr 2020 19:46:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="BerH3Qg9" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729372AbgDXTqI (ORCPT ); Fri, 24 Apr 2020 15:46:08 -0400 Received: from mail-eopbgr70047.outbound.protection.outlook.com ([40.107.7.47]:44128 "EHLO EUR04-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729175AbgDXTqI (ORCPT ); Fri, 24 Apr 2020 15:46:08 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=m5YHnfyVv7E14puQ/pJLHmqeL/WfXuHtgo1pFs36mCqY35NL2lSvVnPIkagdfHVj3UGo5ry3Zpk2SVBpGP3w5Awmq+h8Wf13wGmc0VeQfiT5KLZA2eXKSfhwdo0O/9YuWsSrRowQxIMLBRzhw45lQO/SmSItY6CF/4IsbXdcgoA7HOlrgbTTkKKSXK09DSqE0rIIRS4Q+9wFEgFrsG3wK3u4wPCISthkAfIxZRQWSaU1IYAk7IPYRwurlivpum8l9XIUnL8ta1fVRtq/KHIDtwfjfnLEfg+GU7yqHpLtlSZyJkENJ7Knroq9gX6DRywBnsDzgybEXLh9sv9NYg9miA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=a5xRLFA1Tle0XqLn/wfcUDVCWJTjiLV5LVbyE3WW3F0=; b=R+2LWBwkSVTSZf6sBrMo/mxm+DyfHepZ6Jhg0vZyPUTmqC4RPAI8spRDGFMWRAaxhIA8/2ywpD5rS3/YHzNt7UlrZEiFPYwDVBgV7k+oTx36po2uxPi8XaH4JySO1yl2cHisciohyUxBViUpIQUmdfG/ExmKsFBcvYXVs62VeqTSj90NFrNbe49t6rLjysJt5r9Ig2VBB6o3K9Pa6ad2pESy3b+4tYAjPu9gD6cR8S/nl2XPGjpV+BEERkd1fIVCqzuEpYAZ6vRgKulK0+6l8B8Ln0EOEjmyTZb2TVJuhX5P1sQn0yQWyz3JNQIr5kgENms2EFAovtSVRv0R2gOdPQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=a5xRLFA1Tle0XqLn/wfcUDVCWJTjiLV5LVbyE3WW3F0=; b=BerH3Qg9YOEo9QlRTyeWZPkc7YkHN0kxVyTKLSz3ktXObv1PMvqElR9+J8mTJ4U3b19J4r9I04+Mj5LeXGN0OBJL/9tCAInp2xx6P6QcW3AwXbk6PPUd1WV9kFhfYfR0KxmIX/RPUbM41125tCOPzt9S2UX7mvJFW12aPc0KFiI= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=saeedm@mellanox.com; Received: from VI1PR05MB5102.eurprd05.prod.outlook.com (2603:10a6:803:5e::23) by VI1PR05MB5072.eurprd05.prod.outlook.com (2603:10a6:803:61::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.29; Fri, 24 Apr 2020 19:45:52 +0000 Received: from VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::9d19:a564:b84e:7c19]) by VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::9d19:a564:b84e:7c19%7]) with mapi id 15.20.2937.020; Fri, 24 Apr 2020 19:45:52 +0000 From: Saeed Mahameed To: Saeed Mahameed , Leon Romanovsky Cc: netdev@vger.kernel.org, linux-rdma@vger.kernel.org, Moshe Shemesh , Tariq Toukan Subject: [PATCH mlx5-next 5/9] net/mlx5: Add structure layout and defines for MFRL register Date: Fri, 24 Apr 2020 12:45:06 -0700 Message-Id: <20200424194510.11221-6-saeedm@mellanox.com> X-Mailer: git-send-email 2.25.3 In-Reply-To: <20200424194510.11221-1-saeedm@mellanox.com> References: <20200424194510.11221-1-saeedm@mellanox.com> X-ClientProxiedBy: BYAPR06CA0016.namprd06.prod.outlook.com (2603:10b6:a03:d4::29) To VI1PR05MB5102.eurprd05.prod.outlook.com (2603:10a6:803:5e::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from smtp.office365.com (73.15.39.150) by BYAPR06CA0016.namprd06.prod.outlook.com (2603:10b6:a03:d4::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Fri, 24 Apr 2020 19:45:44 +0000 X-Mailer: git-send-email 2.25.3 X-Originating-IP: [73.15.39.150] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: fecf1454-f203-44eb-56f0-08d7e88814b9 X-MS-TrafficTypeDiagnostic: VI1PR05MB5072:|VI1PR05MB5072: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5236; X-Forefront-PRVS: 03838E948C X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR05MB5102.eurprd05.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(10009020)(4636009)(39860400002)(136003)(396003)(376002)(366004)(346002)(6506007)(26005)(2616005)(8936002)(8676002)(316002)(6636002)(36756003)(6666004)(66946007)(66556008)(52116002)(81156014)(478600001)(107886003)(66476007)(6512007)(956004)(5660300002)(110136005)(4326008)(1076003)(54906003)(16526019)(186003)(2906002)(6486002)(86362001)(450100002)(54420400002);DIR:OUT;SFP:1101; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LD01Hx++sexolPrX7qZJ199xqKpIp0GHcDYinorsbZfsia1isOBLdT+izz/v2QrtuNfFkfx8rQ3wKQaDizIqlC7VAu6VamxsSye7tlVT8CwKF+3mCOs4E7XoHGaGA46AIu6PRImhl1CNnE5uNlvWc2Fm0VO4bIiLiXn3jJFp3TnkxHQcUPPA6D1acSKGz1MDEZO75vj9Yv6quL7FNeRiPd1hmaWSKIEcchm5+YkwSzOoehogSji7VA+tMDd5BsvsVthzf4lkgtZjUYDzru2Z46fJ778mXBkkwH95Qqc+6fqwRNuoQ2A7ZmPCZQnLUzTo3hio6c8vp2KM8OJ8cQozuPovHzO1BruykMINKsoTD12es95jD3Lny9C4X+/J98ROgKJ8akxEtH2Oro+AryMdQBBk/81cLTohZW5sj8v6rcEr7nLdC5UUq1VufQGB4xismjqP8cvvSacFv8IL9aoG5J0KUY9DKMEaBwuli555z78xQu7DgqSRO80L8NQGabcV X-MS-Exchange-AntiSpam-MessageData: qZeNH+pEzzY3rFTZTIwSRmRZbTXycydaDhQxn8unK1fwpu+80ku/l2VmlSzGR+LBc6J3ar690VI+At1HIPCXNWhmksJ/s3LgPS9gmkV+c9gyG9IBBihEL5rk/Q7278hi0JvQiPwD0YmKKSsghfv+QA== X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: fecf1454-f203-44eb-56f0-08d7e88814b9 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Apr 2020 19:45:46.3907 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: zmHIcjEWx7/Ae0tZCpzUlc2yY8R8nLPRQFGowvq69fU+YaKz3W8QEpHwieeLAeFmo4+cC2VnWsOMBhC7ZotS9g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB5072 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Moshe Shemesh Add needed structure layouts and defines for MFRL (Management Firmware Reset Level) register. This structure will be used for the firmware upgrade and reset flow in the downstream patches. Signed-off-by: Moshe Shemesh Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed --- include/linux/mlx5/driver.h | 1 + include/linux/mlx5/mlx5_ifc.h | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h index b46537a81703..d82dbbab8179 100644 --- a/include/linux/mlx5/driver.h +++ b/include/linux/mlx5/driver.h @@ -130,6 +130,7 @@ enum { MLX5_REG_NODE_DESC = 0x6001, MLX5_REG_HOST_ENDIANNESS = 0x7004, MLX5_REG_MCIA = 0x9014, + MLX5_REG_MFRL = 0x9028, MLX5_REG_MLCR = 0x902b, MLX5_REG_MTRC_CAP = 0x9040, MLX5_REG_MTRC_CONF = 0x9041, diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h index cf971d341189..9e6a3cec1e32 100644 --- a/include/linux/mlx5/mlx5_ifc.h +++ b/include/linux/mlx5/mlx5_ifc.h @@ -9703,6 +9703,29 @@ struct mlx5_ifc_mcda_reg_bits { u8 data[0][0x20]; }; +enum { + MLX5_MFRL_REG_RESET_TYPE_FULL_CHIP = BIT(0), + MLX5_MFRL_REG_RESET_TYPE_NET_PORT_ALIVE = BIT(1), +}; + +enum { + MLX5_MFRL_REG_RESET_LEVEL0 = BIT(0), + MLX5_MFRL_REG_RESET_LEVEL3 = BIT(3), + MLX5_MFRL_REG_RESET_LEVEL6 = BIT(6), +}; + +struct mlx5_ifc_mfrl_reg_bits { + u8 reserved_at_0[0x20]; + + u8 reserved_at_20[0x2]; + u8 pci_sync_for_fw_update_start[0x1]; + u8 pci_sync_for_fw_update_resp[0x2]; + u8 rst_type_sel[0x3]; + u8 reserved_at_28[0x8]; + u8 reset_type[0x8]; + u8 reset_level[0x8]; +}; + struct mlx5_ifc_mirc_reg_bits { u8 reserved_at_0[0x18]; u8 status_code[0x8]; @@ -9766,6 +9789,7 @@ union mlx5_ifc_ports_control_registers_document_bits { struct mlx5_ifc_mcc_reg_bits mcc_reg; struct mlx5_ifc_mcda_reg_bits mcda_reg; struct mlx5_ifc_mirc_reg_bits mirc_reg; + struct mlx5_ifc_mfrl_reg_bits mfrl_reg; u8 reserved_at_0[0x60e0]; }; From patchwork Fri Apr 24 19:45:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 11508975 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 745D21575 for ; Fri, 24 Apr 2020 19:46:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 56BBF215A4 for ; Fri, 24 Apr 2020 19:46:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="Mz6STkeB" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729387AbgDXTqN (ORCPT ); Fri, 24 Apr 2020 15:46:13 -0400 Received: from mail-eopbgr70047.outbound.protection.outlook.com ([40.107.7.47]:44128 "EHLO EUR04-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729198AbgDXTqL (ORCPT ); Fri, 24 Apr 2020 15:46:11 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bZOEm145LLNWbKGS3/E5GZPV1s/dKcQi0n20ub8tRoI5/KPLqFTWonYnTEHwi/Vhd0aqDgTqFvogljeplOVIWM8utNvNkpKgkemve0NvEE131NToI9Cbuu8gBYK37K5GVJiSLTukyiKnV2Uf/FYJNTS4rQ9VTfDT67nZPFnVD5arJ1Bj6J4EUbt90Q/DGrSZb15ILBmJ7Sm2xvt+1bw3qylqMgEa1JeHJlQRyWmhJG1okntMRdH6s6bLM4/Z3YDYOk6e0PT7I+CHV+I+i9os8v/yLunlxrtf+Be34QNddxUdDMpfbNoeI55usl/Uei/LtAFayvwIG195gGfrdOdJaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=c3g4qVwpZ6o5t7fM1e0WYB+dM1B1DYCfi0O8RDyY9DE=; b=XtJxICh6EM+HOKE037YjMAbTWFOKvgN3pzbuBG8Sb+5tHcwx3s8zomjusiG/LNqMNp9kBaouRZ2pyHxvdq2gPGuPG+Lyr+ecOBG5PRq3Ws3Ls/Kqu9yh/y0S1KScX2yAWc4IjDZozchKJN75G6/X9Er2sJJ4gAMKP6ybKPfI+F8Bqc7jrRvQJIPebomt1pwQp8Y9DNtBFYqavebGqKJk4/2CteXl2J4NQ1Zkgt4m8gvZupNrwFUDpPGhugNGs29dvpfsUOrpxEEnsjJ7o7NwgEYTVHW8LVOt4YutZaezL5NJig56btZOAPisiP3tE8MIVd07TXb2mOOvaDdOITeJ8g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=c3g4qVwpZ6o5t7fM1e0WYB+dM1B1DYCfi0O8RDyY9DE=; b=Mz6STkeBk73E4o4OKJTbMjXBewRDELfZVu9fKU0ur8J58Ak1DbXMs05vKEW5KlPK81aSbzw3G2XQCLC+BPRhCexKoThDqh/4XxLV8ldHQW79HNjF83XbaMyrrcmwdncHZhdbiuLyQEq8A1ZP2TGPSmnoCAzA54rjKGzku4XdP9g= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=saeedm@mellanox.com; Received: from VI1PR05MB5102.eurprd05.prod.outlook.com (2603:10a6:803:5e::23) by VI1PR05MB5072.eurprd05.prod.outlook.com (2603:10a6:803:61::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.29; Fri, 24 Apr 2020 19:45:53 +0000 Received: from VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::9d19:a564:b84e:7c19]) by VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::9d19:a564:b84e:7c19%7]) with mapi id 15.20.2937.020; Fri, 24 Apr 2020 19:45:53 +0000 From: Saeed Mahameed To: Saeed Mahameed , Leon Romanovsky Cc: netdev@vger.kernel.org, linux-rdma@vger.kernel.org, Moshe Shemesh , Tariq Toukan Subject: [PATCH mlx5-next 6/9] net/mlx5: Add structure and defines for pci sync for fw update event Date: Fri, 24 Apr 2020 12:45:07 -0700 Message-Id: <20200424194510.11221-7-saeedm@mellanox.com> X-Mailer: git-send-email 2.25.3 In-Reply-To: <20200424194510.11221-1-saeedm@mellanox.com> References: <20200424194510.11221-1-saeedm@mellanox.com> X-ClientProxiedBy: BYAPR06CA0016.namprd06.prod.outlook.com (2603:10b6:a03:d4::29) To VI1PR05MB5102.eurprd05.prod.outlook.com (2603:10a6:803:5e::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from smtp.office365.com (73.15.39.150) by BYAPR06CA0016.namprd06.prod.outlook.com (2603:10b6:a03:d4::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Fri, 24 Apr 2020 19:45:47 +0000 X-Mailer: git-send-email 2.25.3 X-Originating-IP: [73.15.39.150] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: c0314a83-0235-42d2-30fb-08d7e888165b X-MS-TrafficTypeDiagnostic: VI1PR05MB5072:|VI1PR05MB5072: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:82; X-Forefront-PRVS: 03838E948C X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR05MB5102.eurprd05.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(10009020)(4636009)(39860400002)(136003)(396003)(376002)(366004)(346002)(6506007)(26005)(2616005)(8936002)(8676002)(316002)(6636002)(36756003)(6666004)(15650500001)(66946007)(66556008)(52116002)(81156014)(478600001)(107886003)(66476007)(6512007)(956004)(5660300002)(110136005)(4326008)(1076003)(54906003)(16526019)(186003)(2906002)(6486002)(86362001)(450100002)(54420400002);DIR:OUT;SFP:1101; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KvPxjlSP9qdTxyUuilalENh1hXmzIac+7QQ/U6pHTFbxB6bW1TT/Q7qNPd+2kO65zT5pgW33Q9yh0U1qkWhfh8p1uyKpo2bdChQYzbyqAaMGaS1iatvHHFPF8wo/V6V023NR4QtnXhKLrZGfz0tOVOp1nPGJ/wPB7NXLGG8VJxMhopjEOUEeYGDZfy0MXkakGEO9qkBTEghW+H3A0kZHHotP4F+hLHm9eeJYzOFiNXYgCAKPy1Uu6UrrBdwqhWegHjUZU3c3r+ODf5856iEm6PhxXdz9nsacWFevKMTLD7oQY3OueduMMgPfPRlv3S/Bo73mp691ipowjMBnP3AsvX4SDIxNUMv13RwMsM6KUtvjat0quf9xqhfxNaeTUIU8OIcHVCmCKg/+fZ/8NMhqGK5T4jzaFxRlvTpAiMF63UPmT6BHaKHdV7kb6BHTfhkWqdNEN+27Gf+d8Fr8fS06E2neivSLUfMmvpseKGO+Rkv6FGYjrzTf7w7P2SLSjh+G X-MS-Exchange-AntiSpam-MessageData: 3BjqWjuKYOvbAj11y/K9XRcu57JBxJBuvUTp2kJe15k0wwsgTIldAiJdUjcbVxE6GN6v2oytiYHnNpn/XqOvTjo8KUGAzljUQURq+hxhQOIcbfq0gUt0jmIEVex3SREB2Mccf7NO2oqkYY1i7ZjG2g== X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: c0314a83-0235-42d2-30fb-08d7e888165b X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Apr 2020 19:45:49.9727 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: UnODygRqw1BsG76Qjx3svacpZ4vwvAQgPuLP+FT1zr9Naa2aqtlhfiHnbdu/8KB+Ed+g+xV2W2gxMhMJ2ku85Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB5072 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Moshe Shemesh Add needed structure layouts and defines for pci sync for fw update event. The downstream patches will include event handlers for this event type. Signed-off-by: Moshe Shemesh Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed --- include/linux/mlx5/device.h | 15 +++++++++++++++ include/linux/mlx5/mlx5_ifc.h | 4 +++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/include/linux/mlx5/device.h b/include/linux/mlx5/device.h index 746e17473d72..de93f0b67973 100644 --- a/include/linux/mlx5/device.h +++ b/include/linux/mlx5/device.h @@ -364,6 +364,7 @@ enum { enum { MLX5_GENERAL_SUBTYPE_DELAY_DROP_TIMEOUT = 0x1, MLX5_GENERAL_SUBTYPE_PCI_POWER_CHANGE_EVENT = 0x5, + MLX5_GENERAL_SUBTYPE_PCI_SYNC_FOR_FW_UPDATE_EVENT = 0x8, }; enum { @@ -689,6 +690,19 @@ struct mlx5_eqe_temp_warning { __be64 sensor_warning_lsb; } __packed; +#define SYNC_RST_STATE_MASK 0xf + +enum sync_rst_state_type { + MLX5_SYNC_RST_STATE_RESET_REQUEST = 0x0, + MLX5_SYNC_RST_STATE_RESET_NOW = 0x1, + MLX5_SYNC_RST_STATE_RESET_ABORT = 0x2, +}; + +struct mlx5_eqe_sync_fw_update { + u8 reserved_at_0[3]; + u8 sync_rst_state; +}; + union ev_data { __be32 raw[7]; struct mlx5_eqe_cmd cmd; @@ -707,6 +721,7 @@ union ev_data { struct mlx5_eqe_dct dct; struct mlx5_eqe_temp_warning temp_warning; struct mlx5_eqe_xrq_err xrq_err; + struct mlx5_eqe_sync_fw_update sync_fw_update; } __packed; struct mlx5_eqe { diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h index 9e6a3cec1e32..058ded202b65 100644 --- a/include/linux/mlx5/mlx5_ifc.h +++ b/include/linux/mlx5/mlx5_ifc.h @@ -1317,7 +1317,9 @@ struct mlx5_ifc_cmd_hca_cap_bits { u8 wol_p[0x1]; u8 stat_rate_support[0x10]; - u8 reserved_at_1f0[0xc]; + u8 reserved_at_1f0[0x1]; + u8 pci_sync_for_fw_update_event[0x1]; + u8 reserved_at_1f2[0xa]; u8 cqe_version[0x4]; u8 compact_address_vector[0x1]; From patchwork Fri Apr 24 19:45:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 11508977 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 88EEA15AB for ; Fri, 24 Apr 2020 19:46:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7078E20736 for ; Fri, 24 Apr 2020 19:46:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="jwKOBEqO" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729405AbgDXTqP (ORCPT ); Fri, 24 Apr 2020 15:46:15 -0400 Received: from mail-eopbgr70047.outbound.protection.outlook.com ([40.107.7.47]:44128 "EHLO EUR04-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729389AbgDXTqP (ORCPT ); Fri, 24 Apr 2020 15:46:15 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DpuV0QTtTjIBLTh8vPC4juCqNuOBHXePImzu64Z+/WauYC3DfLUDqpCf14YlyUAMSNOi1y3cwsAoZAGsr/ZtU6A3mDTtS3t8O02b+NoWz4kZEeTczl/eye25iIgQZ4hd+Q4Zl/U9g5qEqcOaetyY0BnfdKusQKWqix0CWyXlRO3WUsZ2xKJ/ZSrULNpwcGaO2V3BG8B4BDkj0UKSYTt3Ge7Qc6TXT/BocJw9KGWDQA2cpiZ07k7CslMjubQnGV9m33S/ufc5q44aFFVu1PlfLXq7Q2xR9afl6WBVrFZDGfazXEFafZ0zYek6hoygvUMurXaQiyTksyEeFrb5NAX0lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8cVfc70a0WP2X/neLjKcF1OOT1y9XUbAfiAEafxI7SM=; b=lN0BxBeuHv92N6Esnx+Q2Xp7hw5dT75VdlD7SJmgthXEi5HUFQl4TxTt8ZxyECGSZBaYPoNZAso0yqgoo8JqwOPi6ov7EOaY0aTs1rTIFAoGqNfRKNnN3inUwYwaizYcOsMbNsauHu8S9zGanFWsJQ9e9fVmpV2O7wgz1w2bfwE8+T1t0EWEcFt8yo+Ko10hlQgX7AgoTm5PKUx9ciyeFZkfFQx0+57QUQHDq5xjsvhpvcOZNb+W3M0IZyU5Z0GK2Sk30fV3ykuGqYKu43CC+/awnHnEYuNfejciq99++nFj90WaKp4n+Jen48D755awRarLjzQ8Cg4aBZPvU7YZIQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8cVfc70a0WP2X/neLjKcF1OOT1y9XUbAfiAEafxI7SM=; b=jwKOBEqOf5aou0RHp9jLCSptqYvzdvBpFv/YL6tUtExlv1N9dB2MLdflVVRpn1AeruvyjdZ/c8HgkXWhyLvXJXS+bZLLYXbgLqZtskA3JWmunQbtLP9wYiot5JtUEVNBn7ECqZs/bFnfvBHbmiiRvwt2BiSxwz3g2ou7e7rd3QM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=saeedm@mellanox.com; Received: from VI1PR05MB5102.eurprd05.prod.outlook.com (2603:10a6:803:5e::23) by VI1PR05MB5072.eurprd05.prod.outlook.com (2603:10a6:803:61::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.29; Fri, 24 Apr 2020 19:45:55 +0000 Received: from VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::9d19:a564:b84e:7c19]) by VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::9d19:a564:b84e:7c19%7]) with mapi id 15.20.2937.020; Fri, 24 Apr 2020 19:45:54 +0000 From: Saeed Mahameed To: Saeed Mahameed , Leon Romanovsky Cc: netdev@vger.kernel.org, linux-rdma@vger.kernel.org, Tariq Toukan , Maxim Mikityanskiy , Boris Pismenny Subject: [PATCH mlx5-next 7/9] net/mlx5: Introduce TLS RX offload hardware bits Date: Fri, 24 Apr 2020 12:45:08 -0700 Message-Id: <20200424194510.11221-8-saeedm@mellanox.com> X-Mailer: git-send-email 2.25.3 In-Reply-To: <20200424194510.11221-1-saeedm@mellanox.com> References: <20200424194510.11221-1-saeedm@mellanox.com> X-ClientProxiedBy: BYAPR06CA0016.namprd06.prod.outlook.com (2603:10b6:a03:d4::29) To VI1PR05MB5102.eurprd05.prod.outlook.com (2603:10a6:803:5e::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from smtp.office365.com (73.15.39.150) by BYAPR06CA0016.namprd06.prod.outlook.com (2603:10b6:a03:d4::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Fri, 24 Apr 2020 19:45:52 +0000 X-Mailer: git-send-email 2.25.3 X-Originating-IP: [73.15.39.150] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: bc7e9a3c-328c-4c26-5291-08d7e8881991 X-MS-TrafficTypeDiagnostic: VI1PR05MB5072:|VI1PR05MB5072: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:454; X-Forefront-PRVS: 03838E948C X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR05MB5102.eurprd05.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(10009020)(4636009)(39860400002)(136003)(396003)(376002)(366004)(346002)(6506007)(26005)(2616005)(8936002)(8676002)(316002)(6636002)(36756003)(6666004)(66946007)(66556008)(52116002)(81156014)(478600001)(107886003)(66476007)(6512007)(956004)(5660300002)(110136005)(4326008)(1076003)(54906003)(16526019)(186003)(2906002)(6486002)(86362001)(450100002)(54420400002);DIR:OUT;SFP:1101; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3OJscuoONR3yEh5reRJfW01kMStytryb/K0bJsDjNDJk2HyrPxdthBJwCW0rcvFKuVS3L5mOw0MEFDHM7qVepGBQ9prMp23fjz8z24SKgCoqhOr34vhm8zVRnxelx558I5gNWdOKiyhLxvYJvyzAWUzLKJusJiGXfoN3BDbfziV7wI6ufWrxVc/7x8MXZ0MGaOgttfvCSDVmsL/GzA5IJhQPn415z/VXR3hD3gduAr/FLvvUDqk4bOe67+TfgmuVJFcozU+H+KmpgZg6lBoSnJGCK3nnkZ2gGarZBL3kdhQyqJgJXZk2RIEE3KZAJt+OkBOd0U2SYytZPgMw8zo3ypX8y4BAWGz0G4IF7/y6SlJwepeRE8p/WTHOZ7vL81dqBrH6kVJCe+63ncxRk/wWEnLHVhu3wUUBuye77pFLvdH8AxWGLsJ7REuWfj3Fpy9FQpBnSVuH9Z4HVsnnCxSml7ZbysqiO8uAFybByQBXPIvkont/hViZ6tuwrq1Hxmy0 X-MS-Exchange-AntiSpam-MessageData: iiyQLcp8JhRndnwiUHJtyEOr85HVdRbU3LY7AR2EG2i1WUFKPoog8fQnpGjga2cQX/+xAVbuJ21bq58tTwJVoAZreNe55o67AKYI4dCtL8xwo5QPmbZOSKxvBLoJNeJRJ4fstRagBWj/zU/CStbzwg== X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: bc7e9a3c-328c-4c26-5291-08d7e8881991 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Apr 2020 19:45:54.1013 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: UGsuiqzcmOq+nutqJ6Qa5J73hkYZ2eYrFRQWcuTqb8XhyA75x6Jsot9RUm4GQO5Df3zg8Od3UTVA9Oqb3ztTiQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB5072 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Tariq Toukan Add TLS RX offload related IFC hardware fields and enumerations. Signed-off-by: Tariq Toukan Reviewed-by: Maxim Mikityanskiy Reviewed-by: Boris Pismenny Signed-off-by: Saeed Mahameed --- include/linux/mlx5/device.h | 18 ++++++++++++++++-- include/linux/mlx5/mlx5_ifc.h | 5 +++-- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/include/linux/mlx5/device.h b/include/linux/mlx5/device.h index de93f0b67973..1bc27aca648b 100644 --- a/include/linux/mlx5/device.h +++ b/include/linux/mlx5/device.h @@ -450,10 +450,12 @@ enum { enum { MLX5_OPC_MOD_TLS_TIS_STATIC_PARAMS = 0x1, + MLX5_OPC_MOD_TLS_TIR_STATIC_PARAMS = 0x2, }; enum { MLX5_OPC_MOD_TLS_TIS_PROGRESS_PARAMS = 0x1, + MLX5_OPC_MOD_TLS_TIR_PROGRESS_PARAMS = 0x2, }; enum { @@ -764,7 +766,7 @@ struct mlx5_err_cqe { }; struct mlx5_cqe64 { - u8 outer_l3_tunneled; + u8 tls_outer_l3_tunneled; u8 rsvd0; __be16 wqe_id; u8 lro_tcppsh_abort_dupack; @@ -854,7 +856,12 @@ static inline u8 get_cqe_l3_hdr_type(struct mlx5_cqe64 *cqe) static inline bool cqe_is_tunneled(struct mlx5_cqe64 *cqe) { - return cqe->outer_l3_tunneled & 0x1; + return cqe->tls_outer_l3_tunneled & 0x1; +} + +static inline u8 get_cqe_tls_offload(struct mlx5_cqe64 *cqe) +{ + return (cqe->tls_outer_l3_tunneled >> 3) & 0x3; } static inline bool cqe_has_vlan(struct mlx5_cqe64 *cqe) @@ -942,6 +949,13 @@ enum { CQE_L4_OK = 1 << 2, }; +enum { + CQE_TLS_OFFLOAD_NOT_DECRYPTED = 0x0, + CQE_TLS_OFFLOAD_DECRYPTED = 0x1, + CQE_TLS_OFFLOAD_RESYNC = 0x2, + CQE_TLS_OFFLOAD_ERROR = 0x3, +}; + struct mlx5_sig_err_cqe { u8 rsvd0[16]; __be32 expected_trans_sig; diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h index 058ded202b65..6a6bb5dc7916 100644 --- a/include/linux/mlx5/mlx5_ifc.h +++ b/include/linux/mlx5/mlx5_ifc.h @@ -1491,7 +1491,7 @@ struct mlx5_ifc_cmd_hca_cap_bits { u8 reserved_at_480[0x1]; u8 tls_tx[0x1]; - u8 reserved_at_482[0x1]; + u8 tls_rx[0x1]; u8 log_max_l2_table[0x5]; u8 reserved_at_488[0x8]; u8 log_uar_page_sz[0x10]; @@ -3136,7 +3136,8 @@ struct mlx5_ifc_tirc_bits { u8 reserved_at_0[0x20]; u8 disp_type[0x4]; - u8 reserved_at_24[0x1c]; + u8 tls_en[0x1]; + u8 reserved_at_25[0x1b]; u8 reserved_at_40[0x40]; From patchwork Fri Apr 24 19:45:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 11508981 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8482D14B4 for ; Fri, 24 Apr 2020 19:46:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6CE70215A4 for ; Fri, 24 Apr 2020 19:46:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="tURRT9Tv" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725970AbgDXTqV (ORCPT ); Fri, 24 Apr 2020 15:46:21 -0400 Received: from mail-eopbgr70047.outbound.protection.outlook.com ([40.107.7.47]:44128 "EHLO EUR04-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729389AbgDXTqV (ORCPT ); Fri, 24 Apr 2020 15:46:21 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=B+GBisU3Mbx7XyzolMcyzxqixl/D8rns3s3rd/lAyfAAWvSSbDgqOMkBNl5ROnVV/vfwzIsMrBw/Iat8iXyxURPI/Ooe+P3yfkAnvjjEVsz8oiBX8DoKuBnsstqbI5XmUzrjMeTTttHe3b82mAp2yxCdRcxSuA8oC8nnOSFwGCiC+LkpA3a0ryqPFMHc4HF7D0I7jnR3gkCg5jWGIf/ggBEphhp3x2jhi2OBATfIEJDj6Lfdv/o9RozWet7P/kYB7HXkf8cDMO3OqUIA6i9D32eARnIElHSh3GDdU4ZVEBHtApOrMvgRTfrvXDw2bnM5B955h7at8Pe5zfrXr0gL0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sUSwSsZAFxCJJ3OMp1P/ZuH3miNIosZvgho+7sqr6ao=; b=nEn2qtLYfeeDYuM6TJfyscGpD59w+7fduyeNiofiblVqzW6fSEQI0CL3JMb3Qx7dwb/vCEt+Qdm4ItgYqgsQN4HlCqqTJyR3QuMfj9aOCe85dPouCafJelfQpBDVjXRR/HoiVRxVNttqXfXGHOXYSOL90j2nVVFXl6vFNoXNnjpPMVKCLYcBZtVNa+QDMBAMiOu6ept3cQQASUbjurjlgalU+B5Vgng/ZVzP1vIukgyOLgiN8VSGUcVG+Cg0VprRdOd/7wI81aalJq5hoxvvh3oLCjhSXn0jHTJyiYCxbHCrFRbpwXdWAaKqI4Sf8YBkqeoTzLM7K7ZQWC0xqNatkQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sUSwSsZAFxCJJ3OMp1P/ZuH3miNIosZvgho+7sqr6ao=; b=tURRT9TvL337NRrDw0zrEj/4RC5xKN9UbfWwqBjvglTQiSDit9qXKqPGqQO0u6ZbxD74wnIjsbYYIHkSUlw4KZ+U0sTE7BKbz0da6QAttcBlIwi7KbGjfZk6W/wvWz73d4nthhPzRjUQZjREU8LDr62qn6paP52VE7T+y/yDAOk= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=saeedm@mellanox.com; Received: from VI1PR05MB5102.eurprd05.prod.outlook.com (2603:10a6:803:5e::23) by VI1PR05MB5072.eurprd05.prod.outlook.com (2603:10a6:803:61::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.29; Fri, 24 Apr 2020 19:45:59 +0000 Received: from VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::9d19:a564:b84e:7c19]) by VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::9d19:a564:b84e:7c19%7]) with mapi id 15.20.2937.020; Fri, 24 Apr 2020 19:45:59 +0000 From: Saeed Mahameed To: Saeed Mahameed , Leon Romanovsky Cc: netdev@vger.kernel.org, linux-rdma@vger.kernel.org, Eran Ben Elisha , Moshe Shemesh Subject: [PATCH mlx5-next 8/9] net/mlx5: Add release all pages capability bit Date: Fri, 24 Apr 2020 12:45:09 -0700 Message-Id: <20200424194510.11221-9-saeedm@mellanox.com> X-Mailer: git-send-email 2.25.3 In-Reply-To: <20200424194510.11221-1-saeedm@mellanox.com> References: <20200424194510.11221-1-saeedm@mellanox.com> X-ClientProxiedBy: BYAPR06CA0016.namprd06.prod.outlook.com (2603:10b6:a03:d4::29) To VI1PR05MB5102.eurprd05.prod.outlook.com (2603:10a6:803:5e::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from smtp.office365.com (73.15.39.150) by BYAPR06CA0016.namprd06.prod.outlook.com (2603:10b6:a03:d4::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Fri, 24 Apr 2020 19:45:56 +0000 X-Mailer: git-send-email 2.25.3 X-Originating-IP: [73.15.39.150] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: bfe163c1-f5ef-4202-bcd2-08d7e8881bde X-MS-TrafficTypeDiagnostic: VI1PR05MB5072:|VI1PR05MB5072: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2582; X-Forefront-PRVS: 03838E948C X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR05MB5102.eurprd05.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(10009020)(4636009)(39860400002)(136003)(396003)(376002)(366004)(346002)(6506007)(26005)(4744005)(2616005)(8936002)(8676002)(316002)(6636002)(36756003)(6666004)(66946007)(66556008)(52116002)(81156014)(478600001)(107886003)(66476007)(6512007)(956004)(5660300002)(110136005)(4326008)(1076003)(54906003)(16526019)(186003)(2906002)(6486002)(86362001)(450100002)(54420400002);DIR:OUT;SFP:1101; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hUMSJ6EgfAyQVh2eDGUeejf4utLLQV/8cKiL8ZSqL99YG3dCI2+KzKUm4mpp8PyTQLnQQUAxznWaTO8Gp2pHNX9z/18qcJXmVx9Bh27u72ZNanqgRA6PAeCYJIZ7LgBlC+ZoFMn9fOwrC04v7al4laJNwNQnw8MDaRlssQEslessc5zCQ3+wYFxVDAJEeMfhYq5G0+3D8FAGsWmogElftqYXShnkY6kEaFqwJhWlcJJI4D8jncsWS0b7Mgyr9gVrYtuvRmR1MvaSE0MHqn8H35P2AUCpzpdvdA5J5+Bhl9Vl5+Qxg7GiTwdG1pTIVJ+xOlMZtBp+NmFAR+gT+lDRXKSoAXdWT2izb4ClOzpJYqL9WyZ8QYVAesyI0tmB0a6JF+K15H9IWdg4571PUQPCoqYPPXXfWeD5N9PLpn8ZRv9xNW2tx6fo4VbJKBv29w7PH7nlWM3Fzb52FOxyFi8nHOAF1qBv6uG+NbhO8/McqB35/B/0TwEtzLhDuM26BGdh X-MS-Exchange-AntiSpam-MessageData: dpXIiMh/wfGEmM0HFHbDlyvFdBLB0Qc4bRlgF7kju1F8sN1/17XFrvT9n6ed6bU/5eMMFl72ZpiTFoqBN2E/3cYyESpY4p+7M4blLr3GHlpVhCoM8CLcgMJbpbO+noeMXjxpGo90mlz4o1iDg7LpEA== X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: bfe163c1-f5ef-4202-bcd2-08d7e8881bde X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Apr 2020 19:45:58.8546 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: CBzj60ts3rmUYQweLspM7Fl1GmhZWVD30OaRFVjAk/qmQcB9GF8+NSjlI6AiLUszrVB2ScGtKA8u2LaQHv8JyQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB5072 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Eran Ben Elisha Add a bit in HCA capabilities layout to indicate if release all pages is supported. Signed-off-by: Eran Ben Elisha Reviewed-by: Moshe Shemesh Signed-off-by: Saeed Mahameed --- include/linux/mlx5/mlx5_ifc.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h index 6a6bb5dc7916..fb243848132d 100644 --- a/include/linux/mlx5/mlx5_ifc.h +++ b/include/linux/mlx5/mlx5_ifc.h @@ -1244,7 +1244,9 @@ struct mlx5_ifc_cmd_hca_cap_bits { u8 reserved_at_130[0xa]; u8 log_max_ra_res_dc[0x6]; - u8 reserved_at_140[0x9]; + u8 reserved_at_140[0x6]; + u8 release_all_pages[0x1]; + u8 reserved_at_147[0x2]; u8 roce_accl[0x1]; u8 log_max_ra_req_qp[0x6]; u8 reserved_at_150[0xa]; From patchwork Fri Apr 24 19:45:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 11508979 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2149214B4 for ; Fri, 24 Apr 2020 19:46:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 05848215A4 for ; Fri, 24 Apr 2020 19:46:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="LbyBS4hD" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729418AbgDXTqS (ORCPT ); Fri, 24 Apr 2020 15:46:18 -0400 Received: from mail-eopbgr70047.outbound.protection.outlook.com ([40.107.7.47]:44128 "EHLO EUR04-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729175AbgDXTqS (ORCPT ); Fri, 24 Apr 2020 15:46:18 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cPiT8/F+1rKJRsZQRHCV/YhpEGb259CYkJME03ZssBCb/0mHJA/e6/q/COQe1yia+mz+KNyHYVIlUI5Qb7w3HdUAux/Gc3xpsweejUTrDDToOuavQ7Z86/Q6Lo8Y+B3u5SBMzwmOaqgixul8B9hvIns6XKtC0qtto7mKw1lW6wCX2hcO9bRAyijvJ32gpTYcOfksmkZYaJZei3ADab8xqVafM3sKHIgEPs5w70tnLoSRdeVt/f6i+MnkM8NSvC4dHxRGsgZfb+MJg6TTunv4ZTzTFJyyr8FxFybCDc3QOaPQXkWGKCMF7BaCBe4TI6IuAVspYfRyiZ088sgPuLx3Zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=A7jKkUf/RlJCXygmbiWGLer9G0lC9xWnrYBt0AtALsw=; b=kSj1PK/uF8DbvFOVgrD4aUwNJEloqdcbWJYM0S82aNJxsnur4Oudu5X1VEFzGf5ndxshaITwwQ/Frv5NlqlkGDCbbgKVP1n/GydvRkHHzgT/ttJcC0qUnQdkcQQplI6wYqvYWRUCs82q5+cDWptEtWmz6Px434rDFvC+LTzI2O+GbpsrXRjS2hZdX0kCtnoNjbalIh6MF3uTKaP1YyUuh5nmwmG6y9w2NrmhZkJOhZWAcck0Pigd8ipeaG8HA7oqdk5riagvatPyeXSn8pSoNPn/meoGlXU3d/eKEz9qPKFqURCiWxatV0fXQxXBG3yvz6jfU3BwVwmPaNqJhjoxbg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=A7jKkUf/RlJCXygmbiWGLer9G0lC9xWnrYBt0AtALsw=; b=LbyBS4hDgK22ON4bGmBZoMh4wRfOjE8KkGvpD1D2J4uzfuyNAqlD9WupynONW6m7yoOuUvwhk6b9jlHk+bSBTW7dYW8q3giCiL2Z0KkqvjSjy6+05cPe9wv6uyPwtpjOlkhQR4I3giglKDKdS0Py/etttCjuIGUcnb43k2vuNxE= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=saeedm@mellanox.com; Received: from VI1PR05MB5102.eurprd05.prod.outlook.com (2603:10a6:803:5e::23) by VI1PR05MB5072.eurprd05.prod.outlook.com (2603:10a6:803:61::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.29; Fri, 24 Apr 2020 19:46:04 +0000 Received: from VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::9d19:a564:b84e:7c19]) by VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::9d19:a564:b84e:7c19%7]) with mapi id 15.20.2937.020; Fri, 24 Apr 2020 19:46:04 +0000 From: Saeed Mahameed To: Saeed Mahameed , Leon Romanovsky Cc: netdev@vger.kernel.org, linux-rdma@vger.kernel.org, Raed Salem Subject: [PATCH mlx5-next 9/9] net/mlx5: TX WQE Add trailer insertion field Date: Fri, 24 Apr 2020 12:45:10 -0700 Message-Id: <20200424194510.11221-10-saeedm@mellanox.com> X-Mailer: git-send-email 2.25.3 In-Reply-To: <20200424194510.11221-1-saeedm@mellanox.com> References: <20200424194510.11221-1-saeedm@mellanox.com> X-ClientProxiedBy: BYAPR06CA0016.namprd06.prod.outlook.com (2603:10b6:a03:d4::29) To VI1PR05MB5102.eurprd05.prod.outlook.com (2603:10a6:803:5e::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from smtp.office365.com (73.15.39.150) by BYAPR06CA0016.namprd06.prod.outlook.com (2603:10b6:a03:d4::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Fri, 24 Apr 2020 19:46:00 +0000 X-Mailer: git-send-email 2.25.3 X-Originating-IP: [73.15.39.150] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 71d58aa9-c12b-485a-6b83-08d7e8881dfc X-MS-TrafficTypeDiagnostic: VI1PR05MB5072:|VI1PR05MB5072: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4125; X-Forefront-PRVS: 03838E948C X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR05MB5102.eurprd05.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(10009020)(4636009)(39860400002)(136003)(396003)(376002)(366004)(346002)(6506007)(26005)(2616005)(8936002)(8676002)(316002)(6636002)(36756003)(6666004)(66946007)(66556008)(52116002)(81156014)(478600001)(107886003)(66476007)(6512007)(956004)(5660300002)(110136005)(4326008)(1076003)(16526019)(186003)(2906002)(6486002)(86362001)(450100002)(54420400002);DIR:OUT;SFP:1101; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5ZbZZs9qjJDxsWsPKphApImbbn6qW+CIpapVfDPrLG4qGKUrf6UBymt4MsYURzDP5lf8CNcGJsyyT92nJCaAiLaKPzrYUkb8JClw/FRoyS/TSFT8zD1x5vMG3erusPWurN8o2QKpq/PtlkHbcjSEvofWX6u30Ypa83I0kAlFZfDfLrPojf40ZuM9+mdUcFYCCQh3GOoojars1v3dL4GHznTh3Csg4qmUpv4+ZlU+v/9IlCYPALfwodvn0c3tNiRY75SBn3lDyv0nrgigj8Dgh91wumEN8iaV6Q5xENg1Y5M3rwKuHUuYVSAmbs1iLsl22mQX2TQz2jB8NBCX5ZxQMxKyw0bL8iHEhyafvCbwRQNKAQayO+ELuOAGSpeKfY6pUHCIkFr4NJYIzb7pXG/TzvoRymXg3CFtY/ObBiW14qBy+ZHn1GU2T9uXcZa1ShGVFCbHayNHlq6TbOPn9FM7J12mGCR7Ek9G2jXHbNyWLbM/eHUfa3a5VwJ1bAO/wHwc X-MS-Exchange-AntiSpam-MessageData: Z9u+wA+7ikaukv+nkQgPnpPClBX7N1DAHoTSixfNSFh/dZw5Psz2Uf4lcS2sFXZ31oDlIliMeSjvpW4JONa/7AlLpSG9f+T5tt1Fb09RPSOzc4HdUVtbM92df1Xuqs6N9476/cj+tGDmvLCng6Vm2Q== X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 71d58aa9-c12b-485a-6b83-08d7e8881dfc X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Apr 2020 19:46:02.2456 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: USWPqcq1srthx4ueU11hzNqmVJsoEUf4LJg2oH04Yfp8Szvx8XOL9Q5SnNBpnGRc9ibFriB6JmPCHCF0P8uUvw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB5072 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Raed Salem Add new TX WQE field for Connect-X6DX trailer insertion support, when set, the HW adds a trailer to the packet, the WQE trailer association flags are used to set to HW the header which the trailer belongs. Signed-off-by: Raed Salem Signed-off-by: Saeed Mahameed --- include/linux/mlx5/qp.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/linux/mlx5/qp.h b/include/linux/mlx5/qp.h index ef127a156a62..f23eb18526fe 100644 --- a/include/linux/mlx5/qp.h +++ b/include/linux/mlx5/qp.h @@ -229,6 +229,11 @@ enum { enum { MLX5_ETH_WQE_SVLAN = 1 << 0, + MLX5_ETH_WQE_TRAILER_HDR_OUTER_IP_ASSOC = 1 << 26, + MLX5_ETH_WQE_TRAILER_HDR_OUTER_L4_ASSOC = 1 << 27, + MLX5_ETH_WQE_TRAILER_HDR_INNER_IP_ASSOC = 3 << 26, + MLX5_ETH_WQE_TRAILER_HDR_INNER_L4_ASSOC = 1 << 28, + MLX5_ETH_WQE_INSERT_TRAILER = 1 << 30, MLX5_ETH_WQE_INSERT_VLAN = 1 << 15, }; @@ -257,6 +262,7 @@ struct mlx5_wqe_eth_seg { __be16 type; __be16 vlan_tci; } insert; + __be32 trailer; }; };