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)
commit7ae9dc356f247ad9f9634b3da61a45eb72968b2e
tree9f1700ed4ea45004e4049b78df5a4f985864b636
parent6fdab8a3ade2adc123bbf5c4fdec3394560b1fb1
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: 1698d600b361 ("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