Commit 1bdc0b10 authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'vxlan-fixes'



Jiri Benc says:

====================
vxlan fixes

This fixes various issues with vxlan related to IPv6.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents c38f6ac7 ac7eccd4
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1946,6 +1946,7 @@ struct bnx2x {
	u16 vlan_cnt;
	u16 vlan_credit;
	u16 vxlan_dst_port;
	u8 vxlan_dst_port_count;
	bool accept_any_vlan;
};

+12 −2
Original line number Diff line number Diff line
@@ -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);
+1 −0
Original line number Diff line number Diff line
@@ -582,6 +582,7 @@ struct be_adapter {
	u16 pvid;
	__be16 vxlan_port;
	int vxlan_port_count;
	int vxlan_port_aliases;
	struct phy_info phy;
	u8 wol_cap;
	bool wol_en;
+10 −0
Original line number Diff line number Diff line
@@ -5176,6 +5176,11 @@ static void be_add_vxlan_port(struct net_device *netdev, sa_family_t sa_family,
	if (lancer_chip(adapter) || BEx_chip(adapter) || be_is_mc(adapter))
		return;

	if (adapter->vxlan_port == port && adapter->vxlan_port_count) {
		adapter->vxlan_port_aliases++;
		return;
	}

	if (adapter->flags & BE_FLAGS_VXLAN_OFFLOADS) {
		dev_info(dev,
			 "Only one UDP port supported for VxLAN offloads\n");
@@ -5226,6 +5231,11 @@ static void be_del_vxlan_port(struct net_device *netdev, sa_family_t sa_family,
	if (adapter->vxlan_port != port)
		goto done;

	if (adapter->vxlan_port_aliases) {
		adapter->vxlan_port_aliases--;
		return;
	}

	be_disable_vxlan_offloads(adapter);

	dev_info(&adapter->pdev->dev,
+1 −0
Original line number Diff line number Diff line
@@ -536,6 +536,7 @@ struct qlcnic_hardware_context {
	u8 extend_lb_time;
	u8 phys_port_id[ETH_ALEN];
	u8 lb_mode;
	u8 vxlan_port_count;
	u16 vxlan_port;
	struct device *hwmon_dev;
	u32 post_mode;
Loading