History

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: eee2faabc63d tcp: account for ts offset only if tsecr not zero v3: * Rebased, conflict solved. v2: * Added Eric's fix (patch 5/5). ====================

David S. Miller committed 9 years ago

Commit e65ade72 parents c12f4d7 7f0137e13 files · +49 −27Browse files

Unified · Split

13 files
  1. drivers/net/ethernet/mellanox/mlx4/cmd.c +20 −2
  2. drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c +1 −1
  3. drivers/net/ethernet/mellanox/mlx4/en_netdev.c +1 −5
  4. drivers/net/ethernet/mellanox/mlx4/en_rx.c +4 −4
  5. drivers/net/ethernet/mellanox/mlx4/eq.c +2 −3
  6. drivers/net/ethernet/mellanox/mlx4/fw.c +1 −1
  7. drivers/net/ethernet/mellanox/mlx4/intf.c +1 −1
  8. drivers/net/ethernet/mellanox/mlx4/main.c +5 −6
  9. drivers/net/ethernet/mellanox/mlx4/mr.c +1 −1
  10. drivers/net/ethernet/mellanox/mlx4/qp.c +1 −1
  11. drivers/net/ethernet/mellanox/mlx4/resource_tracker.c +1 −1
  12. include/linux/mlx4/cmd.h +1 −1
  13. include/linux/mlx4/driver.h +10 −0
drivers/net/ethernet/mellanox/mlx4/cmd.c+20−2
@@ -43,6 +43,7 @@ · 42 unmodified lines
43#include <linux/semaphore.h>43#include <linux/semaphore.h>
44#include <rdma/ib_smi.h>44#include <rdma/ib_smi.h>
45#include <linux/delay.h>45#include <linux/delay.h>
46#include <linux/etherdevice.h>
46 47
47#include <asm/io.h>48#include <asm/io.h>
48 49
@@ -2955,7 +2956,7 @@ static bool mlx4_valid_vf_state_change(struct mlx4_dev *dev, int port, · 2906 unmodified lines
2955 return false;2956 return false;
2956}2957}
2957 2958
2958int mlx4_set_vf_mac(struct mlx4_dev *dev, int port, int vf, u64 mac)2959int mlx4_set_vf_mac(struct mlx4_dev *dev, int port, int vf, u8 *mac)
2959{2960{
2960 struct mlx4_priv *priv = mlx4_priv(dev);2961 struct mlx4_priv *priv = mlx4_priv(dev);
2961 struct mlx4_vport_state *s_info;2962 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) · 2 unmodified lines
2964 if (!mlx4_is_master(dev))2965 if (!mlx4_is_master(dev))
2965 return -EPROTONOSUPPORT;2966 return -EPROTONOSUPPORT;
2966 2967
2968 if (is_multicast_ether_addr(mac))
2969 return -EINVAL;
2970
2967 slave = mlx4_get_slave_indx(dev, vf);2971 slave = mlx4_get_slave_indx(dev, vf);
2968 if (slave < 0)2972 if (slave < 0)
2969 return -EINVAL;2973 return -EINVAL;
2970 2974
2971 port = mlx4_slaves_closest_port(dev, slave, port);2975 port = mlx4_slaves_closest_port(dev, slave, port);
2972 s_info = &priv->mfunc.master.vf_admin[slave].vport[port];2976 s_info = &priv->mfunc.master.vf_admin[slave].vport[port];
2973 s_info->mac = mac;2977
2978 if (s_info->spoofchk && is_zero_ether_addr(mac)) {
2979 mlx4_info(dev, "MAC invalidation is not allowed when spoofchk is on\n");
2980 return -EPERM;
2981 }
2982
2983 s_info->mac = mlx4_mac_to_u64(mac);
2974 mlx4_info(dev, "default mac on vf %d port %d to %llX will take effect only after vf restart\n",2984 mlx4_info(dev, "default mac on vf %d port %d to %llX will take effect only after vf restart\n",
2975 vf, port, s_info->mac);2985 vf, port, s_info->mac);
2976 return 0;2986 return 0;
@@ -3143,6 +3153,7 @@ int mlx4_set_vf_spoofchk(struct mlx4_dev *dev, int port, int vf, bool setting) · 166 unmodified lines
3143 struct mlx4_priv *priv = mlx4_priv(dev);3153 struct mlx4_priv *priv = mlx4_priv(dev);
3144 struct mlx4_vport_state *s_info;3154 struct mlx4_vport_state *s_info;
3145 int slave;3155 int slave;
3156 u8 mac[ETH_ALEN];
3146 3157
3147 if ((!mlx4_is_master(dev)) ||3158 if ((!mlx4_is_master(dev)) ||
3148 !(dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_FSM))3159 !(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) · 5 unmodified lines
3154 3165
3155 port = mlx4_slaves_closest_port(dev, slave, port);3166 port = mlx4_slaves_closest_port(dev, slave, port);
3156 s_info = &priv->mfunc.master.vf_admin[slave].vport[port];3167 s_info = &priv->mfunc.master.vf_admin[slave].vport[port];
3168
3169 mlx4_u64_to_mac(mac, s_info->mac);
3170 if (setting && !is_valid_ether_addr(mac)) {
3171 mlx4_info(dev, "Illegal MAC with spoofchk\n");
3172 return -EPERM;
3173 }
3174
3157 s_info->spoofchk = setting;3175 s_info->spoofchk = setting;
3158 3176
3159 return 0;3177 return 0;
drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c+1−1
@@ -319,7 +319,7 @@ static int mlx4_en_ets_validate(struct mlx4_en_priv *priv, struct ieee_ets *ets) · 318 unmodified lines
319 default:319 default:
320 en_err(priv, "TC[%d]: Not supported TSA: %d\n",320 en_err(priv, "TC[%d]: Not supported TSA: %d\n",
321 i, ets->tc_tsa[i]);321 i, ets->tc_tsa[i]);
322 return -ENOTSUPP;322 return -EOPNOTSUPP;
323 }323 }
324 }324 }
325 325
drivers/net/ethernet/mellanox/mlx4/en_netdev.c+1−5
@@ -2485,12 +2485,8 @@ static int mlx4_en_set_vf_mac(struct net_device *dev, int queue, u8 *mac) · 2484 unmodified lines
2485{2485{
2486 struct mlx4_en_priv *en_priv = netdev_priv(dev);2486 struct mlx4_en_priv *en_priv = netdev_priv(dev);
2487 struct mlx4_en_dev *mdev = en_priv->mdev;2487 struct mlx4_en_dev *mdev = en_priv->mdev;
2488 u64 mac_u64 = mlx4_mac_to_u64(mac);
2489 2488
2490 if (is_multicast_ether_addr(mac))2489 return mlx4_set_vf_mac(mdev->dev, en_priv->port, queue, mac);
2491 return -EINVAL;
2492
2493 return mlx4_set_vf_mac(mdev->dev, en_priv->port, queue, mac_u64);
2494}2490}
2495 2491
2496static int mlx4_en_set_vf_vlan(struct net_device *dev, int vf, u16 vlan, u8 qos,2492static int mlx4_en_set_vf_vlan(struct net_device *dev, int vf, u16 vlan, u8 qos,
drivers/net/ethernet/mellanox/mlx4/en_rx.c+4−4
@@ -604,10 +604,10 @@ static int mlx4_en_complete_rx_desc(struct mlx4_en_priv *priv, · 603 unmodified lines
604 dma_sync_single_for_cpu(priv->ddev, dma, frag_info->frag_size,604 dma_sync_single_for_cpu(priv->ddev, dma, frag_info->frag_size,
605 DMA_FROM_DEVICE);605 DMA_FROM_DEVICE);
606 606
607 /* Save page reference in skb */607 __skb_fill_page_desc(skb, nr, frags[nr].page,
608 __skb_frag_set_page(&skb_frags_rx[nr], frags[nr].page);608 frags[nr].page_offset,
609 skb_frag_size_set(&skb_frags_rx[nr], frag_info->frag_size);609 frag_info->frag_size);
610 skb_frags_rx[nr].page_offset = frags[nr].page_offset;610
611 skb->truesize += frag_info->frag_stride;611 skb->truesize += frag_info->frag_stride;
612 frags[nr].page = NULL;612 frags[nr].page = NULL;
613 }613 }
drivers/net/ethernet/mellanox/mlx4/eq.c+2−3
@@ -1249,9 +1249,8 @@ int mlx4_init_eq_table(struct mlx4_dev *dev) · 1248 unmodified lines
1249 mlx4_warn(dev, "Failed adding irq rmap\n");1249 mlx4_warn(dev, "Failed adding irq rmap\n");
1250 }1250 }
1251#endif1251#endif
1252 err = mlx4_create_eq(dev, dev->caps.num_cqs -1252 err = mlx4_create_eq(dev, dev->quotas.cq +
1253 dev->caps.reserved_cqs +1253 MLX4_NUM_SPARE_EQE,
1254 MLX4_NUM_SPARE_EQE,
1255 (dev->flags & MLX4_FLAG_MSI_X) ?1254 (dev->flags & MLX4_FLAG_MSI_X) ?
1256 i + 1 - !!(i > MLX4_EQ_ASYNC) : 0,1255 i + 1 - !!(i > MLX4_EQ_ASYNC) : 0,
1257 eq);1256 eq);
drivers/net/ethernet/mellanox/mlx4/fw.c+1−1
@@ -2436,7 +2436,7 @@ int mlx4_config_dev_retrieval(struct mlx4_dev *dev, · 2435 unmodified lines
2436#define CONFIG_DEV_RX_CSUM_MODE_PORT2_BIT_OFFSET 42436#define CONFIG_DEV_RX_CSUM_MODE_PORT2_BIT_OFFSET 4
2437 2437
2438 if (!(dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_CONFIG_DEV))2438 if (!(dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_CONFIG_DEV))
2439 return -ENOTSUPP;2439 return -EOPNOTSUPP;
2440 2440
2441 err = mlx4_CONFIG_DEV_get(dev, &config_dev);2441 err = mlx4_CONFIG_DEV_get(dev, &config_dev);
2442 if (err)2442 if (err)
drivers/net/ethernet/mellanox/mlx4/intf.c+1−1
@@ -136,7 +136,7 @@ int mlx4_do_bond(struct mlx4_dev *dev, bool enable) · 135 unmodified lines
136 LIST_HEAD(bond_list);136 LIST_HEAD(bond_list);
137 137
138 if (!(dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_PORT_REMAP))138 if (!(dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_PORT_REMAP))
139 return -ENOTSUPP;139 return -EOPNOTSUPP;
140 140
141 ret = mlx4_disable_rx_port_check(dev, enable);141 ret = mlx4_disable_rx_port_check(dev, enable);
142 if (ret) {142 if (ret) {
drivers/net/ethernet/mellanox/mlx4/main.c+5−6
@@ -841,8 +841,6 @@ static int mlx4_slave_cap(struct mlx4_dev *dev) · 840 unmodified lines
841 return -EINVAL;841 return -EINVAL;
842 }842 }
843 843
844 mlx4_log_num_mgm_entry_size = hca_param.log_mc_entry_sz;
845
846 dev->caps.hca_core_clock = hca_param.hca_core_clock;844 dev->caps.hca_core_clock = hca_param.hca_core_clock;
847 845
848 memset(&dev_cap, 0, sizeof(dev_cap));846 memset(&dev_cap, 0, sizeof(dev_cap));
@@ -1447,7 +1445,7 @@ int mlx4_port_map_set(struct mlx4_dev *dev, struct mlx4_port_map *v2p) · 598 unmodified lines
1447 int err;1445 int err;
1448 1446
1449 if (!(dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_PORT_REMAP))1447 if (!(dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_PORT_REMAP))
1450 return -ENOTSUPP;1448 return -EOPNOTSUPP;
1451 1449
1452 mutex_lock(&priv->bond_mutex);1450 mutex_lock(&priv->bond_mutex);
1453 1451
@@ -1884,7 +1882,7 @@ int mlx4_get_internal_clock_params(struct mlx4_dev *dev, · 430 unmodified lines
1884 struct mlx4_priv *priv = mlx4_priv(dev);1882 struct mlx4_priv *priv = mlx4_priv(dev);
1885 1883
1886 if (mlx4_is_slave(dev))1884 if (mlx4_is_slave(dev))
1887 return -ENOTSUPP;1885 return -EOPNOTSUPP;
1888 1886
1889 if (!params)1887 if (!params)
1890 return -EINVAL;1888 return -EINVAL;
@@ -2384,7 +2382,7 @@ static int mlx4_init_hca(struct mlx4_dev *dev) · 493 unmodified lines
2384 2382
2385 /* Query CONFIG_DEV parameters */2383 /* Query CONFIG_DEV parameters */
2386 err = mlx4_config_dev_retrieval(dev, &params);2384 err = mlx4_config_dev_retrieval(dev, &params);
2387 if (err && err != -ENOTSUPP) {2385 if (err && err != -EOPNOTSUPP) {
2388 mlx4_err(dev, "Failed to query CONFIG_DEV parameters\n");2386 mlx4_err(dev, "Failed to query CONFIG_DEV parameters\n");
2389 } else if (!err) {2387 } else if (!err) {
2390 dev->caps.rx_checksum_flags_port[1] = params.rx_csum_flags_port_1;2388 dev->caps.rx_checksum_flags_port[1] = params.rx_csum_flags_port_1;
@@ -3503,6 +3501,8 @@ slave_start: · 1112 unmodified lines
3503 goto err_disable_msix;3501 goto err_disable_msix;
3504 }3502 }
3505 3503
3504 mlx4_init_quotas(dev);
3505
3506 err = mlx4_setup_hca(dev);3506 err = mlx4_setup_hca(dev);
3507 if (err == -EBUSY && (dev->flags & MLX4_FLAG_MSI_X) &&3507 if (err == -EBUSY && (dev->flags & MLX4_FLAG_MSI_X) &&
3508 !mlx4_is_mfunc(dev)) {3508 !mlx4_is_mfunc(dev)) {
@@ -3515,7 +3515,6 @@ slave_start: · 6 unmodified lines
3515 if (err)3515 if (err)
3516 goto err_steer;3516 goto err_steer;
3517 3517
3518 mlx4_init_quotas(dev);
3519 /* When PF resources are ready arm its comm channel to enable3518 /* When PF resources are ready arm its comm channel to enable
3520 * getting commands3519 * getting commands
3521 */3520 */
drivers/net/ethernet/mellanox/mlx4/mr.c+1−1
@@ -823,7 +823,7 @@ int mlx4_mw_alloc(struct mlx4_dev *dev, u32 pd, enum mlx4_mw_type type, · 822 unmodified lines
823 !(dev->caps.flags & MLX4_DEV_CAP_FLAG_MEM_WINDOW)) ||823 !(dev->caps.flags & MLX4_DEV_CAP_FLAG_MEM_WINDOW)) ||
824 (type == MLX4_MW_TYPE_2 &&824 (type == MLX4_MW_TYPE_2 &&
825 !(dev->caps.bmme_flags & MLX4_BMME_FLAG_TYPE_2_WIN)))825 !(dev->caps.bmme_flags & MLX4_BMME_FLAG_TYPE_2_WIN)))
826 return -ENOTSUPP;826 return -EOPNOTSUPP;
827 827
828 index = mlx4_mpt_reserve(dev);828 index = mlx4_mpt_reserve(dev);
829 if (index == -1)829 if (index == -1)
drivers/net/ethernet/mellanox/mlx4/qp.c+1−1
@@ -447,7 +447,7 @@ int mlx4_update_qp(struct mlx4_dev *dev, u32 qpn, · 446 unmodified lines
447 & MLX4_DEV_CAP_FLAG2_UPDATE_QP_SRC_CHECK_LB)) {447 & MLX4_DEV_CAP_FLAG2_UPDATE_QP_SRC_CHECK_LB)) {
448 mlx4_warn(dev,448 mlx4_warn(dev,
449 "Trying to set src check LB, but it isn't supported\n");449 "Trying to set src check LB, but it isn't supported\n");
450 err = -ENOTSUPP;450 err = -EOPNOTSUPP;
451 goto out;451 goto out;
452 }452 }
453 pri_addr_path_mask |=453 pri_addr_path_mask |=
drivers/net/ethernet/mellanox/mlx4/resource_tracker.c+1−1
@@ -4297,7 +4297,7 @@ int mlx4_UPDATE_QP_wrapper(struct mlx4_dev *dev, int slave, · 4296 unmodified lines
4297 MLX4_DEV_CAP_FLAG2_UPDATE_QP_SRC_CHECK_LB)) {4297 MLX4_DEV_CAP_FLAG2_UPDATE_QP_SRC_CHECK_LB)) {
4298 mlx4_warn(dev, "Src check LB for slave %d isn't supported\n",4298 mlx4_warn(dev, "Src check LB for slave %d isn't supported\n",
4299 slave);4299 slave);
4300 return -ENOTSUPP;4300 return -EOPNOTSUPP;
4301 }4301 }
4302 4302
4303 /* Just change the smac for the QP */4303 /* Just change the smac for the QP */
include/linux/mlx4/cmd.h+1−1
@@ -308,7 +308,7 @@ int mlx4_get_counter_stats(struct mlx4_dev *dev, int counter_index, · 307 unmodified lines
308int mlx4_get_vf_stats(struct mlx4_dev *dev, int port, int vf_idx,308int mlx4_get_vf_stats(struct mlx4_dev *dev, int port, int vf_idx,
309 struct ifla_vf_stats *vf_stats);309 struct ifla_vf_stats *vf_stats);
310u32 mlx4_comm_get_version(void);310u32 mlx4_comm_get_version(void);
311int mlx4_set_vf_mac(struct mlx4_dev *dev, int port, int vf, u64 mac);311int mlx4_set_vf_mac(struct mlx4_dev *dev, int port, int vf, u8 *mac);
312int mlx4_set_vf_vlan(struct mlx4_dev *dev, int port, int vf, u16 vlan,312int mlx4_set_vf_vlan(struct mlx4_dev *dev, int port, int vf, u16 vlan,
313 u8 qos, __be16 proto);313 u8 qos, __be16 proto);
314int mlx4_set_vf_rate(struct mlx4_dev *dev, int port, int vf, int min_tx_rate,314int mlx4_set_vf_rate(struct mlx4_dev *dev, int port, int vf, int min_tx_rate,
include/linux/mlx4/driver.h+10−0
@@ -104,4 +104,14 @@ static inline u64 mlx4_mac_to_u64(u8 *addr) · 103 unmodified lines
104 return mac;104 return mac;
105}105}
106 106
107static inline void mlx4_u64_to_mac(u8 *addr, u64 mac)
108{
109 int i;
110
111 for (i = ETH_ALEN; i > 0; i--) {
112 addr[i - 1] = mac && 0xFF;
113 mac >>= 8;
114 }
115}
116
107#endif /* MLX4_DRIVER_H */117#endif /* MLX4_DRIVER_H */