]> git.baikalelectronics.ru Git - kernel.git/commit
bnxt_en: Check TQM rings for maximum supported value.
authorMichael Chan <michael.chan@broadcom.com>
Sun, 27 Dec 2020 19:18:18 +0000 (14:18 -0500)
committerJakub Kicinski <kuba@kernel.org>
Mon, 28 Dec 2020 22:10:53 +0000 (14:10 -0800)
commit02fe99f6a17bdfabc3867ddfa0e185a16a448c15
tree877d4864ef27fdd0a9979bdbe95815c42bb48972
parent1541dc7bd15c474ec0e52d997a554aeeaaaaa30c
bnxt_en: Check TQM rings for maximum supported value.

TQM rings are hardware resources that require host context memory
managed by the driver.  The driver supports up to 9 TQM rings and
the number of rings to use is requested by firmware during run-time.
Cap this number to the maximum supported to prevent accessing beyond
the array.  Future firmware may request more than 9 TQM rings.  Define
macros to remove the magic number 9 from the C code.

Fixes: 66a396af3f67 ("bnxt_en: Allocate TQM ring context memory according to fw specification.")
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Reviewed-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/broadcom/bnxt/bnxt.c
drivers/net/ethernet/broadcom/bnxt/bnxt.h