From patchwork Fri Mar 1 16:37:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 208919 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:fa17:b0:10a:f01:a869 with SMTP id ju23csp968dyc; Fri, 1 Mar 2024 08:40:22 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXU6ugssSIraG5ABKtkJMiNOmvfXLkRwKzlG9iPH2pGqKMF08kTOUEe5oeoVByQEW/nhhnfKipvzFS0JvItB04WAo6nFQ== X-Google-Smtp-Source: AGHT+IFNVgk3f/Yj71QjSYCDnJjcaYd5Id2Eqr4BJqLIkZ/D8KtfDKW/LAEex88IV00ocWi6CghA X-Received: by 2002:a05:620a:ce7:b0:787:a5fe:9d82 with SMTP id c7-20020a05620a0ce700b00787a5fe9d82mr1928996qkj.17.1709311221687; Fri, 01 Mar 2024 08:40:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709311221; cv=pass; d=google.com; s=arc-20160816; b=D3O61lrjS1B8lMX5+uQlQ+hWp/22AiTYo5Buz2uWhfUKOPvO10rmZyNdFRQhpwNcb5 f3AByHjO/RG1oRlgy+lEW+zjh6fbwhA6oiqj5W4L/EZ6ud2zr5PvkVoOrRhYxR3lNDvu u8yLtfg6Va/DUrEo6h0enN0knfNXrmR4+9JME/8oe/ahL/bAIqalFpr73c0aVWWxjuQZ WHLZ52njbHaz6/O4Fmo9gy2p97NbfJdl05xmCWCvcmzkLorcGnne5DgjtPD2nJdEtQU8 W417fx0d34JHJbU5JN9yPp4bNWZq6fCBctzvVvcnEQUy+S34WyAtgHQ857K9kYh1ojpo 15Vw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=cMQOrfq9a6ADqnlPZTTmLOdel6QUSyVccUmRoxVrLQY=; fh=icnuzcdbhXgwjK0pgvJXK7xplE+Och0jvyZv2PxZJ18=; b=PFsjvnWDs8Ic4YgYRHSkR95vANJgJl/bKdGcc4DSawvNdTzrXZS9SnnNCjYNQYurwt i0XtZp1QP85eetiqmFjj6sukriT9UMJRdEcS5qkWGr8Hr/BSXmOkbVZgei9zxsGLJLV/ 4a2yUjyG6ZQ6YNkq3T3f20S/gIf07eVn8E7BIYeBAIn6Zd1f23wVjjq4IorASWEmBUld G0mSp4OHg6zMg984qEEOiwmru52GKkF37FR7i5BJAMQFgelgqucp64BfyImteeEuOG3G As5Z0uBeOILMdK0VmZIRcqkF229gcA7qYHD2Tg7yASjkzCa4erDLERCtK/l8UxIBskxR 4YPQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Zg1UYOWp; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-88719-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-88719-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id c22-20020a05620a165600b0078723518d01si3781394qko.395.2024.03.01.08.40.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 08:40:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-88719-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Zg1UYOWp; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-88719-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-88719-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 58FC31C210A5 for ; Fri, 1 Mar 2024 16:40:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 733052744E; Fri, 1 Mar 2024 16:38:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Zg1UYOWp" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 5597846B3 for ; Fri, 1 Mar 2024 16:38:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709311105; cv=none; b=JQHjqjeNhBIcXMPjS5rKMjDjiUIk7LsKPH1YOf3jMymDAs7WLdgdPVZIS29CzLIL8/xzD31W7yyiKvWFGluWINyiL/WXSSzBlyTdnHT/iKF0osLFjZNzGU8U5w8s37/5JkiykodOBWDvYXlEpaIC+YCtbtG0Tpv+z96x85yQl5Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709311105; c=relaxed/simple; bh=YWox0hlkKOXJP+Kviv9g4eZURamiy3zXGc3RHcp1fE4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CJYY1IvoF26FgRDAwjD+nVSz88eqnyhKhDKpUCppnOtb2yWk6C3/qH4SlfeDym60OWKoPQS7B3X70wcb02/HzPcTfQAGJv09thp/YNZzQWlYubNteCAsLvf8if8tMFzuSyigPaqFDIOFGxEOv4J3GTw5G20pDnc6usom0Ag5mYY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Zg1UYOWp; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1709311101; 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=cMQOrfq9a6ADqnlPZTTmLOdel6QUSyVccUmRoxVrLQY=; b=Zg1UYOWpnZKVcuwEO0ZEhzyAt+PUFKN8ZOh6p12cWN9SCvbQLhcGhN9/tLUVeGqi2LGv5q fpqiR1ys1KlsCIkjDWZNm+HkFCh2Ga9X7Oryflr4qdircsUO9v0Up/f7/5MBiLcQwjdtEm T4rwDg9sVs0dO8q2WQMHwBzUNttcayw= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-586-FSuJS39xOtGxIZ7msT-Jqg-1; Fri, 01 Mar 2024 11:38:17 -0500 X-MC-Unique: FSuJS39xOtGxIZ7msT-Jqg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 30BD0859550; Fri, 1 Mar 2024 16:38:17 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.114]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0F81620229A4; Fri, 1 Mar 2024 16:38:15 +0000 (UTC) From: David Howells To: netdev@vger.kernel.org Cc: David Howells , Marc Dionne , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-afs@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 03/21] rxrpc: Note cksum in txbuf Date: Fri, 1 Mar 2024 16:37:35 +0000 Message-ID: <20240301163807.385573-4-dhowells@redhat.com> In-Reply-To: <20240301163807.385573-1-dhowells@redhat.com> References: <20240301163807.385573-1-dhowells@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792342723287022456 X-GMAIL-MSGID: 1792342723287022456 Add a field to rxrpc_txbuf in which to store the checksum to go in the header as this may get overwritten in the wire header struct when transmitting as part of a jumbo packet. Signed-off-by: David Howells cc: Marc Dionne cc: "David S. Miller" cc: Eric Dumazet cc: Jakub Kicinski cc: Paolo Abeni cc: linux-afs@lists.infradead.org cc: netdev@vger.kernel.org --- net/rxrpc/ar-internal.h | 1 + net/rxrpc/output.c | 1 + net/rxrpc/rxkad.c | 2 +- net/rxrpc/txbuf.c | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/net/rxrpc/ar-internal.h b/net/rxrpc/ar-internal.h index 54d1dc97cb0f..c9a2882627aa 100644 --- a/net/rxrpc/ar-internal.h +++ b/net/rxrpc/ar-internal.h @@ -803,6 +803,7 @@ struct rxrpc_txbuf { unsigned int flags; #define RXRPC_TXBUF_WIRE_FLAGS 0xff /* The wire protocol flags */ #define RXRPC_TXBUF_RESENT 0x100 /* Set if has been resent */ + __be16 cksum; /* Checksum to go in header */ u8 /*enum rxrpc_propose_ack_trace*/ ack_why; /* If ack, why */ struct { /* The packet for encrypting and DMA'ing. We align it such diff --git a/net/rxrpc/output.c b/net/rxrpc/output.c index 8344ece5358a..828b145edc56 100644 --- a/net/rxrpc/output.c +++ b/net/rxrpc/output.c @@ -335,6 +335,7 @@ int rxrpc_send_data_packet(struct rxrpc_call *call, struct rxrpc_txbuf *txb) /* Each transmission of a Tx packet+ needs a new serial number */ txb->serial = rxrpc_get_next_serial(conn); txb->wire.serial = htonl(txb->serial); + txb->wire.cksum = txb->cksum; if (test_bit(RXRPC_CONN_PROBING_FOR_UPGRADE, &conn->flags) && txb->seq == 1) diff --git a/net/rxrpc/rxkad.c b/net/rxrpc/rxkad.c index 6b32d61d4cdc..28c9ce763be4 100644 --- a/net/rxrpc/rxkad.c +++ b/net/rxrpc/rxkad.c @@ -378,7 +378,7 @@ static int rxkad_secure_packet(struct rxrpc_call *call, struct rxrpc_txbuf *txb) y = (y >> 16) & 0xffff; if (y == 0) y = 1; /* zero checksums are not permitted */ - txb->wire.cksum = htons(y); + txb->cksum = htons(y); switch (call->conn->security_level) { case RXRPC_SECURITY_PLAIN: diff --git a/net/rxrpc/txbuf.c b/net/rxrpc/txbuf.c index 48d5a8f644e5..7273615afe94 100644 --- a/net/rxrpc/txbuf.c +++ b/net/rxrpc/txbuf.c @@ -35,6 +35,7 @@ struct rxrpc_txbuf *rxrpc_alloc_txbuf(struct rxrpc_call *call, u8 packet_type, txb->ack_why = 0; txb->seq = call->tx_prepared + 1; txb->serial = 0; + txb->cksum = 0; txb->wire.epoch = htonl(call->conn->proto.epoch); txb->wire.cid = htonl(call->cid); txb->wire.callNumber = htonl(call->call_id);