Make asyn mctp signal handling Issue 1: Potential dbus timeout while mctp offline handling is being done - MCTP offline signal handling was cpu intensive operation which gets triggered through property change signal - MCTP service sends burst of signals when device transtion from Enabled to Disabled state Issue 2: Unordered handling of MCTP signals Before this change whenever MCTP Enabled signal is recived it started a co-routine in the match call back as it involved IO interacting with the device while Disabled signal didn't involve IO and completed as part of match call back execution Whats the impact of above issues and when it is seen - Impact is unordered processing of signals, which can lead to incorrect device state - Typically happens when the volume of property change signal is high and signals are flckering in nature - When the volume of signals to process is high it can lead to service dbus timeouts as well This commit do following - To address both issues, mctp signal queuing mechanism has been implemented so that singal processing is in the same order as signal arrival - Additionall to fix issue #1, this commit migrated mctp offline signal to a co-routine and yield some cpu cycles in cpu intensive operation(set offline) Fixes nvbug https://nvbugs/5208433, https://nvbugs/5217118
Source an NvBMC ARM/x86 SDK.
# Meson configure meson setup --reconfigure -Db_sanitize=address,undefined -Db_lundef=true -Dwerror=true -Dwarning_level=3 -Db_colorout=never --buildtype=debug -Dcpp_args=\"-Wno-error=invalid-constexpr -Wno-invalid-constexpr -Werror=uninitialized -Werror=strict-aliasing\" builddir # Build all targets ninja -C builddir # Run all unit tests meson test -C builddir
If you encounter sdbusplus build errors, verify that the revision in subprojects/sdbusplus.wrap matches the version specified in the openbmc-build-scripts repository. Version mismatches can cause build failures.
For other subproject-related errors, you can update all subproject repositories to their latest commits using:
cd subprojects
find -L . -type d -name ".git" | while read gitdir; do
repo=$(dirname "$gitdir")
echo "Pulling updates in $repo"
cd "$repo"
git pull
cd - > /dev/null
done
To ensure code consistency and formatting standards in the CI pipeline, clang-format-17 needs to be installed. Follow the steps below to install clang-format-17 on your system:
# Update the package list sudo apt update # Install wget if not already installed sudo apt install wget # Download the LLVM installation script wget https://apt.llvm.org/llvm.sh # Make the script executable sudo chmod +x llvm.sh # Run the script to install LLVM version 17 sudo ./llvm.sh 17 # Install clang-format-17 sudo apt install clang-format-17
This will install clang-format-17 on your system, enabling it for use in the CI pipeline.
To automatically format your code before each commit, create a pre-commit hook with the following steps:
cat > .git/hooks/pre-commit << EOL
#!/bin/sh
# Get list of staged files that are C/C++ source files
files=$(git diff --cached --name-only --diff-filter=ACMR | grep ".*\.[ch]\(pp\)\?$")
if [ -n "$files" ]; then
# Format the files
clang-format-17 -i $files
# Add the formatted files back to staging
git add $files
# Check if any files were modified after formatting
if ! git diff --cached --quiet; then
echo "Formatted C/C++ files were automatically fixed up"
fi
fi
exit 0
EOL
chmod +x .git/hooks/pre-commit
Successful build should generate three binary artifacts.
A Daemon that can discover NSM endpoint, gather telemetry data from the endpoints, and can publish them to D-Bus or similar IPC services, for consumer services like bmcweb.
nsmtool is a client tool that acts as a NSM requester which can be invoked from the BMC. nsmtool sends the request message and parse the response message & display it in readable format.
A mockup NSM responder that can be used for development purpose. Its primary usage is to test nsmd and nsmtool features on an emulator like QEMU. The mockup NSM responder includes modified MCTP control and demux daemon, user can create a emulated MCTP endpoint by providing a json file to modified MCTP control daemon to expose the emulated MCTP Endpoint to D-Bus.
The mockup NSM responder listens to demux unix socket for the request from nsmd/nsmtool and returns the respond through modified MCTP demux daemon.