mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Gur Stavi <gur.stavi@huawei.com>
To: <przemyslaw.kitszel@intel.com>
Cc: <andrew+netdev@lunn.ch>, <cai.huoqing@linux.dev>,
	<corbet@lwn.net>, <davem@davemloft.net>, <edumazet@google.com>,
	<gongfan1@huawei.com>, <guoxin09@huawei.com>,
	<gur.stavi@huawei.com>, <helgaas@kernel.org>, <horms@kernel.org>,
	<kuba@kernel.org>, <linux-doc@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <luosifu@huawei.com>,
	<meny.yossefi@huawei.com>, <netdev@vger.kernel.org>,
	<pabeni@redhat.com>, <shenchenyang1@hisilicon.com>,
	<shijing34@huawei.com>, <sumang@marvell.com>,
	<wulike1@huawei.com>, <zhoushuai28@huawei.com>
Subject: Re: [PATCH net-next v04 1/1] hinic3: module initialization and tx/rx logic
Date: Wed, 22 Jan 2025 09:07:52 +0200	[thread overview]
Message-ID: <20250122070752.3966233-1-gur.stavi@huawei.com> (raw)
In-Reply-To: <3bc8a815-96c3-46cd-ae87-b46b61648bca@intel.com>

> > Auxiliary driver registration.
> > Net device_ops registration but open/stop are empty stubs.
> > tx/rx logic.
>
> Take care for spelling: Tx/Rx; HW (just below).

Please elaborate. Spelling of what?

>
> >
> > All major data structures of the driver are fully introduced with the
> > code that uses them but without their initialization code that requires
> > management interface with the hw.
> >
> > Submitted-by: Gur Stavi <gur.stavi@huawei.com>
>
> this tag is not needed
>
> > Signed-off-by: Gur Stavi <gur.stavi@huawei.com>
>
> your tag should be last
>
> > Signed-off-by: Xin Guo <guoxin09@huawei.com>
>
> no idea what Xin did, if you want to give credit to someone
> you could use Co-developed-by: tag (put it just above the SoB)
>
> > Signed-off-by: gongfan <gongfan1@huawei.com>
>
> It would be much appricieated if you will spell the full name
> for gongfan, at least two parts (like you did for the rest),
> especially for someone you put into the MAINTAINERS file.
> OTOH, please keep in mind that maintainer should be active
> on the mailing list (regarding this driver).
>

Ack

> > +
> > +Global function ID
> > +------------------
> > +
> > +Every function, PF or VF, has a unique ordinal identification within the device.
> > +Many commands to management (mbox or cmdq) contain this ID so HW can apply the
>
> s/commands to management/management commands/
>

Ack

> > +L:	netdev@vger.kernel.org
> > +S:	Supported
>
> there is a (relatively new) requirement that the device needs to report
> to the netdev CI to have an "S" here, so for now you should use "M"
>

Ack

> > +	# Fields of HW and management structures are little endian and are
> > +	# currently not converted
> > +	depends on !CPU_BIG_ENDIAN
> > +	depends on X86 || ARM64 || COMPILE_TEST
> > +	depends on PCI_MSI && 64BIT
> > +	select AUXILIARY_BUS
> > +	help
> > +	  This driver supports HiNIC PCIE Ethernet cards.
> > +	  To compile this driver as part of the kernel, choose Y here.
> > +	  If unsure, choose N.
> > +	  The default is N.
>
> the last 3 lines are very much obvious/redundant
>

Ack

> > diff --git a/drivers/net/ethernet/huawei/hinic3/Makefile b/drivers/net/ethernet/huawei/hinic3/Makefile
> > new file mode 100644
> > index 000000000000..02656853f629
> > --- /dev/null
> > +++ b/drivers/net/ethernet/huawei/hinic3/Makefile
> > @@ -0,0 +1,21 @@
> > +# SPDX-License-Identifier: GPL-2.0
> > +# Copyright (c) Huawei Technologies Co., Ltd. 2024. All rights reserved.
>
> too late
>

Ack

> > +
> > +obj-$(CONFIG_HINIC3) += hinic3.o
> > +
> > +hinic3-objs := hinic3_hwdev.o \
> > +	       hinic3_lld.o \
> > +	       hinic3_common.o \
> > +	       hinic3_hwif.o \
> > +	       hinic3_hw_cfg.o \
> > +	       hinic3_queue_common.o \
> > +	       hinic3_mbox.o \
> > +	       hinic3_hw_comm.o \
> > +	       hinic3_wq.o \
> > +	       hinic3_nic_io.o \
> > +	       hinic3_nic_cfg.o \
> > +	       hinic3_tx.o \
> > +	       hinic3_rx.o \
> > +	       hinic3_netdev_ops.o \
> > +	       hinic3_rss.o \
> > +	       hinic3_main.o
>
> in general, any list of random things could be sorted (to ease out git
> merges in the future)
>

Ack

> > +	(((u32)(hwdev)->cfg_mgmt->svc_cap.chip_svc_type) & BIT(HINIC3_SERVICE_T_NIC))
> > +
> > +bool hinic3_support_nic(struct hinic3_hwdev *hwdev)
> > +{
> > +	if (!IS_NIC_TYPE(hwdev))
> > +		return false;
> > +
> > +	return true;
>
> this is just:
> 	return IS_NIC_TYPE(hwdev);
>

Ack

> > +static int comm_msg_to_mgmt_sync(struct hinic3_hwdev *hwdev, u16 cmd, const void *buf_in,
> > +				 u32 in_size, void *buf_out, u32 *out_size)
> > +{
> > +	return hinic3_send_mbox_to_mgmt(hwdev, HINIC3_MOD_COMM, cmd, buf_in,
> > +					in_size, buf_out, out_size, 0);
> > +}
> > +
> > +int hinic3_func_reset(struct hinic3_hwdev *hwdev, u16 func_id, u64 reset_flag)
> > +{
> > +	struct comm_cmd_func_reset func_reset;
>
>   = {}
>
> > +	u32 out_size = sizeof(func_reset);
> > +	int err;
> > +
> > +	memset(&func_reset, 0, sizeof(func_reset));
>
> with "= {}" above, memset() could be eliminated
>
> > +	func_reset.func_id = func_id;
> > +	func_reset.reset_flag = reset_flag;
>
> alternative would be
> 	struct comm_cmd_func_reset func_reset = {
> 		.func_id = func_id,
> 		.reset_flag = reset_flag,
> 	};
>

Ack

> > +++ b/drivers/net/ethernet/huawei/hinic3/hinic3_hw_intf.h
> > @@ -0,0 +1,88 @@
> > +/* SPDX-License-Identifier: GPL-2.0 */
> > +/* Copyright (c) Huawei Technologies Co., Ltd. 2024. All rights reserved. */
> > +
> > +#ifndef HINIC3_HW_INTF_H
>
> please add two underscores to the header guards
>

Ack

> > +#define HINIC3_HW_INTF_H

  reply	other threads:[~2025-01-22  6:55 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-16  7:51 [PATCH net-next v04 0/1] net: hinic3: Add a driver for Huawei 3rd gen NIC Gur Stavi
2025-01-16  7:51 ` [PATCH net-next v04 1/1] hinic3: module initialization and tx/rx logic Gur Stavi
2025-01-16  9:36   ` Przemek Kitszel
2025-01-22  7:07     ` Gur Stavi [this message]
2025-01-22 13:58       ` Przemek Kitszel
2025-01-23  8:20         ` Gur Stavi
2025-01-23  9:32           ` Przemek Kitszel
2025-01-16 18:10   ` Simon Horman
2025-01-21  9:47     ` Gur Stavi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250122070752.3966233-1-gur.stavi@huawei.com \
    --to=gur.stavi@huawei.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=cai.huoqing@linux.dev \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gongfan1@huawei.com \
    --cc=guoxin09@huawei.com \
    --cc=helgaas@kernel.org \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luosifu@huawei.com \
    --cc=meny.yossefi@huawei.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=przemyslaw.kitszel@intel.com \
    --cc=shenchenyang1@hisilicon.com \
    --cc=shijing34@huawei.com \
    --cc=sumang@marvell.com \
    --cc=wulike1@huawei.com \
    --cc=zhoushuai28@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®