-
Notifications
You must be signed in to change notification settings - Fork 1.1k
FreeBSD: Support kernel-offloaded TLS TCP #4482
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
b60cffa
to
7e42c78
Compare
For nightly freebsd-15 ci task to success, you would need to update the ci freebsd env with the new headers. I have no idea why freebsd-13 is failing. |
@asomers would you mind reviewing this since it's FreeBSD?
If there is a version bump available, feel freeto submit a PR updating it. I'm not sure about freebsd-13 either, ctest seems extremely flaky on that target. |
Is there an existing example of the PR with such update? |
You just want to update a minor freebsd version? I don't know one off the top of my head but it shouldn't be too hard, the FreeBSD CI config is in https://github.com/rust-lang/libc/blob/9c8cd59b2367ce9cd5acd6247c3764cdf670a9f8/.cirrus.yml |
Our CI config uses the latest FreeBSD 15 snapshot on GCE. So we don't need to do anything. If we just wait, GCE will have the latest release soon enough. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool project, kib! I look forward to trying it.
pub _xig_spare32: u32, | ||
pub xig_gen: inp_gen_t, | ||
pub xig_sogen: so_gen_t, | ||
pub _xig_spare64: [u64; 4], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The convention used elsewhere in libc is to make spare and padding fields private. The forces consumers to initialize with mem::zeroed
, but it also makes it easier for future versions of libc to replace those spare fields with no backwards-compatibility problems.
pub _xig_spare32: u32, | |
pub xig_gen: inp_gen_t, | |
pub xig_sogen: so_gen_t, | |
pub _xig_spare64: [u64; 4], | |
_xig_spare32: u32, | |
pub xig_gen: inp_gen_t, | |
pub xig_sogen: so_gen_t, | |
_xig_spare64: [u64; 4], |
} | ||
|
||
pub struct in_addr_4in6 { | ||
pub ia46_pad32: [u32; 3], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pub ia46_pad32: [u32; 3], | |
ia46_pad32: [u32; 3], |
pub inp_gencnt: u64, | ||
pub so_pcb: kvaddr_t, | ||
pub coninf: crate::in_conninfo, | ||
pub rx_vlan_id: c_short, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pub rx_vlan_id: c_short, | |
pub rx_vlan_id: c_ushort, |
Could you please push this? |
I rebased this to pick up a new set of CI runs since one thing was fixed. The FreeBSD-15 and FreeBSD-13 x86-64 jobs are spurious, but the FreeBSD-13 i686 "bad xinpgen align: rust: 4 (0x4) != c 8 (0x8)" message looks legit. Is one of these fields actually a different size on 32-bit? |
@@ -1722,6 +1725,72 @@ s_no_extra_traits! { | |||
pub uc_flags: c_int, | |||
__spare__: [c_int; 4], | |||
} | |||
|
|||
pub struct xinpgen { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this will fix the latest test failure on i386.
pub struct xinpgen { | |
#[repr(align(8)] | |
pub struct xinpgen { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, can I still update the branch, or should the change be a fixup?
Hm, no. The reason for the message is the attribute of the C structure, declaring 8-bytes alignment. Would it be enough to add |
You don't need to include |
So I added a commit with the align. If you want me to squash, please say so. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! No need to squash everything to one but if you combine the align fix with whatever added the struct, that would make a bit more clean cherry pick.
Squashed just the fix. |
Thanks! |
Description
The PR adds definitions for kernel-offloaded TLS TCP session information sysctls. It is used by the utility to list kTLS connections https://github.com/kostikbel/ktcplist
Sources
https://github.com/freebsd/freebsd-src/blob/4078e0d1d6f8189bff44fcad04df256220035f76/sys/sys/ktls.h
freebsd/freebsd-src@c9e9a0f
@rustbot label +stable-nominated