aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMoni Shoua <monis@mellanox.com>2016-01-14 10:50:36 -0500
committerDoug Ledford <dledford@redhat.com>2016-01-19 15:35:00 -0500
commitfca83006294a6356705781eee31da1658fd411a5 (patch)
tree5f59f6cce1bab3c6c08b833f54ec675bfa65b337
parent7e57b85c444c3c1bf3550aa6890666fc4353bd33 (diff)
net/mlx4_core: Add support for configuring RoCE v2 UDP port
In order to support RoCE v2, the hardware needs to be configured to classify certain UDP packets as RoCE v2 packets and pass it through its RoCE pipeline. This patch enables configuring this UDP port. Signed-off-by: Moni Shoua <monis@mellanox.com> Signed-off-by: Matan Barak <matanb@mellanox.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/fw.c16
-rw-r--r--include/linux/mlx4/device.h1
2 files changed, 16 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/fw.c b/drivers/net/ethernet/mellanox/mlx4/fw.c
index e6282fc16d74..9d1dfc608887 100644
--- a/drivers/net/ethernet/mellanox/mlx4/fw.c
+++ b/drivers/net/ethernet/mellanox/mlx4/fw.c
@@ -2252,7 +2252,8 @@ struct mlx4_config_dev {
2252 __be32 rsvd1[3]; 2252 __be32 rsvd1[3];
2253 __be16 vxlan_udp_dport; 2253 __be16 vxlan_udp_dport;
2254 __be16 rsvd2; 2254 __be16 rsvd2;
2255 __be32 rsvd3; 2255 __be16 roce_v2_entropy;
2256 __be16 roce_v2_udp_dport;
2256 __be32 roce_flags; 2257 __be32 roce_flags;
2257 __be32 rsvd4[25]; 2258 __be32 rsvd4[25];
2258 __be16 rsvd5; 2259 __be16 rsvd5;
@@ -2261,6 +2262,7 @@ struct mlx4_config_dev {
2261}; 2262};
2262 2263
2263#define MLX4_VXLAN_UDP_DPORT (1 << 0) 2264#define MLX4_VXLAN_UDP_DPORT (1 << 0)
2265#define MLX4_ROCE_V2_UDP_DPORT BIT(3)
2264#define MLX4_DISABLE_RX_PORT BIT(18) 2266#define MLX4_DISABLE_RX_PORT BIT(18)
2265 2267
2266static int mlx4_CONFIG_DEV_set(struct mlx4_dev *dev, struct mlx4_config_dev *config_dev) 2268static int mlx4_CONFIG_DEV_set(struct mlx4_dev *dev, struct mlx4_config_dev *config_dev)
@@ -2378,6 +2380,18 @@ int mlx4_disable_rx_port_check(struct mlx4_dev *dev, bool dis)
2378 return mlx4_CONFIG_DEV_set(dev, &config_dev); 2380 return mlx4_CONFIG_DEV_set(dev, &config_dev);
2379} 2381}
2380 2382
2383int mlx4_config_roce_v2_port(struct mlx4_dev *dev, u16 udp_port)
2384{
2385 struct mlx4_config_dev config_dev;
2386
2387 memset(&config_dev, 0, sizeof(config_dev));
2388 config_dev.update_flags = cpu_to_be32(MLX4_ROCE_V2_UDP_DPORT);
2389 config_dev.roce_v2_udp_dport = cpu_to_be16(udp_port);
2390
2391 return mlx4_CONFIG_DEV_set(dev, &config_dev);
2392}
2393EXPORT_SYMBOL_GPL(mlx4_config_roce_v2_port);
2394
2381int mlx4_virt2phy_port_map(struct mlx4_dev *dev, u32 port1, u32 port2) 2395int mlx4_virt2phy_port_map(struct mlx4_dev *dev, u32 port1, u32 port2)
2382{ 2396{
2383 struct mlx4_cmd_mailbox *mailbox; 2397 struct mlx4_cmd_mailbox *mailbox;
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index 28cbee0df7d7..430a929f048b 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -1457,6 +1457,7 @@ int mlx4_get_base_gid_ix(struct mlx4_dev *dev, int slave, int port);
1457 1457
1458int mlx4_config_vxlan_port(struct mlx4_dev *dev, __be16 udp_port); 1458int mlx4_config_vxlan_port(struct mlx4_dev *dev, __be16 udp_port);
1459int mlx4_disable_rx_port_check(struct mlx4_dev *dev, bool dis); 1459int mlx4_disable_rx_port_check(struct mlx4_dev *dev, bool dis);
1460int mlx4_config_roce_v2_port(struct mlx4_dev *dev, u16 udp_port);
1460int mlx4_virt2phy_port_map(struct mlx4_dev *dev, u32 port1, u32 port2); 1461int mlx4_virt2phy_port_map(struct mlx4_dev *dev, u32 port1, u32 port2);
1461int mlx4_vf_smi_enabled(struct mlx4_dev *dev, int slave, int port); 1462int mlx4_vf_smi_enabled(struct mlx4_dev *dev, int slave, int port);
1462int mlx4_vf_get_enable_smi_admin(struct mlx4_dev *dev, int slave, int port); 1463int mlx4_vf_get_enable_smi_admin(struct mlx4_dev *dev, int slave, int port);