From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 928AE370ACD; Tue, 30 Jun 2026 02:30:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782786603; cv=none; b=C6A0RBByB8TrbuTIYPO6TiUfPpWR+lJLYpb4WKKUGu8tAH/uvCFVyLQeQTerd8o83odvvVdoeG11x2+JdkDqPqQDwr73mg04HE9U27Mo9llsNzuRhEEAsu2kvg9VcdG7bKhqViKWJ7wXNVrfkVa1Mtcznnc7lIiaG3Z3IpJcYXk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782786603; c=relaxed/simple; bh=vGz1xmoOhcMJWflsgQPsykuacz76OA0Jg1PNP/0+0v0=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Cyy14hqn0meWdR/piBX/0xLFs8IBusyWQQasFt5rQWQ6OFCKofTVvuzObf36oV4NfWK8XmzGOOVd11oLhMqP/4nJ0uHwBCkbdm/aDio2KeNij38fHbLn4NeJHzPCDS834GFUqfKxoA3fJ7u8+NwYVZ8mz7kBKk+X/v1oKJW7qlA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=PwDPzkhF; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="PwDPzkhF" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A795A1F000E9; Tue, 30 Jun 2026 02:30:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1782786601; bh=L++3hzXL4ngc0TFc47tkEmKfA6rLjeJCPXuHbDDNS3M=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=PwDPzkhF1+ViQrC8oR997CWk04zvb6xPVVr3nlUt7lEsfA2Wbhur0lyMiCjgEwtL5 xsJb7rKf/nAaOgouF3/zdpCRHuk8scAvRXWCF7dvnlAYVg1FgOHlTpjEZCPWDtUpeJ ph8mqMj5lq5OAhg86KS6/sxEUVXPIHESjuYcHQv1kuf15wV1A5LjcSsHRNUAE9hdTK xNk6M9N5bRdc4sz1PsWtCz2Xs0n4JH23fYLvrlZ95quI0Zwm5ctQEP73n7X8Qx5YpX bLwQlWdojpkFNgvlroQMHoVH/OpHui6ZefXbbksJ2h0x5VgnCi9CDy/KcBAUWV0ujc BDM4z+67YRVBw== Date: Mon, 29 Jun 2026 19:29:59 -0700 From: Jakub Kicinski To: Selvamani Rajagopal via B4 Relay Cc: Selvamani.Rajagopal@onsemi.com, Parthiban Veerasooran , Andrew Lunn , Piergiorgio Beruto , "David S. Miller" , Eric Dumazet , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Andrew Lunn Subject: Re: [PATCH net v2 2/2] net: ethernet: oa_tc6: Improvement in buffer overflow handling Message-ID: <20260629192959.445776c9@kernel.org> In-Reply-To: <20260626-fix-race-condition-and-crash-v2-2-b6c5c10e604f@onsemi.com> References: <20260626-fix-race-condition-and-crash-v2-0-b6c5c10e604f@onsemi.com> <20260626-fix-race-condition-and-crash-v2-2-b6c5c10e604f@onsemi.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Fri, 26 Jun 2026 08:35:19 -0700 Selvamani Rajagopal via B4 Relay wrote: > When oversubscribed traffic causes lot of buffer overflow errors, > probably due to loss of data chunks, driver fails to find a > data chunk with end_valid bit set, before it runs out of sk buffer > space. As a result, assert is seen during skb_put. > > Now check is made if tail + len > end, driver abandons the current > data and starts look for a data chunk with start_valid bit, > that is a new frame. This sounds rather scary. The driver seems to have no length information to confirm it got all the chunks. So if it missed a middle chunk we will never know? At the very least this seems like something we should increment rx_error for, not just rx_dropped? Regarding the patch itself, I'm not clear on why we need to look for new frame. Will we not notice the start bit immediately and call oa_tc6_allocate_rx_skb() (if there is indeed a start bit in the stream?) So handling skb-already-exists in oa_tc6_allocate_rx_skb() seems like enough to start a new frame. Sashiko has another comment: https://sashiko.dev/#/patchset/20260626-fix-race-condition-and-crash-v2-1-b6c5c10e604f@onsemi.com -- pw-bot: cr