netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Saleem, Shiraz" <shiraz.saleem@intel.com>
To: Parav Pandit <parav@nvidia.com>,
	"Nguyen, Anthony L" <anthony.l.nguyen@intel.com>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"kuba@kernel.org" <kuba@kernel.org>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
	"Ismail, Mustafa" <mustafa.ismail@intel.com>,
	"Keller, Jacob E" <jacob.e.keller@intel.com>,
	Jiri Pirko <jiri@nvidia.com>,
	"Kaliszczuk, Leszek" <leszek.kaliszczuk@intel.com>
Subject: RE: [PATCH net-next 2/3] net/ice: Add support for enable_iwarp and enable_roce devlink param
Date: Wed, 24 Nov 2021 01:46:53 +0000	[thread overview]
Message-ID: <22a7a4292dcd4bc1a504637ff9732539@intel.com> (raw)
In-Reply-To: <PH0PR12MB54817F492455B2E32E00A932DC609@PH0PR12MB5481.namprd12.prod.outlook.com>

> Subject: RE: [PATCH net-next 2/3] net/ice: Add support for enable_iwarp and
> enable_roce devlink param
> 
> 
> 
> > From: Saleem, Shiraz <shiraz.saleem@intel.com>
> > Sent: Tuesday, November 23, 2021 8:18 PM
> >
> > > Subject: RE: [PATCH net-next 2/3] net/ice: Add support for
> > > enable_iwarp and enable_roce devlink param
> > >
> > > Hi Tony,
> > >
> > > > From: Tony Nguyen <anthony.l.nguyen@intel.com>
> > > > Sent: Tuesday, November 23, 2021 2:41 AM
> > > >
> > > > From: Shiraz Saleem <shiraz.saleem@intel.com>
> > > >
> > > > Allow support for 'enable_iwarp' and 'enable_roce' devlink params
> > > > to turn on/off iWARP or RoCE protocol support for E800 devices.
> > > >
> > > > For example, a user can turn on iWARP functionality with,
> > > >
> > > > devlink dev param set pci/0000:07:00.0 name enable_iwarp value
> > > > true cmode runtime
> > > >
> > > > This add an iWARP auxiliary rdma device, ice.iwarp.<>, under this PF.
> > > >
> > > > A user request to enable both iWARP and RoCE under the same PF is
> > > > rejected since this device does not support both protocols
> > > > simultaneously on the same port.
> > > >
> > > > Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
> > > > Tested-by: Leszek Kaliszczuk <leszek.kaliszczuk@intel.com>
> > > > Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
> > > > ---
> > > >  drivers/net/ethernet/intel/ice/ice.h         |   1 +
> > > >  drivers/net/ethernet/intel/ice/ice_devlink.c | 144 +++++++++++++++++++
> > > >  drivers/net/ethernet/intel/ice/ice_devlink.h |   6 +
> > > >  drivers/net/ethernet/intel/ice/ice_idc.c     |   4 +-
> > > >  drivers/net/ethernet/intel/ice/ice_main.c    |   9 +-
> > > >  include/linux/net/intel/iidc.h               |   7 +-
> > > >  6 files changed, 166 insertions(+), 5 deletions(-)
> > > >
> > > > diff --git a/drivers/net/ethernet/intel/ice/ice.h
> > > > b/drivers/net/ethernet/intel/ice/ice.h
> > > > index b2db39ee5f85..b67ad51cbcc9 100644
> > > > --- a/drivers/net/ethernet/intel/ice/ice.h
> > > > +++ b/drivers/net/ethernet/intel/ice/ice.h
> > > > @@ -576,6 +576,7 @@ struct ice_pf {
> > > >  	struct ice_hw_port_stats stats_prev;
> > > >  	struct ice_hw hw;
> > > >  	u8 stat_prev_loaded:1; /* has previous stats been loaded */
> > > > +	u8 rdma_mode;
> > > This can be u8 rdma_mode: 1;
> > > See below.
> > >
> > > >  	u16 dcbx_cap;
> > > >  	u32 tx_timeout_count;
> > > >  	unsigned long tx_timeout_last_recovery; diff --git
> > > > a/drivers/net/ethernet/intel/ice/ice_devlink.c
> > > > b/drivers/net/ethernet/intel/ice/ice_devlink.c
> > > > index b9bd9f9472f6..478412b28a76 100644
> > > > --- a/drivers/net/ethernet/intel/ice/ice_devlink.c
> > > > +++ b/drivers/net/ethernet/intel/ice/ice_devlink.c
> > > > @@ -430,6 +430,120 @@ static const struct devlink_ops
> > > > ice_devlink_ops =
> > {
> > > >  	.flash_update = ice_devlink_flash_update,  };
> > > >
> > > > +static int
> > > > +ice_devlink_enable_roce_get(struct devlink *devlink, u32 id,
> > > > +			    struct devlink_param_gset_ctx *ctx) {
> > > > +	struct ice_pf *pf = devlink_priv(devlink);
> > > > +
> > > > +	ctx->val.vbool = pf->rdma_mode & IIDC_RDMA_PROTOCOL_ROCEV2;
> > > > +
> > > This is logical operation, and vbool will be still zero when rdma
> > > mode is rocev2, because it is not bit 0.
> > > Please see below. This error can be avoided by having rdma mode as
> > Boolean.
> >
> > Hi Parav -
> >
> > rdma_mode is used as a bit-mask.
> > 0 = disabled, i.e. enable_iwarp and enable_roce set to false by user.
> > 1 = IIDC_RDMA_PROTOCOL_IWARP
> > 2 = IIDC_RDMA_PROTOCOL_ROCEV2
> >
> Yes, I got it. bit mask is ok.
> But this line,
> ctx->val.vbool = pf->rdma_mode & IIDC_RDMA_PROTOCOL_ROCEV2;
> should be
> ctx->val.vbool = !!(pf->rdma_mode & IIDC_RDMA_PROTOCOL_ROCEV2);
>  or
> ctx->val.vbool = pf->rdma_mode & IIDC_RDMA_PROTOCOL_ROCEV2 ? true :
> ctx->false;
> 
> because & IIDC_RDMA_PROTOCOL_ROCEV2 is BIT(1) = 0x2.
> 

Sure. I will send a fix.



  reply	other threads:[~2021-11-24  1:46 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-22 21:11 [PATCH net-next 0/3][pull request] 100GbE Intel Wired LAN Driver Updates 2021-11-22 Tony Nguyen
2021-11-22 21:11 ` [PATCH net-next 1/3] devlink: Add 'enable_iwarp' generic device param Tony Nguyen
2021-11-23  5:17   ` Parav Pandit
2021-11-22 21:11 ` [PATCH net-next 2/3] net/ice: Add support for enable_iwarp and enable_roce devlink param Tony Nguyen
2021-11-23  5:15   ` Parav Pandit
2021-11-23 14:47     ` Saleem, Shiraz
2021-11-23 16:55       ` Parav Pandit
2021-11-24  1:46         ` Saleem, Shiraz [this message]
2021-11-23  5:19   ` Parav Pandit
2021-11-22 21:11 ` [PATCH net-next 3/3] RDMA/irdma: Set protocol based on PF rdma_mode flag Tony Nguyen
2021-11-23 12:20 ` [PATCH net-next 0/3][pull request] 100GbE Intel Wired LAN Driver Updates 2021-11-22 patchwork-bot+netdevbpf
2021-11-23 12:31   ` Parav Pandit
2021-11-23 17:22   ` Jason Gunthorpe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=22a7a4292dcd4bc1a504637ff9732539@intel.com \
    --to=shiraz.saleem@intel.com \
    --cc=anthony.l.nguyen@intel.com \
    --cc=davem@davemloft.net \
    --cc=jacob.e.keller@intel.com \
    --cc=jiri@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=leszek.kaliszczuk@intel.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=mustafa.ismail@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=parav@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).