From patchwork Tue Sep 3 18:43:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 13789213 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D448ACD37AA for ; Tue, 3 Sep 2024 18:45:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=miVlX6AWASpn/Rgevxfm45wsjcuK0SlwyRSflTtdySU=; b=o9AWhKTY3KtJgDHV+r9pG1k3hc PNo3xDVwMDBGMaKyC6BIV/0tMkNbC9mA0BxdZ0Tq7KPDl5Wq8uuDDKUDAo0ysTIyRoQRyeyuH0SDB Rgn/bsWQ4pbozFTJCFX8n64W7WmNoJ7Sa/ECfBu9H1ckDbThm3k7OSgFN0mJ1WjoteCh9ipXlYz89 nDlNayoanGLOMUeVin5BincLG/VDT8V/s1/PIb9WhJx2iR3r4KftgYBonF6IcvUp1qi4dydVwxsSQ sp9CqWWaGuBtz/eGfNqXRxs7sPnswlu+AzVnbx8eo1JFF7z85OORYZXR8Du2/GqimBo2LLY/PHIBo H7/SDmmw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1slYX2-00000001UtF-1x3R; Tue, 03 Sep 2024 18:45:36 +0000 Received: from out-171.mta0.migadu.com ([91.218.175.171]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1slYVD-00000001UNm-3EXd for linux-arm-kernel@lists.infradead.org; Tue, 03 Sep 2024 18:43:45 +0000 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1725389021; 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=miVlX6AWASpn/Rgevxfm45wsjcuK0SlwyRSflTtdySU=; b=ugehQBYBI5JaPFAjPagyMl042nSEprLVnVKT6vj3dJoqXxPZ+eUrThmyZairmugvjcakf9 wftGOb5lDL8Alh3Qz9mcEB4HqSn5LbTxqovwJSTjgS5Gzs2I4gZrscUqwMBQ1blHpuCQV1 aLnHp+XgIJa9gyHdJemulrL1ilzrBy4= From: Sean Anderson To: Radhey Shyam Pandey , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: Michal Simek , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Sean Anderson Subject: [PATCH 1/3] net: xilinx: axienet: Remove unused checksum variables Date: Tue, 3 Sep 2024 14:43:32 -0400 Message-Id: <20240903184334.4150843-2-sean.anderson@linux.dev> In-Reply-To: <20240903184334.4150843-1-sean.anderson@linux.dev> References: <20240903184334.4150843-1-sean.anderson@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240903_114343_978155_18584172 X-CRM114-Status: UNSURE ( 9.66 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org These variables are set but never used. Remove them Signed-off-by: Sean Anderson Reviewed-by: Simon Horman Reviewed-by: Radhey Shyam Pandey --- drivers/net/ethernet/xilinx/xilinx_axienet.h | 5 ----- drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 12 ------------ 2 files changed, 17 deletions(-) diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet.h b/drivers/net/ethernet/xilinx/xilinx_axienet.h index c301dd2ee083..b9d2d7319220 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet.h +++ b/drivers/net/ethernet/xilinx/xilinx_axienet.h @@ -527,8 +527,6 @@ struct skbuf_dma_descriptor { * supported, the maximum frame size would be 9k. Else it is * 1522 bytes (assuming support for basic VLAN) * @rxmem: Stores rx memory size for jumbo frame handling. - * @csum_offload_on_tx_path: Stores the checksum selection on TX side. - * @csum_offload_on_rx_path: Stores the checksum selection on RX side. * @coalesce_count_rx: Store the irq coalesce on RX side. * @coalesce_usec_rx: IRQ coalesce delay for RX * @coalesce_count_tx: Store the irq coalesce on TX side. @@ -606,9 +604,6 @@ struct axienet_local { u32 max_frm_size; u32 rxmem; - int csum_offload_on_tx_path; - int csum_offload_on_rx_path; - u32 coalesce_count_rx; u32 coalesce_usec_rx; u32 coalesce_count_tx; diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c index fe6a0e2e463f..60ec430f3eb0 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c @@ -2631,38 +2631,26 @@ static int axienet_probe(struct platform_device *pdev) if (!ret) { switch (value) { case 1: - lp->csum_offload_on_tx_path = - XAE_FEATURE_PARTIAL_TX_CSUM; lp->features |= XAE_FEATURE_PARTIAL_TX_CSUM; /* Can checksum TCP/UDP over IPv4. */ ndev->features |= NETIF_F_IP_CSUM; break; case 2: - lp->csum_offload_on_tx_path = - XAE_FEATURE_FULL_TX_CSUM; lp->features |= XAE_FEATURE_FULL_TX_CSUM; /* Can checksum TCP/UDP over IPv4. */ ndev->features |= NETIF_F_IP_CSUM; break; - default: - lp->csum_offload_on_tx_path = XAE_NO_CSUM_OFFLOAD; } } ret = of_property_read_u32(pdev->dev.of_node, "xlnx,rxcsum", &value); if (!ret) { switch (value) { case 1: - lp->csum_offload_on_rx_path = - XAE_FEATURE_PARTIAL_RX_CSUM; lp->features |= XAE_FEATURE_PARTIAL_RX_CSUM; break; case 2: - lp->csum_offload_on_rx_path = - XAE_FEATURE_FULL_RX_CSUM; lp->features |= XAE_FEATURE_FULL_RX_CSUM; break; - default: - lp->csum_offload_on_rx_path = XAE_NO_CSUM_OFFLOAD; } } /* For supporting jumbo frames, the Axi Ethernet hardware must have From patchwork Tue Sep 3 18:43:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 13789216 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BC968CD37AB for ; Tue, 3 Sep 2024 18:46:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=NXxxYldboyxzE9Wae39eG+jfv6vdAxMeW5NxEwKdx/M=; b=XfwvLRguVpy23qQqeChScC2aOg Xd84U4UskuCrJ5aR1SYLjj8SNoPH7MA8w+f65p3YM9QJWSUwrtisOaTkrPTSgi/D0z1bldsnUoOup oWispA2KNBny7EtWrPhpNJaQQC1SKU3pPnmJ7YbumtMdm4unVuVlF61GbwoxSI3MGwhj4MaLDPEbE uQniICIGckcBINEA8iFLOpM3tXPvfxpVE2tdtQ5QubX/vKM3TGHXDA/IbOHdCdCAFukfr3cGJDJMi 4O2DDurDRr2MV0s9jlMyhB+OYLPDdkqrYLG/36zO51htwFBYnSAkdHCHLpWSZWqNsvTCYF03asmdD ikrgnSEQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1slYXu-00000001V1x-2TKZ; Tue, 03 Sep 2024 18:46:30 +0000 Received: from out-180.mta0.migadu.com ([91.218.175.180]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1slYVF-00000001UO9-2Kea for linux-arm-kernel@lists.infradead.org; Tue, 03 Sep 2024 18:43:47 +0000 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1725389023; 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=NXxxYldboyxzE9Wae39eG+jfv6vdAxMeW5NxEwKdx/M=; b=NShfBAY37foLKXLE9aUjjeK3vDl801KxB506r4Er5d3tmzGPfCbIpWBGTou+3GFI8NfF5i 90tu1l92vHrC3vdGDDMvRjlM5E4YEYHV/gvyDX1cOz3JDy5JD3dIwWl/pqlkoTeX1NpEZ3 DvYLzfI1nBmFv4c9acb/gOFBufMnt7s= From: Sean Anderson To: Radhey Shyam Pandey , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: Michal Simek , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Sean Anderson Subject: [PATCH 2/3] net: xilinx: axienet: Enable NETIF_F_HW_CSUM for partial tx checksumming Date: Tue, 3 Sep 2024 14:43:33 -0400 Message-Id: <20240903184334.4150843-3-sean.anderson@linux.dev> In-Reply-To: <20240903184334.4150843-1-sean.anderson@linux.dev> References: <20240903184334.4150843-1-sean.anderson@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240903_114345_762971_E8297B42 X-CRM114-Status: GOOD ( 10.55 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Partial tx chechsumming is completely generic and does not depend on the L3/L4 protocol. Signal this to the net subsystem by enabling the more-generic offload feature (instead of restricting ourselves to TCP/UDP over IPv4 checksumming only like is necessary with full checksumming). Signed-off-by: Sean Anderson Reviewed-by: Simon Horman --- drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c index 60ec430f3eb0..74fade5a95c2 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c @@ -2632,8 +2632,8 @@ static int axienet_probe(struct platform_device *pdev) switch (value) { case 1: lp->features |= XAE_FEATURE_PARTIAL_TX_CSUM; - /* Can checksum TCP/UDP over IPv4. */ - ndev->features |= NETIF_F_IP_CSUM; + /* Can checksum any contiguous range */ + ndev->features |= NETIF_F_HW_CSUM; break; case 2: lp->features |= XAE_FEATURE_FULL_TX_CSUM; From patchwork Tue Sep 3 18:43:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 13789217 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 50505CD37AB for ; Tue, 3 Sep 2024 18:47:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=lO6Qw3fND5cpAM7rycrrrnZxNspjCnlupd/fVRDk9Z4=; b=QM3jCrnVG3zLQi5rbuyhTYqsCb YVzNNrdhi4jkoPm8EOOUYuVe9eB7Fsr504Ucby/yZ2aCZPtNBvrgE6luunGyYnsTDbbaHnGaTcXVd Uqt8M1jT5npKTIEoEUKLZVMMEvVcfw5bWU79WPxGw72W7fGcv15zERFO+2exvytJb9Ky1aCYLBx+G vL973RdfKnPQd9PqphI13JtqOuXm0vuABtoNLvTUND0muGFZgsgx3s2+Eb7Vc+GdiYz1S7Bf2xvgE ljiR+wki82IyeK3AjCaZxkT84s8WhKLdWveMInw8m+p60FEV34iK7DkebzAW1Vh6bldTbfazAuz22 5PmwkyzQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1slYYn-00000001VIB-3b3D; Tue, 03 Sep 2024 18:47:25 +0000 Received: from out-183.mta0.migadu.com ([91.218.175.183]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1slYVH-00000001UOg-1KRc for linux-arm-kernel@lists.infradead.org; Tue, 03 Sep 2024 18:43:48 +0000 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1725389025; 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=lO6Qw3fND5cpAM7rycrrrnZxNspjCnlupd/fVRDk9Z4=; b=AbGCJCJ508jUBRJ/mh9JRd8STPK8QfLfeMtrJJkPRmvRqVaB3yPQaRjpU6JCPlVk5piNGn +x0IxqW0VX6k/trXotrH09A4gejbumgjDHS9IGzQXVppm1S9t9iLpcSykRvANT7VeDLTSu SpfQTC04ToqwgDMR39W3uxS3JHsvTPw= From: Sean Anderson To: Radhey Shyam Pandey , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: Michal Simek , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Sean Anderson Subject: [PATCH 3/3] net: xilinx: axienet: Relax partial rx checksum checks Date: Tue, 3 Sep 2024 14:43:34 -0400 Message-Id: <20240903184334.4150843-4-sean.anderson@linux.dev> In-Reply-To: <20240903184334.4150843-1-sean.anderson@linux.dev> References: <20240903184334.4150843-1-sean.anderson@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240903_114347_551647_D639A29C X-CRM114-Status: GOOD ( 11.09 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The partial rx checksum feature computes a checksum over the entire packet, regardless of the L3 protocol. Remove the check for IPv4. Additionally, packets under 64 bytes should have been dropped by the MAC, so we can remove the length check as well. Signed-off-by: Sean Anderson Reviewed-by: Simon Horman --- drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c index 74fade5a95c2..99d08a775520 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c @@ -1188,9 +1188,7 @@ static int axienet_rx_poll(struct napi_struct *napi, int budget) csumstatus == XAE_IP_UDP_CSUM_VALIDATED) { skb->ip_summed = CHECKSUM_UNNECESSARY; } - } else if ((lp->features & XAE_FEATURE_PARTIAL_RX_CSUM) != 0 && - skb->protocol == htons(ETH_P_IP) && - skb->len > 64) { + } else if (lp->features & XAE_FEATURE_PARTIAL_RX_CSUM) { skb->csum = be32_to_cpu(cur_p->app3 & 0xFFFF); skb->ip_summed = CHECKSUM_COMPLETE; }