[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 03 Mar 2014 15:19:46 -0500 (EST)
From: David Miller <davem@...emloft.net>
To: VenkatKumar.Duvvuru@...lex.com
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH v3 net-next 1/2] ethtool: Support for configurable RSS
hash key
From: Venkat Duvvuru <VenkatKumar.Duvvuru@...lex.com>
Date: Fri, 28 Feb 2014 17:35:40 +0530
> + * @get_rxfh_key_size: Get the size of the RX flow hash key.
> + * Returns zero if not supported for this specific device.
> * @get_rxfh_indir_size: Get the size of the RX flow hash indirection table.
> * Returns zero if not supported for this specific device.
> * @get_rxfh_indir: Get the contents of the RX flow hash indirection table.
> * Will not be called if @get_rxfh_indir_size returns zero.
> + * @get_rxfh: Get the contents of the RX flow hash indirection table and hash
> + * key.
> + * Will not be called if @get_rxfh_indir_size and @get_rxfh_key_size
> + * returns zero.
> * Returns a negative error code or zero.
> * @set_rxfh_indir: Set the contents of the RX flow hash indirection table.
> * Will not be called if @get_rxfh_indir_size returns zero.
> + * @set_rxfh: Set the contents of the RX flow hash indirection table and
> + * hash key.
> + * Will not be called if @get_rxfh_indir_size and @get_rxfh_key_size
> + * returns zero.
...
> + if (!(dev->ethtool_ops->get_rxfh_indir_size ||
> + dev->ethtool_ops->get_rxfh_key_size ||
> + dev->ethtool_ops->get_rxfh))
> + return -EOPNOTSUPP;
This may be just my taste but I prefer it if all the operations have to
be non-NULL to support the new feature. The code is so much easier to
validate that way.
Even if you have to make generic "ethtool_get_rxfh_indir_size_zero"
etc. routines that implementations hook up if they don't support the
particular aspect, I prefer that to "NULL means this".
Could you make this change and resubmit?
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists