From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp10.goneo.de (smtp10.goneo.de [85.220.189.106]) (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 65E8F3890E8; Tue, 2 Jun 2026 16:54:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=85.220.189.106 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780419287; cv=none; b=mbDENy/KKyTZHq/Xj8GREGHv732EhFy6aXjJ+qXOlq+EcR4yClw5vyZE9Q//mtYwlK0BTiRrRaKSrN6Es6f8KNSOl9hVLz7/kBoo97ns+AImjNC/4KXlCvwZg7uCiIC0vOqgbCTTB9G1c7zQbQNz3RcrjCB2JsN2tUd8MhPf48E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780419287; c=relaxed/simple; bh=X3uWoFTL43TKtRaGf/jtjolAY6UPFdTmz02blP+KP3k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GBncFgDindzjcYmbffuf7owj79HBPzwPRf/4ZYx6NNfaKrCHTmQBXzU+Z9OacaszCpZDyYg7bKpVskhomKCkjWYWOIcQlpn4TEd+C2RU9y24WqeTPElEXPzoIgJVY3f+H/TdCsxJRnFN9oT+1EXr3VgZ6XzK2Y6NSFIUwT1RQAA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tk154.de; spf=pass smtp.mailfrom=tk154.de; dkim=pass (2048-bit key) header.d=tk154.de header.i=@tk154.de header.b=G1xioQis; arc=none smtp.client-ip=85.220.189.106 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tk154.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tk154.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tk154.de header.i=@tk154.de header.b="G1xioQis" Received: from hub2.goneo.de (hub2.goneo.de [IPv6:2001:1640:5::8:53]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (No client certificate requested) by smtp10.goneo.de (Postfix) with ESMTPS id B24CA2408C6; Tue, 02 Jun 2026 18:47:08 +0200 (CEST) Received: from hub2.goneo.de (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by hub2.goneo.de (Postfix) with ESMTPS id 1B81F2400A3; Tue, 2 Jun 2026 18:47:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tk154.de; s=DKIM001; t=1780418827; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZoTVEgLNauvougTiOOzgJ66IRmD3vjDkLm4JeWlu9kI=; b=G1xioQisIbsblKXOqfh8AgPIfXyNQRguD0CD7GejIdQVClcmscnMtcMj9oYs0VrbrvSnlg AiPYUjA5KoJ77Pbast0YN5IYk9dA1Q/vD4Sm4YRVPZgU90Jm7ditRkT+bjaTcGJPyXJZEC mCrt0eE1yEzil83rloBmj4ZKwwm/SodunJGKp4zqLpybQcC4PL4/5s6DssSsFTrHo0sOQi 9zLzq74MtC392Fnkfjell36DCV5I83q1xSbmt892crI18VEz31HfdljMoEhKEgqHXWF05V FnxHRxxpNqMKEhEyAIaoH0tgzSif99eLNATtgY20BnHBSGNNDa4FnEAz5c0n1w== Received: from Til-Notebook.meshlab (unknown [195.37.88.189]) (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) (No client certificate requested) by hub2.goneo.de (Postfix) with ESMTPSA id E011C2402FE; Tue, 2 Jun 2026 18:47:03 +0200 (CEST) From: Til Kaiser To: Marcin Wojtas , Russell King Cc: Andrew Lunn , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , Stanislav Fomichev , Matteo Croce , Sven Auhagen , Lorenzo Bianconi , netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org, Til Kaiser Subject: [PATCH net v2 1/4] net: mvpp2: sync RX data at the hardware packet offset Date: Tue, 2 Jun 2026 18:46:32 +0200 Message-ID: <20260602164635.62517-2-mail@tk154.de> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260602164635.62517-1-mail@tk154.de> References: <20260602164635.62517-1-mail@tk154.de> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-UID: 2e1b24 X-Rspamd-UID: ed6eb1 mvpp2 programs the RX queue packet offset, so hardware writes received data at dma_addr + MVPP2_SKB_HEADROOM. The current CPU sync starts at dma_addr and only covers rx_bytes + MVPP2_MH_SIZE bytes, which syncs the unused headroom and misses the same number of bytes at the packet tail. On non-coherent DMA systems this can leave the CPU reading stale cache contents for the end of the received frame. Use dma_sync_single_range_for_cpu() with MVPP2_SKB_HEADROOM as the range offset so the sync covers the Marvell header and packet data actually written by hardware. Fixes: e1921168bbd4 ("mvpp2: sync only the received frame") Signed-off-by: Til Kaiser --- drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c index f442b874bb59..92a701f4fe3f 100644 --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c @@ -3946,9 +3946,10 @@ static int mvpp2_rx(struct mvpp2_port *port, struct napi_struct *napi, dma_dir = DMA_FROM_DEVICE; } - dma_sync_single_for_cpu(dev->dev.parent, dma_addr, - rx_bytes + MVPP2_MH_SIZE, - dma_dir); + dma_sync_single_range_for_cpu(dev->dev.parent, dma_addr, + MVPP2_SKB_HEADROOM, + rx_bytes + MVPP2_MH_SIZE, + dma_dir); /* Buffer header not supported */ if (rx_status & MVPP2_RXD_BUF_HDR) -- 2.54.0