summaryrefslogtreecommitdiff
path: root/meta-openbmc-mods/meta-common/recipes-network
diff options
context:
space:
mode:
authorJason M. Bills <jason.m.bills@linux.intel.com>2021-08-26 23:18:00 +0300
committerJason M. Bills <jason.m.bills@linux.intel.com>2021-08-27 19:05:02 +0300
commit6f106a0a4ce15fe0678d4ffefd572e6978c72597 (patch)
treed98626c9763ad9048ac9bfd8269e12eced18d496 /meta-openbmc-mods/meta-common/recipes-network
parentae908254d22318b9e27acf6e5e28d1a4ab5e2195 (diff)
downloadopenbmc-6f106a0a4ce15fe0678d4ffefd572e6978c72597.tar.xz
Update to internal 0.70
Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
Diffstat (limited to 'meta-openbmc-mods/meta-common/recipes-network')
-rw-r--r--meta-openbmc-mods/meta-common/recipes-network/network/phosphor-network/0003-Adding-channel-specific-privilege-to-network.patch37
-rw-r--r--meta-openbmc-mods/meta-common/recipes-network/network/phosphor-network/0004-Fix-for-updating-MAC-address-from-RedFish.patch110
-rw-r--r--meta-openbmc-mods/meta-common/recipes-network/network/phosphor-network_%.bbappend3
3 files changed, 130 insertions, 20 deletions
diff --git a/meta-openbmc-mods/meta-common/recipes-network/network/phosphor-network/0003-Adding-channel-specific-privilege-to-network.patch b/meta-openbmc-mods/meta-common/recipes-network/network/phosphor-network/0003-Adding-channel-specific-privilege-to-network.patch
index 282b5669a..2cfa380ef 100644
--- a/meta-openbmc-mods/meta-common/recipes-network/network/phosphor-network/0003-Adding-channel-specific-privilege-to-network.patch
+++ b/meta-openbmc-mods/meta-common/recipes-network/network/phosphor-network/0003-Adding-channel-specific-privilege-to-network.patch
@@ -1,4 +1,4 @@
-From 24bac5f6660ec5e5ea15c0f062dc4a08fbc0e876 Mon Sep 17 00:00:00 2001
+From 29c6b0a294e2c32c9617d243d71d202e926262d0 Mon Sep 17 00:00:00 2001
From: AppaRao Puli <apparao.puli@linux.intel.com>
Date: Thu, 2 Apr 2020 17:06:07 +0530
Subject: [PATCH] Adding channel specific privilege to network
@@ -19,17 +19,17 @@ Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
Signed-off-by: Yong Li <yong.b.li@linux.intel.com>
Signed-off-by: Johnathan Mantey <johnathanx.mantey@intel.com>
---
- src/ethernet_interface.cpp | 124 +++++++++++++++++++++++++++++++++++++++++
- src/ethernet_interface.hpp | 37 +++++++++++-
- src/network_manager.cpp | 102 +++++++++++++++++++++++++++++++++
+ src/ethernet_interface.cpp | 124 +++++++++++++++++++++++++++++++++++++
+ src/ethernet_interface.hpp | 36 ++++++++++-
+ src/network_manager.cpp | 102 ++++++++++++++++++++++++++++++
src/network_manager.hpp | 9 +++
- 4 files changed, 271 insertions(+), 1 deletion(-)
+ 4 files changed, 270 insertions(+), 1 deletion(-)
diff --git a/src/ethernet_interface.cpp b/src/ethernet_interface.cpp
-index 607e658..e2b2da9 100644
+index 5ce4349..4c52fc8 100644
--- a/src/ethernet_interface.cpp
+++ b/src/ethernet_interface.cpp
-@@ -45,6 +45,10 @@ constexpr auto PROPERTY_INTERFACE = "org.freedesktop.DBus.Properties";
+@@ -49,6 +49,10 @@ constexpr auto PROPERTY_INTERFACE = "org.freedesktop.DBus.Properties";
constexpr auto RESOLVED_SERVICE_PATH = "/org/freedesktop/resolve1/link/";
constexpr auto METHOD_GET = "Get";
@@ -40,7 +40,7 @@ index 607e658..e2b2da9 100644
struct EthernetIntfSocket
{
EthernetIntfSocket(int domain, int type, int protocol)
-@@ -128,6 +132,7 @@ EthernetInterface::EthernetInterface(sdbusplus::bus::bus& bus,
+@@ -133,6 +137,7 @@ EthernetInterface::EthernetInterface(sdbusplus::bus::bus& bus,
EthernetInterfaceIntf::autoNeg(std::get<2>(ifInfo));
EthernetInterfaceIntf::speed(std::get<0>(ifInfo));
#endif
@@ -48,7 +48,7 @@ index 607e658..e2b2da9 100644
// Emit deferred signal.
if (emitSignal)
-@@ -1175,5 +1180,124 @@ std::string EthernetInterface::defaultGateway6(std::string gateway)
+@@ -1248,5 +1253,124 @@ std::string EthernetInterface::defaultGateway6(std::string gateway)
manager.writeToConfigurationFile();
return gw;
}
@@ -174,7 +174,7 @@ index 607e658..e2b2da9 100644
} // namespace network
} // namespace phosphor
diff --git a/src/ethernet_interface.hpp b/src/ethernet_interface.hpp
-index 8e28b51..ebba151 100644
+index 12d307f..d764b2b 100644
--- a/src/ethernet_interface.hpp
+++ b/src/ethernet_interface.hpp
@@ -2,11 +2,14 @@
@@ -190,9 +190,9 @@ index 8e28b51..ebba151 100644
#include <sdbusplus/bus.hpp>
+#include <sdbusplus/bus/match.hpp>
#include <sdbusplus/server/object.hpp>
+ #include <sdbusplus/timer.hpp>
#include <string>
- #include <xyz/openbmc_project/Collection/DeleteAll/server.hpp>
-@@ -33,7 +36,8 @@ using Ifaces = sdbusplus::server::object::object<
+@@ -35,7 +38,8 @@ using Ifaces = sdbusplus::server::object::object<
sdbusplus::xyz::openbmc_project::Network::server::MACAddress,
sdbusplus::xyz::openbmc_project::Network::IP::server::Create,
sdbusplus::xyz::openbmc_project::Network::Neighbor::server::CreateStatic,
@@ -202,7 +202,7 @@ index 8e28b51..ebba151 100644
using IP = sdbusplus::xyz::openbmc_project::Network::server::IP;
-@@ -41,11 +45,14 @@ using EthernetInterfaceIntf =
+@@ -43,11 +47,14 @@ using EthernetInterfaceIntf =
sdbusplus::xyz::openbmc_project::Network::server::EthernetInterface;
using MacAddressIntf =
sdbusplus::xyz::openbmc_project::Network::server::MACAddress;
@@ -217,7 +217,7 @@ index 8e28b51..ebba151 100644
class Manager; // forward declaration of network manager.
-@@ -244,6 +251,14 @@ class EthernetInterface : public Ifaces
+@@ -247,6 +254,14 @@ class EthernetInterface : public Ifaces
std::string defaultGateway6(std::string gateway) override;
using EthernetInterfaceIntf::dhcpEnabled;
@@ -232,11 +232,10 @@ index 8e28b51..ebba151 100644
using EthernetInterfaceIntf::interfaceName;
using EthernetInterfaceIntf::linkUp;
using EthernetInterfaceIntf::nicEnabled;
-@@ -366,6 +381,26 @@ class EthernetInterface : public Ifaces
- * @returns true/false value if the address is static
+@@ -374,6 +389,25 @@ class EthernetInterface : public Ifaces
+ * @returns true/false value if the NIC is enabled
*/
- bool originIsManuallyAssigned(IP::AddressOrigin origin);
-+
+ bool queryNicEnabled() const;
+ /** @brief gets the channel privilege.
+ * @param[in] interfaceName - Network interface name.
+ * @returns privilege of the interface
@@ -260,7 +259,7 @@ index 8e28b51..ebba151 100644
} // namespace network
diff --git a/src/network_manager.cpp b/src/network_manager.cpp
-index 881b767..847852f 100644
+index 9ae9c5b..2f5097a 100644
--- a/src/network_manager.cpp
+++ b/src/network_manager.cpp
@@ -36,6 +36,13 @@ extern std::unique_ptr<Timer> restartTimer;
diff --git a/meta-openbmc-mods/meta-common/recipes-network/network/phosphor-network/0004-Fix-for-updating-MAC-address-from-RedFish.patch b/meta-openbmc-mods/meta-common/recipes-network/network/phosphor-network/0004-Fix-for-updating-MAC-address-from-RedFish.patch
new file mode 100644
index 000000000..e4d9d2837
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-network/network/phosphor-network/0004-Fix-for-updating-MAC-address-from-RedFish.patch
@@ -0,0 +1,110 @@
+From c139e292d43bdc9484f77ef2f75df5dc9ff14e15 Mon Sep 17 00:00:00 2001
+From: sunitakx <sunitax.kumari@linux.intel.com>
+Date: Tue, 13 Jul 2021 12:54:01 +0000
+Subject: [PATCH] Fix for updating MAC address from RedFish
+
+Issue: When IP address source for an interface is DHCP and its MAC
+address is patched using RedFish, response code is not reaching the
+RedFish request initiator (client).
+
+RootCause: After bmcweb patches the MAC address, immediately IP address
+of that interface also changes to new value (because of DHCP).
+Due to this, success response from bmcweb is not reaching the client as
+expected.
+
+Fix: Do MAC-ADDR patching after validating the request and responding
+"200 OK" to RedFish client. i.e Start a timer which will modify the
+MAC-ADDR at the end of its expiry.
+
+Tested:
+Update the MAC address from RedFish.
+PATCH: https://<bmc_ip>/redfish/v1/Managers/bmc/EthernetInterfaces/eth0
+Body:
+ {"MACAddress": "xx:xx:xx:xx:xx:xx"}
+
+Response code: {"200 OK"} received.
+
+Signed-off-by: sunitakx <sunitax.kumari@linux.intel.com>
+---
+ src/ethernet_interface.cpp | 19 +++++++++++++------
+ src/ethernet_interface.hpp | 4 ++++
+ 2 files changed, 17 insertions(+), 6 deletions(-)
+
+diff --git a/src/ethernet_interface.cpp b/src/ethernet_interface.cpp
+index 9a4d95a..95cd70b 100644
+--- a/src/ethernet_interface.cpp
++++ b/src/ethernet_interface.cpp
+@@ -139,6 +139,8 @@ EthernetInterface::EthernetInterface(sdbusplus::bus::bus& bus,
+ {
+ this->emit_object_added();
+ }
++ macUpdateTimer = std::make_unique<phosphor::Timer>(
++ [this](void) { macAddressTimeoutHandler(); });
+ }
+
+ static IP::Protocol convertFamily(int family)
+@@ -1069,8 +1071,18 @@ void EthernetInterface::writeDHCPSection(std::fstream& stream)
+ }
+ }
+
++void EthernetInterface::macAddressTimeoutHandler()
++{
++ macUpdateTimer->stop();
++ // TODO: would remove the call below and
++ // just restart systemd-netwokd
++ // through https://github.com/systemd/systemd/issues/6696
++ execute("/sbin/ip", "ip", "link", "set", "dev", interfaceName().c_str(),
++ "down");
++}
+ std::string EthernetInterface::macAddress(std::string value)
+ {
++ std::chrono::seconds usec(defaultTimeout);
+ ether_addr newMAC;
+ try
+ {
+@@ -1104,12 +1116,7 @@ std::string EthernetInterface::macAddress(std::string value)
+ intf->MacAddressIntf::macAddress(validMAC);
+ }
+ MacAddressIntf::macAddress(validMAC);
+-
+- // TODO: would remove the call below and
+- // just restart systemd-netwokd
+- // through https://github.com/systemd/systemd/issues/6696
+- execute("/sbin/ip", "ip", "link", "set", "dev", interface.c_str(),
+- "down");
++ macUpdateTimer->start(usec);
+ manager.writeToConfigurationFile();
+ }
+
+diff --git a/src/ethernet_interface.hpp b/src/ethernet_interface.hpp
+index ebba151..ebe72a1 100644
+--- a/src/ethernet_interface.hpp
++++ b/src/ethernet_interface.hpp
+@@ -11,6 +11,7 @@
+ #include <sdbusplus/bus.hpp>
+ #include <sdbusplus/bus/match.hpp>
+ #include <sdbusplus/server/object.hpp>
++#include <sdbusplus/timer.hpp>
+ #include <string>
+ #include <xyz/openbmc_project/Collection/DeleteAll/server.hpp>
+ #include <xyz/openbmc_project/Network/EthernetInterface/server.hpp>
+@@ -25,6 +26,7 @@
+ #define nicEnabled nICEnabled
+ #define ntpServers nTPServers
+ #endif
++static constexpr const uint32_t defaultTimeout = 1;
+
+ namespace phosphor
+ {
+@@ -93,6 +95,8 @@ class EthernetInterface : public Ifaces
+ EthernetInterface& operator=(EthernetInterface&&) = delete;
+ virtual ~EthernetInterface() = default;
+
++ std::unique_ptr<phosphor::Timer> macUpdateTimer;
++ void macAddressTimeoutHandler();
+ /** @brief Constructor to put object onto bus at a dbus path.
+ * @param[in] bus - Bus to attach to.
+ * @param[in] objPath - Path to attach at.
+--
+2.17.1
+
diff --git a/meta-openbmc-mods/meta-common/recipes-network/network/phosphor-network_%.bbappend b/meta-openbmc-mods/meta-common/recipes-network/network/phosphor-network_%.bbappend
index 808380de7..be2c2c070 100644
--- a/meta-openbmc-mods/meta-common/recipes-network/network/phosphor-network_%.bbappend
+++ b/meta-openbmc-mods/meta-common/recipes-network/network/phosphor-network_%.bbappend
@@ -3,9 +3,10 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
DEPENDS += "nlohmann-json boost"
SRC_URI = "git://github.com/openbmc/phosphor-networkd"
-SRCREV = "d49c5c650bd6b13f267d59be452ac2b4493e8201"
+SRCREV = "1ea359943afbd59168f490778a528c858903b74d"
SRC_URI += " file://0003-Adding-channel-specific-privilege-to-network.patch \
+ file://0004-Fix-for-updating-MAC-address-from-RedFish.patch \
"
EXTRA_OECONF_append = " --enable-nic-ethtool=yes"