Lines Matching refs:spec

835 static int parse_trans_rule(struct mlx4_dev *dev, struct mlx4_spec_list *spec,  in parse_trans_rule()  argument
838 if (mlx4_hw_rule_sz(dev, spec->id) < 0) in parse_trans_rule()
840 memset(rule_hw, 0, mlx4_hw_rule_sz(dev, spec->id)); in parse_trans_rule()
841 rule_hw->id = cpu_to_be16(__sw_id_hw[spec->id]); in parse_trans_rule()
842 rule_hw->size = mlx4_hw_rule_sz(dev, spec->id) >> 2; in parse_trans_rule()
844 switch (spec->id) { in parse_trans_rule()
846 memcpy(rule_hw->eth.dst_mac, spec->eth.dst_mac, ETH_ALEN); in parse_trans_rule()
847 memcpy(rule_hw->eth.dst_mac_msk, spec->eth.dst_mac_msk, in parse_trans_rule()
849 memcpy(rule_hw->eth.src_mac, spec->eth.src_mac, ETH_ALEN); in parse_trans_rule()
850 memcpy(rule_hw->eth.src_mac_msk, spec->eth.src_mac_msk, in parse_trans_rule()
852 if (spec->eth.ether_type_enable) { in parse_trans_rule()
854 rule_hw->eth.ether_type = spec->eth.ether_type; in parse_trans_rule()
856 rule_hw->eth.vlan_tag = spec->eth.vlan_id; in parse_trans_rule()
857 rule_hw->eth.vlan_tag_msk = spec->eth.vlan_id_msk; in parse_trans_rule()
861 rule_hw->ib.l3_qpn = spec->ib.l3_qpn; in parse_trans_rule()
862 rule_hw->ib.qpn_mask = spec->ib.qpn_msk; in parse_trans_rule()
863 memcpy(&rule_hw->ib.dst_gid, &spec->ib.dst_gid, 16); in parse_trans_rule()
864 memcpy(&rule_hw->ib.dst_gid_msk, &spec->ib.dst_gid_msk, 16); in parse_trans_rule()
871 rule_hw->ipv4.src_ip = spec->ipv4.src_ip; in parse_trans_rule()
872 rule_hw->ipv4.src_ip_msk = spec->ipv4.src_ip_msk; in parse_trans_rule()
873 rule_hw->ipv4.dst_ip = spec->ipv4.dst_ip; in parse_trans_rule()
874 rule_hw->ipv4.dst_ip_msk = spec->ipv4.dst_ip_msk; in parse_trans_rule()
879 rule_hw->tcp_udp.dst_port = spec->tcp_udp.dst_port; in parse_trans_rule()
880 rule_hw->tcp_udp.dst_port_msk = spec->tcp_udp.dst_port_msk; in parse_trans_rule()
881 rule_hw->tcp_udp.src_port = spec->tcp_udp.src_port; in parse_trans_rule()
882 rule_hw->tcp_udp.src_port_msk = spec->tcp_udp.src_port_msk; in parse_trans_rule()
887 cpu_to_be32(be32_to_cpu(spec->vxlan.vni) << 8); in parse_trans_rule()
889 cpu_to_be32(be32_to_cpu(spec->vxlan.vni_mask) << 8); in parse_trans_rule()
896 return __rule_hw_sz[spec->id]; in parse_trans_rule()
1365 struct mlx4_spec_list spec = { {NULL} }; in mlx4_trans_to_dmfs_attach() local
1382 spec.id = MLX4_NET_TRANS_RULE_ID_ETH; in mlx4_trans_to_dmfs_attach()
1383 memcpy(spec.eth.dst_mac, &gid[10], ETH_ALEN); in mlx4_trans_to_dmfs_attach()
1384 memcpy(spec.eth.dst_mac_msk, &mac_mask, ETH_ALEN); in mlx4_trans_to_dmfs_attach()
1388 spec.id = MLX4_NET_TRANS_RULE_ID_IB; in mlx4_trans_to_dmfs_attach()
1389 memcpy(spec.ib.dst_gid, gid, 16); in mlx4_trans_to_dmfs_attach()
1390 memset(&spec.ib.dst_gid_msk, 0xff, 16); in mlx4_trans_to_dmfs_attach()
1395 list_add_tail(&spec.list, &rule.list); in mlx4_trans_to_dmfs_attach()