public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: "Vishwanathapura,
	Niranjana"
	<niranjana.vishwanathapura-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
	ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
	Sadanand Warrier
	<sadanand.warrier-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	Sudeep Dutt <sudeep.dutt-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	Andrzej Kacprowski
	<andrzej.kacprowski-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Subject: Re: [PATCH rdma-next v1 04/12] IB/opa-vnic: Virtual Network Interface Controller (VNIC) netdev
Date: Wed, 12 Apr 2017 22:21:31 +0300	[thread overview]
Message-ID: <20170412192131.GB1343@mtr-leonro.local> (raw)
In-Reply-To: <20170412183136.GA19704-wPcXA7LoDC+1XWohqUldA0EOCMrvLtNR@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 3042 bytes --]

On Wed, Apr 12, 2017 at 11:31:37AM -0700, Vishwanathapura, Niranjana wrote:
> On Wed, Apr 12, 2017 at 10:08:30AM +0300, Leon Romanovsky wrote:
> > > +#define v_dbg(format, arg...) \
> > > +	netdev_dbg(adapter->netdev, format, ## arg)
> > > +#define v_err(format, arg...) \
> > > +	netdev_err(adapter->netdev, format, ## arg)
> > > +#define v_info(format, arg...) \
> > > +	netdev_info(adapter->netdev, format, ## arg)
> > > +#define v_warn(format, arg...) \
> > > +	netdev_warn(adapter->netdev, format, ## arg)
> > > +
> >
> > IMHO, these wrappers are redundant.
> >
>
> Using same constructs as some Intel standard ethernet drivers.

I'll leave this decision to Doug. IMHO open coded variant is preferable.

>
> > > +/* opa_netdev_open - activate network interface */
> > > +static int opa_netdev_open(struct net_device *netdev)
> > > +{
> > > +	struct opa_vnic_adapter *adapter = opa_vnic_priv(netdev);
> > > +	int rc;
> > > +
> > > +	rc = adapter->rn_ops->ndo_open(adapter->netdev);
> > > +	if (rc) {
> > > +		v_dbg("open failed %d\n", rc);
> > > +		return rc;
> > > +	}
> > > +
> > > +	v_info("opened\n");
> >
> > All these v_info are achieved by tracepoints (function tracer).
> >
>
> Some of these messages are useful for analysing reported logs.
> Let me change these opened/closed messges to debug level.

I agree with you regarding error messages, I disagree regarding
flow/info messages.

>
> > > +
> > > +	netdev = ibdev->alloc_rdma_netdev(ibdev, port_num,
> > > +					  RDMA_NETDEV_OPA_VNIC,
> > > +					  "veth%d", NET_NAME_UNKNOWN,
> > > +					  ether_setup);
> > > +	if (!netdev)
> > > +		return ERR_PTR(-ENOMEM);
> > > +	else if (IS_ERR(netdev))
> > > +		return ERR_CAST(netdev);
> > > +
> >
>
> > Erez and Jason came to this code for IPoIB, it is better to have same
> > error handling for all alloc_rdma_netdev callers.
> > +       if (hca->alloc_rdma_netdev) {
> > +               dev = hca->alloc_rdma_netdev(hca, port,
> > +                                            RDMA_NETDEV_IPOIB, name,
> > +                                            NET_NAME_UNKNOWN,
> > +                                            ipoib_setup_common);
> > +               if (IS_ERR_OR_NULL(dev) && PTR_ERR(dev) != -EOPNOTSUPP)
> > +                       return NULL;
> > +       }
> >
> >
>
> IPoIB handles EOPNOTSUPP differently (by assigning default operations).
> It is not applicable to OPA VNIC, hence it just returns the error code.
>
> I just noticed that IPoIB is using EOPNOTSUPP, however OPA VNIC is using
> ENOTSUPP. EOPNOTSUPP seesm to be widely used, so I will change OPA VNIC to
> use the same. Will also document this requirement in ib_verbs.h where this
> function is defined.

The ENOTSUPP is for NFS and it can't be returned to user space. The proper
error is EOPNOTSUPP.

Thanks

>
> Niranjana
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  parent reply	other threads:[~2017-04-12 19:21 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-12  6:39 [PATCH rdma-next v1 00/12] Omni-Path Virtual Network Interface Controller (VNIC) Vishwanathapura, Niranjana
2017-04-12  6:39 ` [PATCH rdma-next v1 01/12] IB/opa-vnic: Virtual Network Interface Controller (VNIC) documentation Vishwanathapura, Niranjana
     [not found] ` <1491979207-18686-1-git-send-email-niranjana.vishwanathapura-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2017-04-12  6:39   ` [PATCH rdma-next v1 02/12] IB/opa-vnic: RDMA NETDEV interface Vishwanathapura, Niranjana
2017-04-12  6:39   ` [PATCH rdma-next v1 03/12] IB/opa-vnic: Virtual Network Interface Controller (VNIC) interface Vishwanathapura, Niranjana
2017-04-12  6:39   ` [PATCH rdma-next v1 04/12] IB/opa-vnic: Virtual Network Interface Controller (VNIC) netdev Vishwanathapura, Niranjana
     [not found]     ` <1491979207-18686-5-git-send-email-niranjana.vishwanathapura-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2017-04-12  7:08       ` Leon Romanovsky
     [not found]         ` <20170412070830.GR2269-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-04-12 18:31           ` Vishwanathapura, Niranjana
     [not found]             ` <20170412183136.GA19704-wPcXA7LoDC+1XWohqUldA0EOCMrvLtNR@public.gmane.org>
2017-04-12 19:21               ` Leon Romanovsky [this message]
2017-04-12  6:40   ` [PATCH rdma-next v1 05/12] IB/opa-vnic: VNIC Ethernet Management (EM) structure definitions Vishwanathapura, Niranjana
2017-04-12  6:40   ` [PATCH rdma-next v1 09/12] IB/opa-vnic: VNIC Ethernet Management Agent (VEMA) function Vishwanathapura, Niranjana
2017-04-12  6:40 ` [PATCH rdma-next v1 06/12] IB/opa-vnic: VNIC statistics support Vishwanathapura, Niranjana
2017-04-12  6:40 ` [PATCH rdma-next v1 07/12] IB/opa-vnic: VNIC MAC table support Vishwanathapura, Niranjana
2017-04-12  6:40 ` [PATCH rdma-next v1 08/12] IB/opa-vnic: VNIC Ethernet Management Agent (VEMA) interface Vishwanathapura, Niranjana
2017-04-12  6:40 ` [PATCH rdma-next v1 10/12] IB/hfi1: OPA_VNIC RDMA netdev support Vishwanathapura, Niranjana
     [not found]   ` <1491979207-18686-11-git-send-email-niranjana.vishwanathapura-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2017-04-12 15:56     ` Jason Gunthorpe
2017-04-12 18:38       ` Vishwanathapura, Niranjana
2017-04-12  6:40 ` [PATCH rdma-next v1 11/12] IB/hfi1: Virtual Network Interface Controller (VNIC) HW support Vishwanathapura, Niranjana
2017-04-12  6:40 ` [PATCH rdma-next v1 12/12] IB/hfi1: VNIC SDMA support Vishwanathapura, Niranjana

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=20170412192131.GB1343@mtr-leonro.local \
    --to=leon-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
    --cc=andrzej.kacprowski-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=niranjana.vishwanathapura-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=sadanand.warrier-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=sudeep.dutt-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    /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