All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Gur Stavi <gur.stavi@huawei.com>
Cc: gongfan <gongfan1@huawei.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	linux-doc@vger.kernel.org, Jonathan Corbet <corbet@lwn.net>,
	Cai Huoqing <cai.huoqing@linux.dev>,
	Xin Guo <guoxin09@huawei.com>,
	Shen Chenyang <shenchenyang1@hisilicon.com>,
	Zhou Shuai <zhoushuai28@huawei.com>, Wu Like <wulike1@huawei.com>,
	Shi Jing <shijing34@huawei.com>,
	Meny Yossefi <meny.yossefi@huawei.com>
Subject: Re: [RFC net-next v02 1/3] net: hinic3: module initialization and tx/rx logic
Date: Thu, 12 Dec 2024 11:02:56 -0600	[thread overview]
Message-ID: <20241212170256.GA3347301@bhelgaas> (raw)
In-Reply-To: <7d62ca11c809ac646c2fd8613fd48729061c22b3.1733990727.git.gur.stavi@huawei.com>

On Thu, Dec 12, 2024 at 02:04:15PM +0200, Gur Stavi wrote:
> From: gongfan <gongfan1@huawei.com>
> 
> This is [1/3] part of hinic3 Ethernet driver initial submission.
> With this patch hinic3 is a valid kernel module but non-functional driver.

> +++ b/Documentation/networking/device_drivers/ethernet/huawei/hinic3.rst
> @@ -0,0 +1,136 @@
> +.. SPDX-License-Identifier: GPL-2.0
> +
> +=====================================================================
> +Linux kernel driver for Huawei Ethernet Device Driver (hinic3) family
> +=====================================================================
> +
> +Overview
> +========
> +
> +The hinic3 is a network interface card(NIC) for Data Center. It supports

Add space before "(".

> +Prime Physical Function (PPF) is responsible for the management of the
> +whole NIC card. For example, clock synchronization between the NIC and
> +the host.
> +Any PF may serve as a PPF. The PPF is selected dynamically.

Add blank line between paragraphs or reflow into a single paragraph.

Is the PPF selected dynamically by the driver?  By firmware on the
NIC?

> +hinic3_pci_id_tbl.h       Supported device IDs.
> +hinic3_hw_intf.h          Interface between HW and driver.
> +hinic3_queue_common.[ch]  Common structures and methods for NIC queues.
> +hinic3_common.[ch]        Encapsulation of memory operations in Linux.
> +hinic3_csr.h              Register definitions in the BAR.
> +hinic3_hwif.[ch]          Interface for BAR.
> +hinic3_eqs.[ch]           Interface for AEQs and CEQs.
> +hinic3_mbox.[ch]          Interface for mailbox.
> +hinic3_mgmt.[ch]          Management interface based on mailbox and AEQ.
> +hinic3_wq.[ch]            Work queue data structures and interface.
> +hinic3_cmdq.[ch]          Command queue is used to post command to HW.
> +hinic3_hwdev.[ch]         HW structures and methods abstractions.
> +hinic3_lld.[ch]           Auxiliary driver adaptation layer.
> +hinic3_hw_comm.[ch]       Interface for common HW operations.
> +hinic3_mgmt_interface.h   Interface between firmware and driver.
> +hinic3_hw_cfg.[ch]        Interface for HW configuration.
> +hinic3_irq.c              Interrupt request
> +hinic3_netdev_ops.c       Operations registered to Linux kernel stack.
> +hinic3_nic_dev.h          NIC structures and methods abstractions.
> +hinic3_main.c             Main Linux kernel driver.
> +hinic3_nic_cfg.[ch]       NIC service configuration.
> +hinic3_nic_io.[ch]        Management plane interface for TX and RX.
> +hinic3_rss.[ch]           Interface for Receive Side Scaling (RSS).
> +hinic3_rx.[ch]            Interface for transmit.
> +hinic3_tx.[ch]            Interface for receive.
> +hinic3_ethtool.c          Interface for ethtool operations (ops).
> +hinic3_filter.c           Interface for mac address.

Could drop "." at end (or use it consistently).

s/mac/MAC/

> +2 mailbox related events.
> +
> +MailBox

s/MailBox/Mailbox/ since that's how you use it elsewhere.

> +-------
> +
> +Mailbox is a communication mechanism between the hinic3 driver and the HW.

> +The implementation of CEQ is the same as AEQ. It receives completion events
> +form HW over a fixed size descriptor of 32 bits. Every device can have up
> +to 32 CEQs. Every CEQ has a dedicated IRQ. CEQ only receives solicited
> +events that are responses to requests from the driver. CEQ can receive
> +multiple types of events, but in practice the hinic3 driver ignores all
> +events except for HINIC3_CMDQ that represents completion of previously
> +posted commands on a cmdq.

s/form HW/from HW/

> +Work queues are logical arrays of fixed size WQEs. The array may be spread
> +over multiple non-contiguous pages using indirection table.

Add blank line or wrap into single paragraph.

> +Work queues are used by I/O queues and command queues.

> +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
> +command effect to the right function.

Add blank line or wrap into single paragraph.

> +PF is allowed to post management commands to a subordinate VF by specifying the
> +VFs ID. A VF must provide its own ID. Anti-spoofing in the HW will cause
> +command from a VF to fail if it contains the wrong ID.

> +config HINIC3
> +	tristate "Huawei Intelligent Network Interface Card 3rd"
> +	# Fields of HW and management structures are little endian and will not
> +	# be explicitly converted

I guess this comment is here to explain the !CPU_BIG_ENDIAN below?
That's quite an unusual dependency.

> +	depends on 64BIT && !CPU_BIG_ENDIAN

> +++ 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.
> +
> +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
> \ No newline at end of file

Add newline.

  reply	other threads:[~2024-12-12 17:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-12 12:04 [RFC net-next v02 0/3] net: hinic3: Add a driver for Huawei 3rd gen NIC Gur Stavi
2024-12-12 12:04 ` [RFC net-next v02 1/3] net: hinic3: module initialization and tx/rx logic Gur Stavi
2024-12-12 17:02   ` Bjorn Helgaas [this message]
2024-12-15  8:59     ` Gur Stavi
2024-12-12 17:41   ` Andrew Lunn
2024-12-19  8:55     ` Gur Stavi
2024-12-19  8:46       ` Andrew Lunn
2024-12-19  9:28         ` Gur Stavi
2024-12-12 12:04 ` [RFC net-next v02 2/3] net: hinic3: management interfaces Gur Stavi
2024-12-12 12:04 ` [RFC net-next v02 3/3] net: hinic3: sw and hw initialization code 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=20241212170256.GA3347301@bhelgaas \
    --to=helgaas@kernel.org \
    --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=gur.stavi@huawei.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=meny.yossefi@huawei.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shenchenyang1@hisilicon.com \
    --cc=shijing34@huawei.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.