net/ncsi: Add Intel OS2BMC OEM command
Subsystems (3)
PATCH 1/1 net/ncsi: Add Intel OS2BMC OEM command
The Intel OS2BMC OEM NCSI command is used for controlling whether network traffic between host and sideband is allowed or not. By default such traffic is disallowed, meaning that if the device using NCS (usually BMC) does not have extra active connection, it cannot reach the host.
This patch enables the host-sideband traffic by sending the Enable OS2BMC flow OEM NCSI command, which is controlled by kernel option CONFIG_NCSI_OEM_CMD_INTEL_OS2BMC.
--- net/ncsi/Kconfig | 6 ++++++ net/ncsi/internal.h | 4 ++++ net/ncsi/ncsi-manage.c | 42 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+)
net/ncsi/Kconfig +6 -0
@@ -23,3 +23,9 @@ config NCSI_OEM_CMD_KEEP_PHY help This allows to keep PHY link up and prevents any channel resets during the host load. +config NCSI_OEM_CMD_INTEL_OS2BMC + bool "Allow traffic between host and sideband (Intel-specific)" + depends on NET_NCSI + help + This allows network traffic between host and sideband, specific to + Intel network controllers.
net/ncsi/internal.h +4 -0
@@ -82,6 +82,8 @@ enum {/* Intel specific OEM command */ #define NCSI_OEM_INTEL_CMD_GMA 0x06/* CMD ID for Get MAC */ #define NCSI_OEM_INTEL_CMD_KEEP_PHY 0x20/* CMD ID for Keep PHY up */ +#define NCSI_OEM_INTEL_CMD_OS2BMC 0x40/* CMD ID for Enable OS2BMC traffic */ +#define NCSI_OEM_INTEL_CMD_OS2BMC_PARAM 0x03/* Parameter for Enable OS2BMC */ /* Broadcom specific OEM Command */ #define NCSI_OEM_BCM_CMD_GMA 0x01/* CMD ID for Get MAC */ /* Mellanox specific OEM Command */
@@ -92,6 +94,7 @@ enum {/* OEM Command payload lengths*/ #define NCSI_OEM_INTEL_CMD_GMA_LEN 5#define NCSI_OEM_INTEL_CMD_KEEP_PHY_LEN 7 +#define NCSI_OEM_INTEL_CMD_OS2BMC_LEN 6#define NCSI_OEM_BCM_CMD_GMA_LEN 12#define NCSI_OEM_MLX_CMD_GMA_LEN 8#define NCSI_OEM_MLX_CMD_SMAF_LEN 60
@@ -285,6 +288,7 @@ enum { ncsi_dev_state_probe_dp, ncsi_dev_state_config_sp =0x0301 , ncsi_dev_state_config_cis, + ncsi_dev_state_config_intel_os2bmc, ncsi_dev_state_config_oem_gma, ncsi_dev_state_config_clear_vids, ncsi_dev_state_config_svf,
net/ncsi/ncsi-manage.c +42 -0
54 lines not on this page · raw message
Signature · 1 line
2.34.1
Paul Fertser
reviewerHello,
Quoted 5 lines · Jiaqing Zhao
The Intel OS2BMC OEM NCSI command is used for controlling whether network traffic between host and sideband is allowed or not. By default such traffic is disallowed, meaning that if the device using NCS (usually BMC) does not have extra active connection, it cannot reach the host.
Can you please explain the rationale behind introducing this as a compile-time kernel config option? I can probably imagine how this can make sense as a DT switch (e.g. to describe hardware where there's no other communication channel between the host and BMC) but even this feels far-fetched.
Can you please outline some particular use cases for this feature?
Signature · 2 lines
Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software! mailto:[email protected]
Quoted 9 lines · Paul Fertser
Hello,
Quoted 5 lines · Jiaqing Zhao
The Intel OS2BMC OEM NCSI command is used for controlling whether network traffic between host and sideband is allowed or not. By default such traffic is disallowed, meaning that if the device using NCS (usually BMC) does not have extra active connection, it cannot reach the host.
Quoted 5 lines
Can you please explain the rationale behind introducing this as a compile-time kernel config option? I can probably imagine how this can make sense as a DT switch (e.g. to describe hardware where there's no other communication channel between the host and BMC) but even this feels far-fetched.
Previously I submitted a patch to make the NCSI configurable in DT[1], but it was not accepted by kernel community. A limitation is that currently NCSI is not a standalone device node, it is controlled by "use-ncsi" option in the MAC device DT node (like ftgmac100).
Other features like keep phy (also intel-specific oem) also uses kernel option. (CONFIG_NCSI_OEM_CMD_KEEP_PHY)
[1] https://lore.kernel.org/netdev/[email protected]/T/
Quoted 2 lines
Can you please outline some particular use cases for this feature?
It enables access between host and BMC when BMC shares the network connection with host using NCSI, like accessing BMC via HTTP or SSH from host.
Paul Fertser
reviewerHello,
Quoted 4 lines · Jiaqing Zhao
Quoted 2 lines
Can you please outline some particular use cases for this feature?
It enables access between host and BMC when BMC shares the network connection with host using NCSI, like accessing BMC via HTTP or SSH from host.
Why having a compile time kernel option here more appropriate than just running something like "/usr/bin/ncsi-netlink --package 0 --channel 0 --index 3 --oem-payload 00000157200001" (this example uses another OEM command) on BMC userspace startup?
Signature · 2 lines
Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software! mailto:[email protected]
Quoted 5 lines · Paul Fertser
Hello,
Quoted 2 lines · Jiaqing Zhao
Quoted 2 lines
Can you please outline some particular use cases for this feature?
Quoted 8 lines
Quoted 2 lines
It enables access between host and BMC when BMC shares the network connection with host using NCSI, like accessing BMC via HTTP or SSH from host.
Why having a compile time kernel option here more appropriate than just running something like "
/usr/bin/ncsi-netlink--package 0 --channel 0 --index 3 --oem-payload 00000157200001" (this example uses another OEM command) on BMC userspace startup?
Using ncsi-netlink is one way, but the package and channel id is undetermined as it is selected at runtime. Calling the netlink command on a nonexistent package/channel may lead to kernel panic.
Why I prefer the kernel option is that it applies the config to all ncsi devices by default when setting up them. This reduces the effort and keeps compatibility. Lots of things in current ncsi kernel driver can be done via commands from userspace, but I think it is not a good idea to have a driver resides on both kernel and userspace.
Sam Mendoza-Jonas
maintainerQuoted 17 lines · Jiaqing Zhao
Quoted 5 lines · Paul Fertser
Hello,
Quoted 2 lines · Jiaqing Zhao
Quoted 2 lines
Can you please outline some particular use cases for this feature?
Quoted 8 lines
Quoted 2 lines
It enables access between host and BMC when BMC shares the network connection with host using NCSI, like accessing BMC via HTTP or SSH from host.
Why having a compile time kernel option here more appropriate than just running something like "
/usr/bin/ncsi-netlink--package 0 --channel 0 --index 3 --oem-payload 00000157200001" (this example uses another OEM command) on BMC userspace startup?
Quoted 3 lines
Using ncsi-netlink is one way, but the package and channel id is undetermined as it is selected at runtime. Calling the netlink command on a nonexistent package/channel may lead to kernel panic.
If so, that would be a bug :)
Quoted 6 lines
Why I prefer the kernel option is that it applies the config to all ncsi devices by default when setting up them. This reduces the effort and keeps compatibility. Lots of things in current ncsi kernel driver can be done via commands from userspace, but I think it is not a good idea to have a driver resides on both kernel and userspace.
BMCs are of course in their own world and there's already some examples of the config option, but how would a system owner be able to disable this without reflashing the BMC?
Quoted 18 lines · Sam Mendoza-Jonas
Quoted 17 lines · Jiaqing Zhao
Quoted 13 lines · Paul Fertser
Hello,
Quoted 4 lines · Jiaqing Zhao
Quoted 2 lines
Can you please outline some particular use cases for this feature?
It enables access between host and BMC when BMC shares the network connection with host using NCSI, like accessing BMC via HTTP or SSH from host.
Why having a compile time kernel option here more appropriate than just running something like "
/usr/bin/ncsi-netlink--package 0 --channel 0 --index 3 --oem-payload 00000157200001" (this example uses another OEM command) on BMC userspace startup?
Quoted 5 lines
Quoted 3 lines
Using ncsi-netlink is one way, but the package and channel id is undetermined as it is selected at runtime. Calling the netlink command on a nonexistent package/channel may lead to kernel panic.
If so, that would be a bug :)
Yes but I haven't found the root cause so far, it only panics with some specific NICs I remember.
Quoted 8 lines
Quoted 6 lines
Why I prefer the kernel option is that it applies the config to all ncsi devices by default when setting up them. This reduces the effort and keeps compatibility. Lots of things in current ncsi kernel driver can be done via commands from userspace, but I think it is not a good idea to have a driver resides on both kernel and userspace.
BMCs are of course in their own world and there's already some examples of the config option, but how would a system owner be able to disable this without reflashing the BMC?
Given that ncsi driver is a driver binding to the PHY driver, it seems to be unable to make it a module and have some module options. So far build option seems to be the only way. Maybe in future sysfs entries can be added to make it configurable at runtime.
Paul Fertser
reviewerHello,
Quoted 13 lines · Jiaqing Zhao
Quoted 11 lines · Paul Fertser
Quoted 4 lines · Jiaqing Zhao
Quoted 2 lines
Can you please outline some particular use cases for this feature?
It enables access between host and BMC when BMC shares the network connection with host using NCSI, like accessing BMC via HTTP or SSH from host.
Why having a compile time kernel option here more appropriate than just running something like "
/usr/bin/ncsi-netlink--package 0 --channel 0 --index 3 --oem-payload 00000157200001" (this example uses another OEM command) on BMC userspace startup?
Quoted 3 lines
Using ncsi-netlink is one way, but the package and channel id is undetermined as it is selected at runtime. Calling the netlink command on a nonexistent package/channel may lead to kernel panic.
That sounds like a bug all right. If you can reproduce, it's likely the fix is reasonably easy, please consider doing it.
Quoted 5 lines
Why I prefer the kernel option is that it applies the config to all ncsi devices by default when setting up them. This reduces the effort and keeps compatibility. Lots of things in current ncsi kernel driver can be done via commands from userspace, but I think it is not a good idea to have a driver resides on both kernel and userspace.
How should the developer decide whether to enable this compile-time option for a platform or not? If it's always nice to have why not add the code unconditionally? And if not, are you sure kernel compile time is the right decision point? So far I get an impression a sysfs runtime knob would be more useful.
Signature · 2 lines
Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software! mailto:[email protected]
Quoted 16 lines · Paul Fertser
Hello,
Quoted 13 lines · Jiaqing Zhao
Quoted 11 lines · Paul Fertser
Quoted 4 lines · Jiaqing Zhao
Quoted 2 lines
Can you please outline some particular use cases for this feature?
It enables access between host and BMC when BMC shares the network connection with host using NCSI, like accessing BMC via HTTP or SSH from host.
Why having a compile time kernel option here more appropriate than just running something like "
/usr/bin/ncsi-netlink--package 0 --channel 0 --index 3 --oem-payload 00000157200001" (this example uses another OEM command) on BMC userspace startup?
Quoted 6 lines
Quoted 3 lines
Using ncsi-netlink is one way, but the package and channel id is undetermined as it is selected at runtime. Calling the netlink command on a nonexistent package/channel may lead to kernel panic.
That sounds like a bug all right. If you can reproduce, it's likely the fix is reasonably easy, please consider doing it.
It cannot be reproduced stably and varies on NICs, I'm still investigating it, it might be some NIC firmware issue.
Quoted 11 lines
Quoted 5 lines
Why I prefer the kernel option is that it applies the config to all ncsi devices by default when setting up them. This reduces the effort and keeps compatibility. Lots of things in current ncsi kernel driver can be done via commands from userspace, but I think it is not a good idea to have a driver resides on both kernel and userspace.
How should the developer decide whether to enable this compile-time option for a platform or not? If it's always nice to have why not add the code unconditionally? And if not, are you sure kernel compile time is the right decision point? So far I get an impression a sysfs runtime knob would be more useful.
Disabling Host-BMC traffic ensures the isolation between Host network and BMC's management network, some developers/vendors may prefer disable it for security concerns. Though having a runtime knob in sysfs would be useful, setting the default behavior in kernel config is also useful from my point.