common/sfc_efx/base: limit reported MCDI response length
common/sfc_efx/base: limit reported MCDI response length

MCDI helper routines in libefx include length checks for response
messages, to ensure that short replies and optional fields are
handled correctly.

If the MCDI response message from the firmware is larger than the
caller's buffer then the response length reported to the caller
should be limited to the buffer size. Otherwise length checks in
the caller may allow reading past the end of the buffer.

Fixes: 6f619653b9b1 ("net/sfc/base: import MCDI implementation")
Cc: stable@dpdk.org

Signed-off-by: Andy Moreton <adbee5d9b6a6a553b71b14302d03837591e26c9d@xilinx.com>
Signed-off-by: Ivan Malov <436a2feb05eb79a6862681e66bd0193220e8fb2d@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <4155e7bf8e0185127625dac6d84336299844982f@oktetlabs.ru>

john-mcnamara-intel/dpdk,john-mcnamara-intel/dpdk,john-mcnamara-intel/dpdk,john-mcnamara-intel/dpdk