From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 D6E4B17AD4 for ; Tue, 30 May 2023 14:57:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4E902C43446; Tue, 30 May 2023 14:57:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685458675; bh=73+UDU+unOjvtv62nEMnbe11+qS0aLNpOC7OKJDByuk=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=cUGo0sfQWnh++vJoqXTZWMmbnJ1ViMjHatQWO4giG+0BgEcGgIdGb5GjuTg/aazxA ZioZGQXhHqm2+AVckkghW823303qX8kiZLDx68R/WsbJOGUbj/77kl5QBxQeYs1loU FFjfHb9HfRwKElc8XcApE1V7eBJslWNq0LLyR/OUGqfc2lWht77tU2FoBmpNJbx2Vw //VP0Yn9nvd9NoTNVIRU+tzj2XujJNfiXzCRdBNWxBk+a0ctYAXyZn/ku9JptwkKU5 TpBWuPfQkHPmrtuV9s8+U0yjqXGC9IRs1SqLm29wJj5aHbBjHl7WUVWW4rZKEbTYC8 RVHzRYjTFzQsw== Message-ID: Date: Tue, 30 May 2023 08:57:54 -0600 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH net-next 1/4] nexthop: Factor out hash threshold fdb nexthop selection Content-Language: en-US To: Benjamin Poirier , netdev@vger.kernel.org Cc: Shuah Khan , linux-kselftest@vger.kernel.org, Ido Schimmel References: <20230529201914.69828-1-bpoirier@nvidia.com> <20230529201914.69828-2-bpoirier@nvidia.com> From: David Ahern In-Reply-To: <20230529201914.69828-2-bpoirier@nvidia.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 5/29/23 2:19 PM, Benjamin Poirier wrote: > diff --git a/net/ipv4/nexthop.c b/net/ipv4/nexthop.c > index f95142e56da0..27089dea0ed0 100644 > --- a/net/ipv4/nexthop.c > +++ b/net/ipv4/nexthop.c > @@ -1152,11 +1152,31 @@ static bool ipv4_good_nh(const struct fib_nh *nh) > return !!(state & NUD_VALID); > } > > +static struct nexthop *nexthop_select_path_fdb(struct nh_group *nhg, int hash) > +{ > + int i; > + > + for (i = 0; i < nhg->num_nh; i++) { > + struct nh_grp_entry *nhge = &nhg->nh_entries[i]; > + > + if (hash > atomic_read(&nhge->hthr.upper_bound)) > + continue; > + > + return nhge->nh; > + } > + > + WARN_ON_ONCE(1); I do not see how the stack is going to provide useful information; it should always be vxlan_xmit ... nexthop_select_path_fdb, right? besides that: Reviewed-by: David Ahern