From nobody Tue Jan 21 15:36:00 2025 X-Original-To: net@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ycrrw5BQqz5lFRj for ; Tue, 21 Jan 2025 15:36:00 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ycrrw4SNrz3BnQ for ; Tue, 21 Jan 2025 15:36:00 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737473760; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=H0687E/bIst1eUhZyAxsr7c6R8UGUF64uoUwqcMQcCk=; b=EHEQMrlyDZF8K3yZitf+LgUXhdVPxpOaRcWolkwgjQRkiwWrUOrv4tqiWo6QAM4H/pY+15 3ukyP3ivB47mTwp/+PHt1Eit383KR9fhdoVID4bxyV95OX7hBRWYLV1JGFSDy2HsHu5juN alxZh8oygNWhphmE9aNOhlfi/xrFExL5kKcv1VnjWIVfATfOld1g2kzF0ECPD6v92LE6an A+Z8OySuVPRhGK9vEwRz0cLUaCE9X/8uzhOlXtfIUOFqJlKNlUJsI4F0OYIQ/bkXgFqyjm gMX35D6ph4aLttQL5lsMx3p/9lREqRHYrrQU5NFjblT346MAAAjYxJsteirUcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737473760; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=H0687E/bIst1eUhZyAxsr7c6R8UGUF64uoUwqcMQcCk=; b=OfsK/Zb5qPdHnltebycVGwFztAhwiYjlMqQcMtwU70EjJ2qBhUCIAGWAHJjwCxfiFC8Mb/ Qq5vcrncT14fkSxyKewdimzuCnU9/7V2Dyg7FG47xOd1ATSGWJFgODxqoe4ouoP2YkgKpY ZmoEUSyWLrJr3hg5RZlc7yvaqh8J3HiC/G+Lrwq8ce1a/MEyMsV7euzBV1RR/uKiR6xmoO /rBOSJC07/qCYJxkDgjnfgYmHvlkm9NYqG9eR5I13LZ4TA1T2qVIIJJgDdNdk/epejkzQ8 l06P7cXnsyCQCOqMqhSVt9kYBjrnxxDO3GRZECgAv9MY/T+I78DURuooN3GX5w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737473760; a=rsa-sha256; cv=none; b=Rlt7iS7HyuQOgWDhB3DYPAtagShR/sCVVsxdK8Uk5I5z3fMVroqpdvo8jq/ATi6p3WXZGP GjTLM4q7BV3CEIs7iT5wZ4bXe9zC/OKriUBorRJJUHvGPugJkYaZDLTRvOkyhlKAMVuaDf Q17aJlenmrV6/G3wYLTc6xrb4l5SIw2nTsbcHNEycAt3gbHn4qkaJiN5MzQMdwHMT48LSd tMn7y5bGry5vCz3BFnZ6tbBLE4DTTKgIXCV0epyujPGDux41AGxXJlLY9oxgMBuB6iXXnr qQ99nZt7DZY9BLJPTSbbuKM4W+/z0tQH2nNk5Asy+hN20EglIMU/VfYjx1QhVQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ycrrw3mdzz1BLg for ; Tue, 21 Jan 2025 15:36:00 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 50LFa0i0051935 for ; Tue, 21 Jan 2025 15:36:00 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 50LFa0NE051934 for net@FreeBSD.org; Tue, 21 Jan 2025 15:36:00 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: net@FreeBSD.org Subject: [Bug 284057] vmxnet3/iflib: crash in vmxnet3_isc_txd_credits_update Date: Tue, 21 Jan 2025 15:36:00 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 13.3-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: avg@FreeBSD.org X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: net@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Networking and TCP/IP with FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-net List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-net@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D284057 --- Comment #11 from Andriy Gapon --- (In reply to Mark Johnston from comment #10) The spin-lock should be a straightforward and sure-fire way to ensure race-= free execution. Thank you for the suggestion. At the same time I've been wondering if my earlier patch broke things becau= se of vxcr_gen. I see that in other drivers isc_txd_credits_update methods are also not protected from races. But they try to not change things until the very end which probably reduces= the window where any inconsistency can be observed. But vmxnet3 changes vcxr_next, vxtxr_next and vxcr_gen in each iteration. I am also still concerned that some fundamental assumption in iflib is brok= en either by iflib itself or by vmxnet3. Code in the transmit path gives an impression that it was not supposed to be executed concurrently. Returning back to your proposal, my immediate concern is where to put the spinlock, where to init it and where to destroy it. I think that struct vmxnet3_txqueue may be a good place for it. Then, vmxnet3_init_txq seems like a natural place to initialize the lock. But I am a bit stuck figuring out where to destroy it. --=20 You are receiving this mail because: You are the assignee for the bug.=