Skip to content

Commit 1eb4ef1

Browse files
skotur-brcmPaolo Abeni
authored andcommitted
bnxt_en: Implement .set_port / .unset_port UDP tunnel callbacks
As per the new udp tunnel framework, drivers which need to know the details of a port entry (i.e. port type) when it gets deleted should use the .set_port / .unset_port callbacks. Implementing the current .udp_tunnel_sync callback would mean that the deleted tunnel port entry would be all zeros. This used to work on older firmware because it would not check the input when deleting a tunnel port. With newer firmware, the delete will now fail and subsequent tunnel port allocation will fail as a result. Fixes: 442a35a ("bnxt: convert to new udp_tunnel_nic infra") Reviewed-by: Kalesh Anakkur Purayil <[email protected]> Signed-off-by: Somnath Kotur <[email protected]> Signed-off-by: Michael Chan <[email protected]> Signed-off-by: Paolo Abeni <[email protected]>
1 parent 319a782 commit 1eb4ef1

File tree

1 file changed

+18
-7
lines changed
  • drivers/net/ethernet/broadcom/bnxt

1 file changed

+18
-7
lines changed

drivers/net/ethernet/broadcom/bnxt/bnxt.c

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13036,26 +13036,37 @@ static void bnxt_cfg_ntp_filters(struct bnxt *bp)
1303613036

1303713037
#endif /* CONFIG_RFS_ACCEL */
1303813038

13039-
static int bnxt_udp_tunnel_sync(struct net_device *netdev, unsigned int table)
13039+
static int bnxt_udp_tunnel_set_port(struct net_device *netdev, unsigned int table,
13040+
unsigned int entry, struct udp_tunnel_info *ti)
1304013041
{
1304113042
struct bnxt *bp = netdev_priv(netdev);
13042-
struct udp_tunnel_info ti;
1304313043
unsigned int cmd;
1304413044

13045-
udp_tunnel_nic_get_port(netdev, table, 0, &ti);
13046-
if (ti.type == UDP_TUNNEL_TYPE_VXLAN)
13045+
if (ti->type == UDP_TUNNEL_TYPE_VXLAN)
1304713046
cmd = TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_VXLAN;
1304813047
else
1304913048
cmd = TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_GENEVE;
1305013049

13051-
if (ti.port)
13052-
return bnxt_hwrm_tunnel_dst_port_alloc(bp, ti.port, cmd);
13050+
return bnxt_hwrm_tunnel_dst_port_alloc(bp, ti->port, cmd);
13051+
}
13052+
13053+
static int bnxt_udp_tunnel_unset_port(struct net_device *netdev, unsigned int table,
13054+
unsigned int entry, struct udp_tunnel_info *ti)
13055+
{
13056+
struct bnxt *bp = netdev_priv(netdev);
13057+
unsigned int cmd;
13058+
13059+
if (ti->type == UDP_TUNNEL_TYPE_VXLAN)
13060+
cmd = TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_VXLAN;
13061+
else
13062+
cmd = TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_GENEVE;
1305313063

1305413064
return bnxt_hwrm_tunnel_dst_port_free(bp, cmd);
1305513065
}
1305613066

1305713067
static const struct udp_tunnel_nic_info bnxt_udp_tunnels = {
13058-
.sync_table = bnxt_udp_tunnel_sync,
13068+
.set_port = bnxt_udp_tunnel_set_port,
13069+
.unset_port = bnxt_udp_tunnel_unset_port,
1305913070
.flags = UDP_TUNNEL_NIC_INFO_MAY_SLEEP |
1306013071
UDP_TUNNEL_NIC_INFO_OPEN_ONLY,
1306113072
.tables = {

0 commit comments

Comments
 (0)