From: Gavin Shan <gwshan@linux.vnet.ibm.com>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, benh@kernel.crashing.org, joel@jms.id.au,
gerlitz.or@gmail.com, weixue@trustnetic.com, yuvali@mellanox.com,
alexei.starovoitov@gmail.com, f.fainelli@gmail.com,
Gavin Shan <gwshan@linux.vnet.ibm.com>
Subject: [PATCH net-next v2 00/10] NCSI Support
Date: Fri, 15 Jul 2016 20:44:10 +1000 [thread overview]
Message-ID: <1468579460-13768-1-git-send-email-gwshan@linux.vnet.ibm.com> (raw)
This series rebases on David's linux-net git repo ("master" branch). It's
to support NCSI stack on drivers/net/ethernet/faraday/ftgmac100.c. The
implementation is based on NCSI spec (version: 1.1.0):
https://www.dmtf.org/sites/default/files/standards/documents/DSP0222_1.1.0.pdf
As the following figure shows and defined in NCSI spec:
* The NC-SI (aka NCSI) is defined as the interface between a (Base)
Management Controller (BMC) and one or multiple Network Interface
Controlers (NIC) on host side. The interface is responsible for providing
external network connectivity for BMC.
* Each BMC can connect to multiple packages, up to 8. Each package can have
multiple channels, up to 32. Every package and channel are identified by
3-bits and 5-bits in NCSI packet.
* NCSI packet, encapsulated in ethernet frame, has 0x88F8 in the protocol
field. The destination MAC address should be 0xFF's while the source MAC
address can be arbitrary one.
* NCSI packets are classified to command, response, AEN (Asynchronous Event Notification).
Commands are sent from BMC to host (NIC) for configuration and
information retrival. Responses, corresponding to commands, are sent from
host to BMC for confirmation and requested information. One command should
have one and only one response. AEN is sent from host to BMC for notification
(e.g. link down on active channel) so that BMC can take appropriate action.
+------------------+ +----------------------------------------------+
| | | Host |
| BMC | | |
| | | +-------------------+ +-------------------+ |
| +---------+ | | | Package-A | | Package-B | |
| | | | | +---------+---------+ +-------------------+ |
| |ftgmac100| | | | Channel | Channel | | Channel | Channel | |
+----+----+----+---+ +-+---------+---------+--+---------+---------+-+
| | |
| | |
+-----------------------------+----------------------+
The series of patches is highlighted as:
The design for the patchset is highlighted as below:
* The network driver uses 3 interfaces exported from NCSI stack:
ncsi_register_dev() - Register (create) a associated NCSI device.
ncsi_start_dev() - Bring up the NCSI device.
ncsi_unregister_dev() - Destroy the registered NCSI device.
* There are several data structures introduced for different objects:
struct ncsi_dev - NCSI device seen by network device driver.
struct ncsi_dev_priv - NCSI device seen by NCSI stack.
struct ncsi_package - NCSI package which can have multiple channels.
struct ncsi_channel - NCSI channel.
* The NCSI stack is driven by workqueue and state machine internally.
* The all available NCSI packages and channels are enumerated (probed) on
the first call to ncsi_start_dev(). The NCSI topology won't change until
the NCSI device is destroyed.
* All available channels will be brought up When the hardware arbitration
is enabled. Otherwise, only one channel is selected as active one. The
NCSI internal is driven by state machine with help of a workqueue. In
the meanwhile, there are 3 states for each channel which can be put into
a queue requesting for configuration or suspending. Channels in the queue
with inactive state set will be configured (bringup) while channels in
the queue with active state will be suspended (teardown). The request
configuration or suspending is being applied on the channel if it's in
invisible state.
* Failover, another inactive channel is selected as active, can happen when
the hardware arbitration is disabled. The failover can be caused by timeout
on link monitor and AEN.
* NCSI stack should be configurable through netlink or another mechanism, it's
not implemented in this patchset. It's something TBD.
* The first NIC driver that is aware of NCSI: drivers/net/ethernet/faraday/ftgmac100.c
Changelog
=========
v1 -> v2:
* Support NCSI spec v1.1.0 (3 more commands and 4 hardware arbitration
modes added).
* Enable AEN packets according to the supported list.
* Introduce NCSI channel states and processing queue in order to support
the hardware arbitration.
* The hardware arbitration is supported (tested with emulated environment).
* Introduce link monitor with GLS (Get Link Status) command/response as part
of the error handling defined in NCSI spec.
* Support IPv6 address discovery when CONFIG_IPV6 is enabled.
Gavin Shan (10):
net/ncsi: Resource management
net/ncsi: NCSI command packet handler
net/ncsi: NCSI response packet handler
net/ncsi: Package and channel management
net/ncsi: NCSI AEN packet handler
net/faraday: Helper functions to create or destroy MDIO interface
net/faraday: Read MAC address from chip
net/faraday: Support NCSI mode
net/faraday: Match driver according to compatible property
net/faraday: Mask PHY interrupt with NCSI mode
drivers/net/ethernet/faraday/ftgmac100.c | 280 +++++--
include/net/ncsi.h | 52 ++
net/Kconfig | 1 +
net/Makefile | 1 +
net/ncsi/Kconfig | 12 +
net/ncsi/Makefile | 4 +
net/ncsi/internal.h | 328 ++++++++
net/ncsi/ncsi-aen.c | 193 +++++
net/ncsi/ncsi-cmd.c | 367 +++++++++
net/ncsi/ncsi-manage.c | 1199 ++++++++++++++++++++++++++++++
net/ncsi/ncsi-pkt.h | 415 +++++++++++
net/ncsi/ncsi-rsp.c | 1035 ++++++++++++++++++++++++++
12 files changed, 3824 insertions(+), 63 deletions(-)
create mode 100644 include/net/ncsi.h
create mode 100644 net/ncsi/Kconfig
create mode 100644 net/ncsi/Makefile
create mode 100644 net/ncsi/internal.h
create mode 100644 net/ncsi/ncsi-aen.c
create mode 100644 net/ncsi/ncsi-cmd.c
create mode 100644 net/ncsi/ncsi-manage.c
create mode 100644 net/ncsi/ncsi-pkt.h
create mode 100644 net/ncsi/ncsi-rsp.c
--
2.1.0
next reply other threads:[~2016-07-15 10:51 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-15 10:44 Gavin Shan [this message]
2016-07-15 10:44 ` [PATCH net-next v2 01/10] net/ncsi: Resource management Gavin Shan
2016-07-15 10:44 ` [PATCH net-next v2 02/10] net/ncsi: NCSI command packet handler Gavin Shan
2016-07-15 14:08 ` kbuild test robot
2016-07-18 0:15 ` Gavin Shan
2016-07-19 1:48 ` Gavin Shan
2016-07-15 10:44 ` [PATCH net-next v2 03/10] net/ncsi: NCSI response " Gavin Shan
2016-07-15 10:44 ` [PATCH net-next v2 04/10] net/ncsi: Package and channel management Gavin Shan
2016-07-15 14:30 ` kbuild test robot
2016-07-18 0:16 ` Gavin Shan
2016-07-15 10:44 ` [PATCH net-next v2 05/10] net/ncsi: NCSI AEN packet handler Gavin Shan
2016-07-15 10:44 ` [PATCH net-next v2 06/10] net/faraday: Helper functions to create or destroy MDIO interface Gavin Shan
2016-07-15 10:44 ` [PATCH net-next v2 07/10] net/faraday: Read MAC address from chip Gavin Shan
2016-07-19 10:50 ` David Laight
2016-07-19 10:57 ` Benjamin Herrenschmidt
2016-07-19 23:40 ` Gavin Shan
2016-07-15 10:44 ` [PATCH net-next v2 08/10] net/faraday: Support NCSI mode Gavin Shan
2016-07-15 10:44 ` [PATCH net-next v2 09/10] net/faraday: Match driver according to compatible property Gavin Shan
2016-07-15 10:44 ` [PATCH net-next v2 10/10] net/faraday: Mask PHY interrupt with NCSI mode Gavin Shan
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=1468579460-13768-1-git-send-email-gwshan@linux.vnet.ibm.com \
--to=gwshan@linux.vnet.ibm.com \
--cc=alexei.starovoitov@gmail.com \
--cc=benh@kernel.crashing.org \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=gerlitz.or@gmail.com \
--cc=joel@jms.id.au \
--cc=netdev@vger.kernel.org \
--cc=weixue@trustnetic.com \
--cc=yuvali@mellanox.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;
as well as URLs for NNTP newsgroup(s).