#
a42a8651 |
| 04-Dec-2024 |
Jeremy Kerr <jk@codeconstruct.com.au> |
ncsi-cmd: mctp: Add a simple IID allocator for NCSI commands
Currently, we just use a fixed IID of zero for NCSI commands. However, DSP0222 has a requirement that the IID of a command should not mat
ncsi-cmd: mctp: Add a simple IID allocator for NCSI commands
Currently, we just use a fixed IID of zero for NCSI commands. However, DSP0222 has a requirement that the IID of a command should not match that of a previously-issued command.
So, implement a straightforward per-EID IID allocator, which will persist the current IID over invocations of ncsi-cmd. We keep state in /run/ncsi-mctp-iids, with an IID byte per possible MCTP EID.
Tested: on first usage against a specific EID, commands are issued with IID 1, and subsequent commands use an incremented IID.
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au> Change-Id: Iafc942abe6253a2560997ee5392a04af4412dc2e
show more ...
|
#
ca9d8677 |
| 16-Sep-2024 |
Jeremy Kerr <jk@codeconstruct.com.au> |
ncsi: Add a NCSI-over-MCTP transport
Add a facility for performing NCSI commands over a NCSI-over-MCTP interface, alongside the existing Netlink transport.
This adds a new Interface subclass, MCTPI
ncsi: Add a NCSI-over-MCTP transport
Add a facility for performing NCSI commands over a NCSI-over-MCTP interface, alongside the existing Netlink transport.
This adds a new Interface subclass, MCTPInterface, which performs the MCTP encapsulation/decapsulation, over an AF_MCTP socket.
Tested: able to perform NCSI commands over a MCTP link, to both emulated and hardware NIC devices. The -m argument can now target a NIC using MCTP.
For example, sending a raw command to perform a Get Version ID (type 0x15):
root@bmc:~# ncsi-cmd -m 9 --package 0 raw 0x15 <7> Command: type 0x15, payload 0 bytes: <7> Response 60 bytes: 00 01 00 2b 95 [...]
Change-Id: I9a7bfddfc4fd1b5bb8d0bff187936a0258d3dade Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
show more ...
|
#
2d0b48da |
| 16-Sep-2024 |
Jeremy Kerr <jk@codeconstruct.com.au> |
ncsi: make Interface virtual
Now that we have encapsulation for passing NCSI commands and responses to/from an interface, we can make the Interface object virtual, and have the Netlink implementatio
ncsi: make Interface virtual
Now that we have encapsulation for passing NCSI commands and responses to/from an interface, we can make the Interface object virtual, and have the Netlink implementation as a subclass.
We keep the netlink-specific operations in NetlinkInterface; getInfo(), setChannel(), clearInterface(), and the channel/package mask operations are all netlink-specific items to control kernel state.
Change-Id: I30b9cec41712d2e32d12685dd8406e08c6dea1f0 Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
show more ...
|
#
b788524a |
| 15-Sep-2024 |
Jeremy Kerr <jk@codeconstruct.com.au> |
ncsi: encapsulate NC-SI commands with NCSICommand / NCSIResponse structs
... and rename Interface::sendOemCommand to Interface::sendCommand.
This provides a more clear facility to pass command and
ncsi: encapsulate NC-SI commands with NCSICommand / NCSIResponse structs
... and rename Interface::sendOemCommand to Interface::sendCommand.
This provides a more clear facility to pass command and response objects around, for future command and transport implementations.
Change-Id: I46e594ab6467ed87cfc27189c3ec4bd321726ee5 Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
show more ...
|
#
147086d0 |
| 27-Aug-2024 |
Jeremy Kerr <jk@codeconstruct.com.au> |
ncsi: return command response from sendOemCommand
Rather than expecting the response to be handled from the command callback, return it as the return value from sendOemCommand().
This addresses the
ncsi: return command response from sendOemCommand
Rather than expecting the response to be handled from the command callback, return it as the return value from sendOemCommand().
This addresses the todo in the sendOemCommand implementation.
Change-Id: I144128f50341d4ff7d8e248cb4dfa1427ead515b Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
show more ...
|
#
7f7c085e |
| 07-Aug-2024 |
Jeremy Kerr <jk@codeconstruct.com.au> |
ncsi: return interface info from Interface::getInfo()
Rather than expecting the ncsi_util callback to print the interface info, return the interface info, and print that.
This allows for a specific
ncsi: return interface info from Interface::getInfo()
Rather than expecting the ncsi_util callback to print the interface info, return the interface info, and print that.
This allows for a specific output formatting function in ncsi_netlink_main.c, rather than printing directly from the libnl callback. We reformat for a more structured display of the package/channel layouts.
We use std::optional for the return value here; it would be nice to use std::expected instead, and get a full error code, but that's not quite working with clang-18 at present. Even if we have an error code though, we're just going to return EXIT_FAILURE anyway.
Tested: Invoked on a simlated dual-channel NCSI package:
# ncsi-netlink -x 2 --info <7> Get Info , PACKAGE : 0xffffffffffffffff, INTERFACE: 0x7e8bf9bc <7> Package id : 0 <7> package is forced <7> Channel id : 0 <7> version 1.2 (p0c00) <7> link state 0x40022f <7> Channel id : 1 <7> version 1.2 (p0c01) <7> link state 0x40022f
Change-Id: Idb62cc6695da67f4415ed9b0e7950c506018d630 Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
show more ...
|
#
bc22f81c |
| 29-Jul-2024 |
Jeremy Kerr <jk@codeconstruct.com.au> |
ncsi: move ncsi operations to Interface class
The existing NCSI operations are quite Interface-specific (ie., rely on netlink-specific constructs), so move these to methods on the Interface class.
ncsi: move ncsi operations to Interface class
The existing NCSI operations are quite Interface-specific (ie., rely on netlink-specific constructs), so move these to methods on the Interface class.
We'll add alternative implementations in a future change.
Change-Id: I3ea5fcd64969a2c164503057e35881010ad141a0 Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
show more ...
|
#
8a76d89d |
| 26-Jul-2024 |
Jeremy Kerr <jk@codeconstruct.com.au> |
ncsi: log interface types using to_string
Add a to_string() method for Interfaces, to handle printing via lg2.
Since we're printing the interface object, don't specify _INDEX on the metadata, this
ncsi: log interface types using to_string
Add a to_string() method for Interfaces, to handle printing via lg2.
Since we're printing the interface object, don't specify _INDEX on the metadata, this may not always be an index.
Also, interface indices are typically referred to as decimal. Use decimal instead of a lg2::hex conversion.
Change-Id: I90b5fbac52adde3bbc3f2699087373ed96361083 Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
show more ...
|
#
8d9af023 |
| 26-Jul-2024 |
Jeremy Kerr <jk@codeconstruct.com.au> |
ncsi: Create Interface type to wrap a network interface instance
Define an interface as a new type, just containing the ifindex currently.
This will allow future Interface implementations that don'
ncsi: Create Interface type to wrap a network interface instance
Define an interface as a new type, just containing the ifindex currently.
This will allow future Interface implementations that don't interact directly with a local Linux network interface.
Tested: "get info" (--info) and "send OEM command" (--oem-payload) operations tested against kernel NCSI layer, to a test NC-SI device.
Change-Id: If0471ac3fa41e08bb916e9279d4fe5b668860b03 Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
show more ...
|
#
5a456061 |
| 15-Feb-2024 |
Johnathan Mantey <johnathanx.mantey@intel.com> |
Add Set Package and Channel Mask to ncsi-netlink utility
The NCSI driver has added two commands for setting the Package Mask and the Channel Mask within a package. The ncsi-netlink utility does not
Add Set Package and Channel Mask to ncsi-netlink utility
The NCSI driver has added two commands for setting the Package Mask and the Channel Mask within a package. The ncsi-netlink utility does not support these new commands.
Add the ability to set the package and the channel mask values.
Tested: Instrumented the NCSI kernel driver to print mask values. Issued 'ncsi-netlink -x 3 -j 0x3' and saw the NCSI driver print the new package mask. Issued 'ncsi-netlink -x 3 -p 0 -k 0x3' and saw the NCSI driver print the new channel mask.
Change-Id: Icd2188e789de43f631fe26d9e751d564ba5f822f Signed-off-by: Johnathan Mantey <johnathanx.mantey@intel.com>
show more ...
|
#
1ebea28c |
| 15-Feb-2024 |
Johnathan Mantey <johnathanx.mantey@intel.com> |
Make Send Command feature more flexible
The sendOemCommand command, used to send NCSI_CMD_SEND_CMD payloads, is hardcoded to only send one command.
Update the sendOemCommand function to allow the s
Make Send Command feature more flexible
The sendOemCommand command, used to send NCSI_CMD_SEND_CMD payloads, is hardcoded to only send one command.
Update the sendOemCommand function to allow the sub-operation to be passed as a command line argument. This is done by prepending the sub-operation byte to the front of the Send Cmd payload.
Doing this allows sub-operations without any payload bytes to be called. For example "-o 0a", where the sub-operation for Send Cmd is the 0x0a value.
Tested: Sent 'ncsi-netlink -x 3 -p 0 -c 0 -o 50000001572100' and confirmed the 0x50 byte worked the same way as the original hard-coded value. Sent 'ncsi-netlink -x 3 -p 0 -c 0 -o 0a' and confirmed the 0x0a sub-operation functioned on the submitters SUT.
Change-Id: I20f093fd8296f549fce03dc5729b8e5fedcab313 Signed-off-by: Johnathan Mantey <johnathanx.mantey@intel.com>
show more ...
|
#
fa1f5c03 |
| 17-Sep-2020 |
Eddie James <eajames@linux.ibm.com> |
Add support for sending NCSI command
Provide a means to send an OEM command to an NIC via NCSI netlink. This may be invoked from a systemd Unit file to configure NIC behavior.
Some NICs provide OEM
Add support for sending NCSI command
Provide a means to send an OEM command to an NIC via NCSI netlink. This may be invoked from a systemd Unit file to configure NIC behavior.
Some NICs provide OEM commands to influence their behavior, for example maintaining full speed even when the host is down instead of negotiating a lower speed for power.
Signed-off-by: Eddie James <eajames@linux.ibm.com> Change-Id: Id920b618422e8fbfc51984fbf932045bfb5e56e6
show more ...
|
#
1bbe3d1e |
| 14-May-2021 |
William A. Kennington III <wak@google.com> |
build: Split c++ sources into a subdirectory
Change-Id: Iedea50c688189ae4953195105e323f7173d17a4b Signed-off-by: William A. Kennington III <wak@google.com>
|