Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding support for asynchronous file transfer #404

Open
wants to merge 19 commits into
base: 1060
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
f31f74d
Dummy PR: Non blocking socket changes
Patel-Kamalkumar Apr 5, 2023
35aeb4a
Merge branch '1050' of github.com:Patel-Kamalkumar/pldm into AIO
Patel-Kamalkumar Apr 17, 2023
ba2a578
Merge branch '1050' of github.com:Patel-Kamalkumar/pldm into AIO
Patel-Kamalkumar May 4, 2023
a988aeb
Merge branch '1050' of github.com:Patel-Kamalkumar/pldm into AIO
Patel-Kamalkumar May 4, 2023
1832f37
Merge branch '1050' of github.com:Patel-Kamalkumar/pldm into AIO
Patel-Kamalkumar May 8, 2023
3434379
Adding Support of Nonblocking socket
Patel-Kamalkumar May 9, 2023
81944ba
Merge branch '1050' of github.com:Patel-Kamalkumar/pldm into AIO
Patel-Kamalkumar May 16, 2023
7dde80c
Merge branch '1050' of github.com:Patel-Kamalkumar/pldm into AIO
Patel-Kamalkumar May 22, 2023
b6aca03
Adding support for asynchronous file transfer
Patel-Kamalkumar May 25, 2023
5cf6317
Merge branch '1050' of github.com:Patel-Kamalkumar/pldm into AIO
Patel-Kamalkumar Aug 1, 2023
7d15686
Throw Marker Lid validate error (#446)
sagisin Aug 21, 2023
5f426bd
Merge branch '1050' of github.com:Patel-Kamalkumar/pldm into AIO
Patel-Kamalkumar Aug 1, 2023
6ff41f6
Moving fetch activation property (#449)
sagisin Aug 25, 2023
924e026
pdr: Missing nvme slot entries in the json (#447)
Pavithrab7 Aug 25, 2023
af6dea7
PLDM: 5 sec timeout for dbus calls without reply (#444)
vkaverap Aug 28, 2023
9633dd8
oem-ibm: Call PEL API when host drops event log (#461)
spinler Sep 15, 2023
d7e0cb9
PLDM: LG2 migration for missed out traces (#466)
riyadixitagra Oct 4, 2023
07cd485
Adding support for asynchronous file transfer
Patel-Kamalkumar Aug 27, 2023
d576b33
Merge branch '1050' of github.com:Patel-Kamalkumar/pldm into AIO
Patel-Kamalkumar Oct 6, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions common/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,9 @@ GetSubTreeResponse
}
catch (const std::exception& e)
{
std::cerr << "failed GetSubTree query for interface " << ifaceList[0]
<< " with ERROR=" << e.what() << "\n";
error(
"failed GetSubTree query for interface {FACE_LIST} with ERROR = {ERR_EXCEP}",
"FACE_LIST", ifaceList[0], "ERR_EXCEP", e.what());
}
return response;
}
Expand All @@ -289,7 +290,9 @@ void reportError(const char* errorMsg, const Severity& sev)
}
std::map<std::string, std::string> addlData{};
method.append(errorMsg, severity, addlData);
bus.call_noreply(method);
bus.call_noreply(
method,
std::chrono::duration_cast<microsec>(sec(DBUS_TIMEOUT)).count());
}
catch (const std::exception& e)
{
Expand Down Expand Up @@ -324,7 +327,9 @@ void DBusHandler::setDbusProperty(const DBusMapping& dBusMap,
service.c_str(), "/xyz/openbmc_project/inventory",
"xyz.openbmc_project.Inventory.Manager", "Notify");
method.append(std::move(objectValueTree));
bus.call_noreply(method);
bus.call_noreply(
method, std::chrono::duration_cast<microsec>(sec(DBUS_TIMEOUT))
.count());
}
else
{
Expand All @@ -343,7 +348,9 @@ void DBusHandler::setDbusProperty(const DBusMapping& dBusMap,
}
method.append(dBusMap.interface.c_str(),
dBusMap.propertyName.c_str(), variant);
bus.call_noreply(method);
bus.call_noreply(
method, std::chrono::duration_cast<microsec>(sec(DBUS_TIMEOUT))
.count());
}
};

Expand Down Expand Up @@ -727,7 +734,9 @@ void setBiosAttr(const BiosAttributeList& biosAttrList)
method.append(
biosConfigIntf, "PendingAttributes",
std::variant<PendingAttributesType>(pendingAttributes));
bus.call_noreply(method);
bus.call_noreply(
method, std::chrono::duration_cast<microsec>(sec(DBUS_TIMEOUT))
.count());
}
catch (const sdbusplus::exception::SdBusError& e)
{
Expand Down
7 changes: 5 additions & 2 deletions common/utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,13 @@ struct CustomFD
CustomFD(CustomFD&&) = delete;
CustomFD& operator=(CustomFD&&) = delete;

CustomFD(int fd) : fd(fd) {}
CustomFD(int fd, bool closeOnOutScope = true) :
fd(fd), closeOnOutScope(closeOnOutScope)
{}

~CustomFD()
{
if (fd >= 0)
if (fd >= 0 && closeOnOutScope)
{
close(fd);
}
Expand All @@ -76,6 +78,7 @@ struct CustomFD

private:
int fd = -1;
bool closeOnOutScope;
};

/** @brief Calculate the pad for PLDM data
Expand Down
2 changes: 1 addition & 1 deletion host-bmc/dbus/serialize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ void Serialize::reSerialize(const std::vector<uint16_t> types)
{
if (savedObjs.contains(type))
{
error(
info(
"Removing objects of type : {OBJ_TYP} from the persistent cache",
"OBJ_TYP", (unsigned)type);
savedObjs.erase(savedObjs.find(type));
Expand Down
4 changes: 2 additions & 2 deletions host-bmc/host_pdr_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1476,7 +1476,7 @@ void HostPDRHandler::getPresentStateBySensorReadigs(
++sensorMapIndex;
if (sensorMapIndex == sensorMap.end())
{
// std::cerr << "sensor map completed\n";
// error("sensor map completed");
++objMapIndex;
sensorMapIndex = sensorMap.begin();
}
Expand Down Expand Up @@ -1543,7 +1543,7 @@ void HostPDRHandler::getPresentStateBySensorReadigs(
++sensorMapIndex;
if (sensorMapIndex == sensorMap.end())
{
// std::cerr << "sensor map completed\n";
// error("sensor map completed");
++objMapIndex;
sensorMapIndex = sensorMap.begin();
}
Expand Down
4 changes: 3 additions & 1 deletion libpldmresponder/bios_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,9 @@ void BIOSConfig::updateBaseBIOSTableProperty()
}
#endif
method.append(biosConfigInterface, biosConfigPropertyName, value);
bus.call_noreply(method);
bus.call_noreply(
method,
std::chrono::duration_cast<microsec>(sec(DBUS_TIMEOUT)).count());
}
catch (const std::exception& e)
{
Expand Down
6 changes: 3 additions & 3 deletions libpldmresponder/fru.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ void FruImpl::buildFRUTable()
}
catch (const std::exception& e)
{
info(
error(
"Config JSONs missing for the item interface type, interface = {INTF}",
"INTF", interface.first);
break;
Expand Down Expand Up @@ -561,7 +561,7 @@ void FruImpl::buildIndividualFRU(const std::string& fruInterface,
pldm_entity node_entity = pldm_entity_extract(node);
objToEntityNode[fruObjectPath] = node_entity;
error(
"Building Individual FRU [FRU_OBJ_PATH] with entityid [ {ENTITY_TYP}, {ENTITY_NUM}, {ENTITY_ID} ] Parent :[ {P_ENTITY_TYP}, {P_ENTITY_NUM}, {P_ENTITY_ID} ]",
"Building Individual FRU [{FRU_OBJ_PATH}] with entityid [ {ENTITY_TYP}, {ENTITY_NUM}, {ENTITY_ID} ] Parent :[ {P_ENTITY_TYP}, {P_ENTITY_NUM}, {P_ENTITY_ID} ]",
"FRU_OBJ_PATH", fruObjectPath, "ENTITY_TYP",
static_cast<unsigned>(node_entity.entity_type), "ENTITY_NUM",
static_cast<unsigned>(node_entity.entity_instance_num), "ENTITY_ID",
Expand Down Expand Up @@ -602,7 +602,7 @@ void FruImpl::buildIndividualFRU(const std::string& fruInterface,
}
catch (const std::exception& e)
{
info(
error(
"Config JSONs missing for the item in concurrent add path interface type, interface = {FRU_INTF}",
"FRU_INTF", fruInterface);
}
Expand Down
2 changes: 1 addition & 1 deletion libpldmresponder/platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ void Handler::generate(const pldm::utils::DBusHandler& dBusIntf,
{
for (const auto& directory : dir)
{
error("checking if : {DIR} exists", "DIR", directory.c_str());
info("checking if : {DIR} exists", "DIR", directory.c_str());
if (!fs::exists(directory))
{
return;
Expand Down
3 changes: 0 additions & 3 deletions libpldmresponder/test/libpldmresponder_platform_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,13 +198,10 @@ TEST(getPDR, testFindPDR)
// current is not what we want

pldm_pdr_hdr* hdr = reinterpret_cast<pldm_pdr_hdr*>(resp->record_data);
std::cerr << "PDR next record handle " << handle << "\n";
std::cerr << "PDR type " << hdr->type << "\n";
if (hdr->type == PLDM_STATE_EFFECTER_PDR)
{
pldm_state_effecter_pdr* pdr =
reinterpret_cast<pldm_state_effecter_pdr*>(resp->record_data);
std::cerr << "PDR entity type " << pdr->entity_type << "\n";
if (pdr->entity_type == 100)
{
found = true;
Expand Down
Loading