From patchwork Tue Jan 23 15:19:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 13527587 Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B9351604A2; Tue, 23 Jan 2024 15:19:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.160.252.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706023175; cv=none; b=pfiwr6HBElK7k544B8siFgPTKgR7RmM9AmGC3t6qkI+5XkipJ4lSyg6P17QRuYxpFCJhMClwll2eRDNDmx15OQjI7Phe96zFxi6GrYmwgWRa7iEKjE/nXaQCb9aejZvhlPH9tSnDqBASSo+vKEC2MiHhrMh3p1GF4fYoCxAx8Rg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706023175; c=relaxed/simple; bh=+yJL9KDj0aMIFbT4y6ud2q83ukmRwjDWwnHtE9ShxMY=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Content-Type; b=JT2Cved2s1Z1h28lzSD1k1hSBO8734gEEe4KgvgAl7xUUpNWyaunkhvw1J0HS6eNizXEb15QbsQ2lvWKRjHE5C/LVWS7AMofmdE5WdHWhJOEntshJvt5BCOo63KI+mynKTAxetCx4TqdjqgRRYQwuzicS9ZMjoteYF3P5ewRt6s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=bp.renesas.com; spf=pass smtp.mailfrom=bp.renesas.com; arc=none smtp.client-ip=210.160.252.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=bp.renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bp.renesas.com X-IronPort-AV: E=Sophos;i="6.05,214,1701097200"; d="scan'208";a="195354997" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 24 Jan 2024 00:19:31 +0900 Received: from localhost.localdomain (unknown [10.226.93.36]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id ECB4E400CEED; Wed, 24 Jan 2024 00:19:26 +0900 (JST) From: Biju Das To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Biju Das , Sergey Shtylyov , Claudiu Beznea , Yoshihiro Shimoda , Wolfram Sang , Nikita Yushchenko , netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Geert Uytterhoeven , Prabhakar Mahadev Lad , Biju Das Subject: [PATCH net-next 0/2] Add HW check sum of load for RZ/G2L GbEthernet IP Date: Tue, 23 Jan 2024 15:19:22 +0000 Message-Id: <20240123151924.373917-1-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org TOE has hw support for calculating IP header and TCP/UDP/ICMP checksum for both IPV4 and IPV6. Add Tx/Rx checksum offload supported by TOE for IPV4 and TCP/UDP protocols. For Rx, the result of checksum calculation is attached to last 4byte of ethernet frames. First 2bytes is result of IPV4 header checksum and next 2 bytes is TCP/UDP/ICMP. If frame does not have error "0000" attached to checksum calculation result. For unsupported frames "ffff" is attached to checksum calculation result. Cases like IPV6, IPV4 header is always set to "FFFF". For Tx, the result of checksum calculation is set to the checksum field of each IPv4 Header/TCP/UDP/ICMP of ethernet frames. For the unsupported frames, those fields are not changed. If a transmission frame is an UDP frame of IPv4 and its checksum value in the UDP header field is H’0000, TOE does not calculate checksum for UDP part of this frame as it is optional function as per standards. UDP(Tx/Rx) results With check Enabled: 909/946 UDP(Tx/Rx) results With check Disabled: 903/907 TCP(Tx/Rx) results With check Enabled: 922/928 TCP(Tx/Rx) results With check Disabled: 882/629 Note: This patches are tested with reverting commit b3edde44e5d4 ("cpufreq/schedutil: Use a fixed reference frequency") as it impacts network performance. Biju Das (2): ravb: Add Rx checksum offload support ravb: Add Tx checksum offload support drivers/net/ethernet/renesas/ravb.h | 35 ++++++ drivers/net/ethernet/renesas/ravb_main.c | 137 ++++++++++++++++++++++- 2 files changed, 170 insertions(+), 2 deletions(-)