]> git.baikalelectronics.ru Git - kernel.git/commit
bnxt_en: Fix UDP tunnel logic
authorMichael Chan <michael.chan@broadcom.com>
Sun, 5 Sep 2021 18:10:58 +0000 (14:10 -0400)
committerDavid S. Miller <davem@davemloft.net>
Sun, 5 Sep 2021 19:43:04 +0000 (20:43 +0100)
commit508c9b413ae2e4ef47c1ad3bb3e11d3334f23f67
tree9f1700ed4ea45004e4049b78df5a4f985864b636
parent2085c6f0188e7a83bd91fd309b73ab7f468bc851
bnxt_en: Fix UDP tunnel logic

The current logic assumes that when the driver sends the message to the
firmware to add the VXLAN or Geneve port, the firmware will never fail
the operation.  The UDP ports are always stored and are used to check
the tunnel packets in .ndo_features_check().  These tunnnel packets
will fail to offload on the transmit side if firmware fails the call to
add the UDP ports.

To fix the problem, bp->vxlan_port and bp->nge_port will only be set to
the offloaded ports when the HWRM_TUNNEL_DST_PORT_ALLOC firmware call
succeeds.  When deleting a UDP port, we check that the port was
previously added successfuly first by checking the FW ID.

Fixes: 9bc50a7d58f0 ("bnxt_en: Implement .ndo_features_check().")
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