From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 923E03793AD for ; Fri, 3 Jul 2026 09:47:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783072064; cv=none; b=g790L71n+s0mDaiLWMG+WOYP2DmmXQ88naRI9XvxPTOl59xqRnBxBGGg2pod4EB1FcG4dQPT9fqAt3ZJ7R92KCSBTu8Vd7kIYiCOTEuYSf7o48sNjXt4zDiLcoZqcGxl4Mm/o/X8n/3boDzURlDYkdgP1xrnoM+b3F4Gge3H54I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783072064; c=relaxed/simple; bh=lNI0jkzgU10bEMmAwWSpjMSI1ZyKMy71h/uww2cMwc4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZWhPrPioNHlFR7gyQ9tmD8YWcvOJLO5MP2hEt7malnqzklrUhn+oAUs11JyaUL2uH3cgRm50uM2uzrShla41NhkEd8CP/AKES8QKkJPUHQO7/eCuKpyLp4xe2/rVDkNX6LG19HSocD861DIhdTT4Sr1KJaepR0cZcSZXUXz0p/Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=JZViriTK; arc=none smtp.client-ip=209.85.214.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="JZViriTK" Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-2ca11143dbbso3060905ad.2 for ; Fri, 03 Jul 2026 02:47:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783072063; x=1783676863; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=PQfDcSW0vZstOnFMmpjYEhp/0jcqHENe0+2Wtgs9t1Y=; b=JZViriTKHE1KkgjJW7DY2XhwMtvtUJ9d/n9T8ng+4VsLf13YExnLlij+cLBBMdvfFR AHCThILIrQR065C9+yvs6DyklerssSF0WUBN2K7u2vXKJp6CFxn/znP0QpJpCaRC8QIm 92eYo1FguPKuqlgn1vEgbibsV5I1BYzdnxI0kD+PRKPapKfQo0Mov/OfuKrvgC+KkFfe Bb4Uv6fwbjzkZBCbWWmTBuhpopeL9m3lBhH4OLyaIKO8Y2BDhQ9BCmxxW4V8MbZ1cKIz fkN6IDCxYbsHefAYD1kOnTTly2JQ5EQeillVknGe+Uc6kj1HR7SKWG6JBN7cOj6CnEe/ RsAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783072063; x=1783676863; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=PQfDcSW0vZstOnFMmpjYEhp/0jcqHENe0+2Wtgs9t1Y=; b=feWFOin3Tw+9YS1caynTJfiV4YEoK0bK3sIELiKuWWcHtc6XKyUlZR4APDrBIRbWkb WdRcvXPSUfoQiHUtXZN+4CMENXvI1j/K7v81aGEHHhqDtR2+Cj1NVG4UOdHPVL3HRCSV xPyIBUTmiNmuRaSDeRCZJH2lRftr3bAAocR5sc1E2UIY6JxLtJHmwq348aLTM+mEnIjO IYTfb+hRSNXUDz4E7nD1jWoPy8aHFNoWk2bbmSkh4APQUf5Xy0Y0iMl81jkrtcLVNF+6 l+1ik/pIrCNG36KhoUiBpyrYJC5EPZJJzMTfE7I0o6FmhE1qpiIezljYnSxx1fJAtnyV x4Gg== X-Forwarded-Encrypted: i=1; AFNElJ9DSeo1/THT7PyMEjbZB7vQ4TdjLmvdlUXfp20p744onpL8nCmejlkBjOXPVaJ8ntLaxXN4pXS1YInQJ6w=@vger.kernel.org X-Gm-Message-State: AOJu0YyEXJxAYoyMLIQfR6m3HTMJ/vwweZf4Q0P1mnZ4eLCM92A0vTi7 fzD469XPqHsb0wHxFNvkE05EGUyez3bQFdo1d6MMeQax8nXv6QdxDBol X-Gm-Gg: AfdE7cmTnEyw/lZdPEvnGG4jtNfYr5iZ/+wXTEhUOl1II5v4BdyoroduuzxOa4y9z5N mga2tmIbN5GNaMY+fIzdjMB6cfbYemMIUZUpBEGE29stZJLbGUx6xntrUjJhH8BiYcqmay49uSM m4y+QXHZ92Ay6Rejwlxy+BKFmka2adY1t57hJDAArkzHbxlijKbzV10XdScqnwKUN8es0lYWXHr 9px+pH2KlgPlt2IiMnbBtDOWl47OctL8rKjce6Rq0fnQ04L8DD83cYhRXHcoMI8E7zRPG2Ucczq ahf1ucDPwy4410i7cBSFbvP6y0A/ELLa38Uxm7l74G706HZMDuXyPubovBZBh3fleaQRJonWAhq loBycx+est8gOLKR17KhdN2O0uQbVCZhCyAo9Kv4qM9wv0DwXEwFGPnoEMpnkIQiJMsLpoYs2j9 YKkNjyodkEPFO4e1qB X-Received: by 2002:a17:902:ebca:b0:2c8:1f56:9fc5 with SMTP id d9443c01a7336-2ca7e8faf17mr115363295ad.35.1783072062755; Fri, 03 Jul 2026 02:47:42 -0700 (PDT) Received: from amd.com ([165.204.156.251]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-13b3ececfe4sm19586606c88.8.2026.07.03.02.47.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jul 2026 02:47:42 -0700 (PDT) From: Paritosh Potukuchi X-Google-Original-From: Paritosh Potukuchi To: kuniyu@google.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kuba@kernel.org, edumazet@google.com, andrew+netdev@lunn.ch, jv@jvosburgh.net, davem@davemloft.net, pabeni@redhat.com, paritosh.potukuchi@amd.com Subject: Re: [PATCH v2 2/2] bonding: reuse neigh_setup from slave neigh_parms Date: Fri, 3 Jul 2026 09:47:35 +0000 Message-ID: <20260703094735.678916-1-paritosh.potukuchi@amd.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260703064109.1836070-1-kuniyu@google.com> References: <20260703064109.1836070-1-kuniyu@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Hi Kuniyuki, >This introduces O(n) list traversal while it can be done >with fixed costs (3 dereferences + 1 call). >Since neigh_table is global (arp_tbl or nd_tbl), the O(n) >list traversal could take longer and rather de-optimise. Yes, that is true. One reason why I chose to do that is because ndo_neigh_setup is a function primarily meant to setup the neigh_parms structure, when neigh_parms does not exist. On the other hand, lookup_neigh_parms is meant to search for a near-complete neigh_parms structure, that is already associated with a netdev. Even if we want to use ndo_neigh_setup, since it takes less time, I would suggest using it as a fallback to not finding an already existing parms, setup. Moreover, time complexity might not be an issue in this path since, this is rarely used aggresively. One issue with ndo_neigh_setup in bond-like devices is that, to get the underlying netdevs neigh_setup function, it expects us to pass a dummy neigh_parms structure that has been zeroed out. This seems to be fragile as suggested in a TODO in bond_neigh_init(). Generally its main goal is to fill the parms.neigh_setup field. Can we populate a few more fields in the zeroed- out parms structure, before passing to the driver in ndo_neigh_setup? That seems to be a much safer approach. Regards, Paritosh