From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=46.14.198.178 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796069306; b=YT5FXoKjr4hUbBfkzG9+ruTgiBIjY/LXxMhtnvHrdU7VQcDjfDDUn1gC/r5EKkZkvGSo JPzqqXyYEho8Uqc6nmGdoBvOO7G2TfjGXZZwpYli1UrjgWTtcVi219/brMy2/M6iCx99q pzGUil2AYvUD+qzZdUJCETrXtvRnvqa354LyraVsdLuP7FiCR2Qoeo4yZIfw6kZq45aJC S9FpRPEiScRcIj7jMhw7aGINoU5I/IHRTYbV5Wi+TfGCARQglfiGhpi23QPTHrf8tN6wD xOCDUj6xQw2HYrFac3CHTrJHH4N0xBo8eXZvVsbxTlEHgI7OmFDW9lQsml/oLqGxOpw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796069306; h=DMARC-Filter:Received:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Type: Content-Transfer-Encoding:DKIM-Signature; bh=YABKyw0Xp7bmy5zd5b8Xf9+uN3PHzjEyIEV6v1D4nvM=; b=tz//7PVa5WBc+x467DfdTQj6EGLQnSKhzcoFOhY8HQq2srJO1IpQzRKmLQ0rKczpqmmI S3S0FBApBFBCHu0mJT8KnY1KKBmhXNxElBAyjGA7YtIMQPEz8SYWLodKvp7oxP43cfN/0 Va1LbkgM7Tj+2RPhX1O+18CR/hk6HGMhCqRUGszTmi7blaeOzjrPZOPw4+jHTk7dzA5Za AgP4lhRu+nHYO4P8WdSypt6xl1zw9DVblkTozbjaRdOBlqu+U9ark9Rct+dXgqdJ71dlI lnAD/V15r7N9LLgpkmOEmR9yUiOVvme6fplt1q7s+CoDfqG+LXRwQLJ5bDug16rRAIg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=rimpianto.com; spf=pass smtp.mailfrom=rimpianto.com; dkim=pass header.d=rimpianto.com header.i=@rimpianto.com header.a=rsa-sha256 header.s=s20260314391 header.b=OtFt1sRM; arc=none smtp.remote-ip=46.14.198.178 Received: from mail.rimpianto.com (mail.rimpianto.com [46.14.198.178]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1D472606A325; Mon, 30 Nov 2026 20:08:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 1D472606A325 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=rimpianto.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rimpianto.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=rimpianto.com header.i=@rimpianto.com header.a=rsa-sha256 header.s=s20260314391 header.b=OtFt1sRM Received: from localhost (Unknown [127.0.0.1]) by mail.rimpianto.com (Haraka) with ESMTPSA id 9E649D5F-7732-4944-91CF-EC6AF05B7CB5.1 envelope-from tls TLS_AES_256_GCM_SHA384 (authenticated bits=0); Mon, 30 Nov 2026 21:07:18 +0100 Authentication-Results: mail.rimpianto.com; auth=pass (plain) From: Federico Musto To: netdev-bot+sashiko@kernel.org Cc: Federico Musto , Chris Snook , Andrew Lunn , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH net v5 2/2] net: atl1c: free the RX buffer when the descriptor reports an error Date: Mon, 30 Nov 2026 21:07:18 +0100 Message-ID: <20261130200718.34828-1-federico@rimpianto.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <179595291831.3146.7906490727635927112@kernel.org> References: <20261125113120.99743-3-federico@rimpianto.com> <179595291831.3146.7906490727635927112@kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimpianto.com; h=Content-Transfer-Encoding: Content-Type: MIME-Version: References: In-Reply-To: Message-ID: Date: Subject: Cc: To: From; q=dns/txt; s=s20260314391; t=1796069238; bh=YABKyw0Xp7bmy5zd5b8Xf9+uN3PHzjEyIEV6v1D4nvM=; b=OtFt1sRM2KcprtEj3sgppeYosrrNmDFk8wpY89QsObYiqYXmMnbb5+BuaHVlSkRXXvE5KJkE3 syPh7ozmLpdbk4klRizegtr/X0+uQ2VczwMA7YydLRxfqUBhMzdSpfuSHEoDrl6ywXmPkvIqqMX n2Te3LD1FmK1REJvp+1H2ggvzYLS1e+UcwvOrayvIYTJBLsZfqQHiQKVG7bjD+1i9iX2J2s8hFh vbJddZt3rhy16TtK67yT+NeaWE36E5jPPuV1FHNf6KmsIfH4g1ozyl6c71Wv8hFwe+xhpCZEOQT RLbeX+sr0515HyvPpmxwf2C9zSZLNMV2B95jPEB+brZw== Thank you for the review. [Medium] A legitimate multi-RFD frame becomes a controller reset. The arithmetic is correct. For an MTU of 1501 to 1522 atl1c_set_rxbufsize() leaves rx_buffer_len at AT_RX_BUF_SIZE (1522), while atl1c_configure_mac() programs REG_MTU with mtu + 22, that is 1523 to 1544. A frame the MAC accepts can then be larger than one RFD. I have not confirmed whether the device splits such a frame over two RFDs or truncates it into one: the card I test on has only been run at MTU 1500 and 1600. Either way the reset should not depend on that. In v6: - an RRD whose RFD count is 2 to 15 and whose index matches rfd_ring->next_to_clean is dropped: every RFD of the frame is unmapped, freed and recycled, each slot being checked for a buffer first, and RX carries on; - the reset is kept for a real loss of sync only: a count of 0, an index that differs from next_to_clean, or a slot with no buffer. Sizing rx_buffer_len from the same expression as REG_MTU looks right as well, but it changes the buffer size for those MTUs and is a separate patch. Before posting v6 I will run the card at MTU 1508 with frames of about 1530 bytes and report what the device does with them. The reply to the review of patch 1 carries the pw-bot line and a question to the maintainers about the direction for v6: https://lore.kernel.org/netdev/20261130200709.34802-1-federico@rimpianto.com/