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 B95534A2D; Thu, 18 Sep 2025 19:06:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758222412; cv=none; b=in4RK4Kmt67soCWr9af6wnKu9D1wkxDNGmHmbF6Y+y8cc1/It5VRl1U8QlhyWLKoQshIUtsPhIAwmwy24hniIGVEc/TJO/g3ZRaTQf/5oe+nqcF/YLMRv/m+Vs8rqjytsYSkMrErEPztF6jHj8mVcfZ24XhZhBPL3WuXG6hii6o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758222412; c=relaxed/simple; bh=kNq2BBV7RX/0piN88LUKeCXvz59XV/A1jAaDcvjFWys=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=L3s62uLxvihvcDBkmk9B6IGbW8h9sOIdmjis9at+Ni3m8e0loCw44eipkWgkZceIWEWA360ideUGBvM9/KcmmbAgZQHeICAgMEPqq4MoEGFbOKhOBJAmA597zVitxAiJQP3QY0DV05iJ51xKgHvhj5woBZmYFmgSKcVUOi7DE58= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=O9WnJ5fk; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="O9WnJ5fk" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C1D31C4CEE7; Thu, 18 Sep 2025 19:06:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1758222412; bh=kNq2BBV7RX/0piN88LUKeCXvz59XV/A1jAaDcvjFWys=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=O9WnJ5fkhNYH3JTptjLK9oyXJgL9XM4u3NQMviefKGT0ACqwsosPKXEr6XR2CNFYv alm73Mmqcpnv5YJ1LormxgrLP745lglkCDYTggX+MFKOTCNfDdMJaNCuTIQpqHHZXI TmUyQ5vs9yK+tFXJ19BJtGFr0z5ws1a29MQYNOm6swKdGkTnzXIPCJ5gex95Ke3W4V loB+RN2zpZKVlhvd+rlFJfUQusiCQPeQAvo40hojXOyjMUAfncC8p1SpW5MhXdq/bK 9TC8sHa/15nJ5ZZ00ksmEg/5FFMe4X0bdsDieCZ7RW+ZYaGjY2b/BrnahBe9kjYAJ1 Jlth69CRQ/M6A== Date: Thu, 18 Sep 2025 20:06:47 +0100 From: Simon Horman To: Bhargava Chenna Marreddy Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, andrew+netdev@lunn.ch, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, michael.chan@broadcom.com, pavan.chebbi@broadcom.com, vsrama-krishna.nemani@broadcom.com, vikas.gupta@broadcom.com, Rajashekar Hudumula Subject: Re: [v7, net-next 08/10] bng_en: Register rings with the firmware Message-ID: <20250918190647.GB589538@horms.kernel.org> References: <20250911193505.24068-1-bhargava.marreddy@broadcom.com> <20250911193505.24068-9-bhargava.marreddy@broadcom.com> <20250916155130.GK224143@horms.kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Thu, Sep 18, 2025 at 04:11:12PM +0530, Bhargava Chenna Marreddy wrote: > On Tue, Sep 16, 2025 at 9:21 PM Simon Horman wrote: > > > > On Fri, Sep 12, 2025 at 01:05:03AM +0530, Bhargava Marreddy wrote: > > > Enable ring functionality by registering RX, AGG, TX, CMPL, and > > > NQ rings with the firmware. Initialise the doorbells associated > > > with the rings. > > > > > > Signed-off-by: Bhargava Marreddy > > > Reviewed-by: Vikas Gupta > > > Reviewed-by: Rajashekar Hudumula > > > > ... > > > > > diff --git a/drivers/net/ethernet/broadcom/bnge/bnge_db.h b/drivers/net/ethernet/broadcom/bnge/bnge_db.h > > > new file mode 100644 > > > index 00000000000..950ed582f1d > > > --- /dev/null > > > +++ b/drivers/net/ethernet/broadcom/bnge/bnge_db.h > > > @@ -0,0 +1,34 @@ > > > +/* SPDX-License-Identifier: GPL-2.0 */ > > > +/* Copyright (c) 2025 Broadcom */ > > > + > > > +#ifndef _BNGE_DB_H_ > > > +#define _BNGE_DB_H_ > > > + > > > +/* 64-bit doorbell */ > > > +#define DBR_EPOCH_SFT 24 > > > +#define DBR_TOGGLE_SFT 25 > > > +#define DBR_XID_SFT 32 > > > +#define DBR_PATH_L2 (0x1ULL << 56) > > > +#define DBR_VALID (0x1ULL << 58) > > > +#define DBR_TYPE_SQ (0x0ULL << 60) > > > +#define DBR_TYPE_SRQ (0x2ULL << 60) > > > +#define DBR_TYPE_CQ (0x4ULL << 60) > > > +#define DBR_TYPE_CQ_ARMALL (0x6ULL << 60) > > > +#define DBR_TYPE_NQ (0xaULL << 60) > > > +#define DBR_TYPE_NQ_ARM (0xbULL << 60) > > > +#define DBR_TYPE_NQ_MASK (0xeULL << 60) > > > > Perhaps BIT_ULL() and GENMASK_ULL() can be used here? > > Thanks for the suggestion, Simon. Some macros have non-contiguous > bits, requiring combinations with "|", > which would make the definitions longer and harder to follow. Since > these Doorbell Register (DBR) values > are hardware-specified, I believe it's better to keep them as they > are. Please let me know if you see any issues. Thanks, understood. If you prefer the current approach, that is fine by me.