]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ethtool: Centralise validation of ETHTOOL_{G, S}RXFHINDIR parameters
authorJoe Jin <joe.jin@oracle.com>
Mon, 27 Aug 2012 12:38:36 +0000 (20:38 +0800)
committerJoe Jin <joe.jin@oracle.com>
Tue, 28 Aug 2012 07:21:27 +0000 (15:21 +0800)
commite5f54314bdfa55fedf96a934f62d4b8bafb3c0b1
treec048e354bbcde6512d56edf8328a5a3644f6ab81
parente403d76d85dab08a63a93151245d580934a67663
ethtool: Centralise validation of ETHTOOL_{G, S}RXFHINDIR parameters

Add a new ethtool operation (get_rxfh_indir_size) to get the
indirectional table size.  Use this to validate the user buffer size
before calling get_rxfh_indir or set_rxfh_indir.  Use get_rxnfc to get
the number of RX rings, and validate the contents of the new
indirection table before calling set_rxfh_indir.  Remove this
validation from drivers.

(backported from upstream commit 7850f63f1620512631445b901ae11cd149e7375c)
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Acked-by: Dimitris Michailidis <dm@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
drivers/net/bnx2x/bnx2x_ethtool.c
drivers/net/cxgb4/cxgb4_main.c
drivers/net/sfc/ethtool.c
drivers/net/vmxnet3/vmxnet3_ethtool.c
include/linux/ethtool.h
net/core/ethtool.c