lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191217210033.GB17227@ziepe.ca>
Date:   Tue, 17 Dec 2019 17:00:33 -0400
From:   Jason Gunthorpe <jgg@...pe.ca>
To:     "Saleem, Shiraz" <shiraz.saleem@...el.com>
Cc:     "Kirsher, Jeffrey T" <jeffrey.t.kirsher@...el.com>,
        "davem@...emloft.net" <davem@...emloft.net>,
        "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
        "Ismail, Mustafa" <mustafa.ismail@...el.com>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "linux-rdma@...r.kernel.org" <linux-rdma@...r.kernel.org>,
        "nhorman@...hat.com" <nhorman@...hat.com>,
        "sassmann@...hat.com" <sassmann@...hat.com>,
        "parav@...lanox.com" <parav@...lanox.com>
Subject: Re: [PATCH v3 05/20] RDMA/irdma: Add driver framework definitions

On Thu, Dec 12, 2019 at 01:40:27AM +0000, Saleem, Shiraz wrote:

> > > +/* client interface functions */
> > > +static const struct i40e_client_ops i40e_ops = {
> > > +	.open = i40iw_open,
> > > +	.close = i40iw_close,
> > > +	.l2_param_change = i40iw_l2param_change };
> > 
> > Wasn't the whole point of virtual bus to avoid stuff like this? Why isn't a client the
> > virtual bus object and this information extended into the driver ops?
> 
> These are the private interface calls between lan and rdma.
> These ops are implemented by RDMA driver but invoked by
> netdev driver.

AFAIK you are supposed to provide things like this as part of your
device driver ops, ie open is probe, close is unbind, etc.

> > > +/**
> > > + * irdma_event_handler - Called by LAN driver to notify events
> > > + * @ldev: Peer device structure
> > > + * @event: event from LAN driver
> > > + */
> > > +static void irdma_event_handler(struct iidc_peer_dev *ldev,
> > > +				struct iidc_event *event)
> > > +{
> > > +	struct irdma_l2params l2params = {};
> > > +	struct irdma_device *iwdev;
> > > +	int i;
> > > +
> > > +	iwdev = irdma_get_device(ldev->netdev);
> > > +	if (!iwdev)
> > > +		return;
> > > +
> > > +	if (test_bit(IIDC_EVENT_LINK_CHANGE, event->type)) {
> > 
> > Is this atomic? Why using test_bit?
> No its not. What do you suggest we use?

Just test the bit?

if (event->type & BIT(IIDC_EVENT_LINK_CHANGE)) ?

test_bit is the atomic version of those that matches atomic
set_bit/clear_bit

> > > +		ldev->ops->reg_for_notification(ldev, &events);
> > > +	dev_info(rfdev_to_dev(dev), "IRDMA VSI Open Successful");
> > 
> > Lets not do this kind of logging..
> >
> 
> There is some dev_info which should be cleaned up to dev_dbg.
> But logging this info is useful to know that this functions VSI (and associated ibdev)
> is up and reading for RDMA traffic.
> Is info logging to be avoided altogether?

Certainly not at display-by-default level. If every driver printed
when it binds we'd have a mess.

> > > new file mode 100644
> > > index 000000000000..b418e76a3302
> > > +++ b/drivers/infiniband/hw/irdma/main.c
> > > @@ -0,0 +1,630 @@
> > > +// SPDX-License-Identifier: GPL-2.0 or Linux-OpenIB
> > > +/* Copyright (c) 2015 - 2019 Intel Corporation */ #include "main.h"
> > > +
> > > +/* Legacy i40iw module parameters */
> > > +static int resource_profile;
> > > +module_param(resource_profile, int, 0644);
> > > +MODULE_PARM_DESC(resource_profile, "Resource Profile: 0=PF only,
> > > +1=Weighted VF, 2=Even Distribution");
> > > +
> > > +static int max_rdma_vfs = 32;
> > > +module_param(max_rdma_vfs, int, 0644);
> > MODULE_PARM_DESC(max_rdma_vfs,
> > > +"Maximum VF count: 0-32 32=default");
> > > +
> > > +static int mpa_version = 2;
> > > +module_param(mpa_version, int, 0644); MODULE_PARM_DESC(mpa_version,
> > > +"MPA version: deprecated parameter");
> > > +
> > > +static int push_mode;
> > > +module_param(push_mode, int, 0644);
> > > +MODULE_PARM_DESC(push_mode, "Low latency mode: deprecated
> > > +parameter");
> > > +
> > > +static int debug;
> > > +module_param(debug, int, 0644);
> > > +MODULE_PARM_DESC(debug, "debug flags: deprecated parameter");
> > 
> > Generally no to module parameters
> 
> Agree. But these are module params that existed in i40iw.
> And irdma replaces i40iw and has a module alias
> for it.

Provide non-module parameter alternatives for all of these, and it can
be OK only because of the module alias, and only if Doug lets you
remove i40iw.

 
> > > +static struct workqueue_struct *irdma_wq;
> > 
> > Another wq already?
> This wq is used for deferred handling of irdma service tasks.
> Such as rebuild/recovery after reset.

We have system global wqs. Why are they not OK?
 
Jason

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ