Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

Merge branch 'mlx4-misc-fixes'



Tariq Toukan says:

====================
mlx4 misc fixes

This patchset contains misc bug fixes from Eric Dumazet and our team
to the mlx4 Core and Eth drivers.

Series generated against net commit:
eee2faab tcp: account for ts offset only if tsecr not zero

v3:
* Rebased, conflict solved.

v2:
* Added Eric's fix (patch 5/5).
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents c12f4d76 7f0137e2
Loading
Loading
Loading
Loading
+20 −2
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@
#include <linux/semaphore.h>
#include <rdma/ib_smi.h>
#include <linux/delay.h>
#include <linux/etherdevice.h>

#include <asm/io.h>

@@ -2955,7 +2956,7 @@ static bool mlx4_valid_vf_state_change(struct mlx4_dev *dev, int port,
	return false;
}

int mlx4_set_vf_mac(struct mlx4_dev *dev, int port, int vf, u64 mac)
int mlx4_set_vf_mac(struct mlx4_dev *dev, int port, int vf, u8 *mac)
{
	struct mlx4_priv *priv = mlx4_priv(dev);
	struct mlx4_vport_state *s_info;
@@ -2964,13 +2965,22 @@ int mlx4_set_vf_mac(struct mlx4_dev *dev, int port, int vf, u64 mac)
	if (!mlx4_is_master(dev))
		return -EPROTONOSUPPORT;

	if (is_multicast_ether_addr(mac))
		return -EINVAL;

	slave = mlx4_get_slave_indx(dev, vf);
	if (slave < 0)
		return -EINVAL;

	port = mlx4_slaves_closest_port(dev, slave, port);
	s_info = &priv->mfunc.master.vf_admin[slave].vport[port];
	s_info->mac = mac;

	if (s_info->spoofchk && is_zero_ether_addr(mac)) {
		mlx4_info(dev, "MAC invalidation is not allowed when spoofchk is on\n");
		return -EPERM;
	}

	s_info->mac = mlx4_mac_to_u64(mac);
	mlx4_info(dev, "default mac on vf %d port %d to %llX will take effect only after vf restart\n",
		  vf, port, s_info->mac);
	return 0;
@@ -3143,6 +3153,7 @@ int mlx4_set_vf_spoofchk(struct mlx4_dev *dev, int port, int vf, bool setting)
	struct mlx4_priv *priv = mlx4_priv(dev);
	struct mlx4_vport_state *s_info;
	int slave;
	u8 mac[ETH_ALEN];

	if ((!mlx4_is_master(dev)) ||
	    !(dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_FSM))
@@ -3154,6 +3165,13 @@ int mlx4_set_vf_spoofchk(struct mlx4_dev *dev, int port, int vf, bool setting)

	port = mlx4_slaves_closest_port(dev, slave, port);
	s_info = &priv->mfunc.master.vf_admin[slave].vport[port];

	mlx4_u64_to_mac(mac, s_info->mac);
	if (setting && !is_valid_ether_addr(mac)) {
		mlx4_info(dev, "Illegal MAC with spoofchk\n");
		return -EPERM;
	}

	s_info->spoofchk = setting;

	return 0;
+1 −1
Original line number Diff line number Diff line
@@ -319,7 +319,7 @@ static int mlx4_en_ets_validate(struct mlx4_en_priv *priv, struct ieee_ets *ets)
		default:
			en_err(priv, "TC[%d]: Not supported TSA: %d\n",
					i, ets->tc_tsa[i]);
			return -ENOTSUPP;
			return -EOPNOTSUPP;
		}
	}

+1 −5
Original line number Diff line number Diff line
@@ -2485,12 +2485,8 @@ static int mlx4_en_set_vf_mac(struct net_device *dev, int queue, u8 *mac)
{
	struct mlx4_en_priv *en_priv = netdev_priv(dev);
	struct mlx4_en_dev *mdev = en_priv->mdev;
	u64 mac_u64 = mlx4_mac_to_u64(mac);

	if (is_multicast_ether_addr(mac))
		return -EINVAL;

	return mlx4_set_vf_mac(mdev->dev, en_priv->port, queue, mac_u64);
	return mlx4_set_vf_mac(mdev->dev, en_priv->port, queue, mac);
}

static int mlx4_en_set_vf_vlan(struct net_device *dev, int vf, u16 vlan, u8 qos,
+4 −4
Original line number Diff line number Diff line
@@ -604,10 +604,10 @@ static int mlx4_en_complete_rx_desc(struct mlx4_en_priv *priv,
		dma_sync_single_for_cpu(priv->ddev, dma, frag_info->frag_size,
					DMA_FROM_DEVICE);

		/* Save page reference in skb */
		__skb_frag_set_page(&skb_frags_rx[nr], frags[nr].page);
		skb_frag_size_set(&skb_frags_rx[nr], frag_info->frag_size);
		skb_frags_rx[nr].page_offset = frags[nr].page_offset;
		__skb_fill_page_desc(skb, nr, frags[nr].page,
				     frags[nr].page_offset,
				     frag_info->frag_size);

		skb->truesize += frag_info->frag_stride;
		frags[nr].page = NULL;
	}
+2 −3
Original line number Diff line number Diff line
@@ -1249,8 +1249,7 @@ int mlx4_init_eq_table(struct mlx4_dev *dev)
					mlx4_warn(dev, "Failed adding irq rmap\n");
			}
#endif
			err = mlx4_create_eq(dev, dev->caps.num_cqs -
						  dev->caps.reserved_cqs +
			err = mlx4_create_eq(dev, dev->quotas.cq +
					     MLX4_NUM_SPARE_EQE,
					     (dev->flags & MLX4_FLAG_MSI_X) ?
					     i + 1 - !!(i > MLX4_EQ_ASYNC) : 0,
Loading