summaryrefslogtreecommitdiff
path: root/net/ncsi
AgeCommit message (Collapse)AuthorFilesLines
2015-10-06net/ncsi: Netlink supportGavin Shan5-1/+1104
This adds netlink support so that userland can retrieve the NCSI topology on the specified interface. Also, more netlink commands are introduced to retrieve information from the active channel or configure the active channel with provided options. Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
2015-10-06net/ncsi: Manage NCSI deviceGavin Shan3-3/+546
There are multiple packages and channels connecting to NCSI enabled interface. The available packages and channels are probed with NCSI packets when NCSI device is started. Among the available packages and channels, only one channel should be selected to be active to provide service. When the active channel enters to failure state, we need choose another channel as active one to do failover. This implements the state machine to support above tasks. Also, the public interfaces are exposed for NIC driver to manage NCSI device. Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
2015-10-06net/ncsi: Packet handlerGavin Shan6-1/+2140
NCSI packet encapsulated in ethernet frame is recognized by the ethernet protocol field (0x88F8). According to NCSI spec, the destination MAC field should be 0xFF's, but the source MAC field could be arbitrary one since channel field in NCSI header indicates the source of the packet. There are 3 types of packets depending on the type field in the NCSI packet header: command, response, Asynchronous Event Notification (AEN). The command packets are sent from NCSI enabled interace to the NCSI package or channel for purpose of information retrival or configuration. The response packets, as responses to the received command packets, originate from NCSI package or channel and terminate at NCSI enabled interface. AEN packets are sent from NCSI channel for asynchronous events that might indicate failure detected on the active channel. This implements the functions to handle NCSI packets. Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
2015-10-06net/ncsi: Resource managementGavin Shan4-0/+535
According to NCSI spec (DSP0222), the NCSI enabled interface can connected to multiple packages simultaneously, up to 8 packages. Each package includes multiple channels, up to 32 channels. At one moment, one channel is enabled to provide service to the NCSI enabled interface. Besides, each channel comprises capabilities, modes, filters, version and statistics etc. All of them are resources to NCSI protocol stack. At the meanwhile, the NCSI device seen from NIC driver is represented by "struct ncsi_dev", which is expected to populated and started by NIC driver before the NIC can work. All possible NCSI packages and NCSI channels connected to the NCSI interface are tracked from the NCSI device. Also, the NCSI device recognizes active channel that is currently providing service to NCSI enabled interface. Also, the NCSI requests (pairs of command and response) are embedded in NCSI device. This introduces the data structs to represents the NCSI resources mentioned as above. Also, functions used by NCSI stack internally are implemented. Besides, this introduces kernel config option CONFIG_NET_NCSI to enable NCSI stack. Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>