From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 30E662E7199 for ; Tue, 17 Feb 2026 08:56:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771318572; cv=none; b=K3m4JXxXLUQPBy5sMkBVGaMhSgLSgTKOFiCueu2UAv7CL/KqTIfjxgltzoFxRqmvRSJrwWRJRoy+KcHRYj7IXR5p2s2DfB6K4ZCRlHKGNX1ZGuSXRBtShud6pLPA8hT9/13kgswSmLsQ6OacHkaTOIx97ohbCRpu89vwmdpezoY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771318572; c=relaxed/simple; bh=Xl8vU02FQuUG6TRf0v5tTiVaO/OQQXOZXKiqrnEce/U=; h=Message-ID:Date:MIME-Version:Subject:From:To:Cc:References: In-Reply-To:Content-Type; b=tqdfbFVO9KMIZ+3N7ocN93NBnRNa46+Sh/G2O0bR/8JdFJjc05XmJGr4bQS/yOKw+G0fFxNjWLWaCZ1K3dSF1d2LV+zgYsD52PitE2x6y8ZUxyngnBtEiyYqlf1ERvSaB1JuUP+ftFGutZQzAIpAylHwezibjabv/ulY/6//Y5Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=BUkVfFwj; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=eW/Tjl+M; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="BUkVfFwj"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="eW/Tjl+M" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1771318570; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TeqDASRJlcgXUCGyq3VQ0ULXt0d2kVFCeY+6VKAR6oU=; b=BUkVfFwjKiTqEeLJkkM49ffQ1uE7k9ww0ozz14wMWOFVNr7nTsRSkK1L5wk2tHVneR6HqJ aMTZUFk1NVeryUlPDov5B0kJhP+L56HOMtqeScrBxBWQd0DG7dQr+WFrLyq+G61jI6N7tw IiWinITatMqG1Fa/L3CbK/xFuK1swbU= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-190-b8tH5bF-Psq00cH778SIFw-1; Tue, 17 Feb 2026 03:56:08 -0500 X-MC-Unique: b8tH5bF-Psq00cH778SIFw-1 X-Mimecast-MFC-AGG-ID: b8tH5bF-Psq00cH778SIFw_1771318568 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-482d8e6e13aso27430935e9.3 for ; Tue, 17 Feb 2026 00:56:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1771318567; x=1771923367; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:from:subject:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=TeqDASRJlcgXUCGyq3VQ0ULXt0d2kVFCeY+6VKAR6oU=; b=eW/Tjl+MX2BWYUk4dal03d9HmCltvZo5jetOxi8jhSEwULevPEimiugdhy1/ZaqPsM 06B/jj7cLgcNuZ5W6W0c4tJ4wBOayA71JRrLVHNTXOr9S7fCMQQ2RR3DAXJrNSTtDy3f k5zeaRzdMHtaOb5dnSmzSv4kShC32fPkpSTnahm8vk4Mezp5BnzvPXBKq+wehm7gfhC3 LxbBNWaLbK3RTyS0IIxs0worffrxTYLdBetvdypz0hJlvqp9NqFgX22suULAMJqo14zg pqyWFAA1o3bIvUavoxRRpT79sjhNIkL8GdWAXBEJnLe0ycx9tKBHP+ZmXR9mmoaUDCba 0cEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771318567; x=1771923367; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:from:subject:user-agent:mime-version:date:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=TeqDASRJlcgXUCGyq3VQ0ULXt0d2kVFCeY+6VKAR6oU=; b=hje8MfPL16I83FPbMsccNX/SdEhPZnE+EOo6axU+P5FfY7uTrzqusOx13K4QslbOy3 q4FMJ5iPEVTHNI3UaLO7PmLashRAflFDctfh9iKEc2ZSHPtZSNSuw7G5UdpTOSfegs9d 5q+oiv17o/8PZJot/0Z1iBkBrVaP22o4vUdcL4GVqiundjVZ6mhgzobX7bN+TcdMr46Y TRtZXEWrxR8+DWVo9ZqkZ9q4WDZMw1rS6wP9IkfCjzBt42HOUpDItsYz7inQQqE7rNQH yRbYOBQiQpUweNwVlJ4X0NKszcfWsqZaZ0mnPkWNYecKNv0iCPIJ7rGKjHdXy+Mcbf6d OpaA== X-Forwarded-Encrypted: i=1; AJvYcCVpy51BTaNlGNam9/z3TGOruUN6N59bS18vjdNUlqO5evT2rjM9d2pVjRhpMSpQvTK4fX8rcnRJWe80rrg=@vger.kernel.org X-Gm-Message-State: AOJu0Yw1zNwrxj6tLrpz5yj02TVj+tzZYt6+BLguaBTfg9Gc59N6aooa KojePSle+OSZfB3BlVUlDTGNkQ3Fn2wuzqMxwcTTKJIuSzREjDzUsW5P9JXYYD43bFjOJvm0JCI hfRcvL7ML5HXVEFx/J1Itbs8sY+h1MW3I25h3pHno08sDA5ZrHUx6YZxcrndz898haQ== X-Gm-Gg: AZuq6aJroyw4aE0WX7rAQ3je+leqkOvoSm1R92HdnhZIPcK7uSZmHsUZpyiyrRXdECo oX6Ftv/ZQuwbib4dUVd0BJP1sZymNWjzetp12ErmycImc9Jbc5Zdgu9+SeIU3wRl2RKPK98Kw2o htNDXBen4GvX3+HhZHUpwBIQuzdOAsI7xyhC4KLNicEFR2f/epGnZx/eF/VSy3ReptKxNKenCUM oEVlSuqd1sCFkGjMQ4DgdEa7sVSlneiKgRnOvid+OW7yUbHYO1OG7sxaIk8TbCNhFBvbHn0xSW9 y6d4wR1JlcPfRRxIhRKwCqRJ3CbovzcSfTvlTC/svoXlUL+peMF5kntBQ7Inf5Yp+muryVIl4tj o9ZcCGZ0exUZSzCSmdjTe+VFE1g== X-Received: by 2002:a05:600c:3b93:b0:480:1e9e:f9c with SMTP id 5b1f17b1804b1-48373a02c73mr260469445e9.10.1771318567394; Tue, 17 Feb 2026 00:56:07 -0800 (PST) X-Received: by 2002:a05:600c:3b93:b0:480:1e9e:f9c with SMTP id 5b1f17b1804b1-48373a02c73mr260469135e9.10.1771318566972; Tue, 17 Feb 2026 00:56:06 -0800 (PST) Received: from [192.168.88.32] ([169.155.232.137]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43796ac7d91sm33443288f8f.26.2026.02.17.00.56.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 17 Feb 2026 00:56:06 -0800 (PST) Message-ID: <65665dd2-90ee-4f52-9238-55ef79832967@redhat.com> Date: Tue, 17 Feb 2026 09:56:05 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] net: usb: kaweth: remove TX queue manipulation in kaweth_set_rx_mode From: Paolo Abeni To: Ziyi Guo , Andrew Lunn Cc: Andrew Lunn , "David S . Miller" , Eric Dumazet , Jakub Kicinski , linux-usb@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20260209053013.1701134-1-n7l8m4@u.northwestern.edu> <119e20b9-4ecd-480d-b629-1c57b2088a41@redhat.com> Content-Language: en-US In-Reply-To: <119e20b9-4ecd-480d-b629-1c57b2088a41@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 2/17/26 9:50 AM, Paolo Abeni wrote: > On 2/9/26 6:48 PM, Ziyi Guo wrote: >> On Mon, Feb 9, 2026 at 7:56 AM Andrew Lunn wrote: >>> >>> I think there needs to be a better explanation why it is safe to >>> remove these stop and wake queue operations. r8152 does the same. Is >>> it also broken? Rather than removing these, should we actually be >>> waiting for the completion of the urb? >>> >>> Andrew >> >> Hi Andrew, >> >> Thank you for your time and email, here is my understanding (correct >> me if I'm wrong). >> >> I think ndo_set_rx_mode runs in atomic context with a spinlock held, >> if we wait for the completion, this would sleep under a spinlock. >> >> And it seems the architecture of r8152 is different from kaweth and >> rtl8150. In r8152, the ndo_set_rx_mode callback (rtl8152_set_rx_mode) >> won't directly call netif_stop_queue/netif_wake_queue. It only sets a >> flag and schedules delayed work. >> The function that does call netif_stop_queue/netif_wake_queue is >> _rtl8152_set_rx_mode(), which runs from the work handler >> rtl_work_func_t() under tp->control mutex, not from the ndo callback >> under netif_addr_lock_bh. >> Also, r8152's start_xmit never submits URBs directly. It only queues >> SKBs to a software queue. Actual URB submission happens in a separate >> tasklet using a pool of 4 independent TX aggregation buffers, each >> with its own URB. >> >> So even if netif_wake_queue() triggers start_xmit, it just adds an SKB >> to the software queue, no URB is touched, and no double-submission can >> occur. >> >> In kaweth and rtl8150, start_xmit calls usb_submit_urb() directly on a >> single shared tx_urb, so the netif_wake_queue() from the ndo callback >> causes the stack to call start_xmit while that URB is still in-flight. > > It looks like kaweth_set_rx_mode() is already functionally broken: the > real set_rx_mode action is performed by kaweth_async_set_rx_mode, which > in turn is not a no-op only at ndo_open() time. > > So this looks safe to me. @Ziyi Guo: I'm sorry I'm low on coffee and I did not notice a couple of relevant things. This needs a fixes tag. Also please specify the target tree ('net' in this case) on re-submit. Thanks! Paolo