From patchwork Tue Jan 5 23:03:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 357351 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.3 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, 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 80222C433DB for ; Tue, 5 Jan 2021 23:07:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4DF4B22E00 for ; Tue, 5 Jan 2021 23:07:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728019AbhAEXG4 (ORCPT ); Tue, 5 Jan 2021 18:06:56 -0500 Received: from mail.kernel.org ([198.145.29.99]:57480 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727557AbhAEXGb (ORCPT ); Tue, 5 Jan 2021 18:06:31 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9541F23104; Tue, 5 Jan 2021 23:05:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1609887913; bh=8SOapg8JpqSpJ6bmp4jsC3CkkF2lHQadknYjtpasf4E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=acPAe2H1TTAT4x05xoFuI2/CNr3ky/tqOsi3f8Sr9xFKXuECBkqTBc9mvFPbpk+Ky vKIvuplmARL7eDr6d5L7AKWJ3D42pToRRBHwfkOUuqPEsQM3evxSIsSsHFCICodnul rrnz2rStn824h68pc2/pUMP4xK5PI15FCN3gYU/aHSQ5fN/fr+PodbMdSBHgBZEifP 7ELEeucI6MZP84GGaEHijN847J8YuIRhfXN8LfusK5ZX5JmL2LAUtvpLs25+p7YfuL 7WoG1PttfiKtpD2B3w2Q0WU0Gwfs/ob9f+Kxp4LOkFYs84tUilM7JQiMwaIGw3X3xv h+P0vD89lcF7w== From: Saeed Mahameed To: "David S. Miller" , Jakub Kicinski Cc: netdev@vger.kernel.org, Yevgeny Kliteynik , Saeed Mahameed Subject: [net-next 11/16] net/mlx5: DR, Add STE setters and getters per-device API Date: Tue, 5 Jan 2021 15:03:28 -0800 Message-Id: <20210105230333.239456-12-saeed@kernel.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210105230333.239456-1-saeed@kernel.org> References: <20210105230333.239456-1-saeed@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Yevgeny Kliteynik Extend the STE context struct with various per-device setters and getters. Signed-off-by: Yevgeny Kliteynik Reviewed-by: Saeed Mahameed Signed-off-by: Saeed Mahameed --- .../ethernet/mellanox/mlx5/core/steering/dr_ste.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste.h b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste.h index 0773dad59f93..53bb42978e84 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste.h @@ -76,6 +76,7 @@ u16 mlx5dr_ste_conv_bit_to_byte_mask(u8 *bit_mask); struct mlx5dr_match_param *mask)) struct mlx5dr_ste_ctx { + /* Builders */ void DR_STE_CTX_BUILDER(eth_l2_src_dst); void DR_STE_CTX_BUILDER(eth_l3_ipv6_src); void DR_STE_CTX_BUILDER(eth_l3_ipv6_dst); @@ -96,6 +97,17 @@ struct mlx5dr_ste_ctx { void DR_STE_CTX_BUILDER(register_0); void DR_STE_CTX_BUILDER(register_1); void DR_STE_CTX_BUILDER(src_gvmi_qpn); + + /* Getters and Setters */ + void (*ste_init)(u8 *hw_ste_p, u16 lu_type, + u8 entry_type, u16 gvmi); + void (*set_next_lu_type)(u8 *hw_ste_p, u16 lu_type); + u16 (*get_next_lu_type)(u8 *hw_ste_p); + void (*set_miss_addr)(u8 *hw_ste_p, u64 miss_addr); + u64 (*get_miss_addr)(u8 *hw_ste_p); + void (*set_hit_addr)(u8 *hw_ste_p, u64 icm_addr, u32 ht_size); + void (*set_byte_mask)(u8 *hw_ste_p, u16 byte_mask); + u16 (*get_byte_mask)(u8 *hw_ste_p); }; extern struct mlx5dr_ste_ctx ste_ctx_v0;