Lines Matching +full:host +full:- +full:id

8  *     http://www.apache.org/licenses/LICENSE-2.0
18 #include <phosphor-logging/lg2.hpp>
29 _retryTimer(_hostIface->getEvent(), in HostNotifier()
32 _hostIface->getEvent(), in HostNotifier()
34 _hostUpTimer(_hostIface->getEvent(), in HostNotifier()
53 // Subscribe to be told about host state changes. in HostNotifier()
59 _hostIface->setResponseFunction( in HostNotifier()
63 // Start sending logs if the host is running in HostNotifier()
66 lg2::debug("Host is already up at startup"); in HostNotifier()
67 _hostUpTimer.restartOnce(_hostIface->getHostUpDelay()); in HostNotifier()
79 lg2::debug("Host up timer expired"); in hostUpTimerExpired()
85 if (enqueueRequired(pel.id())) in addPELToQueue()
87 _pelQueue.push_back(pel.id()); in addPELToQueue()
94 bool HostNotifier::enqueueRequired(uint32_t id) const in enqueueRequired()
97 Repository::LogID i{Repository::LogID::Pel{id}}; in enqueueRequired()
127 lg2::error("Host Enqueue: Unable to find PEL ID {ID} in repository", in enqueueRequired()
128 "ID", lg2::hex, id); in enqueueRequired()
135 bool HostNotifier::notifyRequired(uint32_t id) const in notifyRequired()
138 Repository::LogID i{Repository::LogID::Pel{id}}; in notifyRequired()
142 // If already acked by the host, don't send again. in notifyRequired()
172 if (!enqueueRequired(pel.id())) in newLogCallback()
177 lg2::debug("New PEL added to queue, PEL ID = {ID}", "ID", lg2::hex, in newLogCallback()
178 pel.id()); in newLogCallback()
180 _pelQueue.push_back(pel.id()); in newLogCallback()
182 // Notify shouldn't happen if host is down, not up long enough, or full in newLogCallback()
191 auto inProgress = (_inProgressPEL != 0) || _hostIface->cmdInProgress() || in newLogCallback()
206 void HostNotifier::deleteLogCallback(uint32_t id) in deleteLogCallback() argument
208 auto queueIt = std::find(_pelQueue.begin(), _pelQueue.end(), id); in deleteLogCallback()
211 lg2::debug("Host notifier removing deleted log from queue"); in deleteLogCallback()
215 auto sentIt = std::find(_sentPELs.begin(), _sentPELs.end(), id); in deleteLogCallback()
218 lg2::debug("Host notifier removing deleted log from sent list"); in deleteLogCallback()
223 if (id == _inProgressPEL) in deleteLogCallback()
226 "A PEL was deleted while its host notification was in progress, PEL ID = {ID}", in deleteLogCallback()
227 "ID", lg2::hex, id); in deleteLogCallback()
234 _hostIface->getEvent(), std::bind(std::mem_fn(&HostNotifier::dispatch), in scheduleDispatch()
263 "PEL Host notifier hit max retry attempts. Giving up for now. PEL ID = {ID}", in doNewLogNotify()
264 "ID", lg2::hex, _pelQueue.front()); in doNewLogNotify()
266 // Tell the host interface object to clean itself up, especially to in doNewLogNotify()
267 // release the PLDM instance ID it's been using. in doNewLogNotify()
268 _hostIface->cancelCmd(); in doNewLogNotify()
274 uint32_t id = 0; in doNewLogNotify() local
279 id = _pelQueue.front(); in doNewLogNotify()
282 if (notifyRequired(id)) in doNewLogNotify()
291 Repository::LogID i{Repository::LogID::Pel{id}}; in doNewLogNotify()
297 lg2::debug("sendNewLogCmd: ID {ID} size {SIZE}", "ID", lg2::hex, id, in doNewLogNotify()
300 auto rc = _hostIface->sendNewLogCmd(id, size); in doNewLogNotify()
304 _inProgressPEL = id; in doNewLogNotify()
309 lg2::error("PLDM send failed, PEL ID = {ID}", "ID", lg2::hex, in doNewLogNotify()
310 id); in doNewLogNotify()
311 _pelQueue.push_front(id); in doNewLogNotify()
313 _retryTimer.restartOnce(_hostIface->getSendRetryDelay()); in doNewLogNotify()
319 "PEL ID is not in repository. Cannot notify host. PEL ID = {ID}", in doNewLogNotify()
320 "ID", lg2::hex, id); in doNewLogNotify()
332 lg2::debug("Host state change to on"); in hostStateChange()
333 _hostUpTimer.restartOnce(_hostIface->getHostUpDelay()); in hostStateChange()
337 lg2::debug("Host state change to off"); in hostStateChange()
343 for (auto id : _sentPELs) in hostStateChange() local
345 _pelQueue.push_back(id); in hostStateChange()
346 _repo.setPELHostTransState(id, TransmissionState::newPEL); in hostStateChange()
365 auto id = _inProgressPEL; in commandResponse() local
370 lg2::debug("HostNotifier command response success, PEL ID = {ID}", "ID", in commandResponse()
371 lg2::hex, id); in commandResponse()
374 _sentPELs.push_back(id); in commandResponse()
376 _repo.setPELHostTransState(id, TransmissionState::sent); in commandResponse()
378 // If the host is full, don't send off the next PEL in commandResponse()
386 lg2::error("PLDM command response failure, PEL ID = {ID}", "ID", in commandResponse()
387 lg2::hex, id); in commandResponse()
389 _pelQueue.push_front(id); in commandResponse()
390 _retryTimer.restartOnce(_hostIface->getReceiveRetryDelay()); in commandResponse()
398 lg2::info("Attempting command retry, PEL ID = {ID}", "ID", lg2::hex, in retryTimerExpired()
407 lg2::debug("Host full timer expired, trying send again"); in hostFullTimerExpired()
426 // Ensure the PLDM instance ID is released in stopCommand()
427 _hostIface->cancelCmd(); in stopCommand()
430 void HostNotifier::ackPEL(uint32_t id) in ackPEL() argument
432 _repo.setPELHostTransState(id, TransmissionState::acked); in ackPEL()
435 auto sent = std::find(_sentPELs.begin(), _sentPELs.end(), id); in ackPEL()
441 // An ack means the host is no longer full in ackPEL()
451 lg2::debug("Host previously full, not anymore after this ack"); in ackPEL()
461 void HostNotifier::setHostFull(uint32_t id) in setHostFull() argument
463 lg2::debug("Received Host full indication, PEL ID = {ID}", "ID", lg2::hex, in setHostFull()
464 id); in setHostFull()
468 // This PEL needs to get re-sent in setHostFull()
469 auto sent = std::find(_sentPELs.begin(), _sentPELs.end(), id); in setHostFull()
473 _repo.setPELHostTransState(id, TransmissionState::newPEL); in setHostFull()
475 if (std::find(_pelQueue.begin(), _pelQueue.end(), id) == in setHostFull()
478 _pelQueue.push_front(id); in setHostFull()
483 // host is full is from this timer callback. in setHostFull()
486 lg2::debug("Starting host full timer"); in setHostFull()
487 _hostFullTimer.restartOnce(_hostIface->getHostFullRetryDelay()); in setHostFull()
491 void HostNotifier::setBadPEL(uint32_t id) in setBadPEL() argument
493 lg2::error("PEL rejected by the host, PEL ID = {ID}", "ID", lg2::hex, id); in setBadPEL()
495 auto sent = std::find(_sentPELs.begin(), _sentPELs.end(), id); in setBadPEL()
501 _repo.setPELHostTransState(id, TransmissionState::badPEL); in setBadPEL()