iavf: Fix reporting when setting descriptor count
authorMichal Maloszewski <michal.maloszewski@intel.com>
Tue, 26 Oct 2021 12:59:09 +0000 (12:59 +0000)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Mon, 6 Dec 2021 16:27:50 +0000 (08:27 -0800)
commit1a1aa356ddf3f16539f5962c01c5f702686dfc15
treed0f7a6f4451645a82b9787d4ce882808ffd77ddb
parent7e4dcc13965c57869684d57a1dc6dd7be589488c
iavf: Fix reporting when setting descriptor count

iavf_set_ringparams doesn't communicate to the user that

1. The user requested descriptor count is out of range. Instead it
   just quietly sets descriptors to the "clamped" value and calls it
   done. This makes it look an invalid value was successfully set as
   the descriptor count when this isn't actually true.

2. The user provided descriptor count needs to be inflated for alignment
   reasons.

This behavior is confusing. The ice driver has already addressed this
by rejecting invalid values for descriptor count and
messaging for alignment adjustments.
Do the same thing here by adding the error and info messages.

Fixes: fbb7ddfef253 ("i40evf: core ethtool functionality")
Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Signed-off-by: Michal Maloszewski <michal.maloszewski@intel.com>
Tested-by: Konrad Jankowski <konrad0.jankowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/iavf/iavf_ethtool.c