netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Debashis Dutt <debdut@gmail.com>
To: David Lamparter <equinox@diac24.net>
Cc: Rasesh Mody <rmody@brocade.com>,
	davem@davemloft.net, netdev@vger.kernel.org,
	adapter_linux_open_src_team@brocade.com,
	Debashis Dutt <ddutt@brocade.com>
Subject: Re: [PATCH 2/2] bna: Add Generic Netlink Interface
Date: Wed, 18 May 2011 15:28:04 -0700	[thread overview]
Message-ID: <BANLkTin+kRsGFWG9N16E9Red5SM=g+haSw@mail.gmail.com> (raw)
In-Reply-To: <20110518120005.GC3762520@jupiter.n2.diac24.net>

On Wed, May 18, 2011 at 5:00 AM, David Lamparter <equinox@diac24.net> wrote:
> On Tue, May 17, 2011 at 09:57:01PM -0700, Rasesh Mody wrote:
>> This patch adds the generic netlink communication interface to BNA driver. The
>> in-kernel generic netlink infrastructure can be used to collect hardware
>> specific control information and control attributes. The driver makes use of
>> the "doit" handler provided by the generic netlink layer to accomplish this.
> [...]
>> +struct bnad_genl_ioc_info {
>> +     int             status;
>> +     u16             bnad_num;
>> +     u16             rsvd;
>> +     char            serialnum[64];
>> +     char            hwpath[BFA_STRING_32];
>> +     char            adapter_hwpath[BFA_STRING_32];
>> +     char            guid[BFA_ADAPTER_SYM_NAME_LEN*2];
>> +     char            name[BFA_ADAPTER_SYM_NAME_LEN];
>> +     char            port_name[BFA_ADAPTER_SYM_NAME_LEN];
>> +     char            eth_name[BFA_ADAPTER_SYM_NAME_LEN];
>> +     u64             rsvd1[4];
>> +     mac_t           mac;
>> +     mac_t           factory_mac;    /* Factory mac address */
>> +     mac_t           current_mac;    /* Currently assigned mac address */
>> +     enum bfa_ioc_type     ioc_type;
>> +     u16             pvid;           /* Port vlan id */
>> +     u16             rsvd2;
>> +     u32             host;
>> +     u32             bandwidth;      /* For PF support */
>> +     u32             rsvd3;
>> +};
>> +
>> +struct bnad_genl_ioc_attr {
>> +     int             status;
>> +     u16             bnad_num;
>> +     u16             rsvd;
>> +     struct bfa_ioc_attr  ioc_attr;
>> +};
>
> These things all look like they're better put into sysfs. Why would you
> create a genl protocol just to query some presumably static attributes?
>
>
> -David
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

Hi David,

There could be different ways of doing it, but the reason we chose to go
the generic netlink route are as follows:

1) The recommended format of sysfs (as per sysfs.txt in kernel documentation)
   is one single line of ASCII text per file.

   As a result this:
   a) if there are a lot of attributes to be collected,
         the driver will end up in creating that many sysfs files.
   b) Reading / writing each attribute will result in a set of
        [open()/read()/write()/close()] calls.

   This is not very scalable, particularly if we want to expand on this
   interface for better management functionality in the future.

   Instead, generic netlink provides a much better way of multiplexing data
   over a single socket.

2) Asynchronous event notifications can be much easily handled using the generic
     netlink interface.

Thanks
--Debashis

  reply	other threads:[~2011-05-18 22:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-18  4:56 [PATCH 0/2] bna: Add Debugfs & Generic Netlink Interfaces to BNA Driver Rasesh Mody
2011-05-18  4:57 ` [PATCH 1/2] bna: Add Debugfs Interface Rasesh Mody
2011-05-18  4:57 ` [PATCH 2/2] bna: Add Generic Netlink Interface Rasesh Mody
2011-05-18 12:00   ` David Lamparter
2011-05-18 22:28     ` Debashis Dutt [this message]
2011-05-21 23:06 ` [PATCH 0/2] bna: Add Debugfs & Generic Netlink Interfaces to BNA Driver Rasesh Mody
2011-05-22  3:31   ` David Miller

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='BANLkTin+kRsGFWG9N16E9Red5SM=g+haSw@mail.gmail.com' \
    --to=debdut@gmail.com \
    --cc=adapter_linux_open_src_team@brocade.com \
    --cc=davem@davemloft.net \
    --cc=ddutt@brocade.com \
    --cc=equinox@diac24.net \
    --cc=netdev@vger.kernel.org \
    --cc=rmody@brocade.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).