From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 400EF322C63; Thu, 11 Sep 2025 12:31:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757593887; cv=none; b=A4ZcKJ/kymKVt7OMaAwIm9jABGsqzVhH447TodO7WH/w/SaIWNnddy9QADpjiclOo6P0BJp22HHgQ+MLMMAnDz92Nt10OfSnjtwGly7VPonbBNo12HBMalTYWajnw9EDof1dVQFzZ+nLiCjER+llhE9uC2jNQ/Sz/hpTgY/kPUE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757593887; c=relaxed/simple; bh=Nfp9loWsUAIvLuDHuc9ZNWAFAiOrY8CU8Sj5UYLAyyY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=bWI2MIH1YwJqh/gJD90w/8pQe3uKpwMc9GnbF6ue3gzgHHYknJoQ/8A8dNPTbbR42NwDqbyAh+nXOYsAfOIyajJt+eDmDIQatcty39Dma0f14M0XI5XLJek2Ces7c6aMr2kCUBEGMB7ewP/NWRM0qzyJSt72eh+nOQHCzAtNdQY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=AWutjt32; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="AWutjt32" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1B15CC4CEF0; Thu, 11 Sep 2025 12:31:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1757593887; bh=Nfp9loWsUAIvLuDHuc9ZNWAFAiOrY8CU8Sj5UYLAyyY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=AWutjt325QtNw+LfmxqjhbtdNBmBXLC3zMAEil7r/RG8DL01OctgfwFxRHrh8BVmd sy0SdSpIM4SQZKoUZ+WPXd6nNJihJH44S0FqlCCzT5J2MTHqIQ287PYaQDEwk76z4k BTsS/q8qgjj+OKFZ9VTVzJVKGUPRE2Y68uZUnvytJzTewNWWA8lBO1ir9dRn0HqGBx rfxTJxbF9B93FY+uvk6kIqFXD8gM4Zqgp9y3cHNzkZgbxR9B8PtoE7LoDTLPHLkz7W WhjLjOUBBY7jeLgcWFxsA7aQiV8wl9aMEfv6Fvpy0cLopmri2M9yIt0zmlGv6psA2P tkdOTibCyjaKQ== Date: Thu, 11 Sep 2025 13:31:20 +0100 From: Simon Horman To: Fan Gong Cc: Zhu Yikai , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Andrew Lunn , linux-doc@vger.kernel.org, Jonathan Corbet , Bjorn Helgaas , luosifu , Xin Guo , Shen Chenyang , Zhou Shuai , Wu Like , Shi Jing , Luo Yang , Meny Yossefi , Gur Stavi , Lee Trager , Michael Ellerman , Vadim Fedorenko , Suman Ghosh , Przemek Kitszel , Joe Damato , Christophe JAILLET Subject: Re: [PATCH net-next v05 03/14] hinic3: HW common function initialization Message-ID: <20250911123120.GG30363@horms.kernel.org> References: <95f3ae76e2db6411f4509056d916c63f49e9270c.1757401320.git.zhuyikai1@h-partners.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <95f3ae76e2db6411f4509056d916c63f49e9270c.1757401320.git.zhuyikai1@h-partners.com> On Tue, Sep 09, 2025 at 03:33:28PM +0800, Fan Gong wrote: > Add initialization for data structures and functions(cmdq ceq mbox ceq) > that interact with hardware. > > Co-developed-by: Zhu Yikai > Signed-off-by: Zhu Yikai > Signed-off-by: Fan Gong The nits below notwithstanding, this looks good to me. Reviewed-by: Simon Horman ... > diff --git a/drivers/net/ethernet/huawei/hinic3/hinic3_hw_comm.c b/drivers/net/ethernet/huawei/hinic3/hinic3_hw_comm.c ... > @@ -61,3 +62,176 @@ int hinic3_func_reset(struct hinic3_hwdev *hwdev, u16 func_id, u64 reset_flag) > > return 0; > } > + > +static int hinic3_comm_features_nego(struct hinic3_hwdev *hwdev, u8 opcode, > + u64 *s_feature, u16 size) > +{ > + struct comm_cmd_feature_nego feature_nego = {}; > + struct mgmt_msg_params msg_params = {}; > + int err; > + > + feature_nego.func_id = hinic3_global_func_id(hwdev); > + feature_nego.opcode = opcode; > + if (opcode == MGMT_MSG_CMD_OP_SET) > + memcpy(feature_nego.s_feature, s_feature, (size * sizeof(u64))); nit: This could use array_size() > + > + mgmt_msg_params_init_default(&msg_params, &feature_nego, > + sizeof(feature_nego)); > + > + err = hinic3_send_mbox_to_mgmt(hwdev, MGMT_MOD_COMM, > + COMM_CMD_FEATURE_NEGO, &msg_params); > + if (err || feature_nego.head.status) { > + dev_err(hwdev->dev, "Failed to negotiate feature, err: %d, status: 0x%x\n", > + err, feature_nego.head.status); > + return -EINVAL; > + } > + > + if (opcode == MGMT_MSG_CMD_OP_GET) > + memcpy(s_feature, feature_nego.s_feature, (size * sizeof(u64))); Ditto. > + > + return 0; > +} ...