Page MenuHomeFreeBSD

separate out list manipulation locking from state change in multicast
ClosedPublic

Authored by kmacy on Apr 5 2018, 6:46 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Apr 10, 11:24 AM
Unknown Object (File)
Feb 22 2024, 6:33 AM
Unknown Object (File)
Feb 22 2024, 6:33 AM
Unknown Object (File)
Feb 22 2024, 6:29 AM
Unknown Object (File)
Feb 20 2024, 1:40 AM
Unknown Object (File)
Feb 17 2024, 10:25 AM
Unknown Object (File)
Dec 20 2023, 4:54 AM
Unknown Object (File)
Dec 15 2023, 6:20 AM

Details

Summary

multicast incorrectly calls in to drivers with a mutex held causing drivers to have to go through all manner of contortions to use a non sleepable lock

Test Plan

tested by sbruno and pho

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

add v6 support and witness update

sbruno requested changes to this revision.Apr 9 2018, 2:56 PM
sbruno added inline comments.
sys/netinet6/in6_var.h
105 ↗(On Diff #41284)

Since this is being included from user land (ifconfig or something else), we'll need a #ifdef _KERNEL here to keep the MALLOC_DECLARE() from being looked up:

diff --git a/sys/netinet6/in6_var.h b/sys/netinet6/in6_var.h
index 8507487a100..b95604af417 100644
--- a/sys/netinet6/in6_var.h
+++ b/sys/netinet6/in6_var.h
@@ -101,8 +101,11 @@ struct scope6_id;
 struct lltable;
 struct mld_ifsoftc;
 struct in6_multi;
+
+#ifdef _KERNEL
 SLIST_HEAD(in6_multi_head, in6_multi);
 MALLOC_DECLARE(M_IP6MADDR);
+#endif
 
 struct in6_ifextra {
        counter_u64_t *in6_ifstat;
This revision now requires changes to proceed.Apr 9 2018, 2:56 PM

Fix various panics under v6 as well as world build issue

kmacy added a reviewer: np.
This revision is now accepted and ready to land.May 1 2018, 9:45 PM
shurd requested changes to this revision.May 2 2018, 5:57 AM

Some universe build failures...

_.amd64.LINT-NOINET---- kernel ---
_.amd64.LINT-NOINET-linking kernel
_.amd64.LINT-NOINET:ld: error: undefined symbol: in_multi_list_mtx
_.amd64.LINT-NOINET->>> referenced by if.c
_.amd64.LINT-NOINET->>> if.o:(if_addmulti)

_.amd64.LINT-NOINET6---- kernel ---
_.amd64.LINT-NOINET6-linking kernel
_.amd64.LINT-NOINET6:ld: error: undefined symbol: in6_multi_list_mtx
_.amd64.LINT-NOINET6->>> referenced by if.c
_.amd64.LINT-NOINET6->>> if.o:(if_addmulti)
_.amd64.LINT-NOINET6-*** [kernel] Error code 1

_.amd64.LINT-NOIP---- if.o ---
_.amd64.LINT-NOIP:/usr/home/admin/src/freebsd-base/sys/net/if.c:3434:2: error: implicit declaration of function 'IN_MULTI_LIST_UNLOCK_ASSERT' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
_.amd64.LINT-NOIP- IN_MULTI_LIST_UNLOCK_ASSERT();
_.amd64.LINT-NOIP- ^

This revision now requires changes to proceed.May 2 2018, 5:57 AM

Arm ports fail as well:


--- kernel.full ---
linking kernel.full
in_mcast.o: In function `inm_init':
/usr/home/admin/src/freebsd-base/sys/netinet/in_mcast.c:236: undefined reference to `iflib_config_gtask_init'
in6_mcast.o: In function `in6m_init':
/usr/home/admin/src/freebsd-base/sys/netinet6/in6_mcast.c:557: undefined reference to `iflib_config_gtask_init'
*** [kernel.full] Error code 1

SPARC and PowerPC get this:

--- in_mcast.o ---
cc1: warnings being treated as errors
/usr/home/admin/src/freebsd-base/sys/netinet/in_mcast.c:234: warning: function declaration isn't a prototype [-Wstrict-prototypes]

SPARC and PowerPC get this:

--- in_mcast.o ---
cc1: warnings being treated as errors
/usr/home/admin/src/freebsd-base/sys/netinet/in_mcast.c:234: warning: function declaration isn't a prototype [-Wstrict-prototypes]

ah, yes ... gcc 4.2.1 ... how I loathe thee.

This revision was not accepted when it landed; it landed in state Needs Revision.May 2 2018, 7:36 PM
This revision was automatically updated to reflect the committed changes.

Changes committed did not make it into this review due to issues updating Phabricator from a git source. See rS333175 for final version.