On 6/15/23 21:30, Chautru, Nicolas wrote:
Hi Maxime,
-----Original Message-----
From: Maxime Coquelin <maxime.coque...@redhat.com>
On 6/14/23 20:18, Chautru, Nicolas wrote:
Hi Maxime,
-----Original Message-----
From: Maxime Coquelin <maxime.coque...@redhat.com> Hi,
On 6/13/23 19:16, Chautru, Nicolas wrote:
Hi Maxime,
-----Original Message-----
From: Maxime Coquelin <maxime.coque...@redhat.com>
On 6/12/23 22:53, Chautru, Nicolas wrote:
Hi Maxime, David,
-----Original Message-----
From: Maxime Coquelin <maxime.coque...@redhat.com>
On 6/6/23 23:01, Chautru, Nicolas wrote:
Hi David,
-----Original Message-----
From: David Marchand <david.march...@redhat.com>> >> On
Mon, Jun
5,
2023 at 10:08 PM Chautru, Nicolas <nicolas.chau...@intel.com>
wrote:
Wrt the MLD functions: these are new into the related serie
but still the
break the ABI since the struct rte_bbdev includes these
functions hence causing offset changes.
Should I then just rephrase as:
+* bbdev: Will extend the API to support the new operation
+type
+``RTE_BBDEV_OP_MLDTS`` as per
+ this `v1
+<https://patches.dpdk.org/project/dpdk/list/?series=28192>`.
This
+ will notably introduce + new symbols for
``rte_bbdev_dequeue_mldts_ops``,
+``rte_bbdev_enqueue_mldts_ops`` into the stuct rte_bbdev.
I don't think we need this deprecation notice.
Do you need to expose those new mldts ops in rte_bbdev?
Can't they go to dev_ops?
If you can't, at least moving those new ops at the end of the
structure would avoid the breakage on rte_bbdev.
It would probably be best to move all these ops at the end of
the structure
(ie. keep them together).
In that case the deprecation notice would call out that the
rte_bbdev
structure content is more generally modified. Probably best for
the longer run.
David, Maxime, ok with that option?
struct __rte_cache_aligned rte_bbdev {
rte_bbdev_enqueue_enc_ops_t enqueue_enc_ops;
rte_bbdev_enqueue_dec_ops_t enqueue_dec_ops;
rte_bbdev_dequeue_enc_ops_t dequeue_enc_ops;
rte_bbdev_dequeue_dec_ops_t dequeue_dec_ops;
rte_bbdev_enqueue_enc_ops_t enqueue_ldpc_enc_ops;
rte_bbdev_enqueue_dec_ops_t enqueue_ldpc_dec_ops;
rte_bbdev_dequeue_enc_ops_t dequeue_ldpc_enc_ops;
rte_bbdev_dequeue_dec_ops_t dequeue_ldpc_dec_ops;
rte_bbdev_enqueue_fft_ops_t enqueue_fft_ops;
rte_bbdev_dequeue_fft_ops_t dequeue_fft_ops;
const struct rte_bbdev_ops *dev_ops;
struct rte_bbdev_data *data;
enum rte_bbdev_state state;
struct rte_device *device;
struct rte_bbdev_cb_list list_cbs;
struct rte_intr_handle *intr_handle;
};
The best thing, as suggested by David, would be to move all the
ops out of struct rte_bbdev, as these should not be visible to
the
application.
That would be quite disruptive across all PMDs and possible perf
impact to
validate. I don’t think this is anywhere realistic to consider such
a change in 23.11.
I believe moving these function at the end of the structure is a
good
compromise to avoid future breakage of rte_bbdev structure with
almost seamless impact (purely a ABI break when moving into 23.11
which is not avoidable. Retrospectively we should have done that in
22.11
really.
If we are going to break the ABI, better to do the right rework
directly. Otherwise we'll end-up breaking it again next year.
With the suggested change, this will not break ABI next year. Any
future
functions are added at the end of the structure anyway.
I'm not so sure, it depends if adding a new field at the end cross a
cacheline boundary or not:
/*
* Global array of all devices. This is not static because it's used by the
* inline enqueue and dequeue functions
*/
struct rte_bbdev rte_bbdev_devices[RTE_BBDEV_MAX_DEVS];
If the older inlined functions used by the application retrieve the
dev pointer from the array directly (they do) and added new fields in
new version cross a cacheline, then there will be a misalignement
between the new lib version and the application using the older inlined
functions.
ABI-wise, this is not really future proof.
IMHO, moving these ops should be quite trivial and not much work.
Otherwise, if we just placed the rte_bbdev_dequeue_mldts_ops and
rte_bbdev_enqueue_mldts_ops at the bottom of struct rte_bbdev, it
may not break the ABI, but that's a bit fragile:
- rte_bbdev_devices[] is not static, but is placed in the BSS section so
should be OK
- struct rte_bbdev is cache-aligned, so it may work if adding these two
ops do not overlap a cacheline which depends on the CPU
architecture.
If you prefer to add the only 2 new functions at the end of the
structure
that is okay. I believe it would be cleaner to move all these
enqueue/dequeue funs down together without drawback I can think of.
Let me know.
Adding the new ones at the end is not future proof, but at least it
does not break ABI just for cosmetic reasons (that's a big drawback
IMHO).
I just checked using pahole:
struct rte_bbdev {
rte_bbdev_enqueue_enc_ops_t enqueue_enc_ops; /* 0 8 */
rte_bbdev_enqueue_dec_ops_t enqueue_dec_ops; /* 8 8 */
rte_bbdev_dequeue_enc_ops_t dequeue_enc_ops; /* 16 8 */
rte_bbdev_dequeue_dec_ops_t dequeue_dec_ops; /* 24 8 */
rte_bbdev_enqueue_enc_ops_t enqueue_ldpc_enc_ops; /* 32 8
*/
rte_bbdev_enqueue_dec_ops_t enqueue_ldpc_dec_ops; /* 40 8
*/
rte_bbdev_dequeue_enc_ops_t dequeue_ldpc_enc_ops; /* 48 8
*/
rte_bbdev_dequeue_dec_ops_t dequeue_ldpc_dec_ops; /* 56 8
*/
/* --- cacheline 1 boundary (64 bytes) --- */
rte_bbdev_enqueue_fft_ops_t enqueue_fft_ops; /* 64 8 */
rte_bbdev_dequeue_fft_ops_t dequeue_fft_ops; /* 72 8 */
const struct rte_bbdev_ops * dev_ops; /* 80 8 */
struct rte_bbdev_data * data; /* 88 8 */
enum rte_bbdev_state state; /* 96 4 */
/* XXX 4 bytes hole, try to pack */
struct rte_device * device; /* 104 8 */
struct rte_bbdev_cb_list list_cbs; /* 112 16 */
/* --- cacheline 2 boundary (128 bytes) --- */
struct rte_intr_handle * intr_handle; /* 128 8 */
/* size: 192, cachelines: 3, members: 16 */
/* sum members: 132, holes: 1, sum holes: 4 */
/* padding: 56 */
} __attribute__((__aligned__(64)));
We're lucky on x86, we still have 56 bytes, so we can add 7 new ops
at the end before breaking the ABI if I'm not mistaken.
I checked the other architecture, and it seems we don't support any
with 32B cacheline size so we're good for a while.
OK then just adding the new functions at the end, no other cosmetic
changes. Will update the patch to match this.
In term of deprecation notice, you are okay with latest draft?
+* bbdev: Will extend the API to support the new operation type
+``RTE_BBDEV_OP_MLDTS`` as per this `v1
+<https://patches.dpdk.org/project/dpdk/list/?series=28192>`.
+ This will notably introduce new symbols for
+``rte_bbdev_dequeue_mldts_ops``, ``rte_bbdev_enqueue_mldts_ops``
into the stuct rte_bbdev.
This is not needed in the deprecation notice.
If you are willing to announce it, it could be part of the Intel roadmap.
I still see this abi failure as we extend the struct (see below), what is the
harm in calling it out in the deprecation notice?
1 function with some indirect sub-type change:
[C] 'function rte_bbdev* rte_bbdev_allocate(const char*)' at
rte_bbdev.c:174:1 has some indirect sub-type changes:
return type changed:
in pointed to type 'struct rte_bbdev' at rte_bbdev.h:498:1:
type size hasn't changed
2 data member insertions:
'rte_bbdev_enqueue_mldts_ops_t enqueue_mldts_ops', at offset 1088
(in bits) at rte_bbdev.h:527:1
'rte_bbdev_dequeue_mldts_ops_t dequeue_mldts_ops', at offset 1152
(in bits) at rte_bbdev.h:529:1
no data member changes (12 filtered);
Error: ABI issue reported for abidiff --suppr
/home-local/jenkins-local/jenkins-agent/workspace/Generic-DPDK-Compile-ABI@2/dpdk/devtools/libabigail.abignore
--no-added-syms --headers-dir1 reference/usr/local/include --headers-dir2
build_install/usr/local/include reference/usr/local/lib64/librte_bbdev.so.23.0
build_install/usr/local/lib64/librte_bbdev.so.23.2
ABIDIFF_ABI_CHANGE, this change requires a review (abidiff flagged this as a
potential issue).
To be on the safe side, could you try to dynamically link an application with
a DPDK version before this change, then rebuild DPDK with adding these two
fields. Then test with at least 2 devices with test-bbdev and see if it does not
crash or fail?
This is not something we would validate really. But I agree the chance of that
ABI having an actual impact is slim based on the address alignment.
Bbdev is not only about Intel AFAICS.
Still by process, we can use the abi warning above as a litmus the ABI has some
minor change.
Also we introduce this change in the new LTS version, so unsure this is
controversial or impactful.
Let me know if different opinion.
Either we are sure we can waive this warning, e.g. by testing it.
Or we cannot, and in this case we have an ABI break.
If we are going to have an ABI break, let's do the right thing now and
move ops in a dedicated struct as suggested by Stephen, David and
myself.
Maxime
Thanks
Nic
Thanks,
Maxime
Maxime
Maxime
What do you think Maxime, David? Based on this I can adjust the
change for
23.11 and update slightly the deprecation notice accordingly.
Thanks
Nic