public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Ben Greear <greearb@candelatech•com>
To: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel•com>
Cc: David Miller <davem@davemloft•net>,
	"netdev@vger•kernel.org" <netdev@vger•kernel.org>,
	Eric Dumazet <eric.dumazet@gmail•com>,
	mchan@broadcom•com,
	"bhutchings@solarflare•com" <bhutchings@solarflare•com>,
	linville@tuxdriver•com, shemminger@linux-foundation•org,
	"Brandeburg, Jesse" <jesse.brandeburg@intel•com>,
	"Kirsher, Jeffrey T" <jeffrey.t.kirsher@intel•com>
Subject: Re: RFC: ethtool: add device-specific feature support in a generic fashion
Date: Sat, 12 Dec 2009 20:19:18 -0800	[thread overview]
Message-ID: <4B246B46.1010103@candelatech.com> (raw)
In-Reply-To: <1260671599.2142.79.camel@localhost>

On 12/12/2009 06:33 PM, Peter P Waskiewicz Jr wrote:
> This is a follow-up to my first RFC, getting opinions where the best
> place to put device-specific feature toggling would be.  The feedback I
> received was to look at doing this in ethtool.  Below is a high-level
> design of what I'd like to do, and wanted to vet this with the community
> to see if this is aligned with what people would like to see.
>
> The general idea is to have a generic framework in ethtool to enumerate
> device-specific commands.  A sample structure that would represent each
> of these commands is:
>
> 	enum oem_cmds {
> 		OEM_CMD_0 = 0,
> 		OEM_CMD_1,
> 		OEM_CMD_2,
> 	...
> 	etc.
> 	...
> 	};
>
> 	struct oem_feature_cmd {
> 		/* Description of the feature */
> 		char *description;
>
> 		/* Does the feature toggling requires a device reset */
> 		u8 require_reset;
>
> 		/* The command-line name for the command */
> 		char *oem_cmd_name;
>
> 		/* The command number assigned to this */
> 		u32 oem_cmd;
>
> 		/* value for the command */
> 		u32 oem_cmd_val;
> 	};

I'd add a 32-bit field for flags, with require_reset being one of them.  I'd also
align it so that it has no holes on 32/64 bit (put char*'s next to each other, maybe
pad with another 32-bit 'spare' field.  Maybe even use uint64 for the pointers so
that the struct size is same on 32-bit and 64-bit, to aid using 32-bit apps on
64-bit OS easily.

This way, as new uses are found for this, the structure remains binary compatible.

Thanks,
Ben

-- 
Ben Greear <greearb@candelatech•com>
Candela Technologies Inc  http://www.candelatech.com

  reply	other threads:[~2009-12-13  4:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-13  2:33 RFC: ethtool: add device-specific feature support in a generic fashion Peter P Waskiewicz Jr
2009-12-13  4:19 ` Ben Greear [this message]
2009-12-13  7:09   ` Peter P Waskiewicz Jr
2009-12-14  4:19     ` David Miller
2009-12-14  6:12       ` Peter P Waskiewicz Jr

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=4B246B46.1010103@candelatech.com \
    --to=greearb@candelatech$(echo .)com \
    --cc=bhutchings@solarflare$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=eric.dumazet@gmail$(echo .)com \
    --cc=jeffrey.t.kirsher@intel$(echo .)com \
    --cc=jesse.brandeburg@intel$(echo .)com \
    --cc=linville@tuxdriver$(echo .)com \
    --cc=mchan@broadcom$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=peter.p.waskiewicz.jr@intel$(echo .)com \
    --cc=shemminger@linux-foundation$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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