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 D991E6129 for ; Fri, 28 Jul 2023 15:27:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2DB97C433C7; Fri, 28 Jul 2023 15:27:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690558066; bh=9LkBbOWfi2nD4GJyI2flr4Qveciot93p1s7jpyvwppg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=dg6xhrm4iLhHfCsQeZVanDK4N7GzPhvZfv50NWjD5M1L91FXzKJb9Lg1iiJs5Ia/4 NpUeS7h8xLDrV1bjVVwJC4fAyF1CCtkSLUFetHG18sTacDY1ujXAvDkkJBgT6V3oTD Dd+0rzBAtU+pn8pGwHxmNngWX9zgIXoFeVIw0kcCI2gGjRsB295njTiee377XMT+We 64KGWj75xwcwBaQ3IyBRdS2EhLdxsYGWd00D9EtN8PYTp7E1C+r2MMrWManF5GEhF8 BushOxECWbXIrow0hyEAjkAIFDwBWfec9PLLnY2aF7vYHrjOA5aTuIWGHlDe3ti+PR qNgQCYPrMcLKA== Date: Fri, 28 Jul 2023 08:27:45 -0700 From: Jakub Kicinski To: Leon Romanovsky Cc: davem@davemloft.net, netdev@vger.kernel.org, edumazet@google.com, pabeni@redhat.com, sd@queasysnail.net Subject: Re: [PATCH net-next v2 1/2] net: store netdevs in an xarray Message-ID: <20230728082745.5869bc97@kernel.org> In-Reply-To: <20230728045304.GC2652767@unreal> References: <20230726185530.2247698-1-kuba@kernel.org> <20230726185530.2247698-2-kuba@kernel.org> <20230727130824.GA2652767@unreal> <20230727084519.7ec951dd@kernel.org> <20230728045304.GC2652767@unreal> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Fri, 28 Jul 2023 07:53:04 +0300 Leon Romanovsky wrote: > > I'm feeding xa_alloc_cyclic() xa_limit_31b, which should take care > > of that, no? > > And what about xa_insert() call? Is it safe? I think so, as in - the previous code doesn't have any checks either, so it'd insert the negative ifindex into the hash table. Hopefully nobody assigns negative values to dev->ifindex, that'd be a bug in itself, I reckon.