From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E99CEEB64DD for ; Mon, 24 Jul 2023 23:02:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230099AbjGXXCT (ORCPT ); Mon, 24 Jul 2023 19:02:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230060AbjGXXCS (ORCPT ); Mon, 24 Jul 2023 19:02:18 -0400 Received: from out-36.mta1.migadu.com (out-36.mta1.migadu.com [IPv6:2001:41d0:203:375::24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82FFD10FA for ; Mon, 24 Jul 2023 16:02:17 -0700 (PDT) Message-ID: <4c524936-989b-f679-d9ec-cf374c849c6f@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1690239359; 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=H6YN2MhKnObTVNJlwXZBDVh2nU9Nss9o5bGaetiiYLk=; b=OCUfQwf35fGkg4l3oybIH0OevuT0Zex7S9aARt7wwkSawx/N3p+55TqfELamAc59XkvMjd d7IpN68fWVMFNKZi6ikR2rcdDcsxH8tPMrEqc0sDib+tNM+8LPPKLQfT+bVf5ujtSCOD0Y kqnZnwP9B6xmC1zwwimS+v7HKW0BxFw= Date: Mon, 24 Jul 2023 15:55:49 -0700 MIME-Version: 1.0 Subject: Re: [PATCH bpf-next v6 4/8] net: remove duplicate reuseport_lookup functions Content-Language: en-US To: Lorenz Bauer Cc: Hemanth Malla , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , David Ahern , Willem de Bruijn , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Joe Stringer , Mykola Lysenko , Shuah Khan , Kuniyuki Iwashima References: <20230720-so-reuseport-v6-0-7021b683cdae@isovalent.com> <20230720-so-reuseport-v6-4-7021b683cdae@isovalent.com> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Martin KaFai Lau In-Reply-To: <20230720-so-reuseport-v6-4-7021b683cdae@isovalent.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org On 7/20/23 8:30 AM, Lorenz Bauer wrote: > @@ -452,7 +436,14 @@ static struct sock *udp4_lib_lookup2(struct net *net, > daddr, hnum, dif, sdif); > if (score > badness) { > badness = score; > - result = lookup_reuseport(net, sk, skb, saddr, sport, daddr, hnum); > + > + if (sk->sk_state == TCP_ESTABLISHED) { > + result = sk; > + continue; > + } Thanks for the cleanup. I also found moving the TCP_ESTABLISHED check here made the score logic easier to reason.