Lines Matching defs:esw_attr

130 	struct mlx5_esw_flow_attr *esw_attr = attr->esw_attr;
142 if (!attr->chain && esw_attr && esw_attr->int_port)
144 mlx5e_tc_int_port_get_metadata_for_match(esw_attr->int_port);
286 struct mlx5_esw_flow_attr *esw_attr = attr->esw_attr;
291 if (esw_attr->dests[i].flags & MLX5_ESW_DEST_CHAIN_WITH_SRC_PORT_CHANGE)
293 else if (mlx5_esw_indir_table_needed(esw, attr, esw_attr->dests[i].vport,
294 esw_attr->dests[i].mdev))
295 mlx5_esw_indir_table_put(esw, esw_attr->dests[i].vport, false);
299 esw_is_chain_src_port_rewrite(struct mlx5_eswitch *esw, struct mlx5_esw_flow_attr *esw_attr)
303 for (i = esw_attr->split_count; i < esw_attr->out_count; i++)
304 if (esw_attr->dests[i].flags & MLX5_ESW_DEST_CHAIN_WITH_SRC_PORT_CHANGE)
317 struct mlx5_esw_flow_attr *esw_attr = attr->esw_attr;
326 if (esw_attr->out_count - esw_attr->split_count > 1)
333 if (esw_attr->dests[esw_attr->split_count].pkt_reformat) {
335 flow_act->pkt_reformat = esw_attr->dests[esw_attr->split_count].pkt_reformat;
345 struct mlx5_esw_flow_attr *esw_attr = attr->esw_attr;
347 esw_put_dest_tables_loop(esw, attr, esw_attr->split_count, esw_attr->out_count);
353 struct mlx5_esw_flow_attr *esw_attr = attr->esw_attr;
362 for (i = esw_attr->split_count; i < esw_attr->out_count; i++) {
363 if (esw_attr->dests[i].vport_valid &&
364 mlx5_esw_indir_table_needed(esw, attr, esw_attr->dests[i].vport,
365 esw_attr->dests[i].mdev)) {
382 struct mlx5_esw_flow_attr *esw_attr = attr->esw_attr;
388 for (j = esw_attr->split_count; j < esw_attr->out_count; j++, (*i)++) {
393 esw_attr->dests[j].vport, false);
409 esw_put_dest_tables_loop(esw, attr, esw_attr->split_count, j);
415 struct mlx5_esw_flow_attr *esw_attr = attr->esw_attr;
417 esw_put_dest_tables_loop(esw, attr, esw_attr->split_count, esw_attr->out_count);
433 struct mlx5_esw_flow_attr *esw_attr,
437 esw_attr->dests[attr_idx].vport_valid &&
438 esw_attr->dests[attr_idx].vport == MLX5_VPORT_UPLINK &&
440 (esw_attr->dests[attr_idx].flags & MLX5_ESW_DEST_ENCAP_VALID) &&
441 esw_attr->dests[attr_idx].vport != esw_attr->in_rep->vport &&
442 esw_same_vhca_id(esw_attr->dests[attr_idx].mdev, esw->dev))
449 struct mlx5_esw_flow_attr *esw_attr)
456 for (i = 0; i < esw_attr->split_count; i++)
457 if (esw_setup_uplink_fwd_ipsec_needed(esw, esw_attr, i))
460 for (i = esw_attr->split_count; i < esw_attr->out_count; i++)
461 if (esw_setup_uplink_fwd_ipsec_needed(esw, esw_attr, i) &&
462 (esw_attr->out_count - esw_attr->split_count > 1))
470 struct mlx5_eswitch *esw, struct mlx5_esw_flow_attr *esw_attr,
474 dest[dest_idx].vport.num = esw_attr->dests[attr_idx].vport;
477 MLX5_CAP_GEN(esw_attr->dests[attr_idx].mdev, vhca_id);
483 if (esw_attr->dests[attr_idx].flags & MLX5_ESW_DEST_ENCAP_VALID) {
486 flow_act->pkt_reformat = esw_attr->dests[attr_idx].pkt_reformat;
489 dest[dest_idx].vport.pkt_reformat = esw_attr->dests[attr_idx].pkt_reformat;
495 struct mlx5_eswitch *esw, struct mlx5_esw_flow_attr *esw_attr,
501 esw_attr->dests[attr_idx].flags & MLX5_ESW_DEST_ENCAP_VALID) {
503 flow_act->pkt_reformat = esw_attr->dests[attr_idx].pkt_reformat;
509 struct mlx5_eswitch *esw, struct mlx5_esw_flow_attr *esw_attr,
512 if (esw_setup_uplink_fwd_ipsec_needed(esw, esw_attr, attr_idx))
513 esw_setup_dest_fwd_ipsec(dest, flow_act, esw, esw_attr,
516 esw_setup_dest_fwd_vport(dest, flow_act, esw, esw_attr,
522 struct mlx5_eswitch *esw, struct mlx5_esw_flow_attr *esw_attr,
527 for (j = esw_attr->split_count; j < esw_attr->out_count; j++, i++)
528 esw_setup_vport_dest(dest, flow_act, esw, esw_attr, j, i, true);
575 struct mlx5_esw_flow_attr *esw_attr = attr->esw_attr;
600 } else if (esw_is_chain_src_port_rewrite(esw, esw_attr)) {
603 *i = esw_setup_vport_dests(dest, flow_act, esw, esw_attr, *i);
623 struct mlx5_esw_flow_attr *esw_attr = attr->esw_attr;
633 else if (esw_is_chain_src_port_rewrite(esw, esw_attr))
658 struct mlx5_esw_flow_attr *esw_attr = attr->esw_attr;
660 bool split = !!(esw_attr->split_count);
673 if (!esw_flow_dests_fwd_ipsec_check(esw, esw_attr))
683 flow_act.vlan[0].ethtype = ntohs(esw_attr->vlan_proto[0]);
684 flow_act.vlan[0].vid = esw_attr->vlan_vid[0];
685 flow_act.vlan[0].prio = esw_attr->vlan_prio[0];
687 flow_act.vlan[1].ethtype = ntohs(esw_attr->vlan_proto[1]);
688 flow_act.vlan[1].vid = esw_attr->vlan_vid[1];
689 flow_act.vlan[1].prio = esw_attr->vlan_prio[1];
693 mlx5_eswitch_set_rule_flow_source(esw, spec, esw_attr);
714 if (esw_attr->decap_pkt_reformat)
715 flow_act.pkt_reformat = esw_attr->decap_pkt_reformat;
738 fwd_attr.vport = esw_attr->in_rep->vport;
751 esw_attr->in_mdev->priv.eswitch,
752 esw_attr->in_rep->vport);
765 rule = mlx5_eswitch_add_termtbl_rule(esw, fdb, spec, esw_attr,
795 struct mlx5_esw_flow_attr *esw_attr = attr->esw_attr;
816 fwd_attr.vport = esw_attr->in_rep->vport;
825 for (i = 0; i < esw_attr->split_count; i++) {
826 if (esw_attr->dests[i].flags & MLX5_ESW_DEST_CHAIN_WITH_SRC_PORT_CHANGE)
832 esw_setup_vport_dest(dest, &flow_act, esw, esw_attr, i, i, false);
844 esw_attr->in_mdev->priv.eswitch,
845 esw_attr->in_rep->vport);
854 i = esw_attr->split_count;
877 struct mlx5_esw_flow_attr *esw_attr = attr->esw_attr;
879 bool split = (esw_attr->split_count > 0);
888 if (esw_attr->dests[i].termtbl)
889 mlx5_eswitch_termtbl_put(esw, esw_attr->dests[i].termtbl);
898 fwd_attr.vport = esw_attr->in_rep->vport;
4400 struct mlx5_esw_flow_attr *esw_attr, int attr_idx)
4405 if (!esw_setup_uplink_fwd_ipsec_needed(esw, esw_attr, attr_idx))
4408 esw_setup_dest_fwd_ipsec(&old_dest, NULL, esw, esw_attr, attr_idx, 0, false);
4409 esw_setup_dest_fwd_vport(&new_dest, NULL, esw, esw_attr, attr_idx, 0, false);