History log of /openbmc/phosphor-net-ipmid/sd_event_loop.cpp (Results 1 – 25 of 38)
Revision Date Author Comments
# bd2dde46 06-Feb-2024 Patrick Williams <patrick@stwcx.xyz>

remove unused asio/sd_event.hpp include

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


# b1cbd6fb 19-Nov-2024 George Liu <liuxiwei@ieisystem.com>

Fix the netipmid process failed to start

It is not advisable to declare a local variable 'signals' in the
`setupSignal` method, as this can cause the netipmid process to exit
after the method comple

Fix the netipmid process failed to start

It is not advisable to declare a local variable 'signals' in the
`setupSignal` method, as this can cause the netipmid process to exit
after the method completes execution.

Tested: Loading romulus in qemu and executing out of band ipmitool
successfully returns.

Change-Id: I3fb887db0ec2bfbc434e2a6d8b4f021748ba0a86
Signed-off-by: George Liu <liuxiwei@ieisystem.com>

show more ...


# 01373c2b 14-Nov-2024 George Liu <liuxiwei@ieisystem.com>

Fix coredump when using nullptr

If udpSocket is not initialized when executing the setupSignal method
acoredump may occur due to the use of a nullptr.

Change-Id: Id32990ab8ed3dc75767cc1c2e566015722

Fix coredump when using nullptr

If udpSocket is not initialized when executing the setupSignal method
acoredump may occur due to the use of a nullptr.

Change-Id: Id32990ab8ed3dc75767cc1c2e5660157223f473d
Signed-off-by: George Liu <liuxiwei@ieisystem.com>

show more ...


# afac94d1 23-Oct-2024 George Liu <liuxiwei@ieisystem.com>

Fix the coredump problem caused by lock acquisition failure

As net-ipmid depends on ipmid, stress testing found that frequent
start/stop of net-ipmid will cause coredump due to lock acquisition
fail

Fix the coredump problem caused by lock acquisition failure

As net-ipmid depends on ipmid, stress testing found that frequent
start/stop of net-ipmid will cause coredump due to lock acquisition
failure in ipmid's inithannelPersistData.
Since net-ipmid depends on ipmid, stress testing found that if
net-ipmid is started/stopped frequently, it will exit abnormally due
to failure to obtain the lock in the inithannelPersistData method of
ipmid.
```
netipmid-eth1[893]: terminate called after throwing an instance of ‘boost::interprocess::lock_exception’
netipmid-eth1[893]: what(): boost::interprocess::lock_exception
```

Because in the main method of net-ipmid, the ipmi::ipmiChannelInit
method is called first, and then the startEventLoop method is called
to process the signal. This will cause a bug:
1. After net-ipmid@eth0 starts, ipmi::ipmiChannelInit will be
executed to initialize and construct ChannelConfig.
2. The initChannelPersistData method will be executed in the
construction method to obtain the lock and load the configuration.
3. If the stop method of net-ipmid is executed before the
construction method is completed, the held lock will not be
released correctly
4. If start is executed immediately at this time, the ipmid process
will coredump because the current lock is undefined.

This submission moves the signal processing to before the
ipmi::ipmiChannelInit method, which will ensure that if net-ipmid
starts and captures abnormal operations, it will stop io first, so
that the held lock will be released correctly.

Tested:
Using this patch, no ipmid coredump occurs in the stress test.

Signed-off-by: George Liu <liuxiwei@ieisystem.com>
Change-Id: I29694405679330c083fa35d04443fb2e31bfca3b

show more ...


# 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 ...


# 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 ...


# 1b32b8ee 06-Mar-2023 Ed Tanous <edtanous@google.com>

Move to boost::asio::post

This allows entity_manager to compile with BOOST_ASIO_NO_DEPRECATED set.
It was functionally changed a few years ago, and is identical to the
other behavior.

Change-Id: I7

Move to boost::asio::post

This allows entity_manager to compile with BOOST_ASIO_NO_DEPRECATED set.
It was functionally changed a few years ago, and is identical to the
other behavior.

Change-Id: I73b9bdeb9a079f843122c0bba545f2a08f965b68
Signed-off-by: Ed Tanous <edtanous@google.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 ...


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

Fix cppcheck warnings

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


# 0a59062c 22-Jul-2022 Patrick Williams <patrick@stwcx.xyz>

sdbusplus: use shorter type aliases

The sdbusplus headers provide shortened aliases for many types.
Switch to using them to provide better code clarity and shorter
lines. Possible replacements are

sdbusplus: use shorter type aliases

The sdbusplus headers provide shortened aliases for many types.
Switch to using them to provide better code clarity and shorter
lines. Possible replacements are for:
* bus_t
* exception_t
* manager_t
* match_t
* message_t
* object_t
* slot_t

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

show more ...


# 7f9e3f09 22-Jun-2022 Jiaqing Zhao <jiaqing.zhao@intel.com>

Fix typo in log

"interface" was misspelled as "interfae"

Tested:
Build pass.

Change-Id: Iad3bbb2663d5e4aa46887a2e3a5148e0a01e88dd
Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>


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

catch exceptions as const

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


# 07bb0951 18-Aug-2020 Ed Tanous <ed@tanous.net>

Fix includes

sd_event_loop.cpp is missing some includes. It builds today based on
some very large includes from sdbusplus. This fixes that, and makes it
so sdbusplus can remove the asio.hpp includ

Fix includes

sd_event_loop.cpp is missing some includes. It builds today based on
some very large includes from sdbusplus. This fixes that, and makes it
so sdbusplus can remove the asio.hpp include.

Signed-off-by: Ed Tanous <ed@tanous.net>
Change-Id: I71b1641203da71160d69b0366bb4aba5ae51a064

show more ...


# 8c0bf983 20-Oct-2019 Alvin Wang <alvinwang@msn.com>

Add VLAN device binding

IPMI net channel supports the VLAN. This patch will bind the service
to VLAN device if the VLANID is set in net channel.

Tested:
In all the steps, use following commands to

Add VLAN device binding

IPMI net channel supports the VLAN. This patch will bind the service
to VLAN device if the VLANID is set in net channel.

Tested:
In all the steps, use following commands to check if ipmi overlan is
still working and lan channel info is correct.
ipmitool -I lanplus ... mc info
ipmitool -I lanplus ... lan print 1

1. Start the phosphor-ipmi-net@eth0.service and this service binds to
eth0 device
# Command to get the binding device
journalctl -u phosphor-ipmi-net@eth0.service -o verbose | grep \
INTERFACE
INTERFACE=eth0

2. Set the VLANID (123) for channel 1 (eth0) and restart the service.
The service is binded to eth0.123
# Command to set the channel 1 VLANID
ipmitool -I lanplus ... lan set 1 vlan id 123

# Command to restart
systemctl restart phosphor-ipmi-net@eth0.service

# Command to check the binding
journalctl -u phosphor-ipmi-net@eth0.service -o verbose | grep \
INTERFACE
INTERFACE=eth0.123

3. Disable the VLANID for channel 0 and restart the service.
The service is binded to eth0
# Command to disable the channel 1 VLANID
ipmitool -I lanplus ... lan set 1 vlan id off

# Command to restart
systemctl restart phosphor-ipmi-net@eth0.service

# Command to check the binding
journalctl -u phosphor-ipmi-net@eth0.service -o verbose | grep \
INTERFACE
INTERFACE=eth0

Limitation: Need to restart this service when the VLANID is changed.
This should be done in phosphor-host-ipmid.

Change-Id: I6c05aacf6b18cb1fa0d1cabe6ad36f0d683948d1
Signed-off-by: Alvin Wang <alvinwang@msn.com>

show more ...


# d92bc324 15-Mar-2019 Vernon Mauery <vernon.mauery@linux.intel.com>

spawn one rmcpp bridge per interface

According to the new architecture, each bridge should be a separate
process, or at the very least, be attached on a separate D-Bus
connection with a well-known n

spawn one rmcpp bridge per interface

According to the new architecture, each bridge should be a separate
process, or at the very least, be attached on a separate D-Bus
connection with a well-known name that corresponds to the channel name.

This commit brings netipmid to a state where it can be launched as:
systemctl start phosphor-ipmi-net@eth0

with a parameterized unit file and socket file that binds the socket to
the interface specified. If not launched this way, it will by default be
bound to all interfaces.

This includes the new parameterized service and socket file and the
autoconf/automake magic to install them to the correct place.

Tested-by: launch netipmid via current unit file/socket file
launch netipmid via parameterize unit file/socket file

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

show more ...


# 7a4ea795 25-Oct-2018 Vernon Mauery <vernon.mauery@linux.intel.com>

netipmid: Remove unused event references

Now that all the provider libraries are only loaded by the main ipmid
queue, there are no callers for the event object, so it can be removed.
The same goes f

netipmid: Remove unused event references

Now that all the provider libraries are only loaded by the main ipmid
queue, there are no callers for the event object, so it can be removed.
The same goes for the event loop; all users of the sd_event object have
been replaced with boost::asio, so it can be removed.

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

show more ...


# 8d6f200c 07-Nov-2018 Vernon Mauery <vernon.mauery@linux.intel.com>

netipmid: make Handler asynchronous

The dbus call to the main ipmid queue was up to this point synchronous,
which means it blocks all other networking and execution until the main
queue returns (whi

netipmid: make Handler asynchronous

The dbus call to the main ipmid queue was up to this point synchronous,
which means it blocks all other networking and execution until the main
queue returns (which may be on the order of seconds for some commands).
This is an unacceptable delay, especially when this queue is responsible
for timely updates of SOL traffic.

This turns the call into an asynchronous one by leveraging shared
pointers and an optional action on destruction. So as long as a
reference to the Handler object exists, it will live on, waiting to send
its response. Once the async dbus call has returned and set the reply in
the Handler, it will drop the reference to the shared pointer and the
destructor will send out the response over the channel.

Tested-by: Run multiple sessions at the same time while monitoring dbus
traffic. See that the requests and responses may be
interleaved instead of serial.

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

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 easy to use: asi

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 ...


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

netipmid: move sol console sockets to asio

Rewrite the SOL console sockets use boost::asio. This reduces code size
and ties better into the main asio io loop.

Change-Id: Ia79b9aa3fa3c7ce1ddd9b609b0

netipmid: move sol console sockets to asio

Rewrite the SOL console sockets use boost::asio. This reduces code size
and ties better into the main asio io loop.

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

show more ...


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

netipmid: move raw sockets to boost::asio sockets

Replacing the raw socket code with boost::asio sockets once again
provides a simple API with fewer lines of code.

Change-Id: Ibdd4b5ecbead947128200

netipmid: move raw sockets to boost::asio sockets

Replacing the raw socket code with boost::asio sockets once again
provides a simple API with fewer lines of code.

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

show more ...


# 22c8a210 24-Oct-2018 Vernon Mauery <vernon.mauery@linux.intel.com>

netipmid: use boost::asio signal handling

boost::asio provides a signal handling interface that looks familiar to
the rest of its async API. This will allow the event loop to cleanly
shut down upon

netipmid: use boost::asio signal handling

boost::asio provides a signal handling interface that looks familiar to
the rest of its async API. This will allow the event loop to cleanly
shut down upon receipt of SIGTERM or SIGINT.

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

show more ...


# cbccb05a 24-Oct-2018 Vernon Mauery <vernon.mauery@linux.intel.com>

netipmid: move event loop to boost::asio::io_context

Replacing the event loop with asio provides for more flexibility and
less code than the sd_event model. Intially, this will require the loop
to h

netipmid: move event loop to boost::asio::io_context

Replacing the event loop with asio provides for more flexibility and
less code than the sd_event model. Intially, this will require the loop
to handle both sd_events with a wrapper, but after all the sd_event
sources are replaced with asio event sources the wrapper can be removed.

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

show more ...


# d999ffc1 25-Oct-2018 Vernon Mauery <vernon.mauery@linux.intel.com>

netipmid: use shared_ptr on messages instead of unique_ptr+references

Messages were being created and held by unique_ptr objects and then
shared via reference. This is dangerous and sidesteps the wh

netipmid: use shared_ptr on messages instead of unique_ptr+references

Messages were being created and held by unique_ptr objects and then
shared via reference. This is dangerous and sidesteps the whole point of
a unique_ptr, which is to enforce single ownership. This replaces the
usage with a shared_ptr, which denotes shared ownership.

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

show more ...


# a65e30df 26-Oct-2018 Patrick Venture <venture@google.com>

style: cppcheck cleanup

[command/guid.cpp:37]: (style) The scope of the variable 'rc' can be
reduced.
[socket_channel.hpp:44]: (performance) Variable 'timeout' is assigned
in constructor body. Consi

style: cppcheck cleanup

[command/guid.cpp:37]: (style) The scope of the variable 'rc' can be
reduced.
[socket_channel.hpp:44]: (performance) Variable 'timeout' is assigned
in constructor body. Consider performing initialization in
initialization list.
[sd_event_loop.cpp:107]: (style) The scope of the variable 'instance'
can be reduced.
[sd_event_loop.cpp:108]: (style) The scope of the variable 'rc' can be
reduced.
[sd_event_loop.cpp:142]: (style) The scope of the variable 'instance'
can be reduced.
[sd_event_loop.cpp:304]: (style) The scope of the variable 'rc' can be
reduced.

Change-Id: Id090cb217ea7ed9019f1b8d39ebebd6bb73113b1
Signed-off-by: Patrick Venture <venture@google.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
Signed-off-by: Vernon

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 ...


12