From patchwork Fri Mar 12 23:38:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 12136163 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EFB3AC433E6 for ; Fri, 12 Mar 2021 23:40:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BD94764FC2 for ; Fri, 12 Mar 2021 23:40:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235841AbhCLXjS (ORCPT ); Fri, 12 Mar 2021 18:39:18 -0500 Received: from mail.kernel.org ([198.145.29.99]:60976 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235775AbhCLXi4 (ORCPT ); Fri, 12 Mar 2021 18:38:56 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id D9A7364F86; Fri, 12 Mar 2021 23:38:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1615592336; bh=xlxQIHZ5FOTHP6mv0KJY11l7eWsg49hW69Tx1fcL1BE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DbIngIKSzXqwbc0tvXMtO0PbJNYb3x8Hsy1XsIfgVQ5q1pmm3OJNhPxCQpryCf8Qb jyjHP75GrX62N6CqSGiVsE19Cb6QFSzew/z0lxuc42rSzlVgirRFGp0CwXRhRcCoBy SJPbY5DWMWDIdvONC8KcpGFDcMlWCk+JcSn0k2AkXHn+GGrDflqgD14OKfyJFwyPoG aAzjgvIpzleQBiWaXHn+Nic2R7x4RFkcFZKlYfkphGJPLYXJL5lLKaRLrTUUzhANvv pv9GrqPxA24QbhQ9Weon+8BfGaameIl6xP0t+lm0Fm238QizR32dwTLCxa47PT0KPh HDF8kuKMZIFBw== From: Saeed Mahameed To: "David S. Miller" , Jakub Kicinski Cc: netdev@vger.kernel.org, Yevgeny Kliteynik , Alex Vesker , Saeed Mahameed Subject: [net-next 01/13] net/mlx5: DR, Fixed typo in STE v0 Date: Fri, 12 Mar 2021 15:38:39 -0800 Message-Id: <20210312233851.494832-2-saeed@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210312233851.494832-1-saeed@kernel.org> References: <20210312233851.494832-1-saeed@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Yevgeny Kliteynik "reforamt" -> "reformat" Signed-off-by: Yevgeny Kliteynik Reviewed-by: Alex Vesker Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste_v0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste_v0.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste_v0.c index 9ec079247c4b..c5f62d2a058f 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste_v0.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste_v0.c @@ -331,7 +331,7 @@ static void dr_ste_v0_set_tx_push_vlan(u8 *hw_ste_p, u32 vlan_hdr, MLX5_SET(ste_sx_transmit, hw_ste_p, action_type, DR_STE_ACTION_TYPE_PUSH_VLAN); MLX5_SET(ste_sx_transmit, hw_ste_p, encap_pointer_vlan_data, vlan_hdr); - /* Due to HW limitation we need to set this bit, otherwise reforamt + + /* Due to HW limitation we need to set this bit, otherwise reformat + * push vlan will not work. */ if (go_back) From patchwork Fri Mar 12 23:38:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 12136167 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 36E6DC43381 for ; Fri, 12 Mar 2021 23:40:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EF99864EDF for ; Fri, 12 Mar 2021 23:40:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235861AbhCLXjX (ORCPT ); Fri, 12 Mar 2021 18:39:23 -0500 Received: from mail.kernel.org ([198.145.29.99]:60988 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235781AbhCLXi4 (ORCPT ); Fri, 12 Mar 2021 18:38:56 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4E1DC64F8D; Fri, 12 Mar 2021 23:38:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1615592336; bh=HwU31+TT0fpi7+YAkpDyUMdESnM4B0YABhIF7Uk+wg0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BRE2AynJvNlXDMJO+37Qnu1HHZnm0TEPEyCHnnptdKotzaU7SnsO7y0shGAobM9HF kHtg6Iae/GcP5mlA9Wgf1FSFhuMoZ4WokFbSjcjjzqiEL9vtzF5Uqax3WF/BqC0bRr X2dswG8+hOgrd2MDTNPMLH+YhwT2jQeA7AE3XXxR5bn6x1eo6loM762zVpI2awXuEW sCYxXGjqCvqhC6SGfVEP1Sk0/1d4QjO1YbJVYYpshvnuc+BJYL7nQmI48cWWD+CwA5 SdOY43Ou76GUnUGayroBC1N8dNPoQnlUKx1Nd/sqeopnscIQfisLDChMqHSoQieIYv JC5kOjMdQTOMQ== From: Saeed Mahameed To: "David S. Miller" , Jakub Kicinski Cc: netdev@vger.kernel.org, Yevgeny Kliteynik , Alex Vesker , Saeed Mahameed Subject: [net-next 02/13] net/mlx5: DR, Remove unneeded rx_decap_l3 function for STEv1 Date: Fri, 12 Mar 2021 15:38:40 -0800 Message-Id: <20210312233851.494832-3-saeed@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210312233851.494832-1-saeed@kernel.org> References: <20210312233851.494832-1-saeed@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Yevgeny Kliteynik Remove the dr_ste_v1_set_rx_decap_l3 function that was replaced by another function - fixing a rebase error. Signed-off-by: Yevgeny Kliteynik Reviewed-by: Alex Vesker Signed-off-by: Saeed Mahameed --- .../mellanox/mlx5/core/steering/dr_ste_v1.c | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste_v1.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste_v1.c index 4088d6e51508..6f368ccc428e 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste_v1.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste_v1.c @@ -437,21 +437,6 @@ static void dr_ste_v1_set_rx_decap(u8 *hw_ste_p, u8 *s_action) dr_ste_v1_set_reparse(hw_ste_p); } -static void dr_ste_v1_set_rx_decap_l3(u8 *hw_ste_p, - u8 *s_action, - u16 decap_actions, - u32 decap_index) -{ - MLX5_SET(ste_single_action_modify_list_v1, s_action, action_id, - DR_STE_V1_ACTION_ID_MODIFY_LIST); - MLX5_SET(ste_single_action_modify_list_v1, s_action, num_of_modify_actions, - decap_actions); - MLX5_SET(ste_single_action_modify_list_v1, s_action, modify_actions_ptr, - decap_index); - - dr_ste_v1_set_reparse(hw_ste_p); -} - static void dr_ste_v1_set_rewrite_actions(u8 *hw_ste_p, u8 *s_action, u16 num_of_actions, @@ -571,9 +556,6 @@ static void dr_ste_v1_set_actions_rx(struct mlx5dr_domain *dmn, bool allow_ctr = true; if (action_type_set[DR_ACTION_TYP_TNL_L3_TO_L2]) { - dr_ste_v1_set_rx_decap_l3(last_ste, action, - attr->decap_actions, - attr->decap_index); dr_ste_v1_set_rewrite_actions(last_ste, action, attr->decap_actions, attr->decap_index); From patchwork Fri Mar 12 23:38:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 12136165 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1A6B1C433E9 for ; Fri, 12 Mar 2021 23:40:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DF25764FD9 for ; Fri, 12 Mar 2021 23:40:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235857AbhCLXjX (ORCPT ); Fri, 12 Mar 2021 18:39:23 -0500 Received: from mail.kernel.org ([198.145.29.99]:60992 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235791AbhCLXi5 (ORCPT ); Fri, 12 Mar 2021 18:38:57 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id BAC1C64F8E; Fri, 12 Mar 2021 23:38:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1615592337; bh=rECLVQA13kP6xM5Hv/YcfZz1oc/M9/cAH/ze/TBPJSE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JY18gJxx9t2Ougm1nwUMm8BAP/iLpOBkEL2diyA6CGOAE49rROj6evlIqUEI70KsX 1zM8OUp86C7x3UbEjrKDSEnn6oXl+1yraiXfCxHjN52GgqpAR1YbEe1wRUz9qP7u7h yDL8aiBl7vLrod/+g8Rr1b7fp2AW6ZwUhdeO7kiaFLsXaWaYzHoT/XYCJbymIKkH/u 869CqrWUoL9/qDrec7nHmXMBBJHt5grGLIJovkrnEhQND+qfzegh4yXmKAXUC/UNg1 bxGaZAOweK7ng4hQaGQJbJaX4LbxGoFXBw/9exa4RSPcEO7AGJdKEGEnrrVq32p74r Vl0C88EGd4tfQ== From: Saeed Mahameed To: "David S. Miller" , Jakub Kicinski Cc: netdev@vger.kernel.org, Yevgeny Kliteynik , Alex Vesker , Alex Vesker , Saeed Mahameed Subject: [net-next 03/13] net/mlx5: DR, Add missing vhca_id consume from STEv1 Date: Fri, 12 Mar 2021 15:38:41 -0800 Message-Id: <20210312233851.494832-4-saeed@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210312233851.494832-1-saeed@kernel.org> References: <20210312233851.494832-1-saeed@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Yevgeny Kliteynik The field source_eswitch_owner_vhca_id was not consumed in the same way as in STEv0. Added the missing set. Fixes: 10b694186410 ("net/mlx5: DR, Add HW STEv1 match logic") Signed-off-by: Alex Vesker Signed-off-by: Yevgeny Kliteynik Reviewed-by: Alex Vesker Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste_v1.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste_v1.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste_v1.c index 6f368ccc428e..815951617e7c 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste_v1.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste_v1.c @@ -1514,6 +1514,7 @@ static void dr_ste_v1_build_src_gvmi_qpn_bit_mask(struct mlx5dr_match_param *val DR_STE_SET_ONES(src_gvmi_qp_v1, bit_mask, source_gvmi, misc_mask, source_port); DR_STE_SET_ONES(src_gvmi_qp_v1, bit_mask, source_qp, misc_mask, source_sqn); + misc_mask->source_eswitch_owner_vhca_id = 0; } static int dr_ste_v1_build_src_gvmi_qpn_tag(struct mlx5dr_match_param *value, From patchwork Fri Mar 12 23:38:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 12136183 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 84C1EC4332B for ; Fri, 12 Mar 2021 23:40:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 489C964EDF for ; Fri, 12 Mar 2021 23:40:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235873AbhCLXj0 (ORCPT ); Fri, 12 Mar 2021 18:39:26 -0500 Received: from mail.kernel.org ([198.145.29.99]:32770 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235807AbhCLXi5 (ORCPT ); Fri, 12 Mar 2021 18:38:57 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4AF5764F9E; Fri, 12 Mar 2021 23:38:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1615592337; bh=zX7z9HLXP3KcnCpLp0CbrwdOtAOyjZEY6/JC/WiSwJM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=McxHBrwbqQ/yTUjoFLXMsTDOJyVBlEoBg1cvhdiyS0l9JDsBUeUwK27KQ3cdkfSgD 8cKzMJhYeBNpe2W0L8B82oRyU7TWWLEL7i3XV9f0nkxFgjujUfnm7mOiHYgEauCyKq rzW6ElZWKYQAfd/xK9Cyj3VqNUXH6s1UoCOaCn6B5jFmeAXVW8LlmrMo1OL4lBybzd xJHTD9TbO5KHjMJbNht7qsOCRSXkMyw047GnRxBd3Zz6yjhSOxk4Mcy90lpHzddMef uas/+tbm24WddqNywJlnCivIqNNAsbciFLBHD2u8XARoWFfXXP0bnOe903pcQfWpWS 8zA/UQS3/5zXg== From: Saeed Mahameed To: "David S. Miller" , Jakub Kicinski Cc: netdev@vger.kernel.org, Junlin Yang , Roi Dayan , Saeed Mahameed Subject: [net-next 04/13] net/mlx5: use kvfree() for memory allocated with kvzalloc() Date: Fri, 12 Mar 2021 15:38:42 -0800 Message-Id: <20210312233851.494832-5-saeed@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210312233851.494832-1-saeed@kernel.org> References: <20210312233851.494832-1-saeed@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Junlin Yang It is allocated with kvzalloc(), the corresponding release function should not be kfree(), use kvfree() instead. Generated by: scripts/coccinelle/api/kfree_mismatch.cocci Signed-off-by: Junlin Yang Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed --- .../net/ethernet/mellanox/mlx5/core/esw/indir_table.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/esw/indir_table.c b/drivers/net/ethernet/mellanox/mlx5/core/esw/indir_table.c index 6f6772bf61a2..3da7becc1069 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/esw/indir_table.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/esw/indir_table.c @@ -248,7 +248,7 @@ static int mlx5_esw_indir_table_rule_get(struct mlx5_eswitch *esw, err_ethertype: kfree(rule); out: - kfree(rule_spec); + kvfree(rule_spec); return err; } @@ -328,7 +328,7 @@ static int mlx5_create_indir_recirc_group(struct mlx5_eswitch *esw, e->recirc_cnt = 0; out: - kfree(in); + kvfree(in); return err; } @@ -347,7 +347,7 @@ static int mlx5_create_indir_fwd_group(struct mlx5_eswitch *esw, spec = kvzalloc(sizeof(*spec), GFP_KERNEL); if (!spec) { - kfree(in); + kvfree(in); return -ENOMEM; } @@ -371,8 +371,8 @@ static int mlx5_create_indir_fwd_group(struct mlx5_eswitch *esw, } err_out: - kfree(spec); - kfree(in); + kvfree(spec); + kvfree(in); return err; } From patchwork Fri Mar 12 23:38:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 12136169 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5473BC4332E for ; Fri, 12 Mar 2021 23:40:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3854164F8D for ; Fri, 12 Mar 2021 23:40:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235869AbhCLXjZ (ORCPT ); Fri, 12 Mar 2021 18:39:25 -0500 Received: from mail.kernel.org ([198.145.29.99]:32780 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235809AbhCLXi6 (ORCPT ); Fri, 12 Mar 2021 18:38:58 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id B1AD264FA6; Fri, 12 Mar 2021 23:38:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1615592338; bh=4lqnQLGNMRJjdEbK4BaDdtz2ZVyv5pnkjgNd1dG75MQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qkFpcX+A9YqIcjVGzCPA6MLJFiL85lr1x/8aA+xEJL1pTY9i3bZFt0nr9OqrIz4Wc S/MFeha+S0UipO4ELepWfvsbJBq8eH057UW+TWzs0bSqp/GeqK73lT7/hIFQBxZNas 0UMfV3ic5J0Pr1tu9btKb5zlPMAgBio2mCzvUrf1oQ9gpzZ6v2vzAWx1I9g27O8U6b tLgCHl6LxBRNYTN+6McnuNu7Fp+BZrVOIlN3MO4yM9KZevZRt1nIml3aff7lGjsSua KYVRSNadDh3upanP2u/uX1brPejl0BCaTkMGXqIOVmTdl46+A5wyWcAagYAuh2YFFM SK5NpBoh45cuQ== From: Saeed Mahameed To: "David S. Miller" , Jakub Kicinski Cc: netdev@vger.kernel.org, Jiapeng Chong , Abaci Robot , Parav Pandit , Saeed Mahameed Subject: [net-next 05/13] net/mlx5: remove unneeded semicolon Date: Fri, 12 Mar 2021 15:38:43 -0800 Message-Id: <20210312233851.494832-6-saeed@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210312233851.494832-1-saeed@kernel.org> References: <20210312233851.494832-1-saeed@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Jiapeng Chong Fix the following coccicheck warnings: ./drivers/net/ethernet/mellanox/mlx5/core/sf/devlink.c:495:2-3: Unneeded semicolon. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Reviewed-by: Parav Pandit Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/sf/devlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/sf/devlink.c b/drivers/net/ethernet/mellanox/mlx5/core/sf/devlink.c index c2ba41bb7a70..60a6328a9ca0 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/sf/devlink.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/sf/devlink.c @@ -492,7 +492,7 @@ static int mlx5_sf_esw_event(struct notifier_block *nb, unsigned long event, voi break; default: break; - }; + } return 0; } From patchwork Fri Mar 12 23:38:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 12136181 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNWANTED_LANGUAGE_BODY, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3ED9EC4332D for ; Fri, 12 Mar 2021 23:40:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 18D0964FB3 for ; Fri, 12 Mar 2021 23:40:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235865AbhCLXjY (ORCPT ); Fri, 12 Mar 2021 18:39:24 -0500 Received: from mail.kernel.org ([198.145.29.99]:32790 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235812AbhCLXi6 (ORCPT ); Fri, 12 Mar 2021 18:38:58 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2B53464F5E; Fri, 12 Mar 2021 23:38:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1615592338; bh=AToiMjuvf7q5MNlYrDuWplOjwxdjkej4TyVig2MDdo8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A4JG3CRPInEstvhHxaKFN/4IweDaKDY93h4huht5YLjqszdfEzmU/s5S/N562VZth WS+PhsqN9j09F5VWoKQVWpTJCuI1ebePxxz9eT7wvG2wDKrTRieKUIYGdTHS0Y/8tH FLTfZMjR5ETiVQsV8fcoWmQikqPPWTwdJCgtrRnOLQZ7DVR0F8vNhbs3xqTE0k8LiQ EqmnHHHpwuJejmHAId+uV5y8rLzbiPekKuboms0driStD+WQ+s91izT1yD0xmUQ/RM Otl9PY4+T6J1hEjZZGRcfsm4EQf0dHBcuTYo04qUtCpvtYh9j4lQUCfCravaGak8p5 w3YnOMJ1FqanA== From: Saeed Mahameed To: "David S. Miller" , Jakub Kicinski Cc: netdev@vger.kernel.org, Mark Zhang , Saeed Mahameed , Maor Gottlieb Subject: [net-next 06/13] net/mlx5: Read congestion counters from all ports when lag is active Date: Fri, 12 Mar 2021 15:38:44 -0800 Message-Id: <20210312233851.494832-7-saeed@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210312233851.494832-1-saeed@kernel.org> References: <20210312233851.494832-1-saeed@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Mark Zhang Read congestion counters from all ports in any lag mode rather than only in RoCE lag mode (e.g., VF lag). Signed-off-by: Mark Zhang Reviewed-by: Saeed Mahameed Reviewed-by: Maor Gottlieb Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/lag.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lag.c b/drivers/net/ethernet/mellanox/mlx5/core/lag.c index 83a05371e2aa..127bb92da150 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/lag.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/lag.c @@ -768,7 +768,7 @@ int mlx5_lag_query_cong_counters(struct mlx5_core_dev *dev, spin_lock(&lag_lock); ldev = mlx5_lag_dev_get(dev); - if (ldev && __mlx5_lag_is_roce(ldev)) { + if (ldev && __mlx5_lag_is_active(ldev)) { num_ports = MLX5_MAX_PORTS; mdev[MLX5_LAG_P1] = ldev->pf[MLX5_LAG_P1].dev; mdev[MLX5_LAG_P2] = ldev->pf[MLX5_LAG_P2].dev; From patchwork Fri Mar 12 23:38:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 12136175 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9F06DC43333 for ; Fri, 12 Mar 2021 23:40:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 87DC164F9E for ; Fri, 12 Mar 2021 23:40:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235881AbhCLXj1 (ORCPT ); Fri, 12 Mar 2021 18:39:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:32798 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235814AbhCLXi7 (ORCPT ); Fri, 12 Mar 2021 18:38:59 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9399164F21; Fri, 12 Mar 2021 23:38:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1615592338; bh=ir5A6iMeWvrGnZN8aXiWlvJ6pbmlIpImHCSv6ytHqEo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=r1f1WcaACJQt1yYFkAargZMlfn1eBxlCVokdyaHs5vd5/E8sVauT9DJQHByLRsHu5 AdHyVa8at5RZNpjz50SWQRYl4lFjF8OHMPpK3f+EvD5akKsgPev40/8LqCERbxwyrM xVuBCeMxwpsIyGonUXCTIcApgKzsrssFlxh9xRSCvwnQiEbcKdJiI4VbCn16yWd7Wj NbNZegcs1Xhz4EdbvkRaOKZV17naQml7PNdzA+K71L13UV6wtMvyp+mK/BFCqIZCs6 GOzkiKW2zf358EdJBBhPN50lUY3yz7x44KZ1KXUBaCuyG+8+2Ao2yLp1dP/0wg+/5V DNMXkbsNRZM3Q== From: Saeed Mahameed To: "David S. Miller" , Jakub Kicinski Cc: netdev@vger.kernel.org, Roi Dayan , Saeed Mahameed Subject: [net-next 07/13] net/mlx5e: Remove redundant newline in NL_SET_ERR_MSG_MOD Date: Fri, 12 Mar 2021 15:38:45 -0800 Message-Id: <20210312233851.494832-8-saeed@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210312233851.494832-1-saeed@kernel.org> References: <20210312233851.494832-1-saeed@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Roi Dayan Fix the following coccicheck warnings: drivers/net/ethernet/mellanox/mlx5/core/devlink.c:145:29-66: WARNING avoid newline at end of message in NL_SET_ERR_MSG_MOD drivers/net/ethernet/mellanox/mlx5/core/devlink.c:140:29-77: WARNING avoid newline at end of message in NL_SET_ERR_MSG_MOD Signed-off-by: Roi Dayan Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/devlink.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/devlink.c b/drivers/net/ethernet/mellanox/mlx5/core/devlink.c index 6729720e1ab7..38c7c44fe883 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/devlink.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/devlink.c @@ -137,12 +137,12 @@ static int mlx5_devlink_reload_down(struct devlink *devlink, bool netns_change, * unregistering devlink instance while holding devlink_mutext. * Hence, do not support reload. */ - NL_SET_ERR_MSG_MOD(extack, "reload is unsupported when SFs are allocated\n"); + NL_SET_ERR_MSG_MOD(extack, "reload is unsupported when SFs are allocated"); return -EOPNOTSUPP; } if (mlx5_lag_is_active(dev)) { - NL_SET_ERR_MSG_MOD(extack, "reload is unsupported in Lag mode\n"); + NL_SET_ERR_MSG_MOD(extack, "reload is unsupported in Lag mode"); return -EOPNOTSUPP; } From patchwork Fri Mar 12 23:38:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 12136173 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9EC45C43331 for ; Fri, 12 Mar 2021 23:40:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 68AB464F86 for ; Fri, 12 Mar 2021 23:40:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235877AbhCLXj0 (ORCPT ); Fri, 12 Mar 2021 18:39:26 -0500 Received: from mail.kernel.org ([198.145.29.99]:32806 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235815AbhCLXi7 (ORCPT ); Fri, 12 Mar 2021 18:38:59 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id F378564FA7; Fri, 12 Mar 2021 23:38:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1615592339; bh=kM3/eAavmlOa4Zh/5HnWe4CjrLFaZ2qV6OM93EJ7Eps=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GtDBSMmyIevB4Mj4poxNa5TbPLvn/remBdjB3ZgfzVSGwPIswb7jZ46v2kvZ13yGu BuRe3F3Q8meRNORI1lYw1lejgs6JUYZakSYuEpk80zbPlayDm/GUm5SsCJmJ/RUkKq nw/vrX+OGeV6FmQ6O/wbjTU+4/jIWbxn23kwM/qz7ZXrgNXoIqfhua0P5CYCRtMVpO pmvLBoXL87bFDkkuXjqEqEZ8Iv6mVv2JTVtcyWzoVZACKxArrP4EQNXFJpGLVYlwae NDgTjJFRTaPw/tEVgAnY9CiQVO43is8FSVD2NWxqw/lFg1FS8TKTS8qZekOlH7OT7c svBtQ2/a4Pteg== From: Saeed Mahameed To: "David S. Miller" , Jakub Kicinski Cc: netdev@vger.kernel.org, Maxim Mikityanskiy , Saeed Mahameed , Tariq Toukan Subject: [net-next 08/13] net/mlx5e: Use net_prefetchw instead of prefetchw in MPWQE TX datapath Date: Fri, 12 Mar 2021 15:38:46 -0800 Message-Id: <20210312233851.494832-9-saeed@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210312233851.494832-1-saeed@kernel.org> References: <20210312233851.494832-1-saeed@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Maxim Mikityanskiy Commit e20f0dbf204f ("net/mlx5e: RX, Add a prefetch command for small L1_CACHE_BYTES") switched to using net_prefetchw at all places in mlx5e. In the same time frame, commit 5af75c747e2a ("net/mlx5e: Enhanced TX MPWQE for SKBs") added one more usage of prefetchw. When these two changes were merged, this new occurrence of prefetchw wasn't replaced with net_prefetchw. This commit fixes this last occurrence of prefetchw in mlx5e_tx_mpwqe_session_start, making the same change that was done in mlx5e_xdp_mpwqe_session_start. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Saeed Mahameed Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/en_tx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c index bdbffe484fce..d2efe2455955 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c @@ -576,7 +576,7 @@ static void mlx5e_tx_mpwqe_session_start(struct mlx5e_txqsq *sq, pi = mlx5e_txqsq_get_next_pi(sq, MLX5E_TX_MPW_MAX_WQEBBS); wqe = MLX5E_TX_FETCH_WQE(sq, pi); - prefetchw(wqe->data); + net_prefetchw(wqe->data); *session = (struct mlx5e_tx_mpwqe) { .wqe = wqe, From patchwork Fri Mar 12 23:38:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 12136177 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EB0A9C4321A for ; Fri, 12 Mar 2021 23:40:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BF79064EDF for ; Fri, 12 Mar 2021 23:40:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235893AbhCLXja (ORCPT ); Fri, 12 Mar 2021 18:39:30 -0500 Received: from mail.kernel.org ([198.145.29.99]:32816 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235818AbhCLXi7 (ORCPT ); Fri, 12 Mar 2021 18:38:59 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6899464F8E; Fri, 12 Mar 2021 23:38:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1615592339; bh=sfnEsH3EiRSwzRNvitNEuVou9ghvckBI3hT+dg5tyeY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E+86uZRbEmi4bQi9rMRPodJrFKfVZKTaL4SrhXLa2wrazXLeW8/HRqGo8UG8nFHO6 PmPkD6XPl4s693GADx7ejTct2fwJIyOSW+pKxOyDTvW133YCqo64w+LuI5AFN+aye2 CG//JhXXRFZaavOe7Um6H3UToz0gQ/uk97ijCJVYfM5spS/bUybMnpBaEFGKH7uuXt QlXpfNqjBPybRtUjof85012IvdqBSKyT+egYPPs9ND4LO45GRfdSzCsWikBq2KBo/b cfzU1Crx5j7Mq7O3w6z/phD6big4wE8tRI2nruo59TtUhtmDSv3gv0OV2pnGOe3tjl bd6VrFDwooY2w== From: Saeed Mahameed To: "David S. Miller" , Jakub Kicinski Cc: netdev@vger.kernel.org, Tariq Toukan , Saeed Mahameed Subject: [net-next 09/13] net/mlx5e: Dump ICOSQ WQE descriptor on CQE with error events Date: Fri, 12 Mar 2021 15:38:47 -0800 Message-Id: <20210312233851.494832-10-saeed@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210312233851.494832-1-saeed@kernel.org> References: <20210312233851.494832-1-saeed@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Tariq Toukan Dump the ICOSQ's WQE descriptor when a completion with error is received. Signed-off-by: Tariq Toukan Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c index 1b6ad94ebb10..1f15c6183dc1 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c @@ -669,6 +669,7 @@ int mlx5e_poll_ico_cq(struct mlx5e_cq *cq) get_cqe_opcode(cqe)); mlx5e_dump_error_cqe(&sq->cq, sq->sqn, (struct mlx5_err_cqe *)cqe); + mlx5_wq_cyc_wqe_dump(&sq->wq, ci, wi->num_wqebbs); if (!test_and_set_bit(MLX5E_SQ_STATE_RECOVERING, &sq->state)) queue_work(cq->priv->wq, &sq->recover_work); break; From patchwork Fri Mar 12 23:38:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 12136179 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D5E5EC432C3 for ; Fri, 12 Mar 2021 23:40:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AEAF264F8D for ; Fri, 12 Mar 2021 23:40:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235889AbhCLXj3 (ORCPT ); Fri, 12 Mar 2021 18:39:29 -0500 Received: from mail.kernel.org ([198.145.29.99]:32824 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235819AbhCLXjA (ORCPT ); Fri, 12 Mar 2021 18:39:00 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id CA4DD64F86; Fri, 12 Mar 2021 23:38:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1615592340; bh=5vbNGNIpW0U1T4cAa0Kz7OG1MGTHxQR75AIrz2bHcng=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IjzWVzDZItlcnYN43gP+fVUW7stsfLGA+wZGaaB69q5Is9d+PRhPyQwqbmspxJBmR yixkeOe/XE1i/o6Ll06witCOqOa5lBtTBm+a4DpACEnX744ntw4fQlmP/4n7DDqibn a9nlWyKkB8IH8JwJXxk5vVeMtrqqsdYbfJWV6k8YIwvTEKvg54hiegyBr+h4tZWN6X 2XeM/jLVgCydxKMYjoyf/N6zRy4ar0rzuOxsCsrsDUrBOKOp0+uq4e6QubsW/I/YlK 99l8ZObCnw/giDy3a4z2Q8CdJAFsz1pKyE4CaH2iqmsP8erxiRA+1kwYmTEfTcDk0N lXPmRheIkwHvA== From: Saeed Mahameed To: "David S. Miller" , Jakub Kicinski Cc: netdev@vger.kernel.org, Arnd Bergmann , Tariq Toukan , Saeed Mahameed Subject: [net-next 10/13] net/mlx5e: allocate 'indirection_rqt' buffer dynamically Date: Fri, 12 Mar 2021 15:38:48 -0800 Message-Id: <20210312233851.494832-11-saeed@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210312233851.494832-1-saeed@kernel.org> References: <20210312233851.494832-1-saeed@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Arnd Bergmann Increasing the size of the indirection_rqt array from 128 to 256 bytes pushed the stack usage of the mlx5e_hairpin_fill_rqt_rqns() function over the warning limit when building with clang and CONFIG_KASAN: drivers/net/ethernet/mellanox/mlx5/core/en_tc.c:970:1: error: stack frame size of 1180 bytes in function 'mlx5e_tc_add_nic_flow' [-Werror,-Wframe-larger-than=] Using dynamic allocation here is safe because the caller does the same, and it reduces the stack usage of the function to just a few bytes. Signed-off-by: Arnd Bergmann Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c index dc126389291d..c72725c3f53b 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c @@ -445,12 +445,16 @@ static void mlx5e_hairpin_destroy_transport(struct mlx5e_hairpin *hp) mlx5_core_dealloc_transport_domain(hp->func_mdev, hp->tdn); } -static void mlx5e_hairpin_fill_rqt_rqns(struct mlx5e_hairpin *hp, void *rqtc) +static int mlx5e_hairpin_fill_rqt_rqns(struct mlx5e_hairpin *hp, void *rqtc) { - u32 indirection_rqt[MLX5E_INDIR_RQT_SIZE], rqn; + u32 *indirection_rqt, rqn; struct mlx5e_priv *priv = hp->func_priv; int i, ix, sz = MLX5E_INDIR_RQT_SIZE; + indirection_rqt = kzalloc(sz, GFP_KERNEL); + if (!indirection_rqt) + return -ENOMEM; + mlx5e_build_default_indir_rqt(indirection_rqt, sz, hp->num_channels); @@ -462,6 +466,9 @@ static void mlx5e_hairpin_fill_rqt_rqns(struct mlx5e_hairpin *hp, void *rqtc) rqn = hp->pair->rqn[ix]; MLX5_SET(rqtc, rqtc, rq_num[i], rqn); } + + kfree(indirection_rqt); + return 0; } static int mlx5e_hairpin_create_indirect_rqt(struct mlx5e_hairpin *hp) @@ -482,12 +489,15 @@ static int mlx5e_hairpin_create_indirect_rqt(struct mlx5e_hairpin *hp) MLX5_SET(rqtc, rqtc, rqt_actual_size, sz); MLX5_SET(rqtc, rqtc, rqt_max_size, sz); - mlx5e_hairpin_fill_rqt_rqns(hp, rqtc); + err = mlx5e_hairpin_fill_rqt_rqns(hp, rqtc); + if (err) + goto out; err = mlx5_core_create_rqt(mdev, in, inlen, &hp->indir_rqt.rqtn); if (!err) hp->indir_rqt.enabled = true; +out: kvfree(in); return err; } From patchwork Fri Mar 12 23:38:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 12136185 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AA141C43332 for ; Fri, 12 Mar 2021 23:40:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 963DE64EDF for ; Fri, 12 Mar 2021 23:40:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235885AbhCLXj2 (ORCPT ); Fri, 12 Mar 2021 18:39:28 -0500 Received: from mail.kernel.org ([198.145.29.99]:32834 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235820AbhCLXjA (ORCPT ); Fri, 12 Mar 2021 18:39:00 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3937C64F9F; Fri, 12 Mar 2021 23:39:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1615592340; bh=fA4SBX112QRnkigYDCmQVOKwZ219ewqWaxmNOxyX1aY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aUQMEqJe3YVgL2bAgZ2Je1/ollezjkcGPbQ/CMHjOtyzLbj1mtw7LTTwbQFS8efF8 FRukXTI167323lgpasWO2i9gYhmc7hrt0o2L9hwyhmq8HdsbZJLjPwrAlxCBOExKcz 5ocbwMZiERSHwfKbSPyPttxIAtK7vyC5331CEV90l/vV4UqoLM1hy2ywCMFKA/9KHN 4Z2uAB0ERqmU2xkl1IGMgVmdOoMLnv7lYo113oRgqHEdabdL3XXH8G8rm6qOX0onBi KHw1riwIVWkEb5PYHpvnkn1od9je2ickq0TpE+QKkgmrDNdYC8WQLiYkottdXH0GjE EC/LYUxXLOpVw== From: Saeed Mahameed To: "David S. Miller" , Jakub Kicinski Cc: netdev@vger.kernel.org, Alaa Hleihel , Saeed Mahameed Subject: [net-next 11/13] net/mlx5: Display the command index in command mailbox dump Date: Fri, 12 Mar 2021 15:38:49 -0800 Message-Id: <20210312233851.494832-12-saeed@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210312233851.494832-1-saeed@kernel.org> References: <20210312233851.494832-1-saeed@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Alaa Hleihel Multiple commands can be printed at the same time which can lead to wrong order of their lines in dmesg output. As a result, it's hard to match data dumps to the correct command or which command was fully dumped at some point. Fix this by displaying the corresponding command index, and also indicate when a command was fully dumped. Signed-off-by: Alaa Hleihel Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/cmd.c | 32 +++++++++++-------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c index e8cecd50558d..9d79c5ec31e9 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c @@ -263,15 +263,15 @@ static int verify_signature(struct mlx5_cmd_work_ent *ent) return 0; } -static void dump_buf(void *buf, int size, int data_only, int offset) +static void dump_buf(void *buf, int size, int data_only, int offset, int idx) { __be32 *p = buf; int i; for (i = 0; i < size; i += 16) { - pr_debug("%03x: %08x %08x %08x %08x\n", offset, be32_to_cpu(p[0]), - be32_to_cpu(p[1]), be32_to_cpu(p[2]), - be32_to_cpu(p[3])); + pr_debug("cmd[%d]: %03x: %08x %08x %08x %08x\n", idx, offset, + be32_to_cpu(p[0]), be32_to_cpu(p[1]), + be32_to_cpu(p[2]), be32_to_cpu(p[3])); p += 4; offset += 16; } @@ -802,39 +802,41 @@ static void dump_command(struct mlx5_core_dev *dev, int dump_len; int i; + mlx5_core_dbg(dev, "cmd[%d]: start dump\n", ent->idx); data_only = !!(mlx5_core_debug_mask & (1 << MLX5_CMD_DATA)); if (data_only) mlx5_core_dbg_mask(dev, 1 << MLX5_CMD_DATA, - "dump command data %s(0x%x) %s\n", - mlx5_command_str(op), op, + "cmd[%d]: dump command data %s(0x%x) %s\n", + ent->idx, mlx5_command_str(op), op, input ? "INPUT" : "OUTPUT"); else - mlx5_core_dbg(dev, "dump command %s(0x%x) %s\n", - mlx5_command_str(op), op, + mlx5_core_dbg(dev, "cmd[%d]: dump command %s(0x%x) %s\n", + ent->idx, mlx5_command_str(op), op, input ? "INPUT" : "OUTPUT"); if (data_only) { if (input) { - dump_buf(ent->lay->in, sizeof(ent->lay->in), 1, offset); + dump_buf(ent->lay->in, sizeof(ent->lay->in), 1, offset, ent->idx); offset += sizeof(ent->lay->in); } else { - dump_buf(ent->lay->out, sizeof(ent->lay->out), 1, offset); + dump_buf(ent->lay->out, sizeof(ent->lay->out), 1, offset, ent->idx); offset += sizeof(ent->lay->out); } } else { - dump_buf(ent->lay, sizeof(*ent->lay), 0, offset); + dump_buf(ent->lay, sizeof(*ent->lay), 0, offset, ent->idx); offset += sizeof(*ent->lay); } for (i = 0; i < n && next; i++) { if (data_only) { dump_len = min_t(int, MLX5_CMD_DATA_BLOCK_SIZE, msg->len - offset); - dump_buf(next->buf, dump_len, 1, offset); + dump_buf(next->buf, dump_len, 1, offset, ent->idx); offset += MLX5_CMD_DATA_BLOCK_SIZE; } else { - mlx5_core_dbg(dev, "command block:\n"); - dump_buf(next->buf, sizeof(struct mlx5_cmd_prot_block), 0, offset); + mlx5_core_dbg(dev, "cmd[%d]: command block:\n", ent->idx); + dump_buf(next->buf, sizeof(struct mlx5_cmd_prot_block), 0, offset, + ent->idx); offset += sizeof(struct mlx5_cmd_prot_block); } next = next->next; @@ -842,6 +844,8 @@ static void dump_command(struct mlx5_core_dev *dev, if (data_only) pr_debug("\n"); + + mlx5_core_dbg(dev, "cmd[%d]: end dump\n", ent->idx); } static u16 msg_to_opcode(struct mlx5_cmd_msg *in) From patchwork Fri Mar 12 23:38:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 12136187 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1F28EC43603 for ; Fri, 12 Mar 2021 23:40:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 030E764EDF for ; Fri, 12 Mar 2021 23:40:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235897AbhCLXjb (ORCPT ); Fri, 12 Mar 2021 18:39:31 -0500 Received: from mail.kernel.org ([198.145.29.99]:32842 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235826AbhCLXjB (ORCPT ); Fri, 12 Mar 2021 18:39:01 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 94F6964F89; Fri, 12 Mar 2021 23:39:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1615592340; bh=eu4j/xXHVScm2qElUVqxDINeoVNSl+rSIuym8P4gWto=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A8FBWROgni1/kVroUrU3LNaauKIfUzmlcigofxiLUDzmgjsqwSoE1h6EgB6AQjed4 8tF4hyt+wK0ZbaCHC3wPaDDT2P9ihN6L4TLtbuLIGH52q55/40fOkLycw6QhrugYdL bdR4XfuhtpEyMsRd9U4FnxwQnavedSrYl3fzq3MDlQL8+hHdLzFz/F+qp2AC0x4P2r d4+moXJCKW4IGllL42Ns2uQzXWZFgOCgkHZV5z1T9ZwcvG3xJ28SxUqZQ1niqNin1H 5EQ9W+EJToxhSlTWJH8JeW7YimDCcJoTUy55IIerC5aGhmd4v2qbbcGIou7OqhBt9q aj/L0EkJRy05Q== From: Saeed Mahameed To: "David S. Miller" , Jakub Kicinski Cc: netdev@vger.kernel.org, Paul Blakey , Maor Dickman , Roi Dayan , Saeed Mahameed Subject: [net-next 12/13] net/mlx5: CT: Add support for mirroring Date: Fri, 12 Mar 2021 15:38:50 -0800 Message-Id: <20210312233851.494832-13-saeed@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210312233851.494832-1-saeed@kernel.org> References: <20210312233851.494832-1-saeed@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Paul Blakey Add support for mirroring before the CT action by spliting the pre ct rule. Mirror outputs are done first on the tc chain,prio table rule (the fwd rule), which will then forward to a per port fwd table. On this fwd table, we insert the original pre ct rule that forwards to ct/ct nat table. Signed-off-by: Paul Blakey Signed-off-by: Maor Dickman Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed --- .../ethernet/mellanox/mlx5/core/en/tc_ct.c | 4 ++++ .../net/ethernet/mellanox/mlx5/core/en_tc.c | 19 ++++++++++--------- 2 files changed, 14 insertions(+), 9 deletions(-) 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 3a6095c912f1..5e3d31b888ce 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c @@ -1797,6 +1797,10 @@ __mlx5_tc_ct_flow_offload(struct mlx5_tc_ct_priv *ct_priv, ct_flow->post_ct_attr->prio = 0; ct_flow->post_ct_attr->ft = ct_priv->post_ct; + /* Splits were handled before CT */ + if (ct_priv->ns_type == MLX5_FLOW_NAMESPACE_FDB) + ct_flow->post_ct_attr->esw_attr->split_count = 0; + ct_flow->post_ct_attr->inner_match_level = MLX5_MATCH_NONE; ct_flow->post_ct_attr->outer_match_level = MLX5_MATCH_NONE; ct_flow->post_ct_attr->action &= ~(MLX5_FLOW_CONTEXT_ACTION_DECAP); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c index c72725c3f53b..121f0a744e55 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c @@ -1087,19 +1087,23 @@ mlx5e_tc_offload_fdb_rules(struct mlx5_eswitch *esw, if (flow_flag_test(flow, CT)) { mod_hdr_acts = &attr->parse_attr->mod_hdr_acts; - return mlx5_tc_ct_flow_offload(get_ct_priv(flow->priv), + rule = mlx5_tc_ct_flow_offload(get_ct_priv(flow->priv), flow, spec, attr, mod_hdr_acts); + } else { + rule = mlx5_eswitch_add_offloaded_rule(esw, spec, attr); } - rule = mlx5_eswitch_add_offloaded_rule(esw, spec, attr); if (IS_ERR(rule)) return rule; if (attr->esw_attr->split_count) { flow->rule[1] = mlx5_eswitch_add_fwd_rule(esw, spec, attr); if (IS_ERR(flow->rule[1])) { - mlx5_eswitch_del_offloaded_rule(esw, rule, attr); + if (flow_flag_test(flow, CT)) + mlx5_tc_ct_delete_flow(get_ct_priv(flow->priv), flow, attr); + else + mlx5_eswitch_del_offloaded_rule(esw, rule, attr); return flow->rule[1]; } } @@ -2989,7 +2993,8 @@ static bool actions_match_supported(struct mlx5e_priv *priv, actions = flow->attr->action; if (mlx5e_is_eswitch_flow(flow)) { - if (flow->attr->esw_attr->split_count && ct_flow) { + if (flow->attr->esw_attr->split_count && ct_flow && + !MLX5_CAP_GEN(flow->attr->esw_attr->in_mdev, reg_c_preserve)) { /* All registers used by ct are cleared when using * split rules. */ @@ -3789,6 +3794,7 @@ static int parse_tc_fdb_actions(struct mlx5e_priv *priv, return err; flow_flag_set(flow, CT); + esw_attr->split_count = esw_attr->out_count; break; default: NL_SET_ERR_MSG_MOD(extack, "The offload action is not supported"); @@ -3851,11 +3857,6 @@ static int parse_tc_fdb_actions(struct mlx5e_priv *priv, return -EOPNOTSUPP; } - if (attr->action & MLX5_FLOW_CONTEXT_ACTION_FWD_DEST) { - NL_SET_ERR_MSG_MOD(extack, - "Mirroring goto chain rules isn't supported"); - return -EOPNOTSUPP; - } attr->action |= MLX5_FLOW_CONTEXT_ACTION_FWD_DEST; } From patchwork Fri Mar 12 23:38:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 12136189 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0454CC4360C for ; Fri, 12 Mar 2021 23:40:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E32AB64F8D for ; Fri, 12 Mar 2021 23:40:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235901AbhCLXjb (ORCPT ); Fri, 12 Mar 2021 18:39:31 -0500 Received: from mail.kernel.org ([198.145.29.99]:32852 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235830AbhCLXjB (ORCPT ); Fri, 12 Mar 2021 18:39:01 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1B95564F9F; Fri, 12 Mar 2021 23:39:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1615592341; bh=3cB7wlJC43SIuSjS6UZamwhKty89CIJLHjRK7nVt0Xo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WW9c25S6Sx6DYoP30YeN797RUyC18X/PchIDFs+c2F/UZiQB++KuIdz2d5VjbpRz6 kZJ5dtNLt1ySk71gD8KdceONw4pWFf2RQwNOtb59FUSSZ+zjK/mJTuaUg3vzxd99kf ivdNNPa8d6JxueAKmhQSpMoC9QF9hWow6BAPvmHi51uWXUeaLNQd0fOwniRZmIu2cD LMed0zOK6tarlcaEclF4mj8Sen8ZfwxiWwqe1nddbid79Sie3mtYa8H2qbFIn/yYeH MZKrzvkiDry/waPpcbjlVHEd7kQzCaj+0Mszst5jwijO/lBMgVJJGgR5G865wqHtVE nC0/j32q+Lv0w== From: Saeed Mahameed To: "David S. Miller" , Jakub Kicinski Cc: netdev@vger.kernel.org, Maor Dickman , Roi Dayan , Saeed Mahameed Subject: [net-next 13/13] net/mlx5e: Allow to match on ICMP parameters Date: Fri, 12 Mar 2021 15:38:51 -0800 Message-Id: <20210312233851.494832-14-saeed@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210312233851.494832-1-saeed@kernel.org> References: <20210312233851.494832-1-saeed@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Maor Dickman Support matching on ICMPv4/6 type and code parameters using misc3 section of match parameters. Signed-off-by: Maor Dickman Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed --- .../net/ethernet/mellanox/mlx5/core/en_tc.c | 47 +++++++++++++++++++ include/linux/mlx5/device.h | 2 + 2 files changed, 49 insertions(+) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c index 121f0a744e55..54ea0dae7ded 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c @@ -1961,6 +1961,10 @@ static int __parse_cls_flower(struct mlx5e_priv *priv, misc_parameters); void *misc_v = MLX5_ADDR_OF(fte_match_param, spec->match_value, misc_parameters); + void *misc_c_3 = MLX5_ADDR_OF(fte_match_param, spec->match_criteria, + misc_parameters_3); + void *misc_v_3 = MLX5_ADDR_OF(fte_match_param, spec->match_value, + misc_parameters_3); struct flow_rule *rule = flow_cls_offload_flow_rule(f); struct flow_dissector *dissector = rule->match.dissector; u16 addr_type = 0; @@ -1990,6 +1994,7 @@ static int __parse_cls_flower(struct mlx5e_priv *priv, BIT(FLOW_DISSECTOR_KEY_CT) | BIT(FLOW_DISSECTOR_KEY_ENC_IP) | BIT(FLOW_DISSECTOR_KEY_ENC_OPTS) | + BIT(FLOW_DISSECTOR_KEY_ICMP) | BIT(FLOW_DISSECTOR_KEY_MPLS))) { NL_SET_ERR_MSG_MOD(extack, "Unsupported key"); netdev_dbg(priv->netdev, "Unsupported key used: 0x%x\n", @@ -2309,7 +2314,49 @@ static int __parse_cls_flower(struct mlx5e_priv *priv, if (match.mask->flags) *match_level = MLX5_MATCH_L4; } + if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_ICMP)) { + struct flow_match_icmp match; + flow_rule_match_icmp(rule, &match); + switch (ip_proto) { + case IPPROTO_ICMP: + if (!(MLX5_CAP_GEN(priv->mdev, flex_parser_protocols) & + MLX5_FLEX_PROTO_ICMP)) + return -EOPNOTSUPP; + MLX5_SET(fte_match_set_misc3, misc_c_3, icmp_type, + match.mask->type); + MLX5_SET(fte_match_set_misc3, misc_v_3, icmp_type, + match.key->type); + MLX5_SET(fte_match_set_misc3, misc_c_3, icmp_code, + match.mask->code); + MLX5_SET(fte_match_set_misc3, misc_v_3, icmp_code, + match.key->code); + break; + case IPPROTO_ICMPV6: + if (!(MLX5_CAP_GEN(priv->mdev, flex_parser_protocols) & + MLX5_FLEX_PROTO_ICMPV6)) + return -EOPNOTSUPP; + MLX5_SET(fte_match_set_misc3, misc_c_3, icmpv6_type, + match.mask->type); + MLX5_SET(fte_match_set_misc3, misc_v_3, icmpv6_type, + match.key->type); + MLX5_SET(fte_match_set_misc3, misc_c_3, icmpv6_code, + match.mask->code); + MLX5_SET(fte_match_set_misc3, misc_v_3, icmpv6_code, + match.key->code); + break; + default: + NL_SET_ERR_MSG_MOD(extack, + "Code and type matching only with ICMP and ICMPv6"); + netdev_err(priv->netdev, + "Code and type matching only with ICMP and ICMPv6\n"); + return -EINVAL; + } + if (match.mask->code || match.mask->type) { + *match_level = MLX5_MATCH_L4; + spec->match_criteria_enable |= MLX5_MATCH_MISC_PARAMETERS_3; + } + } return 0; } diff --git a/include/linux/mlx5/device.h b/include/linux/mlx5/device.h index dc3d2508f5c6..92a029a800a0 100644 --- a/include/linux/mlx5/device.h +++ b/include/linux/mlx5/device.h @@ -1142,6 +1142,8 @@ enum mlx5_flex_parser_protos { MLX5_FLEX_PROTO_GENEVE = 1 << 3, MLX5_FLEX_PROTO_CW_MPLS_GRE = 1 << 4, MLX5_FLEX_PROTO_CW_MPLS_UDP = 1 << 5, + MLX5_FLEX_PROTO_ICMP = 1 << 8, + MLX5_FLEX_PROTO_ICMPV6 = 1 << 9, }; /* MLX5 DEV CAPs */