Skip to contentSkip to conversation

devtools: update abi ignore for cryptodev

PATCH Applied Ray Kinsella 3 participants 9 messages Jan 20, 2021 – Jan 26, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 devtools: update abi ignore for cryptodev

Update the ignore entry for crytodev to use named fields instead of bit positions.

Fixes 1c3ffb9559
---
 devtools/libabigail.abignore | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
devtools/libabigail.abignore +1 -1
index 1dc84fa74b..1f17fbed58 100644
@@ -15,4 +15,4 @@
 ; Ignore fields inserted in cacheline boundary of rte_cryptodev
 [suppress_type]
         name = rte_cryptodev
-        has_data_member_inserted_between = {0, 1023}
+        has_data_member_inserted_between = {offset_after(attached), end}
\ No newline at end of file
Signature · 1 line
2.26.2
#1 lore raw

Question to an expert, Dodji,

We have this structure:

struct rte_cryptodev {
	lot of fields...
	uint8_t attached : 1;
} __rte_cache_aligned;

Because of the cache alignment, there is enough padding in the struct (no matter the size of the cache line) for adding two more pointers:

struct rte_cryptodev {
	lot of fields...
	uint8_t attached : 1;
	struct rte_cryptodev_cb_rcu *enq_cbs;
	struct rte_cryptodev_cb_rcu *deq_cbs;
} __rte_cache_aligned;

We checked manually that the ABI is still compatible. Then I've added (quickly) a libabigail exception rule:

[suppress_type]

	name = rte_cryptodev
	has_data_member_inserted_between = {0, 1023}

Now we want to improve this rule to restrict the offsets to the padding at the end of the struct only,
so we keep forbidding changes in existing fields, and forbidding additions further the current struct size. Is this new rule good?

	has_data_member_inserted_between = {offset_after(attached), end}

Do you confirm that the keyword "end" means the old reference size?

What else do we need to check for adding a new field in a padding?

Thank you

20/01/2021 15:25, Ray Kinsella:

Quoted 20 lines

Update the ignore entry for crytodev to use named fields instead of bit positions.

Fixes 1c3ffb9559
---
 devtools/libabigail.abignore | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
devtools/libabigail.abignore +1 -1
index 1dc84fa74b..1f17fbed58 100644
@@ -15,4 +15,4 @@
 ; Ignore fields inserted in cacheline boundary of rte_cryptodev
 [suppress_type]
         name = rte_cryptodev
-        has_data_member_inserted_between = {0, 1023}
+        has_data_member_inserted_between = {offset_after(attached), end}
#2 lore raw

Hello Thomas and others,

Quoted 1 line · Thomas Monjalon

Question to an expert, Dodji,

Thanks for the kind words, but I am not an expert in anything, sadly. I am just trying to keep learning about these things ;-)

Quoted 10 lines

We have this structure:

struct rte_cryptodev {
	lot of fields...
	uint8_t attached : 1;
} __rte_cache_aligned;

Because of the cache alignment, there is enough padding in the struct (no matter the size of the cache line) for adding two more pointers:

Quoted 8 lines
struct rte_cryptodev {
	lot of fields...
	uint8_t attached : 1;
	struct rte_cryptodev_cb_rcu *enq_cbs;
	struct rte_cryptodev_cb_rcu *deq_cbs;
} __rte_cache_aligned;

We checked manually that the ABI is still compatible.

Right.

I am curious, but normally, libabigail should raise the addition of structures, but then it'll tell you that there was no size or offset change between the two structures. If it doesn't, then that's a bug. I hope it does :-)

Quoted 6 lines

Then I've added (quickly) a libabigail exception rule:

[suppress_type]

	name = rte_cryptodev
	has_data_member_inserted_between = {0, 1023}
Quoted 7 lines

Now we want to improve this rule to restrict the offsets to the padding at the end of the struct only,
so we keep forbidding changes in existing fields, and forbidding additions further the current struct size. Is this new rule good?

	has_data_member_inserted_between = {offset_after(attached), end}

Yes, this rule should do what you think it says.

Quoted 1 line

Do you confirm that the keyword "end" means the old reference size?

Yes I do.

Quoted 1 line

What else do we need to check for adding a new field in a padding?

Actually, that rule will work independantly of it there is enough padding or not. It'll shut down the change report, even if the added data exceeds the padding.

You just made me think of an idea of a new feature there.

Maybe we'd need a new property for the [suppress_type] directive that would suppress changes only if said changes don't modify the size of the type or any offset of any member of the type?

Maybe something like:

[suppress_type]
; lots of properties can go here.

; ...

; If the type has any size or offset change ; then this suppression directive will fail ; and the change report will be emitted has_no_size_or_offset_change

Would that be useful to you in this case,

Cheers,

Signature · 1 line
		Dodji
#3 lore raw

21/01/2021 16:15, Dodji Seketeli:

Quoted 26 lines

Hello Thomas and others,

Quoted 1 line · Thomas Monjalon

Question to an expert, Dodji,

Thanks for the kind words, but I am not an expert in anything, sadly. I am just trying to keep learning about these things ;-)

Quoted 17 lines

We have this structure:

struct rte_cryptodev {
	lot of fields...
	uint8_t attached : 1;
} __rte_cache_aligned;

Because of the cache alignment, there is enough padding in the struct (no matter the size of the cache line) for adding two more pointers:

struct rte_cryptodev {
	lot of fields...
	uint8_t attached : 1;
	struct rte_cryptodev_cb_rcu *enq_cbs;
	struct rte_cryptodev_cb_rcu *deq_cbs;
} __rte_cache_aligned;
Quoted 8 lines
Quoted 1 line

We checked manually that the ABI is still compatible.

Right.

I am curious, but normally, libabigail should raise the addition of structures, but then it'll tell you that there was no size or offset change between the two structures. If it doesn't, then that's a bug. I hope it does :-)

Yes it was raising a problem, that's why we are adding a rule.

Quoted 19 lines
Quoted 6 lines

Then I've added (quickly) a libabigail exception rule:

[suppress_type]

	name = rte_cryptodev
	has_data_member_inserted_between = {0, 1023}
Quoted 7 lines

Now we want to improve this rule to restrict the offsets to the padding at the end of the struct only,
so we keep forbidding changes in existing fields, and forbidding additions further the current struct size. Is this new rule good?

	has_data_member_inserted_between = {offset_after(attached), end}

Yes, this rule should do what you think it says.

Quoted 1 line

Do you confirm that the keyword "end" means the old reference size?

Quoted 8 lines

Yes I do.

Quoted 1 line

What else do we need to check for adding a new field in a padding?

Actually, that rule will work independantly of it there is enough padding or not. It'll shut down the change report, even if the added data exceeds the padding.

I don't understand why.
If "end" means the old reference size, then addition after the old size should be reported, isn't it?

Quoted 21 lines

You just made me think of an idea of a new feature there.

Maybe we'd need a new property for the [suppress_type] directive that would suppress changes only if said changes don't modify the size of the type or any offset of any member of the type?

Maybe something like:

[suppress_type]
; lots of properties can go here.

; ...

; If the type has any size or offset change ; then this suppression directive will fail ; and the change report will be emitted has_no_size_or_offset_change

Would that be useful to you in this case,

Cheers,

#4 lore raw
Quoted 63 lines · Thomas Monjalon

21/01/2021 16:15, Dodji Seketeli:

Quoted 26 lines

Hello Thomas and others,

Quoted 1 line · Thomas Monjalon

Question to an expert, Dodji,

Thanks for the kind words, but I am not an expert in anything, sadly. I am just trying to keep learning about these things ;-)

Quoted 17 lines

We have this structure:

struct rte_cryptodev {
	lot of fields...
	uint8_t attached : 1;
} __rte_cache_aligned;

Because of the cache alignment, there is enough padding in the struct (no matter the size of the cache line) for adding two more pointers:

struct rte_cryptodev {
	lot of fields...
	uint8_t attached : 1;
	struct rte_cryptodev_cb_rcu *enq_cbs;
	struct rte_cryptodev_cb_rcu *deq_cbs;
} __rte_cache_aligned;
Quoted 8 lines
Quoted 1 line

We checked manually that the ABI is still compatible.

Right.

I am curious, but normally, libabigail should raise the addition of structures, but then it'll tell you that there was no size or offset change between the two structures. If it doesn't, then that's a bug. I hope it does :-)

Yes it was raising a problem, that's why we are adding a rule.

Quoted 24 lines
Quoted 6 lines

Then I've added (quickly) a libabigail exception rule:

[suppress_type]

	name = rte_cryptodev
	has_data_member_inserted_between = {0, 1023}
Quoted 7 lines

Now we want to improve this rule to restrict the offsets to the padding at the end of the struct only,
so we keep forbidding changes in existing fields, and forbidding additions further the current struct size. Is this new rule good?

	has_data_member_inserted_between = {offset_after(attached), end}

Yes, this rule should do what you think it says.

Quoted 1 line

Do you confirm that the keyword "end" means the old reference size?

Yes I do.

Quoted 1 line

What else do we need to check for adding a new field in a padding?

Quoted 7 lines
Quoted 3 lines

Actually, that rule will work independantly of it there is enough padding or not. It'll shut down the change report, even if the added data exceeds the padding.

I don't understand why.
If "end" means the old reference size, then addition after the old size should be reported, isn't it?

yes - this comment confuses me also.

If "end" refers to the size original data-structure (position of the end), which in this case had some padding. If the additions fall fully within the padding I would expect this rule to work - as long as the data-structure size is still the same.

However if the additions fall beyond the size of the original data-structure, the data-structure's size will have changed, I would not expect this rule to condone a change in the size of the data-structure.

Quoted 26 lines
Quoted 23 lines

You just made me think of an idea of a new feature there.

Maybe we'd need a new property for the [suppress_type] directive that would suppress changes only if said changes don't modify the size of the type or any offset of any member of the type?

Maybe something like:

[suppress_type]
; lots of properties can go here.

; ...

; If the type has any size or offset change ; then this suppression directive will fail ; and the change report will be emitted has_no_size_or_offset_change

Would that be useful to you in this case,

Cheers,

#5 lore raw
In reply to Thomas Monjalon

Thomas Monjalon <[email protected]> writes:

[...]

Quoted 24 lines
Quoted 24 lines
Quoted 6 lines

Then I've added (quickly) a libabigail exception rule:

[suppress_type]

	name = rte_cryptodev
	has_data_member_inserted_between = {0, 1023}
Quoted 7 lines

Now we want to improve this rule to restrict the offsets to the padding at the end of the struct only,
so we keep forbidding changes in existing fields, and forbidding additions further the current struct size. Is this new rule good?

	has_data_member_inserted_between = {offset_after(attached), end}

Yes, this rule should do what you think it says.

Quoted 1 line

Do you confirm that the keyword "end" means the old reference size?

Yes I do.

Quoted 1 line

What else do we need to check for adding a new field in a padding?

Quoted 7 lines
Quoted 3 lines

Actually, that rule will work independantly of it there is enough padding or not. It'll shut down the change report, even if the added data exceeds the padding.

I don't understand why.
If "end" means the old reference size, then addition after the old size should be reported, isn't it?

Yes, you are right.

What I meant is that even if (in an hypothetical case, not yours) the padding was so "small" that it wasn't going up to the 'end' of the struct, that rule would have still shut down the change report.

[...]

Cheers,

Signature · 1 line
		Dodji
#6 lore raw
Quoted 36 lines · Dodji Seketeli

Thomas Monjalon <[email protected]> writes:

[...]

Quoted 24 lines
Quoted 24 lines
Quoted 6 lines

Then I've added (quickly) a libabigail exception rule:

[suppress_type]

	name = rte_cryptodev
	has_data_member_inserted_between = {0, 1023}
Quoted 7 lines

Now we want to improve this rule to restrict the offsets to the padding at the end of the struct only,
so we keep forbidding changes in existing fields, and forbidding additions further the current struct size. Is this new rule good?

	has_data_member_inserted_between = {offset_after(attached), end}

Yes, this rule should do what you think it says.

Quoted 1 line

Do you confirm that the keyword "end" means the old reference size?

Yes I do.

Quoted 1 line

What else do we need to check for adding a new field in a padding?

Quoted 7 lines
Quoted 3 lines

Actually, that rule will work independantly of it there is enough padding or not. It'll shut down the change report, even if the added data exceeds the padding.

I don't understand why.
If "end" means the old reference size, then addition after the old size should be reported, isn't it?

Quoted 5 lines

Yes, you are right.

What I meant is that even if (in an hypothetical case, not yours) the padding was so "small" that it wasn't going up to the 'end' of the struct, that rule would have still shut down the change report.

Understood - you are talking about padding between members.

Quoted 5 lines

[...]

Cheers,

#7 lore raw
Quoted 37 lines · Ray
Quoted 36 lines · Dodji Seketeli

Thomas Monjalon <[email protected]> writes:

[...]

Quoted 31 lines
Quoted 19 lines
Quoted 6 lines

Then I've added (quickly) a libabigail exception rule:

[suppress_type]

	name = rte_cryptodev
	has_data_member_inserted_between = {0, 1023}
Quoted 7 lines

Now we want to improve this rule to restrict the offsets to the padding at the end of the struct only,
so we keep forbidding changes in existing fields, and forbidding additions further the current struct size. Is this new rule good?

	has_data_member_inserted_between = {offset_after(attached), end}

Yes, this rule should do what you think it says.

Quoted 1 line

Do you confirm that the keyword "end" means the old reference size?

Quoted 8 lines

Yes I do.

Quoted 1 line

What else do we need to check for adding a new field in a padding?

Actually, that rule will work independantly of it there is enough padding or not. It'll shut down the change report, even if the added data exceeds the padding.

I don't understand why.
If "end" means the old reference size, then addition after the old size should be reported, isn't it?

Quoted 7 lines
Quoted 5 lines

Yes, you are right.

What I meant is that even if (in an hypothetical case, not yours) the padding was so "small" that it wasn't going up to the 'end' of the struct, that rule would have still shut down the change report.

Understood - you are talking about padding between members.

Exactly.

Cheers,

Signature · 1 line
		Dodji
Acked-by on v1 1/1 Applied
#8 lore raw
In reply to Ray Kinsella

20/01/2021 15:25, Ray Kinsella:

Quoted 10 lines

Update the ignore entry for crytodev to use named fields instead of bit positions.

Fixes 1c3ffb9559

---

devtools/libabigail.abignore line 18

Quoted 5 lines
devtools/libabigail.abignore +1 -1
@@ -15,4 +15,4 @@
 ; Ignore fields inserted in cacheline boundary of rte_cryptodev
 [suppress_type]
         name = rte_cryptodev
-        has_data_member_inserted_between = {0, 1023}
+        has_data_member_inserted_between = {offset_after(attached), end}

Adding a bit more explanations in the commit message:

It is allowing changes between the last field (attached) in ABI 21.0, and the end of the padded struct in ABI 21.

Fixes 1c3ffb95595e ("cryptodev: add enqueue and dequeue callbacks")

Applied, thanks.