Netdev List
 help / color / mirror / Atom feed
From: Ben Hutchings <bhutchings@solarflare.com>
To: Giri Reddy <giri.reddy@qlogic.com>
Cc: netdev <netdev@vger.kernel.org>
Subject: Re: Use of 'SIOCDEVPRIVATE' in ethernet drivers.
Date: Thu, 9 Jan 2014 21:07:58 +0000	[thread overview]
Message-ID: <1389301678.2025.41.camel@bwh-desktop.uk.level5networks.com> (raw)
In-Reply-To: <124064C45E1FC84193A69A61ED3A1F46E22D07@AVMB1.qlogic.org>

On Tue, 2014-01-07 at 18:21 +0000, Giri Reddy wrote:
> I'm implementing a new interface for upgrading the firmware for our next
> generation of Qlogic drivers. We need to transfer control information
> between userspace and driver, in addition to the firmware payload. I'm
> considering using 'SIOCDEVPRIVATE' ioctl interface to pass control
> information between userland and driver.
> 
> I also see comments in the source (include/linux/sockios.h) that
> 'SIOCDEVPRIVATE' will be deprecated 2.5.x. What is the current status of
> deprecation in the latest versions of the kernel?

It is still supported and unlikely to be removed, but no in-tree driver
will be allowed to expose new operations this way.

> Are we still allowed to use 'SIOCDEVPRIVATE' in drivers if there the
> deprecation efforts are on hold.
> 
> Any input will be appreciated.

The existing interfaces used for firmware update are:

1. ethtool ETHTOOL_FLASHDEV command.  Userland program installs a
firmware blob under /lib/firmware and then issues this command using
ioctl().  It can specify which flash partition is to be written.  Driver
loads and writes the entire blob and (presumably) resets the chip if
necessary.  There is no way to read the old firmware.

Example drivers: bna, cxgb4, be2net, vxge

2. MTD driver plus ethtool ETHTOOL_RESET command.  The flash
partition(s) containing firmware are exposed as separate devices with
names that indicate what they all are.  Userland can read and write the
firmware through /dev/mtd* or /dev/mtdblock*.  It can reset the chip
after writing firmware, using ioctl().  This is flexible but relatively
complicated for userland to use.

Example driver: sfc

3. ethtool ETHTOOL_{G,S}EEPROM commands.  Userland program sends these
commands using ioctl().  There is no clean way to expose more than one
flash partition, e.g. for controller, PHY, and net-boot firmware.

Example driver: bnx2

Please choose one of the above and don't invent another one.  (There are
already several other interfaces in use that are too horrible to mention
here.)

Ben.

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

      parent reply	other threads:[~2014-01-09 21:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-07 18:21 Use of 'SIOCDEVPRIVATE' in ethernet drivers Giri Reddy
2014-01-07 19:05 ` David Miller
2014-01-07 22:22   ` Giri Reddy
2014-01-07 23:44     ` Stephen Hemminger
2014-01-08 16:02       ` Giri Reddy
2014-01-09 21:09         ` Ben Hutchings
2014-01-10  3:45           ` Giri Reddy
2014-01-09 21:07 ` Ben Hutchings [this message]

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=1389301678.2025.41.camel@bwh-desktop.uk.level5networks.com \
    --to=bhutchings@solarflare.com \
    --cc=giri.reddy@qlogic.com \
    --cc=netdev@vger.kernel.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