From patchwork Mon Sep 30 16:08:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Barker X-Patchwork-Id: 13816653 X-Patchwork-Delegate: kuba@kernel.org Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8D82C192D71; Mon, 30 Sep 2024 16:09:36 +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=1727712578; cv=none; b=Aw08/a6iZ+bRBfjaXEEwk9VguFNKHaqjUeYV45Ji2bOt/E5AfmrJvD/QLP3MxLi6+Ga48QKaq5aUmk8EY66S7qHU6h1EfuHHqyD1/AvvBVlF5ZgnPP4cm0Z6Ipk5+xRIsW5yVORWSodgiBG7JJRhoZpzFP/ZQPbVba1tNcY3luY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727712578; c=relaxed/simple; bh=GAkTF+MVXTsBDvyOAjsGLZIHTuFjLwJ1GRQYar1BjnM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=fv8Sq2Q+aOqjedYjxUS8Y0O5aN3gG23f7ChyPZFTie2km/UnUVUHFRMypaornir9X6oAp/l0M4YWcJTZ4ZzxkzZqqhMYAyNjavv7KFkVK1F2p2NnhEBsZSOoCyG8PUWp3z3pDRsjredZ1XjhCMMQSq3NWiMJkUrDhC9EK0cbz2Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pbarker.dev; spf=fail smtp.mailfrom=pbarker.dev; arc=none smtp.client-ip=210.160.252.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pbarker.dev Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=pbarker.dev X-IronPort-AV: E=Sophos;i="6.11,166,1725289200"; d="scan'208";a="224347962" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 01 Oct 2024 01:09:35 +0900 Received: from GBR-5CG2373LKG.adwin.renesas.com (unknown [10.226.93.43]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 586474015141; Tue, 1 Oct 2024 01:09:31 +0900 (JST) From: Paul Barker To: Sergey Shtylyov , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Paul Barker , Geert Uytterhoeven , =?utf-8?q?Niklas_S=C3=B6derlu?= =?utf-8?q?nd?= , Biju Das , Claudiu Beznea , netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [net-next PATCH 07/11] net: ravb: Simplify UDP TX checksum offload Date: Mon, 30 Sep 2024 17:08:41 +0100 Message-Id: <20240930160845.8520-8-paul@pbarker.dev> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240930160845.8520-1-paul@pbarker.dev> References: <20240930160845.8520-1-paul@pbarker.dev> 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 From: Paul Barker The GbEth IP will pass through a null UDP checksum without asserting any error flags so we do not need to resort to software checksum calculation in this case. Signed-off-by: Paul Barker Reviewed-by: Sergey Shtylyov --- drivers/net/ethernet/renesas/ravb_main.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c index 9350ca10ab22..ae0268f2eb04 100644 --- a/drivers/net/ethernet/renesas/ravb_main.c +++ b/drivers/net/ethernet/renesas/ravb_main.c @@ -2075,20 +2075,12 @@ static bool ravb_can_tx_csum_gbeth(struct sk_buff *skb) switch (ip->protocol) { case IPPROTO_TCP: - break; case IPPROTO_UDP: - /* If the checksum value in the UDP header field is 0, TOE does - * not calculate checksum for UDP part of this frame as it is - * optional function as per standards. - */ - if (udp_hdr(skb)->check == 0) - return false; - break; + return true; + default: return false; } - - return true; } /* Packet transmit function for Ethernet AVB */