History log of /openbmc/libpldm/src/requester/instance-id.c (Results 1 – 12 of 12)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: v0.11.0, v0.10.0, v0.9.1, v0.9.0
# 2b440d4c 24-Jul-2024 Andrew Jeffery <andrew@codeconstruct.com.au>

msgbuf: Ensure memmem() is correctly typed and visible where required

To ensure memmem() is visible _GNU_SOURCE needs to be defined early,
at least before any system headers are included. Define it

msgbuf: Ensure memmem() is correctly typed and visible where required

To ensure memmem() is visible _GNU_SOURCE needs to be defined early,
at least before any system headers are included. Define it in the build
flags as clang-tidy will re-order includes based on vibes rather than
dependencies. Finally, clean up the remaining compiler warnings by
dropping the unnecessary casts.

Note that _GNU_SOURCE implies _DEFAULT_SOURCE, so we drop the latter:

> Since glibc 2.19, defining _GNU_SOURCE also has the effect of
> implicitly defining _DEFAULT_SOURCE. Before glibc 2.20, defining
> _GNU_SOURCE also had the effect of implicitly defining _BSD_SOURCE
> and _SVID_SOURCE.

https://www.man7.org/linux/man-pages/man7/feature_test_macros.7.html

Fixes: #12
Fixes: 1523778d2739 ("msgbuf: Add pldm_msgbuf_span_string_utf16()")
Change-Id: I9206f7616740790a89366762cce11d3045471b97
Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>

show more ...


# e4240679 28-Jun-2024 Andrew Jeffery <andrew@codeconstruct.com.au>

requester: instance-id: Release read lock on conflict

36af84cdbb66 ("requester: Add new APIs for instance ID allocation and
freeing") introduced the new instance ID allocation APIs, and some
unbalan

requester: instance-id: Release read lock on conflict

36af84cdbb66 ("requester: Add new APIs for instance ID allocation and
freeing") introduced the new instance ID allocation APIs, and some
unbalanced locking along with it. When a conflict arose on an instance
ID, the read lock was not released by the non-owning caller.

Release the lock on conflict and on error, and add a test case to
prevent regression.

gitlint-ignore: UC1, B1
Fixes: 36af84cdbb66 ("requester: Add new APIs for instance ID allocation and freeing")
Reported-by: Jerry Chen <jerry_c_chen@wiwynn.com>
Change-Id: Iecd1583c6b8863b458cc4fbf1ac42b20ca2a3433
Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>

show more ...


Revision tags: v0.8.0
# d12dd36e 09-Nov-2023 Andrew Jeffery <andrew@codeconstruct.com.au>

libpldm: Rationalise the local and installed path of pldm.h

Since chopping libpldm out of openbmc/pldm.git there's been a symlink
from `include/libpldm/pldm.h` pointing to
`include/libpldm/requester

libpldm: Rationalise the local and installed path of pldm.h

Since chopping libpldm out of openbmc/pldm.git there's been a symlink
from `include/libpldm/pldm.h` pointing to
`include/libpldm/requester/pldm.h`. The file list contained in the
`libpldm_headers` variable defined by `include/libpldm/meson.build`
contained an entry for `requester/pldm.h`, though not the symlink found
at `include/libpldm/pldm.h`.

Prior to a7989cd65d51 ("meson: Fix for OEM header collision issue")
`install_headers(libpldm_headers, ...)` directive didn't specify
`preserve_path: true`, therefore the `requester/pldm.h` header file was
installed directly under `${INCLUDEDIR}/libpldm` as
`${INCLUDEDIR}/libpldm/pldm.h`, and no file was installed to
`${INCLUDEDIR}/libpldm/requester/pldm.h`.

All dependent applications using the declarations in `pldm.h` therefore
included the header using the directive `#include <libpldm/pldm.h>`.
However, internal to the libpldm implementation we were using the
non-symlinked path in the local tree:
`#include "libpldm/requester/pldm.h"`

With a7989cd65d51 ("meson: Fix for OEM header collision issue") we
rationalised the meson variables used to install the headers as part of
properly separating OEM headers from one-another. This lead to
specifying `preserve_path: true` for the
`install_headers(libpldm_headers, ...)` meson directive, which further
lead to the installed location of `pldm.h` changing to
`${INCLUDEDIR}/libpldm/requester/pldm.h`. This broke all consuming
applications which were necessarily using `#include <libpldm/pldm.h>` as
outlined above.

Get rid of the symlink at `include/libpldm/pldm.h`, move
`include/libpldm/requester/pldm.h` there instead, and fix up all
internal references to the header. This unbreaks applications consuming
libpldm, and prevents internal inconsistencies going forward.

Fixes: a7989cd65d51 ("meson: Fix for OEM header collision issue")
Change-Id: I24f1e25303890c41fd3da6323c67d838022cc55d
Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>

show more ...


# b0c1d20a 07-Nov-2023 Andrew Jeffery <andrew@codeconstruct.com.au>

libpldm: Fix header use

The headers need to work whether we're building libpldm in the repo or
we're building another project depending on the headers in the system
include directory.

Tidy up the p

libpldm: Fix header use

The headers need to work whether we're building libpldm in the repo or
we're building another project depending on the headers in the system
include directory.

Tidy up the paths involved and switch to defining the public headers as
system headers for the purpose of the build.

Change-Id: I49413988c94d393ea5761bc4684edcd2c2482a98
Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>

show more ...


# 691668fe 01-Nov-2023 Patrick Williams <patrick@stwcx.xyz>

license: add spdx identifier to all files

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


Revision tags: v0.7.0, v0.6.0, v0.5.0, v0.4.0, v0.3.0
# f89befe3 15-Jun-2023 Andrew Jeffery <andrew@aj.id.au>

meson: Force inclusion of config.h via `-include`

Make sure there's no ambiguity about which config.h is used for includes
in the event that libpldm acquires subprojects, or is used as a
subproject

meson: Force inclusion of config.h via `-include`

Make sure there's no ambiguity about which config.h is used for includes
in the event that libpldm acquires subprojects, or is used as a
subproject itself.

Tested: `meson compile -C build` succeeds

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: I08c3bdc807cc268d2401e06f0bfaee07f89ba534

show more ...


# 9d2a1c6a 04-Jun-2023 Andrew Jeffery <andrew@aj.id.au>

libpldm: Explicit deprecated, stable and testing ABI classes

Experimenting with new APIs is important, but ABI stability of the
library is also important. We wish to have the freedom to add APIs
wit

libpldm: Explicit deprecated, stable and testing ABI classes

Experimenting with new APIs is important, but ABI stability of the
library is also important. We wish to have the freedom to add APIs
without being burdened by them being immediately set in stone.

We implement this wish by introducing three classes of ABI:

1. deprecated
2. stable
3. testing

These are enforced by corresponding function attributes:

1. LIBPLDM_ABI_DEPRECATED
2. LIBPLDM_ABI_STABLE
3. LIBPLDM_ABI_TESTING

Symbol visibility in the library is flipped to 'hidden' by default, so
one of these annotations must be used for the symbol to be exposed.

With these classes in place there are now clear points in time at which
we update the ABI dumps captured under the abi/ directory: When an API
is migrated from the 'testing' class to the 'stable' class, or when
removed from the 'deprecated' class.

Which classes of functions are exposed by the build is controlled by the
new 'abi' meson option. The option is of array type which contains the
list of ABI classes the build should consider. It defaults to enabling
all classes to provide test coverage in CI. The classes used should be
constrained to deprecated and stable (and not test) in any dependent
projects.

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: I25402e20c7be9c9f264f9ccd7ac36b384823734c

show more ...


# 37dd6a3d 12-May-2023 Andrew Jeffery <andrew@aj.id.au>

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[1] and reformat
the repository.

[1] https://gerrit.openbmc.org/c/openbmc/docs/+/63441

Further, shift the fixup for C's `_Static_assert` into src/msgbuf.h to
prevent a clang-tidy-16 error:

```
/data0/jenkins/workspace/ci-repository/openbmc/libpldm/src/msgbuf.h:315:2: error: '_Static_assert' is a C11 extension [clang-diagnostic-c11-extensions,-warnings-as-errors]
_Static_assert(sizeof(*dst) == sizeof(ldst),
^
```

And fix up the function prototype in the definition of `pldm_open()`:

```
../src/requester/pldm.c:128:16: error: a function declaration without a prototype is deprecated in all versions of C [clang-diagnostic-strict-prototypes,-warnings-as-errors]
void pldm_close()
^
void
```

Change-Id: I57b53f51914e39237e733d024e62ab41b3d306c1
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>

show more ...


# a6f0cf3e 23-Apr-2023 Andrew Jeffery <andrew@aj.id.au>

instance-id: Ensure database is appropriately sized

Fail initialisation if we know that we may fail to satisfy valid
allocations.

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: Iff38b27

instance-id: Ensure database is appropriately sized

Fail initialisation if we know that we may fail to satisfy valid
allocations.

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: Iff38b27fd324da57a1d81b6ad3c5951e369ce3b3

show more ...


# 0aea707b 23-Apr-2023 Andrew Jeffery <andrew@aj.id.au>

instance-id: Track existing allocations for each db instance

OFD locking allows merging and splitting of locks, which means that it
won't fail an attempt to "recursively" lock the range. We were rel

instance-id: Track existing allocations for each db instance

OFD locking allows merging and splitting of locks, which means that it
won't fail an attempt to "recursively" lock the range. We were relying
on that to prevent double allocation when the available instance IDs for
a TID were exhausted.

Given that we can't rely on it, explicitly track the allocations in the
local state.

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: Ic0f6903935ac712a86a7967d1cceb5a0c463878b

show more ...


# a918a628 21-Apr-2023 Andrew Jeffery <andrew@aj.id.au>

include: Move instance-id.h under libpldm/

The installed location for the header is
`${includedir}/libpldm/instance-id.h`. Make the in-tree location
equivalent so we don't have a slightly jarring in

include: Move instance-id.h under libpldm/

The installed location for the header is
`${includedir}/libpldm/instance-id.h`. Make the in-tree location
equivalent so we don't have a slightly jarring inconsistency.

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: I9c1f324e18ba504261845187e88e35db0d8ef873

show more ...


# 36af84cd 12-Apr-2023 Rashmica Gupta <rashmica@linux.ibm.com>

requester: Add new APIs for instance ID allocation and freeing

This patch starts the move of instance id handling into libpldm.
Currently pldmd allocates instance ids, and exposes a DBus call for
ex

requester: Add new APIs for instance ID allocation and freeing

This patch starts the move of instance id handling into libpldm.
Currently pldmd allocates instance ids, and exposes a DBus call for
external apps to get instance ids. It relies on exploiting a behaviour
of mctp-demux to reclaim used ids by monitoring all incoming PLDM
responses. When moving to AF_MCTP, PLDM messages are not broadcast to
all PLDM sockets, and so this method of reclaiming ids won't work
automatically.

As instance id handling is moving into libpldm eventually, we may as
well do that now rather than adding an additional step to address this
issue. So an allocate and free function for instance ids is added in
this patch. As this implementation uses file locking, we have the
feature of any ids belonging to a process that dies being automatically
reclaimed into the id pool.

Some context behind the file based range locking design for instance IDs
can be found here:
https://amboar.github.io/notes/2023/03/28/motivating-a-new-scheme-for-pldm-instance-id-management-in-openbmc.html
and
https://amboar.github.io/notes/2023/03/29/a-global-pldm-instance-id-allocator-for-libpldm.html

Change-Id: Ia19870b1bcae9e614bda6e475b290faa0b327a73
Signed-off-by: Rashmica Gupta <rashmica@linux.ibm.com>

show more ...