From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.208.50 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796410618; b=Mvucss3oI9SB2cqwXw2Ad+odEhlrVXOcyWVS2AgAee0uK7S1Q5jA9lJIw1mcCTnP2un3 btjeYJOpgsTzuZeWcjyp+KosQcgcWlv0OABiiiy15KVZiZ63+pHHs6X8kML9lZTpUm5dF 8BcLEMa0pnQYfEcinB1Tm+sAVL0pJm5mefhK8f4+CSVZY7D9zxJm63jQd/YvhB1HFdgUt 6gIjFqDr3DcOEMcMIQPcb8A9M01wuHA2mNMUpx6PcU6BC4/luVPBfZVNuNcNQJqEiQvug GIclPtZtkgEKug4/H8l5SKSQs8P/F9QGlyEN38LdrvKHEcxA7nYRq47D8omNjYqsjig== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796410618; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Gm-Gg:X-Received:Received:From:To:Cc:Subject: Date:Message-ID:X-Mailer:MIME-Version:Content-Transfer-Encoding; bh=J3bwi883YZGym/fjv5PLPx4g/DLpIZDLOZ0v+EUAp/E=; b=2Sq4HuK+MPpMFpwAYepE+1ltQ/DdhfPiLCP9YVBAn1GU4ZFIr/FOcKf6t4Uszci4So2j KQNEb2e7EPv5Q742r1p00sAzkZT5plxg+1h8OcimefQ4TeVf1dQ5iEB5F1NLrLUhbp0xN FFdH52Ml6Fdyfw5HG78Jo495rlM4ulBUh6DqlMXPAYB9nxR0uOX6YJsbsI1iVniyD2hYt ybD5cSvwTGcWWtnKFQU6hujEV22sAEozIiBkajmTDC1PLEDY9qd7Me7pvwY4m9qeV7F08 1bY8jxHzwzaStRXPXrJAvHLPc5khiTAoi93kgZEQqBMplT5wbP+Z14T5Gp63+UwSG6A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=gp4Vx+Rp; arc=none smtp.remote-ip=209.85.208.50 Received: from mail-ed1-f50.google.com (mail-ed1-f50.google.com [209.85.208.50]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 156F4606A322 for ; Fri, 4 Dec 2026 18:56:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 156F4606A322 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.a=rsa-sha256 header.s=20260707 header.b=gp4Vx+Rp Received: by mail-ed1-f50.google.com with SMTP id 4fb4d7f45d1cf-6b8977f2785so1341463a12.3 for ; Fri, 04 Dec 2026 10:56:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796410616; x=1797015416; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=J3bwi883YZGym/fjv5PLPx4g/DLpIZDLOZ0v+EUAp/E=; b=gp4Vx+RpH+kuSck5HyzRPrvMcpg2tIleChrjI1bMeUEaHBBVFAuJVlHac/bpZP2Dlg 36TCfURrP8kxbtow8mcV97Z1xU8ueueKhTbq+J7iFMxcHxKxEWlFBWNpSIVJUsO3jse6 iuWwVMCz442XnpiQZg9z8MzPMwgDWrXgEUEVnaZxmZrl6vmTcV/wGuzwKJ1ppkueh4MO pxRJWShW/Mq/uiaqfih6N3KQXhURufmMFtoDDCywlWaVt+7k/HykPShEQWnqoJFkDiah 1aZmWPz7KCKLOV1P56FAuRUsXu2A84PpWJTNWzbqMPB09Ie38VS37/gFrkIfSNjVvmEk MCLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796410616; x=1797015416; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=J3bwi883YZGym/fjv5PLPx4g/DLpIZDLOZ0v+EUAp/E=; b=JXv740dUBK5lNZCLVQ7gCtiTDpzYDp1JavAg/8H+M2qKjnp5oYyD2S1eiY8swDL4C1 n6fW3AsdQHv3+S28nxIZV+epDyqYMbEFfb9Q9Rj5CJTecyKGyrFBUOtseksfUmjAzZEZ aG3GEaFwCkSR6W8Bb1N2Cc8Cc9vGQfAvgTmbvJ0AKzLSdFMmpOxamivT65IlC5ms16VI OwyJNRSk5u1eY2szvYDFz0NvzBvQlVb/hJuRGVr/5Zak/tFKp4H1IGt53tfiiTnoL5ws ZSVZkaI86Jgtto4vrlJ0hoUAGU++7rZ9tuTUBXFNxJrgRyf/NdMZ7LqNrEwcKX9wNAa7 AM2A== X-Gm-Message-State: APuU4Z/jA7G+We/506zrOEpE74r+lnguBdR/nCZ6xEVi24J6CYnnRRY8 8NfxS5+6Z8ER9PKyyEAQ6ppXggazabf2YEzSJG8atZ8wUqddoBrRE6V/CQXm7oZFeLo= X-Gm-Gg: AZFdTZexldYmU9uhXsTT/b8DY4k6wOw5AYkGijKk3UKX0WL/g4IhkMl2gQO+J3RyOZK zkwGHnN++brcqy0wIx54ih1AYyvvbevokpg23syD70m0ZuU8tRprblTceTkkfM/5fNsvF+/0Hpk 7ZMK1F+gVIqsXJKOLxykA87revMWJxZnJHp13POxd7oJdKESLzUD0IkVnNFVgi+cRzg8peNknoh WxVK+XYfx3QVF8onCL72/x6kUusskAN55z4jaYoY3sB53eP0SlaGW7vLQVOORDX8jxkga3k4LJa /rH7xwnaMv9zlIpzmyTEl2TOD1zRxA/QNYgBGj8DFyNQYmW4Tg15pWjTLq9lijK46mq2TZ1jhx4 02XaehcRRBzlzz4sy7y3nYCV6ZsuVs2Rqag1L5FqlSnEJJO1AEKSSm8j81VQz74fVYevp9zKYsJ XVN39ndstDuSSMcn70DytF7TLJR783Yvh3qy+wZKEKleWDlvWMSLsq/6h9/xwoM9qAvA0s/E5pW ykzC1r9mWBjKTpoifQBY6MccKvX64VDY5+asE8q2kVyA7ez84PAaxxEGu2hApdL4xM+mP/t+1r0 OJRE7zkp+ZJDd6VgSr6YzXvtWT0dAqOa6wA2R9XxE1DETjdiDgdBYGV8k9psn2j2s/wGYs4= X-Received: by 2002:a05:6402:501e:b0:6b7:6485:23cf with SMTP id 4fb4d7f45d1cf-6bcc203d263mr1806566a12.42.1796410616291; Fri, 04 Dec 2026 10:56:56 -0800 (PST) Received: from buildhost.darklands.se ([2001:9b1:ff:d701:51eb:176f:63d9:53f8]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-6bcbc00d2b2sm1197070a12.35.2026.12.04.10.56.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Dec 2026 10:56:56 -0800 (PST) From: Magnus Lindholm To: netdev@vger.kernel.org Cc: pavan.chebbi@broadcom.com, michael.chan@broadcom.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, Magnus Lindholm Subject: [PATCH net 0/6] tg3: fix reset and NAPI ordering and reject empty RX rings Date: Fri, 4 Dec 2026 19:54:44 +0100 Message-ID: <20261204185640.2332668-1-linmag7@gmail.com> X-Mailer: git-send-email 2.56.0 X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This is a series for the tg3 driver, which I stared working on while adding support for M3000 sparc VII+. The box uses the tg3 driver. My main objective was to get Linux running on the M3000. Close and suspend can wait under RTNL for a reset worker that also needs RTNL. Reset producers can also queue work after teardown has drained it, and NAPI poll callbacks can still access registers after reset masks interrupts. The first three patches let the worker retry if RTNL is busy, gate new reset work during teardown and unregister the netdevice before freeing its resources. Patches 4 and 5 honor the result of napi_complete_done() and wait for poll callbacks to finish their final register accesses. The ringparam selftest also showed that tg3 accepted an empty standard RX ring and stopped receiving traffic. Patch 6 rejects that setting before stopping the interface and can also be applied directly to net. I tested GLAN2 on a Fujitsu M3000 with a BCM5718 and three MSI-X vectors. The hardware kernels carried Oberon MSI-X support and a tg3 delivery-loss callback [1]. The recovery code gates reset enable and TX restart after a terminal MSI failure. These tests used normal MSI-X delivery. The series applies in order to net without those changes. With patch 6, requesting zero RX entries returned EINVAL and preserved the settings and carrier. On all three runs of ring_reconfig.py, channels passed, reconfig_tx_stall skipped (no combined channels), and ringparam failed to start traffic at one RX entry and 31 TX entries. On this 5717-class ASIC, tg3_set_ringparam() resets the PHY on a ring change while the interface is up. The test starts traffic immediately and samples RX packets 50 times at 100 ms intervals. Carrier was down during part of that window. In separate runs, two consecutive pings succeeded after 8.7 seconds at 1 RX / 31 TX and 8.9 seconds at 2047 RX / 511 TX. Starting the same traffic generator then delivered over 10,000 packets at each size. TCP passed in both directions with one RX entry. On the same BCM5718, stopping an idle TX queue triggered the real watchdog. Close and PCI unbind each canceled delayed reset work. With a reset already in progress, two closes and two unbinds requested RTNL after the first chip-reset flush and acquired it after hardware reinitialization. Nine transfer pairs passed SHA-256 checks in both directions across the watchdog tests. I also reran the earlier x86-64 QEMU fixture. It runs both tg3 poll callbacks on a synthetic netdevice and records writes to memory-backed registers. All 22 cases passed with both lazy and full preemption, including busy-poll completion refusal and mailbox and heartbeat ordering around the modeled reset mask. I have not measured an IRQ-rate change on the BCM5718 or exercised hardware suspend/resume or PCI error recovery. Each patch built tg3.o with W=1 and -Werror for x86-64 allmodconfig and SPARC64. I used Codex to help audit the driver, prepare the patches and run the tests. [1] https://github.com/linmag7/linux-sparc/commit/5b6eaad22926a8158e04f0d209900f666a293382 Magnus Lindholm (6): tg3: defer reset work when RTNL is busy tg3: gate reset work across device teardown tg3: unregister the netdevice before releasing its resources tg3: honor NAPI completion before rearming interrupts tg3: wait for NAPI poll callbacks before resetting hardware tg3: reject an empty standard RX ring drivers/net/ethernet/broadcom/tg3.c | 98 +++++++++++++++++++++-------- drivers/net/ethernet/broadcom/tg3.h | 5 +- 2 files changed, 77 insertions(+), 26 deletions(-) base-commit: af6737b9066832a2017c281159950ba92385ce00 -- 2.43.0