Lines Matching defs:port
147 MODULE_PARM_DESC(log_num_mac, "Log2 max number of MACs per ETH port (1-7)");
151 MODULE_PARM_DESC(log_num_vlan, "Log2 max number of VLANs per ETH port (0-7)");
152 /* Log2 max number of VLANs per ETH port (0-7) */
169 MODULE_PARM_DESC(port_type_array, "Array of port types: HW_DEFAULT (0) is default "
314 mlx4_err(dev, "Only same port types supported on this HCA, aborting\n");
322 mlx4_err(dev, "Requested port type for port %d is not supported on this HCA\n",
396 static int _mlx4_dev_port(struct mlx4_dev *dev, int port,
399 dev->caps.vl_cap[port] = port_cap->max_vl;
400 dev->caps.ib_mtu_cap[port] = port_cap->ib_mtu;
401 dev->phys_caps.gid_phys_table_len[port] = port_cap->max_gids;
402 dev->phys_caps.pkey_phys_table_len[port] = port_cap->max_pkeys;
406 dev->caps.gid_table_len[port] = port_cap->max_gids;
407 dev->caps.pkey_table_len[port] = port_cap->max_pkeys;
408 dev->caps.port_width_cap[port] = port_cap->max_port_width;
409 dev->caps.eth_mtu_cap[port] = port_cap->eth_mtu;
411 dev->caps.def_mac[port] = port_cap->def_mac;
412 dev->caps.supported_type[port] = port_cap->supported_port_types;
413 dev->caps.suggested_type[port] = port_cap->suggested_type;
414 dev->caps.default_sense[port] = port_cap->default_sense;
415 dev->caps.trans_type[port] = port_cap->trans_type;
416 dev->caps.vendor_oui[port] = port_cap->vendor_oui;
417 dev->caps.wavelength[port] = port_cap->wavelength;
418 dev->caps.trans_code[port] = port_cap->trans_code;
423 static int mlx4_dev_port(struct mlx4_dev *dev, int port,
428 err = mlx4_QUERY_PORT(dev, port, port_cap);
573 /* Sense port always allowed on supported devices for ConnectX-1 and -2 */
576 /* Don't do sense port on multifunction devices (for now at least) */
599 /* if IB and ETH are supported, we set the port
600 * type according to user selection of port type;
610 * Link sensing is allowed on the port if 3 conditions are true:
611 * 1. Both protocols are supported on the port.
612 * 2. Different types are supported on the port
621 * If "default_sense" bit is set, we move the port to "AUTO" mode
623 * port type from beginning
637 mlx4_warn(dev, "Requested number of MACs is too much for port %d, reducing to %d\n",
642 mlx4_warn(dev, "Requested number of VLANs is too much for port %d, reducing to %d\n",
778 void mlx4_sync_pkey_table(struct mlx4_dev *dev, int slave, int port, int i, int val)
785 priv->virt2phys_pkey[slave][port - 1][i] = val;
882 mlx4_err(dev, "QUERY_FUNC_CAP port command failed for port %d, aborting (%d)\n",
893 mlx4_err(dev, "QUERY_PORT command failed for port %d, aborting (%d)\n",
1094 * Change the port configuration of the device.
1095 * Every user of this function must hold the port mutex.
1102 int port;
1104 for (port = 0; port < dev->caps.num_ports; port++) {
1105 /* Change the port type only if the new type is different
1107 if (port_types[port] != dev->caps.port_type[port + 1])
1112 for (port = 1; port <= dev->caps.num_ports; port++) {
1113 mlx4_CLOSE_PORT(dev, port);
1114 dev->caps.port_type[port] = port_types[port - 1];
1115 err = mlx4_SET_PORT(dev, port, -1);
1117 mlx4_err(dev, "Failed to set port %d, aborting\n",
1118 port);
1144 (mdev->caps.port_type[info->port] == MLX4_PORT_TYPE_IB) ?
1146 if (mdev->caps.possible_type[info->port] == MLX4_PORT_TYPE_AUTO)
1164 if ((port_type & mdev->caps.supported_type[info->port]) != port_type) {
1166 "Requested port type for port %d is not supported on this HCA\n",
1167 info->port);
1176 mdev->caps.possible_type[info->port] = info->tmp_type;
1179 types[i] = priv->port[i+1].tmp_type ? priv->port[i+1].tmp_type :
1209 priv->port[i + 1].tmp_type = 0;
1240 mlx4_err(mdev, "%s is not supported port type\n", buf);
1293 if (mdev->caps.port_type[info->port] == MLX4_PORT_TYPE_ETH)
1294 mlx4_warn(mdev, "port level mtu is only used for IB ports\n");
1297 ibta_mtu_to_int(mdev->caps.port_ib_mtu[info->port]));
1309 int err, port, mtu, ibta_mtu = -1;
1311 if (mdev->caps.port_type[info->port] == MLX4_PORT_TYPE_ETH) {
1312 mlx4_warn(mdev, "port level mtu is only used for IB ports\n");
1325 mdev->caps.port_ib_mtu[info->port] = ibta_mtu;
1330 for (port = 1; port <= mdev->caps.num_ports; port++) {
1331 mlx4_CLOSE_PORT(mdev, port);
1332 err = mlx4_SET_PORT(mdev, port, -1);
1334 mlx4_err(mdev, "Failed to set port %d, aborting\n",
1335 port);
1358 /* only single port vfs are allowed */
1366 * physical function for each port.
1488 /* zero means keep current mapping for this port */
1506 mlx4_dbg(dev, "port map changed: [%d][%d]\n",
1511 mlx4_err(dev, "Failed to change port mape: %d\n", err);
1541 "Fail to set port map [%d][%d]: %d\n",
2357 mlx4_err(dev, "Fail to get physical port id\n");
2561 int port;
2563 for (port = 0; port < dev->caps.num_ports; port++)
2564 if (priv->def_counter[port] != -1)
2565 mlx4_counter_free(dev, priv->def_counter[port]);
2571 int port, err = 0;
2574 for (port = 0; port < dev->caps.num_ports; port++)
2575 priv->def_counter[port] = -1;
2577 for (port = 0; port < dev->caps.num_ports; port++) {
2581 priv->def_counter[port] = idx;
2587 priv->def_counter[port] = MLX4_SINK_COUNTER_INDEX(dev);
2592 mlx4_err(dev, "%s: failed to allocate default counter port %d err %d\n",
2593 __func__, port + 1, err);
2598 mlx4_dbg(dev, "%s: default counter index %d for port %d\n",
2599 __func__, priv->def_counter[port], port + 1);
2689 int mlx4_get_default_counter_index(struct mlx4_dev *dev, int port)
2693 return priv->def_counter[port - 1];
2697 void mlx4_set_admin_guid(struct mlx4_dev *dev, __be64 guid, int entry, int port)
2701 priv->mfunc.master.vf_admin[entry].vport[port].guid = guid;
2705 __be64 mlx4_get_admin_guid(struct mlx4_dev *dev, int entry, int port)
2709 return priv->mfunc.master.vf_admin[entry].vport[port].guid;
2713 void mlx4_set_random_admin_guid(struct mlx4_dev *dev, int entry, int port)
2725 priv->mfunc.master.vf_admin[entry].vport[port].guid = guid;
2732 int port;
2847 for (port = 1; port <= dev->caps.num_ports; port++) {
2849 err = mlx4_get_port_ib_caps(dev, port,
2852 mlx4_warn(dev, "failed to get port %d default ib capabilities (%d). Continuing with caps = 0\n",
2853 port, err);
2854 dev->caps.ib_port_def_cap[port] = ib_port_default_caps;
2856 /* initialize per-slave default ib port capabilities */
2862 priv->mfunc.master.slave_state[i].ib_cap_mask[port] =
2868 dev->caps.port_ib_mtu[port] = IB_MTU_2048;
2870 dev->caps.port_ib_mtu[port] = IB_MTU_4096;
2872 err = mlx4_SET_PORT(dev, port, mlx4_is_master(dev) ?
2873 dev->caps.pkey_table_len[port] : -1);
2875 mlx4_err(dev, "Failed to set port %d, aborting\n",
2876 port);
2930 static int mlx4_init_affinity_hint(struct mlx4_dev *dev, int port, int eqn)
2941 for (i = 1; i < port; i++)
2946 /* Meaning EQs are shared, and this call comes from the second port */
2965 int port = 0;
3011 set_bit(port,
3013 if (mlx4_init_affinity_hint(dev, port + 1, i))
3019 * refers to the number of Eqs per port
3033 port++;
3084 static int mlx4_init_port_info(struct mlx4_dev *dev, int port)
3087 struct mlx4_port_info *info = &mlx4_priv(dev)->port[port];
3090 err = devl_port_register_with_ops(devlink, &info->devlink_port, port,
3095 /* Ethernet and IB drivers will normally set the port type,
3100 dev->caps.port_type[port] == MLX4_PORT_TYPE_ETH)
3103 dev->caps.port_type[port] == MLX4_PORT_TYPE_IB)
3107 info->port = port;
3112 info->base_qpn = mlx4_get_base_qpn(dev, port);
3115 sprintf(info->dev_name, "mlx4_port%d", port);
3128 mlx4_err(dev, "Failed to create file for port %d\n", port);
3131 info->port = -1;
3135 sprintf(info->dev_mtu_name, "mlx4_port%d_mtu", port);
3149 mlx4_err(dev, "Failed to create mtu file for port %d\n", port);
3154 info->port = -1;
3163 if (info->port < 0)
3398 int port;
3621 "Error: Trying to configure VFs on port 2, but HCA has only %d physical ports\n",
3696 for (port = 1; port <= dev->caps.num_ports; port++) {
3697 err = mlx4_init_port_info(dev, port);
3721 for (--port; port >= 1; --port)
3722 mlx4_cleanup_port_info(&priv->port[port]);
3812 * per port, we must limit the number of VFs to 63 (since their are
3844 "Requested more VF's (%d) for port (%d) than allowed by driver (%d)\n",
4121 mlx4_cleanup_port_info(&priv->port[p]);
4275 mlx4_err(dev, "could not restore original port types (%d)\n",
4413 mlx4_err(dev, "could not restore original port types (%d)\n", err);
4488 mlx4_err(dev, "resume: could not restore original port types (%d)\n", ret);