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. Signed-off-by:Ben Hutchings <bhutchings@solarflare.com> Acked-by:
Dimitris Michailidis <dm@chelsio.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
Showing
- drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c 14 additions, 25 deletionsdrivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
- drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c 14 additions, 13 deletionsdrivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
- drivers/net/ethernet/sfc/ethtool.c 12 additions, 23 deletionsdrivers/net/ethernet/sfc/ethtool.c
- drivers/net/vmxnet3/vmxnet3_ethtool.c 15 additions, 20 deletionsdrivers/net/vmxnet3/vmxnet3_ethtool.c
- include/linux/ethtool.h 7 additions, 4 deletionsinclude/linux/ethtool.h
- net/core/ethtool.c 55 additions, 26 deletionsnet/core/ethtool.c
Loading
Please register or sign in to comment