Lines Matching refs:primary

21 	bool primary;
23 struct { /* primary */
51 return sd->primary ? dev : sd->primary_dev;
55 mlx5_sd_primary_get_peer(struct mlx5_core_dev *primary, int idx)
60 return primary;
62 if (idx >= mlx5_sd_get_host_buses(primary))
65 sd = mlx5_get_sd(primary);
79 struct mlx5_core_dev *mlx5_sd_ch_ix_get_dev(struct mlx5_core_dev *primary, int ch_ix)
81 int mdev_idx = mlx5_sd_ch_ix_get_dev_ix(primary, ch_ix);
83 return mlx5_sd_primary_get_peer(primary, mdev_idx);
117 /* RX steering from primary to secondaries */
123 /* TX steering from secondaries to primary */
209 struct mlx5_core_dev *peer, *primary;
233 primary = dev;
235 if (peer->pdev->bus->number < primary->pdev->bus->number)
236 primary = peer;
238 primary_sd = mlx5_get_sd(primary);
239 primary_sd->primary = true;
246 peer_sd->primary = false;
247 peer_sd->primary_dev = primary;
271 static int sd_cmd_set_primary(struct mlx5_core_dev *primary, u8 *alias_key)
274 struct mlx5_sd *sd = mlx5_get_sd(primary);
280 nic_ns = mlx5_get_flow_namespace(primary, MLX5_FLOW_NAMESPACE_EGRESS);
294 err = mlx5_cmd_allow_other_vhca_access(primary, &allow_attr);
296 mlx5_core_err(primary, "Failed to allow other vhca access err=%d\n",
305 static void sd_cmd_unset_primary(struct mlx5_core_dev *primary)
307 struct mlx5_sd *sd = mlx5_get_sd(primary);
313 struct mlx5_core_dev *primary,
318 u16 vhca_id_to_be_accessed = MLX5_CAP_GEN(primary, vhca_id);
345 struct mlx5_core_dev *primary,
348 struct mlx5_sd *primary_sd = mlx5_get_sd(primary);
356 err = sd_secondary_create_alias_ft(secondary, primary, primary_sd->tx_ft,
381 static void sd_print_group(struct mlx5_core_dev *primary)
383 struct mlx5_sd *sd = mlx5_get_sd(primary);
387 sd_info(primary, "group id %#x, primary %s, vhca %#x\n",
388 sd->group_id, pci_name(primary->pdev),
389 MLX5_CAP_GEN(primary, vhca_id));
390 mlx5_sd_for_each_secondary(i, primary, pos)
391 sd_info(primary, "group id %#x, secondary_%d %s, vhca %#x\n",
418 struct mlx5_core_dev *primary, *pos, *to;
438 primary = mlx5_sd_get_primary(dev);
443 err = sd_cmd_set_primary(primary, alias_key);
447 sd->dfs = debugfs_create_dir("multi-pf", mlx5_debugfs_get_dev_root(primary));
449 debugfs_create_file("primary", 0400, sd->dfs, primary, &dev_fops);
451 mlx5_sd_for_each_secondary(i, primary, pos) {
454 err = sd_cmd_set_secondary(pos, primary, alias_key);
463 sd_info(primary, "group id %#x, size %d, combined\n",
465 sd_print_group(primary);
471 mlx5_sd_for_each_secondary_to(i, primary, to, pos)
473 sd_cmd_unset_primary(primary);
485 struct mlx5_core_dev *primary, *pos;
494 primary = mlx5_sd_get_primary(dev);
495 mlx5_sd_for_each_secondary(i, primary, pos)
497 sd_cmd_unset_primary(primary);
500 sd_info(primary, "group id %#x, uncombined\n", sd->group_id);
511 struct mlx5_core_dev *primary;
519 primary = mlx5_sd_get_primary(dev);
520 if (dev == primary)
523 return &primary->priv.adev[idx]->adev;