From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTP id 9D6365A026A for ; Fri, 25 Nov 2022 02:48:10 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669340889; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2qKAjtm17Hx5wYTWHcp/JRKccKAEsl7J1HexiddoRnY=; b=QGSSwQU70MVhejH+P1EyYo91n+0rruq8D8KQYMGHh68kpMHr9bEZ6+okEilcH68iyNfgUC dlAGd4+ONRzv6DGhPONqeq49sgoHUipSBBOJxsTOIS5vMGojcZQIT/CnXRTFJXCnR2hSPo 2itVq3mxTAK5/iNTn3FEs+GRLCRqYuI= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-606-096y4C3lPwuelXKhbyUNQA-1; Thu, 24 Nov 2022 20:48:08 -0500 X-MC-Unique: 096y4C3lPwuelXKhbyUNQA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 275EC1C05ABA; Fri, 25 Nov 2022 01:48:08 +0000 (UTC) Received: from maya.cloud.tilaa.com (ovpn-208-30.brq.redhat.com [10.40.208.30]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E13922166B26; Fri, 25 Nov 2022 01:48:07 +0000 (UTC) Date: Fri, 25 Nov 2022 02:48:05 +0100 From: Stefano Brivio To: David Gibson Subject: Re: [PATCH v2 09/16] udp: Don't explicitly track originating socket for spliced "connections" Message-ID: <20221125024805.3c95793d@elisabeth> In-Reply-To: <20221124011659.1024901-10-david@gibson.dropbear.id.au> References: <20221124011659.1024901-1-david@gibson.dropbear.id.au> <20221124011659.1024901-10-david@gibson.dropbear.id.au> Organization: Red Hat MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: 5OWDBEJM365PL3RXRHNAYI3V4HYMC3FL X-Message-ID-Hash: 5OWDBEJM365PL3RXRHNAYI3V4HYMC3FL X-MailFrom: sbrivio@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: passt-dev@passt.top X-Mailman-Version: 3.3.3 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Nit: On Thu, 24 Nov 2022 12:16:52 +1100 David Gibson wrote: > When we look up udp_splice_to_ns[][].orig_sock in udp_sock_handler_splice() > we're finding the socket on which the originating packet for the > "connection" was received on. However, we don't specifically need this > socket to be the originating one - we just need one that's bound to the > the source port of this reply packet in the init namespace. We can look > this up in udp_splice_to_init[v6][src].target_sock, whose defining > characteristic is exactly that. The same applies with init and ns swapped. > > In practice, of course, the port we locate this way will always be the > originating port, since we couldn't have started this "connection" if it > wasn't. > > Change this, and we no longer need the @orig_sock field at all. That leaves just @target_sock which we rename to simply @sock. The Long line here. -- Stefano