|
@@ -10108,12 +10108,18 @@ static void __bnx2x_add_vxlan_port(struct bnx2x *bp, u16 port)
|
|
|
if (!netif_running(bp->dev))
|
|
|
return;
|
|
|
|
|
|
- if (bp->vxlan_dst_port || !IS_PF(bp)) {
|
|
|
+ if (bp->vxlan_dst_port_count && bp->vxlan_dst_port == port) {
|
|
|
+ bp->vxlan_dst_port_count++;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (bp->vxlan_dst_port_count || !IS_PF(bp)) {
|
|
|
DP(BNX2X_MSG_SP, "Vxlan destination port limit reached\n");
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
bp->vxlan_dst_port = port;
|
|
|
+ bp->vxlan_dst_port_count = 1;
|
|
|
bnx2x_schedule_sp_rtnl(bp, BNX2X_SP_RTNL_ADD_VXLAN_PORT, 0);
|
|
|
}
|
|
|
|
|
@@ -10128,10 +10134,14 @@ static void bnx2x_add_vxlan_port(struct net_device *netdev,
|
|
|
|
|
|
static void __bnx2x_del_vxlan_port(struct bnx2x *bp, u16 port)
|
|
|
{
|
|
|
- if (!bp->vxlan_dst_port || bp->vxlan_dst_port != port || !IS_PF(bp)) {
|
|
|
+ if (!bp->vxlan_dst_port_count || bp->vxlan_dst_port != port ||
|
|
|
+ !IS_PF(bp)) {
|
|
|
DP(BNX2X_MSG_SP, "Invalid vxlan port\n");
|
|
|
return;
|
|
|
}
|
|
|
+ bp->vxlan_dst_port--;
|
|
|
+ if (bp->vxlan_dst_port)
|
|
|
+ return;
|
|
|
|
|
|
if (netif_running(bp->dev)) {
|
|
|
bnx2x_schedule_sp_rtnl(bp, BNX2X_SP_RTNL_DEL_VXLAN_PORT, 0);
|