Received: by mail.netbsd.org (Postfix, from userid 605) id 6422784FEF; Thu, 3 Mar 2022 05:53:26 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 9398684F97 for ; Thu, 3 Mar 2022 05:53:25 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([IPv6:::1]) by localhost (mail.netbsd.org [IPv6:::1]) (amavisd-new, port 10025) with ESMTP id pnCtH-2N_2Db for ; Thu, 3 Mar 2022 05:53:25 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.netbsd.org [199.233.217.197]) by mail.netbsd.org (Postfix) with ESMTP id 1F00985020 for ; Thu, 3 Mar 2022 05:53:24 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id 1B89BFB24; Thu, 3 Mar 2022 05:53:24 +0000 (UTC) Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" MIME-Version: 1.0 Date: Thu, 3 Mar 2022 05:53:24 +0000 From: "Taylor R Campbell" Subject: CVS commit: src/sys/dev/usb To: source-changes@NetBSD.org X-Mailer: log_accum Message-Id: <20220303055324.1B89BFB24@cvs.NetBSD.org> Sender: source-changes-owner@NetBSD.org List-Id: Precedence: bulk Reply-To: source-changes-d@NetBSD.org Mail-Reply-To: "Taylor R Campbell" Mail-Followup-To: source-changes-d@NetBSD.org List-Unsubscribe: Module Name: src Committed By: riastradh Date: Thu Mar 3 05:53:23 UTC 2022 Modified Files: src/sys/dev/usb: if_aue.c if_axe.c if_axen.c if_smsc.c if_udav.c if_ure.c if_url.c usbnet.c Log Message: usbnet: Apply hardware multicast filter updates synchronously again. To make this work: 1. Do it only under a new lock, unp_mcastlock. This lock lives at IPL_SOFTCLOCK so it can be taken from network stack callouts. It is forbidden to acquire the usbnet core lock under unp_mcastlock. 2. Do it only after usbnet_init_rx_tx and before usbnet_stop; if issued at any other time, drop the update on the floor. 3. Make usbnet_init_rx_tx apply any pending multicast filter updates under the lock before setting the flag that allows SIOCADDMULTI or SIOCDELMULTI to apply the updates. 4. Remove core lock asserts from various drivers' register access routines. This is necessary because the multicast filter updates are done with register reads/writes, but _cannot_ take the core lock when the caller holds softnet_lock. This now programs the hardware multicast filter redundantly in many drivers which already explicitly call *_uno_mcast from the *_uno_init routines. This is probably harmless, but it will likely be better to remove the explicit calls. To generate a diff of this commit: cvs rdiff -u -r1.180 -r1.181 src/sys/dev/usb/if_aue.c cvs rdiff -u -r1.141 -r1.142 src/sys/dev/usb/if_axe.c cvs rdiff -u -r1.83 -r1.84 src/sys/dev/usb/if_axen.c cvs rdiff -u -r1.82 -r1.83 src/sys/dev/usb/if_smsc.c cvs rdiff -u -r1.87 -r1.88 src/sys/dev/usb/if_udav.c src/sys/dev/usb/if_url.c cvs rdiff -u -r1.48 -r1.49 src/sys/dev/usb/if_ure.c cvs rdiff -u -r1.81 -r1.82 src/sys/dev/usb/usbnet.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.