Giter Club home page Giter Club logo

mctp's Introduction

mctp: Userspace tools for MCTP stack management

This project contains two utilities for running a MCTP network from the local machine:

  • mctp: A small command-line utility to query and manage the state of the kernel MCTP stack, in a similar way to iproute2's ip utility.

  • mctpd: A daemon implementing the MCTP control protocol; you'll need this for the local host to perform as a bus-owner. The main function of mctpd is to assign EIDs to remote endpoints, and manage the resulting routes and neighbour-table entries for those endpoints.

Building & installing

This project uses meson for building. To configure and compile:

$ meson setup obj
$ ninja -C obj

to install to the default prefix (/usr/local), with optional DESTDIR:

$ meson install -C obj

For integration with systemd, there are a few example configuration files and systemd target definitions under the conf/ directory. These are not installed by default.

By default, meson is configured to enable tests, which requires a few extra dependencies (mainly pytest, python libraries, and dbus-run-session). In cases where the tests are not required, you can avoid these dependencies by configuring the build tree with -Dtests=false:

$ meson setup obj -Dtests=false

mctp Usage

Use mctp help for the list of available commands:

$ mctp help
mctp link
mctp link show [ifname]
mctp link set <ifname> [up|down] [mtu <mtu>] [network <net>] [bus-owner <physaddr>]

mctp address
mctp address show [IFNAME]
mctp address add <eid> dev <IFNAME>
mctp address del <eid> dev <IFNAME>

mctp route
mctp route show [net <network>]
mctp route add <eid> via <dev> [mtu <mtu>]
mctp route del <eid> via <dev>

mctp neigh
mctp neigh show [dev <network>]
mctp neigh add <eid> dev <device> lladdr <physaddr>
mctp neigh del <eid> dev <device>

mctpd Usage

mctpd should be run as a system service, once the local MCTP stack has been configured (ie., interfaces are enabled, and local addresses have been assigned). There are two sample systemd unit files under the conf/ directory, to coordinate the local setup and the supervision of the mctpd process.

The mctpd daemon will expose a dbus interface, claiming the bus name xyz.openbmc_project.MCTP and object path /xyz/openbmc_project/mctp. This provides a few functions for configuring remote endpoints:

# busctl introspect xyz.openbmc_project.MCTP /xyz/openbmc_project/mctp
NAME                                TYPE      SIGNATURE  RESULT/VALUE  FLAGS
au.com.CodeConstruct.MCTP           interface -          -             -
.AssignEndpoint                     method    say        yisb          -
.AssignEndpointStatic               method    sayy       yisb          -
.LearnEndpoint                      method    say        yisb          -
.SetupEndpoint                      method    say        yisb          -

Results of mctpd enumeration are also represented as dbus objects, using the OpenBMC-specified MCTP endpoint format. Each endpoint appears on the bus at the object path:

/xyz/openbmc_project/mctp/<network-id>/<endpoint-id>

where mctpd exposes three dbus interfaces for each:

  • xyz.openbmc_project.MCTP.Endpoint: Provides MCTP address information (EID and NetworkID properties) and message-type support SupportedMessageTypes property).

    This interface is defined by the MCTP.Endpoint phosphor-dbus specification.

  • xyz.openbmc_project.Common.UUID: MCTP UUID of the discovered endpoint (UUID property).

    This interface is defined by the Common.UUID phosphor-dbus specification.

  • au.com.CodeConstruct.MCTP.EndPoint: Additional control methods for the endpoint - for example, Remove

Testing

We have an initial test suite under tests/. To run:

meson setup obj
ninja -C obj test

Alternatively, you can run pytest directly; this may be more useful during development:

cd obj
pytest

The test infrastructure depends on a few python packages, including the pytest binary. You can use a python venv to provide these:

python3 -m venv venv
venv/bin/pip install -r tests/requirements.txt

Then run the tests using the new venv's pytest:

PATH=$PWD/venv/bin/:$PATH meson setup obj
ninja -C obj test

mctp's People

Contributors

mkj avatar jk-ozlabs avatar amboar avatar kraj avatar rickywu-wiwynn avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.