I recently updated our kernel configuration to include SCTP support for our Jetson AGX Xavier based board. I installed libsctp-dev
and cloned the lksctp-tools repo (GitHub - sctp/lksctp-tools: The Linux SCTP helper library) to the target and built that. The very first test failed when I tried to run make v4tests
. The failure indicated there is an invalid argument problem.
After a bit of digging, I discovered that the /usr/include/linux/sctp.h header, which is provided by the sample rootfs that NVIDIA supplies on the developer site, was referenced during compilation. It turns out that this is incompatible with the version that the kernel is built with. There are 3 additional parameters in the struct sctp_event_subscribe
above what the kernel is expecting, hence the error.
I looked at the sample rootfs we use (JAX-TX2-Tegra_Linux_Sample-Root-Filesystem_R32.1.0_aarch64.tbz2) and the latest and greatest (Tegra_Linux_Sample-Root-Filesystem_R32.4.3_aarch64.tbz2) and they both include additional parameters.
Here’s the struct as defined in the kernel-4.9 include/uapi/linux/sctp.h file:
/*
* Described in Section 7.3
* Ancillary Data and Notification Interest Options
*/
struct sctp_event_subscribe {
__u8 sctp_data_io_event;
__u8 sctp_association_event;
__u8 sctp_address_event;
__u8 sctp_send_failure_event;
__u8 sctp_peer_error_event;
__u8 sctp_shutdown_event;
__u8 sctp_partial_delivery_event;
__u8 sctp_adaptation_layer_event;
__u8 sctp_authentication_event;
__u8 sctp_sender_dry_event;
};
Here’s the struct as defined in the /usr/include/linux/sctp.h from the sample rootfs:
/*
* Described in Section 7.3
* Ancillary Data and Notification Interest Options
*/
struct sctp_event_subscribe {
__u8 sctp_data_io_event;
__u8 sctp_association_event;
__u8 sctp_address_event;
__u8 sctp_send_failure_event;
__u8 sctp_peer_error_event;
__u8 sctp_shutdown_event;
__u8 sctp_partial_delivery_event;
__u8 sctp_adaptation_layer_event;
__u8 sctp_authentication_event;
__u8 sctp_sender_dry_event;
__u8 sctp_stream_reset_event;
__u8 sctp_assoc_reset_event;
__u8 sctp_stream_change_event;
};
Notice that there are 3 extra events in the latter. This difference induces run-time errors when trying to use setsockopt
for SCTP_EVENTS.
I believe NVIDIA should update the sample rootfs to include a version that is compatible with the kernel build.