]> git.baikalelectronics.ru Git - kernel.git/commit
bnxt_en: Drop oversize TX packets to prevent errors.
authorMichael Chan <michael.chan@broadcom.com>
Wed, 27 Feb 2019 08:58:53 +0000 (03:58 -0500)
committerDavid S. Miller <davem@davemloft.net>
Wed, 27 Feb 2019 17:27:21 +0000 (09:27 -0800)
commite8de9a08a1a7b6ce66b6f69e3115616cc8e79e9a
treec66288788789b2a8063737c434f20372f30022d7
parente14367185ec0eac3ceebf5bba6360f6fe6fc8d10
bnxt_en: Drop oversize TX packets to prevent errors.

There have been reports of oversize UDP packets being sent to the
driver to be transmitted, causing error conditions.  The issue is
likely caused by the dst of the SKB switching between 'lo' with
64K MTU and the hardware device with a smaller MTU.  Patches are
being proposed by Mahesh Bandewar <maheshb@google.com> to fix the
issue.

In the meantime, add a quick length check in the driver to prevent
the error.  The driver uses the TX packet size as index to look up an
array to setup the TX BD.  The array is large enough to support all MTU
sizes supported by the driver.  The oversize TX packet causes the
driver to index beyond the array and put garbage values into the
TX BD.  Add a simple check to prevent this.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnxt/bnxt.c