Page MenuHomeFreeBSD

ibcore: Add dependency on "netstack"
Needs ReviewPublic

Authored by khng on Nov 3 2023, 2:03 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Apr 27, 7:07 PM
Unknown Object (File)
Dec 27 2023, 3:38 AM
Unknown Object (File)
Dec 23 2023, 7:29 AM
Unknown Object (File)
Dec 15 2023, 8:02 AM
Subscribers

Details

Reviewers
jhibbits
Summary

Obtained from: Juniper Networks, Inc.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 54269
Build 51159: arc lint + arc unit

Event Timeline

khng requested review of this revision.Nov 3 2023, 2:03 PM

There's no "netstack" module in the FreeBSD kernel. I think a DECLARE_MODULE needs added, probably to sys/net/if.c, before this works.

There's no "netstack" module in the FreeBSD kernel. I think a DECLARE_MODULE needs added, probably to sys/net/if.c, before this works.

The "netstack" is built into kernel. Maybe the following one?

MODULE_DEPEND(ibcore, kernel, __FreeBSD_version, __FreeBSD_version, maxver);

See also sys/sys/module.h https://cgit.freebsd.org/src/tree/sys/sys/module.h#n140

#define	DECLARE_MODULE_WITH_MAXVER(name, data, sub, order, maxver)	\
	MODULE_DEPEND(name, kernel, __FreeBSD_version,			\
	    __FreeBSD_version, maxver);					\
	MODULE_METADATA(_md_##name, MDT_MODULE, &data, __XSTRING(name));\
	SYSINIT(name##module, sub, order, module_register_init, &data);	\
	struct __hack

#ifdef KLD_TIED
#define	DECLARE_MODULE(name, data, sub, order)				\
	DECLARE_MODULE_WITH_MAXVER(name, data, sub, order, __FreeBSD_version)
#else
#define	DECLARE_MODULE(name, data, sub, order)							\
	DECLARE_MODULE_WITH_MAXVER(name, data, sub, order, MODULE_KERNEL_MAXVER)
#endif
sys/ofed/drivers/infiniband/core/ib_device.c
1086

Any problems without a module dependency to "netstack" ?

In D42453#970257, @zlei wrote:

There's no "netstack" module in the FreeBSD kernel. I think a DECLARE_MODULE needs added, probably to sys/net/if.c, before this works.

The "netstack" is built into kernel. Maybe the following one?

MODULE_DEPEND(ibcore, kernel, __FreeBSD_version, __FreeBSD_version, maxver);

There's already an implicit MODULE_DEPEND() on kernel for all modules.

sys/ofed/drivers/infiniband/core/ib_device.c
1086

No problems in FreeBSD. This is to support alternative (loadable) netstacks, as we use at Juniper.