Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F151278119
D22154.id63669.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D22154.id63669.diff
View Options
Index: sys/net/if.c
===================================================================
--- sys/net/if.c
+++ sys/net/if.c
@@ -271,6 +271,7 @@
static void if_delgroups(struct ifnet *);
static void if_attach_internal(struct ifnet *, int, struct if_clone *);
static int if_detach_internal(struct ifnet *, int, struct if_clone **);
+static void if_siocaddmulti(void *, int);
#ifdef VIMAGE
static void if_vmove(struct ifnet *, struct vnet *);
#endif
@@ -556,6 +557,7 @@
IF_ADDR_LOCK_INIT(ifp);
TASK_INIT(&ifp->if_linktask, 0, do_link_state_change, ifp);
+ TASK_INIT(&ifp->if_addmultitask, 0, if_siocaddmulti, ifp);
ifp->if_afdata_initialized = 0;
IF_AFDATA_LOCK_INIT(ifp);
CK_STAILQ_INIT(&ifp->if_addrhead);
@@ -3538,7 +3540,12 @@
* interface to let them know about it.
*/
if (ifp->if_ioctl != NULL) {
- (void) (*ifp->if_ioctl)(ifp, SIOCADDMULTI, 0);
+ if (THREAD_CAN_SLEEP() && curthread->td_epochnest == 0)
+ (void )(*ifp->if_ioctl)(ifp, SIOCADDMULTI, 0);
+ else {
+ if_ref(ifp);
+ taskqueue_enqueue(taskqueue_swi, &ifp->if_addmultitask);
+ }
}
if ((llsa != NULL) && (llsa != (struct sockaddr *)&sdl))
@@ -3553,6 +3560,20 @@
unlock_out:
IF_ADDR_WUNLOCK(ifp);
return (error);
+}
+
+static void
+if_siocaddmulti(void *arg, int pending)
+{
+ struct ifnet *ifp;
+
+ ifp = arg;
+#ifdef DIAGNOSTIC
+ if (pending > 1)
+ if_printf(ifp, "%d SIOCADDMULTI coalesced\n", pending);
+#endif
+ (void )(*ifp->if_ioctl)(ifp, SIOCADDMULTI, 0);
+ if_rele(ifp);
}
/*
Index: sys/net/if_var.h
===================================================================
--- sys/net/if_var.h
+++ sys/net/if_var.h
@@ -317,6 +317,7 @@
struct ifaltq if_snd; /* output queue (includes altq) */
struct task if_linktask; /* task for link change events */
+ struct task if_addmultitask; /* task for SIOCADDMULTI */
/* Addresses of different protocol families assigned to this if. */
struct mtx if_addr_lock; /* lock to protect address lists */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Apr 8, 7:04 AM (1 h, 19 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31084335
Default Alt Text
D22154.id63669.diff (1 KB)
Attached To
Mode
D22154: Delayed context for SIOCADDMULTI
Attached
Detach File
Event Timeline
Log In to Comment