netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Amar Mudrankit" <amar.mudrankit@qlogic.com>
To: "Greg KH" <greg@kroah.com>
Cc: netdev@vger.kernel.org, Stephen Hemminger <shemminger@vyatta.com>,
	rdreier@cisco.com, general@lists.openfabrics.org,
	poornima.kamath@qlogic.com
Subject: Re: [ofa-general] Re: [PATCH v3 08/13] QLogic VNIC: sysfs interface implementation for the driver
Date: Tue, 3 Jun 2008 23:55:00 +0530	[thread overview]
Message-ID: <c8028d330806031125x4181d8e3p9cdaf1f4c79e88c6@mail.gmail.com> (raw)
In-Reply-To: <20080529174805.GA10903@kroah.com>


[-- Attachment #1.1: Type: text/plain, Size: 5780 bytes --]

On Thu, May 29, 2008 at 11:18 PM, Greg KH <greg@kroah.com> wrote:

> On Thu, May 29, 2008 at 10:30:03AM -0700, Stephen Hemminger wrote:
> > On Thu, 29 May 2008 15:27:54 +0530
> > Ramachandra K <ramachandra.kuchimanchi@qlogic.com> wrote:
> >
> > > From: Amar Mudrankit <amar.mudrankit@qlogic.com>
> > >
> > > The sysfs interface for the QLogic VNIC driver is implemented through
> > > this patch.
> > >
> > > Signed-off-by: Amar Mudrankit <amar.mudrankit@qlogic.com>
> > > Signed-off-by: Ramachandra K <ramachandra.kuchimanchi@qlogic.com>
> > > Signed-off-by: Poornima Kamath <poornima.kamath@qlogic.com>
> > > ---
> > >
> > >  drivers/infiniband/ulp/qlgc_vnic/vnic_sys.c | 1133
> +++++++++++++++++++++++++++
> > >  drivers/infiniband/ulp/qlgc_vnic/vnic_sys.h |   51 +
> > >  2 files changed, 1184 insertions(+), 0 deletions(-)
> > >  create mode 100644 drivers/infiniband/ulp/qlgc_vnic/vnic_sys.c
> > >  create mode 100644 drivers/infiniband/ulp/qlgc_vnic/vnic_sys.h
> > >
> > > diff --git a/drivers/infiniband/ulp/qlgc_vnic/vnic_sys.c
> b/drivers/infiniband/ulp/qlgc_vnic/vnic_sys.c
> > > new file mode 100644
> > > index 0000000..40b3c77
> > > --- /dev/null
> > > +++ b/drivers/infiniband/ulp/qlgc_vnic/vnic_sys.c
> > > @@ -0,0 +1,1133 @@
> > > +/*
> > > + * Copyright (c) 2006 QLogic, Inc.  All rights reserved.
> > > + *
> > > + * This software is available to you under a choice of one of two
> > > + * licenses.  You may choose to be licensed under the terms of the GNU
> > > + * General Public License (GPL) Version 2, available from the file
> > > + * COPYING in the main directory of this source tree, or the
> > > + * OpenIB.org BSD license below:
> > > + *
> > > + *     Redistribution and use in source and binary forms, with or
> > > + *     without modification, are permitted provided that the following
> > > + *     conditions are met:
> > > + *
> > > + *      - Redistributions of source code must retain the above
> > > + *        copyright notice, this list of conditions and the following
> > > + *        disclaimer.
> > > + *
> > > + *      - Redistributions in binary form must reproduce the above
> > > + *        copyright notice, this list of conditions and the following
> > > + *        disclaimer in the documentation and/or other materials
> > > + *        provided with the distribution.
> > > + *
> > > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
> > > + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
> > > + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
> > > + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
> > > + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
> > > + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
> > > + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
> > > + * SOFTWARE.
> > > + */
> > > +
> > > +#include <linux/netdevice.h>
> > > +#include <linux/parser.h>
> > > +#include <linux/if.h>
> > > +
> > > +#include "vnic_util.h"
> > > +#include "vnic_config.h"
> > > +#include "vnic_ib.h"
> > > +#include "vnic_viport.h"
> > > +#include "vnic_main.h"
> > > +#include "vnic_stats.h"
> > > +
> > > +/*
> > > + * target eiocs are added by writing
> > > + *
> > > + * ioc_guid=<EIOC GUID>,dgid=<dest
> GID>,pkey=<P_key>,name=<interface_name>
> > > + * to the create_primary  sysfs attribute.
> > > + */
> > > +enum {
> > > +   VNIC_OPT_ERR = 0,
> > > +   VNIC_OPT_IOC_GUID = 1 << 0,
> > > +   VNIC_OPT_DGID = 1 << 1,
> > > +   VNIC_OPT_PKEY = 1 << 2,
> > > +   VNIC_OPT_NAME = 1 << 3,
> > > +   VNIC_OPT_INSTANCE = 1 << 4,
> > > +   VNIC_OPT_RXCSUM = 1 << 5,
> > > +   VNIC_OPT_TXCSUM = 1 << 6,
> > > +   VNIC_OPT_HEARTBEAT = 1 << 7,
> > > +   VNIC_OPT_IOC_STRING = 1 << 8,
> > > +   VNIC_OPT_IB_MULTICAST = 1 << 9,
> > > +   VNIC_OPT_ALL = (VNIC_OPT_IOC_GUID |
> > > +                   VNIC_OPT_DGID | VNIC_OPT_NAME | VNIC_OPT_PKEY),
> > > +};
> > > +
> > > +static match_table_t vnic_opt_tokens = {
> > > +   {VNIC_OPT_IOC_GUID, "ioc_guid=%s"},
> > > +   {VNIC_OPT_DGID, "dgid=%s"},
> > > +   {VNIC_OPT_PKEY, "pkey=%x"},
> > > +   {VNIC_OPT_NAME, "name=%s"},
> > > +   {VNIC_OPT_INSTANCE, "instance=%d"},
> > > +   {VNIC_OPT_RXCSUM, "rx_csum=%s"},
> > > +   {VNIC_OPT_TXCSUM, "tx_csum=%s"},
> > > +   {VNIC_OPT_HEARTBEAT, "heartbeat=%d"},
> > > +   {VNIC_OPT_IOC_STRING, "ioc_string=\"%s"},
> > > +   {VNIC_OPT_IB_MULTICAST, "ib_multicast=%s"},
> > > +   {VNIC_OPT_ERR, NULL}
> > > +};
> > >
> >
> > No sysfs is supposed to be one value per file use separate attributes
> > for each one. This also eliminates the parsing code.
>
> And yes, multiple values per sysfs file are not allowed, sorry, please
> change this.  If you need to configure your device through an interface
> like this, consider using configfs instead, that is what it is there
> for.


Documentation/filesystems/configfs/configfs.txt <<snip>>

                  [Using configfs]

                  Like sysfs, attributes should be ASCII text files,
preferably
                  with only one value per file.  The same efficiency caveats
from sysfs
                  apply.  Don't mix more than one attribute in one attribute
file.

It looks like configfs also does not allow multiple attributes per file.
So, in that case, shall we modify our sysfs code to support one value per
sysfs file? With this approach, the impact on user space applications that
we have which depend on the qlgc_vnic driver sysfs interface will be less.

Thanks and Regards,
Amar

>
> _______________________________________________
> general mailing list
> general@lists.openfabrics.org
> http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general
>
> To unsubscribe, please visit
> http://openib.org/mailman/listinfo/openib-general
>

[-- Attachment #1.2: Type: text/html, Size: 8722 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



  parent reply	other threads:[~2008-06-03 18:25 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-29  9:53 [PATCH v3 00/13] QLogic VNIC Driver Ramachandra K
2008-05-29  9:54 ` [ofa-general] [PATCH v3 01/13] QLogic VNIC: Driver - netdev implementation Ramachandra K
2008-05-29 17:27   ` [ofa-general] " Stephen Hemminger
2008-06-03 12:14     ` Ramachandra K
2008-06-03 17:51       ` Stephen Hemminger
2008-05-29  9:54 ` [ofa-general] [PATCH v3 02/13] QLogic VNIC: Netpath - abstraction of connection to EVIC/VEx Ramachandra K
2008-05-29  9:55 ` [ofa-general] [PATCH v3 03/13] QLogic VNIC: Implementation of communication protocol with EVIC/VEx Ramachandra K
2008-05-29  9:55 ` [ofa-general] [PATCH v3 04/13] QLogic VNIC: Implementation of Control path of communication protocol Ramachandra K
2008-05-29  9:56 ` [ofa-general] [PATCH v3 05/13] QLogic VNIC: Implementation of Data " Ramachandra K
2008-05-29  9:56 ` [ofa-general] [PATCH v3 06/13] QLogic VNIC: IB core stack interaction Ramachandra K
2008-05-29  9:57 ` [ofa-general] [PATCH v3 07/13] QLogic VNIC: Handling configurable parameters of the driver Ramachandra K
2008-05-29  9:57 ` [ofa-general] [PATCH v3 08/13] QLogic VNIC: sysfs interface implementation for " Ramachandra K
2008-05-29 17:30   ` [ofa-general] " Stephen Hemminger
2008-05-29 17:48     ` Greg KH
2008-06-01  5:46       ` Roland Dreier
2008-06-03 12:24         ` [ofa-general] " Ramachandra K
2008-06-03 15:10           ` Roland Dreier
2008-06-03 18:25       ` Amar Mudrankit [this message]
2008-06-03 18:30         ` Greg KH
2008-06-03 18:45         ` David Dillow
2008-06-05  4:10           ` Roland Dreier
2008-06-05  5:40             ` Dave Dillow
2008-06-05 16:38               ` Roland Dreier
2008-06-05 17:01                 ` Stephen Hemminger
2008-06-05 17:32                   ` Patrick McHardy
2008-06-05 20:47                     ` Roland Dreier
2008-06-05 22:54                       ` Patrick McHardy
2008-06-05 17:54                 ` David Dillow
2008-05-29  9:58 ` [ofa-general] [PATCH v3 09/13] QLogic VNIC: IB Multicast for Ethernet broadcast/multicast Ramachandra K
2008-05-29  9:58 ` [ofa-general] [PATCH v3 10/13] QLogic VNIC: Driver Statistics collection Ramachandra K
2008-05-29  9:59 ` [PATCH v3 11/13] QLogic VNIC: Driver utility file - implements various utility macros Ramachandra K
2008-05-29  9:59 ` [ofa-general] [PATCH v3 12/13] QLogic VNIC: Driver Kconfig and Makefile Ramachandra K
2008-05-29 10:00 ` [ofa-general] [PATCH v3 13/13] QLogic VNIC: Modifications to IB " Ramachandra K

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=c8028d330806031125x4181d8e3p9cdaf1f4c79e88c6@mail.gmail.com \
    --to=amar.mudrankit@qlogic.com \
    --cc=general@lists.openfabrics.org \
    --cc=greg@kroah.com \
    --cc=netdev@vger.kernel.org \
    --cc=poornima.kamath@qlogic.com \
    --cc=rdreier@cisco.com \
    --cc=shemminger@vyatta.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).