From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yx1-f51.google.com (mail-yx1-f51.google.com [74.125.224.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6522C30FF32 for ; Mon, 6 Apr 2026 21:20:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.224.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775510434; cv=none; b=WhssMUfZDJ0YBlwD7REuFAFaHAmIiNqGUO7XI+4JrvlDPzcIyDo5vGQ+ueL8RLG5QVcdNcvHpsHcw7ud4jYWfXquC5w4+OzDrzqB4cypCbcCxo9oXiUxE/zRaIaZMr453n1nSfzC78yEKYA0I9yP4Ta93Q8fV/QPsnxl0oKh8dw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775510434; c=relaxed/simple; bh=tOzS5yBZD6qH+T9+3SQjvBHwIz/KRctL1NoeMqapak4=; h=Date:From:To:Cc:Message-ID:In-Reply-To:References:Subject: Mime-Version:Content-Type; b=ERZjSQ+Xr/JWx95AxEFOh+uqBB64Qg7TFJwpQ/qapX2l3iJHytPm3NByKYg99ddlh6cbWEEtPYPCHcXjnSOCtIbsb64FxSFjwvlAjM5MQjejp1I+G1YA0zWVSKPOwtksRvYDybsecxDZETVmWKGAlsvzkIiXcwyBpFQwHzvHf1Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Uz5117rk; arc=none smtp.client-ip=74.125.224.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Uz5117rk" Received: by mail-yx1-f51.google.com with SMTP id 956f58d0204a3-6501c9903edso4233064d50.1 for ; Mon, 06 Apr 2026 14:20:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775510432; x=1776115232; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=6bzs5SDxOWpPA9bqwDu45hXe3OO9/TGgNIA4jG1lKAk=; b=Uz5117rkle5R9ddnVfLtcC5v9UYSGxftsYq7b6UQWhQ8XofihNXl8Ocb9pSEvSJbd2 t9wOYcwuHs0GYwzT60wt670kQj7x+t9+qTjAZxpDi/+fubVhrfCehFasGpPFOWjvXbwE FPjIIOPe9pdUpK4iXeUzHt2kGLNP+yVNaALnuZrQTMFK/WkadwVSK2jRSMny+AgH1sQj C7cjHi1X92L5+09hlKGGdswMGLSG5VWL5/DKRrO+iuK+Sqxv9Mnt4/t7EEM9zR8mTCv6 rpQoggm33Qy2skMgDFb0oUcxO6snlllglv8jpQp9F+ODeGmWYcjfyTyz+KrsluDMP4jY KN1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775510432; x=1776115232; h=content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=6bzs5SDxOWpPA9bqwDu45hXe3OO9/TGgNIA4jG1lKAk=; b=BK/X/MVejdxadFvKrnz6gP4D4MG4T0bKCbUmSU3y3TzIf4ynM/935RQdXOd0sdFqON JpgQCZ5s5oZy3GmWJ0ucEipMQFPqPICFno7cnAVFvse88papxTZPNQKB7ohl8IrLz3CN QorauciDLHsd7ozBTrsev/fwjPSCDadYNiyKPAKD8nOmgaxmOWcEc6xoWmaDJ0WZrumK LVer6g4CuL7TC0RMgelSfNnmaPXBfxfHJLWXmSQCHS0/Uq+IvG9i71NkEP3BPlqFRkSI E/M32+ALg49ri728uyT/Qpk8WKsQVrO1icoZA6AiaKP2rhgfXCzahHe2soyIQAkqcQ48 gWjQ== X-Forwarded-Encrypted: i=1; AJvYcCUb7HAvjIVx1cnlCQPACz8CcmERr7pfj1a4Mgleql60Rlifdz0TyzoF/mvPpQQG5raYmodn0I/n1B+ZSiE=@vger.kernel.org X-Gm-Message-State: AOJu0Yx8+PjWJmAUPsZ2bUDvZryQI1mtQDz4IJ8eJMiSKHDrE6WgSR1s 1EqrKQZbRxgri+SFVMcV2MPNB8y8ZnrEFLjUOQbaXztMQDgH9WbvzO2SthcHmg== X-Gm-Gg: AeBDieupvaCEzQZ9DyqrlLtE5cRYF02NgHj4KxMHmB3dTjT4ZCj3fNb+NLXG27DBazq niO/xPu5ke2KEPp0JUhAQe4j9G6Zfj1gQdMiMPczapmPZyfgEt4JNpey0Pgpc/0BtJX5wb3OG4Z k12K1g7wN0dtaJr9X8MIQrnF8V2v12ppJGgkzpDoa03loQbTUuemStoyRgPTw81eU1c9XhronXy HSTm7lf5hlgxShIcKKObMIwmhpJyFNv8hGyF7bj3Svcc+2naApjrCrqLDgZn2wXny/ypRmV0RT3 yD1RvgIV1taVARSz42M08rfU7NgrJQ1p6XXFT7HNinqDxLPhWjKdLrvP5Tg48jm3yXnXZ9Ze8a2 Sa2dLL0V66JJh0FfaNWHC/hZfzHL/p7PTxnSqDy7bxnn/DpeT0FJGKpRJj+XKk+c1/vZVmis3Ia kQbyXV7jQ0ZPe5Sdnj3OrfJDQy9+VQgoMHS/rf9qjPRkDUO50kPdEv6Rx7jxdb0JYlCmGV2vEmo pQB X-Received: by 2002:a05:690e:d88:b0:64c:c616:c349 with SMTP id 956f58d0204a3-65048754a1cmr13246650d50.31.1775510432437; Mon, 06 Apr 2026 14:20:32 -0700 (PDT) Received: from gmail.com (172.165.85.34.bc.googleusercontent.com. [34.85.165.172]) by smtp.gmail.com with ESMTPSA id 956f58d0204a3-6503a86d1b1sm6582433d50.9.2026.04.06.14.20.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Apr 2026 14:20:31 -0700 (PDT) Date: Mon, 06 Apr 2026 17:20:30 -0400 From: Willem de Bruijn To: Joe Damato , Willem de Bruijn Cc: netdev@vger.kernel.org, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Shuah Khan , andrew+netdev@lunn.ch, linux-kernel@vger.kernel.org, willemb@google.com, linux-kselftest@vger.kernel.org Message-ID: In-Reply-To: References: <20260403233240.178948-1-joe@dama.to> <20260403233240.178948-3-joe@dama.to> Subject: Re: [net-next v2 2/3] selftests/net: Test PACKET_STATISTICS drops Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Joe Damato wrote: > On Sat, Apr 04, 2026 at 11:08:15AM -0400, Willem de Bruijn wrote: > > Joe Damato wrote: > > [...] > > > > @@ -396,6 +424,11 @@ static void run_test(void) > > > > > > total_len = do_tx(); > > > > > > + if (cfg_drop) { > > > + check_packet_stats(fds); > > > + goto out; > > > + } > > > > Sashiko pointed out > > In the future, please link to the AI report. > > > that there may be a race here between rx > > processing in the softirq and check_packet_stats. Seems plausible. > > Can you elaborate why this is true? > > I could be wrong, but I scanned the code and __local_bh_enable_ip seems to run > softirq synchronously in this case, so I think the code is correct. You mean that after the return to user in sendmsg, the packets are guaranteed to have been queued to the sd->input_pkt_queue, the napi schedule was run by enqueue_to_backlog and napi was run on this cpu as a result of reenabling BH. At the end of dev_queue_xmit? I recall that there may be a common one on syscall return too, but the details elude me right now. Either way, makes sense. I had not fully appreciated that the softirq schedule is this deterministic.