Add support for MTU property

This commit add support for the MTU property,
which shows the maximum size of the Protocol Data Uint (PDU) in bytes,
that can be passed in an Ethernet frame on the network interface.

We can Get or Set the MTU Size of any interface.
Also this property helps to populate MTUSize in Redfish.

The backend DBus interface code is committed to below location -
https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-dbus-interfaces/+/45033

Tested:

Verified the property with dbus tool for Get, Set operations.

busctl introspect xyz.openbmc_project.Network /xyz/openbmc_project/network/eth3
NAME						TYPE		SIGNATURE RESULT/VALUE
xyz.openbmc_project.Network.EthernetInterface	interface	-	  -
.MTU						property	u	  1500

dbus-send --system --print-reply --dest="xyz.openbmc_project.Network" "/xyz/openbmc_project/network/eth3" org.freedesktop.DBus.Properties.Get string:"xyz.openbmc_project.Network.EthernetInterface" string:"MTU"
method return time=1627365497.929314 sender=:1.39 -> destination=:1.46740 serial=3219493 reply_serial=2
    variant       uint32 1500

dbus-send --system --print-reply --dest="xyz.openbmc_project.Network" "/xyz/openbmc_project/network/eth3" org.freedesktop.DBus.Properties.Set string:"xyz.openbmc_project.Network.EthernetInterface" string:"MTU" variant:uint32:1480
method return time=1627365546.988526 sender=:1.39 -> destination=:1.46751 serial=3219999 reply_serial=2

dbus-send --system --print-reply --dest="xyz.openbmc_project.Network" "/xyz/openbmc_project/network/eth3" org.freedesktop.DBus.Properties.Get string:"xyz.openbmc_project.Network.EthernetInterface" string:"MTU"
method return time=1627365561.546701 sender=:1.39 -> destination=:1.46754 serial=3220200 reply_serial=2
    variant       uint32 1480

Signed-off-by: Tejas Patil <tejaspp@ami.com>
Change-Id: I1f501d89d0853467357751577e0c9a4d35f843cc
2 files changed
tree: b1c1ef1def334d4d560f10532d6de5d38e3a616d
  1. docs/
  2. gen/
  3. src/
  4. subprojects/
  5. test/
  6. yaml/
  7. .clang-format
  8. .gitignore
  9. .shellcheck
  10. LICENSE
  11. MAINTAINERS
  12. meson.build
  13. meson_options.txt
  14. README.md
  15. xyz.openbmc_project.Network.conf.in
  16. xyz.openbmc_project.Network.service.in
README.md

To Build

To build this package, do the following steps:

    1. meson build
    2. ninja -C build