[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BF3270C86E8B1349A26C34E4EC1C44CB2C889D94@CMEXMB1.ad.emulex.com>
Date: Thu, 6 Mar 2014 14:23:44 +0000
From: Venkata Duvvuru <VenkatKumar.Duvvuru@...lex.Com>
To: Ben Hutchings <ben@...adent.org.uk>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: RE: [PATCH v3 net-next 1/2] ethtool: Support for configurable RSS
hash key
> > + * @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.
>
> Shouldn't that 'and' be an 'or'? I.e. this is only called if the driver exposes both
> the key and the indirection table.
What about the existing drivers those support only indirection configuration.
>
> [...]
> > + indir_bytes = user_indir_size * sizeof(rss_info->rss_config[0]);
> > + total_size = indir_bytes + user_key_size;
> > + rss_info = kzalloc(total_size, GFP_USER);
> > + if (!rss_info)
> > + return -ENOMEM;
>
> This doesn't make sense. You allocate a buffer big enough to hold just the
> indirection table and key, but then treat the pointer as pointing to a full
> command structure.
This is a blunder. My testing didn't catch it by chance.
>
> > + rss_info->indir_size = user_indir_size;
> > + rss_info->key_size = user_key_size;
> > + ret = dev->ethtool_ops->get_rxfh(dev, rss_info);
>
> I think it would be better to pass the driver two separate pointers into the
> buffer, one for the indirection table and one for the key.
The intention is to avoid changing "get_rxfh/set_rxfh" interface every time a new configurable parameter is introduced.
> > + if ((user_indir_size && ((user_indir_size != 0xDEADBEEF) &&
> > + user_indir_size != dev_indir_size)) ||
> > + (user_key_size && (user_key_size != dev_key_size)))
> > + return -EINVAL;
> > +
> > + if (user_indir_size && user_indir_size != 0xDEADBEEF)
> > + indir_bytes = user_indir_size * sizeof(rss_info->rss_config[0]);
>
> Why is 0xDEADBEEF special?
Since 0 is used as a hint to reset to default, we should have a way to hint that indirection table configuration is not requested in this context.
Powered by blists - more mailing lists