diff options
| author | Jakub Kicinski <[email protected]> | 2022-07-08 01:03:09 +0000 |
|---|---|---|
| committer | Jakub Kicinski <[email protected]> | 2022-07-09 01:38:44 +0000 |
| commit | 2d91ecace6614cf6254001566292b808d7f70a91 (patch) | |
| tree | 102051f148bc0998d65f0e2f15c3756eb3bf67ae /net/strparser/strparser.c | |
| parent | net: ag71xx: switch to napi_build_skb() to reuse skbuff_heads (diff) | |
| download | kernel-2d91ecace6614cf6254001566292b808d7f70a91.tar.gz kernel-2d91ecace6614cf6254001566292b808d7f70a91.zip | |
strparser: pad sk_skb_cb to avoid straddling cachelines
sk_skb_cb lives within skb->cb[]. skb->cb[] straddles
2 cache lines, each containing 24B of data.
The first cache line does not contain much interesting
information for users of strparser, so pad things a little.
Previously strp_msg->full_len would live in the first cache
line and strp_msg->offset in the second.
We need to reorder the 8 byte temp_reg with struct tls_msg
to prevent a 4B hole which would push the struct over 48B.
Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'net/strparser/strparser.c')
| -rw-r--r-- | net/strparser/strparser.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/strparser/strparser.c b/net/strparser/strparser.c index 1a72c67afed5..8299ceb3e373 100644 --- a/net/strparser/strparser.c +++ b/net/strparser/strparser.c @@ -533,6 +533,9 @@ EXPORT_SYMBOL_GPL(strp_check_rcv); static int __init strp_dev_init(void) { + BUILD_BUG_ON(sizeof(struct sk_skb_cb) > + sizeof_field(struct sk_buff, cb)); + strp_wq = create_singlethread_workqueue("kstrp"); if (unlikely(!strp_wq)) return -ENOMEM; |
