Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (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 1719B191 for ; Tue, 8 Aug 2023 00:33:47 +0000 (UTC) Received: from out-102.mta1.migadu.com (out-102.mta1.migadu.com [IPv6:2001:41d0:203:375::66]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E0361703 for ; Mon, 7 Aug 2023 17:33:46 -0700 (PDT) Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1691454824; 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=CRuYBmnLzSABJKYlhGN/Af89iV4teHhB9p+KEYcIn90=; b=p6yhagCRuAbXBmCyK9WcrPwOPq3abMfhVz2hWDXJxHEUO+JZQZzmhDECzJzDUrgE2m0q7f 7nkMWF20SqKdmD2InecHcGdhMmEEiFesk06U/O8B4ngFFvL4XrY7HhxxLRXkVsHYoelHrF EuSjy2TSKjuPHmfLU2nPxSbjKRwg7t8= Date: Mon, 7 Aug 2023 17:33:37 -0700 Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH bpf-next] selftests/bpf: remove duplicated functions Content-Language: en-US To: thinker.li@gmail.com Cc: sinquersw@gmail.com, kuifeng@meta.com, ast@kernel.org, song@kernel.org, kernel-team@meta.com, andrii@kernel.org, bpf@vger.kernel.org References: <20230807193840.567962-1-thinker.li@gmail.com> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Martin KaFai Lau In-Reply-To: <20230807193840.567962-1-thinker.li@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net On 8/7/23 12:38 PM, thinker.li@gmail.com wrote: > From: Kui-Feng Lee > > The file cgroup_tcp_skb.c contains redundant implementations of the similar > functions (create_server_sock_v6() and connect_client_server_v6()) found in > network_helpers.c. Let's eliminate these duplicated functions. How about the port function mentioned in https://lore.kernel.org/bpf/c2776380-7550-3777-24a0-1f155785696c@linux.dev/ : >> There is get_socket_local_port() that supports both v4 and v6 in >> network_helpers.c which is equivalent to the get_sock_port_v6() here.