History log of /openbmc/phosphor-net-ipmid/sol/sol_context.cpp (Results 1 – 20 of 20)
Revision Date Author Comments
# 8425624a 16-Aug-2024 Patrick Williams <patrick@stwcx.xyz>

clang-format: re-format for clang-18

clang-format-18 isn't compatible with the clang-format-17 output, so we
need to reformat the code with the latest version. The way clang-18
handles lambda forma

clang-format: re-format for clang-18

clang-format-18 isn't compatible with the clang-format-17 output, so we
need to reformat the code with the latest version. The way clang-18
handles lambda formatting also changed, so we have made changes to the
organization default style format to better handle lambda formatting.

See I5e08687e696dd240402a2780158664b7113def0e for updated style.
See Iea0776aaa7edd483fa395e23de25ebf5a6288f71 for clang-18 enablement.

Change-Id: I8d0072c279e4de87dc001190845d0ca6da233345
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...


# 426fcab8 13-Mar-2024 Konstantin Aladyshev <aladyshev22@gmail.com>

SOL: Another attempt to fix coredump issue

The commit "SOL: Fix coredump due to recursive call deadlock"
(5499bf862d1240bdbc061afc6e3d4f332c31329a) tried to fix coredump
issue when the buffer size i

SOL: Another attempt to fix coredump issue

The commit "SOL: Fix coredump due to recursive call deadlock"
(5499bf862d1240bdbc061afc6e3d4f332c31329a) tried to fix coredump
issue when the buffer size is larger than the send threshold (i.e. user
types too fast in the SoL session). Despite of the commit message the
provided solution doesn't seem to fix the crashdump issue.
Revert 5499bf862d and implement a proper solution.

Normally 'enableAccumulateTimer()' launches a timer to accumulate data
before send, and after the timeout the 'charAccTimerHandler()' sends
all the data via the 'sendOutboundPayload()' function.
If the buffer is not ready at that moment, the 'charAccTimerHandler()'
relaunches the timer via the 'enableAccumulateTimer()' call.
At the same time the 'enableAccumulateTimer()' function has an
optimization: if the data size is more than 'sendThreshold' there is no
point in timer, data can be send directly from the function. For that
the current code calls the 'charAccTimerHandler()'.
In the end this can create an endless recursion in times when buffer is
not ready:
enableAccumulateTimer()
charAccTimerHandler()
sendOutboundPayload()
enableAccumulateTimer()
...
To solve the issue we need to be careful about when we call the
'enableAccumulateTimer()' function:
- first of all we don't need to call it from 'sendOutboundPayload()'
since it is already called from the 'charAccTimerHandler()',
- secondary in the 'enableAccumulateTimer' optimization case we don't
need to call 'charAccTimerHandler()' which can re-launch timer but can
just use 'sendOutboundPayload()' directly.

Tested:
SOL console in ipmitool works fine if holding arrow up/down key
for a long time.

Change-Id: Ibec03fc1394f23ba39b6f2d5a929928588e00590
Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com>

show more ...


# 5499bf86 24-Jan-2024 Jian Zhang <zhangjian.3032@bytedance.com>

SOL: Fix coredump due to recursive call deadlock

When the data buffer size is always larger than the send threshold.
The recursive call deadlock when any input event is received.

the backtrace is a

SOL: Fix coredump due to recursive call deadlock

When the data buffer size is always larger than the send threshold.
The recursive call deadlock when any input event is received.

the backtrace is as below:
- enableAccumulateTimer
- charAccTimerHandler
- sendOutboundPayload
- enableAccumulateTimer

using io.post avoid the recursive call deadlock.

Change-Id: Ic67d2c6dfce5c658b7ef4813bf3a62ad93ced8ad
Signed-off-by: Jian Zhang <zhangjian.3032@bytedance.com>

show more ...


# 15535143 21-Sep-2022 Tang Yiwei <tangyiwei.2022@bytedance.com>

Optimize SOL logic according to SOL Configuration Parameters definition

Issue without this patch:
ipmi sol is always slower than web sol and system output.

Defined in ipmi spec:
Byte 2: Character S

Optimize SOL logic according to SOL Configuration Parameters definition

Issue without this patch:
ipmi sol is always slower than web sol and system output.

Defined in ipmi spec:
Byte 2: Character Send Threshold. 1-based. The BMC will automatically
send an SOL character data packet containing this number of characters
as soon as this number of characters(or greater) has been accepted from
the baseboard serial controller into the BMC.

Tested:
1. ipmitool -I lanplus -H <BMC IP> -U <user> -P <pwd> sol activate
2. ipmi sol output is consistent with system output.

Signed-off-by: Tang Yiwei <tangyiwei.2022@bytedance.com>
Change-Id: I097e5f4bf7ff224a90505dcb69cd59039a297e08

show more ...


# 099fb097 10-May-2023 Patrick Williams <patrick@stwcx.xyz>

clang-format: copy latest and re-format

clang-format-16 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest

clang-format: copy latest and re-format

clang-format-16 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest .clang-format from the docs repository and reformat the
repository.

Change-Id: I862ed296ce1f42dba7047a74540d9004ad78130c
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...


# ec437414 27-Sep-2022 Tingting Chen <chentingting.2150@bytedance.com>

phosphor-ipmi-net: Add sysrq handle in netipmid for ipmitool sol.

Send MSG_OOB flag to console server to generate a break.

Tested:
1. Open SOL by ipmitool: ipmitool -H <bmcip> -I lanp -U <user> -P

phosphor-ipmi-net: Add sysrq handle in netipmid for ipmitool sol.

Send MSG_OOB flag to console server to generate a break.

Tested:
1. Open SOL by ipmitool: ipmitool -H <bmcip> -I lanp -U <user> -P <password> sol activate
2. In SOL terminal, login os and "echo 1 > /proc/sys/kernel/sysrq" to open sysrq function
3. In SOL terminal, Enter ~+B to generate break, then enter "h" in 5 second.
4. Veirfy below message shown in SOL:
root@bytedance:~# ~B [send break]
[ 366.377331] sysrq: HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e)
memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-backtrace-all-active-cpus(l)
show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r)
sync(s) show-task-states(t) unmount(u) force-fb(V) show-blocked-tasks(w) dump-ftrace-buffer(z)

Change-Id: Ieac3ee0c7f964920214aa185a947e0449034726f
Signed-off-by: Tingting Chen <chentingting.2150@bytedance.com>

show more ...


# 7b7f25f7 04-Jul-2022 George Liu <liuxiwei@inspur.com>

logging: switch to lg2

After switching to C++20, it is recommended to use `phosphor::lg2`
to format log, and the correct `CODE_LINE` and `CODE_FUNC` values
can be used in log tracking.

Signed-off-b

logging: switch to lg2

After switching to C++20, it is recommended to use `phosphor::lg2`
to format log, and the correct `CODE_LINE` and `CODE_FUNC` values
can be used in log tracking.

Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: I4aabaafe997e13c10d655a83a9ef0071ad11126e

show more ...


# 12d199b2 06-Oct-2021 Patrick Williams <patrick@stwcx.xyz>

catch exceptions as const

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: If18cc0293b52ce5f7f8e068688aa17d28ed27d50


# 2085ae07 10-Jun-2021 Vernon Mauery <vernon.mauery@linux.intel.com>

replace tuple-based singleton with individual singletons

The tuple-based singletons did not actually enforce singleton behavior
and the requirement of the accessor mechanism to include a

replace tuple-based singleton with individual singletons

The tuple-based singletons did not actually enforce singleton behavior
and the requirement of the accessor mechanism to include all of the
member types at once was starting to cause a header prerequisite
tangle. This removes the cross-dependencies and enforces actual
singletons by making a single way to access the class.

Tested: Run ipmitool to show that behavior has not changed

Change-Id: Ie966e1142363d279365b1095066380c8383e9f9b
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>

show more ...


# a6ad5e16 21-Feb-2020 Vernon Mauery <vernon.mauery@linux.intel.com>

Check if the object is still valid in the timeout callback function

When the SOL module in netipmid is busy, there is a chance that the
timeout callback function is executed after the co

Check if the object is still valid in the timeout callback function

When the SOL module in netipmid is busy, there is a chance that the
timeout callback function is executed after the context object is
destructed. This will cause the process to crash with this error:

terminate called after throwing an instance of
'boost::wrapexcept<boost::asio::bad_executor>'
what(): bad executor

The root cause is that the cancel() cannot cancel the expired callback
handlers. When the callback handler is executed, the object is deleted
already.

This uses proper reference counting on the objects captured in the
lambda so that they are not referencing memory that has already gone out
of scope.

Tested:
Decrease the accumulateInterval to 50ms for easy reproducing.
Run "ipmitool sel list", "ipmitool sensor list"
and "ipmitool sol looptest 200 500" at the same time,
no "sol looptest fail" error

Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
Change-Id: I4b9e4ebce14ff5fca8e991aed96643186c9ea5d9

show more ...


# 6f353e86 09-Nov-2018 Vernon Mauery <vernon.mauery@linux.intel.com>

netipmid: move sol timers to asio

The IPMI SOL console was using sd_event-based timers directly (without
any abstraction). This moves to a much higher level abstraction that is
very

netipmid: move sol timers to asio

The IPMI SOL console was using sd_event-based timers directly (without
any abstraction). This moves to a much higher level abstraction that is
very easy to use: asio timers.

Change-Id: Id5df76a1918cdfae420e01884d664234810b7abd
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>

show more ...


# ae1fda44 15-Oct-2018 Vernon Mauery <vernon.mauery@linux.intel.com>

netipmid: use std::shared_ptr instead of weak_ptr/lock

All of the instances of getSession and startSession were assigning the
result to a local shared_ptr via lock on the weak_ptr. It do

netipmid: use std::shared_ptr instead of weak_ptr/lock

All of the instances of getSession and startSession were assigning the
result to a local shared_ptr via lock on the weak_ptr. It doesn't make
sense to demote the shared_ptr (from the sessionsMap) to a weak_ptr via
the return, only to promote to a shared_ptr again via lock.

Tested-by: running ipmitool -H a.b.c.d -P 0penBmc -I lanplus mc info
Sessions start and stop, same as before.

Change-Id: Ic10779285891d73ee51115f16ed0000b38d1c52a
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>

show more ...


# 9e801a2b 12-Oct-2018 Vernon Mauery <vernon.mauery@linux.intel.com>

netipmid: apply clang-format rules

Lots of whitespace change. Let clang-format do its job and keep the code
looking nice.

Change-Id: Idfcad1a99cab8170d55a06163de8ad3f420b68b7

netipmid: apply clang-format rules

Lots of whitespace change. Let clang-format do its job and keep the code
looking nice.

Change-Id: Idfcad1a99cab8170d55a06163de8ad3f420b68b7
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>

show more ...


# 70fd29cf 30-Nov-2017 Vernon Mauery <vernon.mauery@linux.intel.com>

explicit use of std::vector instead of buffer/Buffer

There were several scoped 'using buffer = std::vector<uint8_t>;' in
header files. This consolidates the code base to use
std::vec

explicit use of std::vector instead of buffer/Buffer

There were several scoped 'using buffer = std::vector<uint8_t>;' in
header files. This consolidates the code base to use
std::vector<uint8_t> instead of buffer or Buffer. This makes the code
easier to read and debug.

Change-Id: I918a0f6ca9b8e4b9d331175dccff45cbf4c8379d
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>

show more ...


# 694fc0cf 21-Aug-2017 Tom Joseph <tomjoseph@in.ibm.com>

netipmid: Support usesolkeepalive option

ipmitool keeps SOL session active by sending Get Device ID
command or using SOL packet to keep the session active. We are
adding support for

netipmid: Support usesolkeepalive option

ipmitool keeps SOL session active by sending Get Device ID
command or using SOL packet to keep the session active. We are
adding support for keeping the SOL session active by using SOL
packet in which case ipmitool would send a SOL payload with no
character data and a valid SOL sequence number, the BMC would
respond with acknowledgement for that sequence number.

Resolves openbmc/openbmc#2101

Change-Id: Ia10e622e761e0de3530e3cc8bc2148a477ffd4ba
Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>

show more ...


# 22596f21 31-Mar-2017 Tom Joseph <tomjoseph@in.ibm.com>

Add function to send outbound SOL payload

Change-Id: I63213034110c0a550b43e1cbc0115b1312821e3d
Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>


# 2fd466f4 29-Mar-2017 Tom Joseph <tomjoseph@in.ibm.com>

Add resendPayload function

Resolves openbmc/openbmc#856

Change-Id: I957ce889500840c067e97537e825571cfb77e1c4
Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>


# 7306314f 14-Mar-2017 Tom Joseph <tomjoseph@in.ibm.com>

Implement API to send SOL payload when console data is available

Change-Id: I7869d389b589c59e0c76000da9bfd72b9e67c064
Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>


# 75e15db4 14-Mar-2017 Tom Joseph <tomjoseph@in.ibm.com>

Implement API to prepare response for inbound SOL payload

Change-Id: Ied9811e7e3176c5edf99fa299549ea1d14e9555f
Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>


# fbcac2e7 14-Mar-2017 Tom Joseph <tomjoseph@in.ibm.com>

Implement API to handle inbound SOL Payload

Change-Id: I4bcb98568d84ba384ac11b7777d936c7d5fc124e
Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>