Lines Matching refs:actions

68 			       struct bnxt_tc_actions *actions,  in bnxt_tc_parse_redir()  argument
78 actions->flags |= BNXT_TC_ACTION_FLAG_FWD; in bnxt_tc_parse_redir()
79 actions->dst_dev = dev; in bnxt_tc_parse_redir()
84 struct bnxt_tc_actions *actions, in bnxt_tc_parse_vlan() argument
89 actions->flags |= BNXT_TC_ACTION_FLAG_POP_VLAN; in bnxt_tc_parse_vlan()
92 actions->flags |= BNXT_TC_ACTION_FLAG_PUSH_VLAN; in bnxt_tc_parse_vlan()
93 actions->push_vlan_tci = htons(act->vlan.vid); in bnxt_tc_parse_vlan()
94 actions->push_vlan_tpid = act->vlan.proto; in bnxt_tc_parse_vlan()
103 struct bnxt_tc_actions *actions, in bnxt_tc_parse_tunnel_set() argument
114 actions->tun_encap_key = *tun_key; in bnxt_tc_parse_tunnel_set()
115 actions->flags |= BNXT_TC_ACTION_FLAG_TUNNEL_ENCAP; in bnxt_tc_parse_tunnel_set()
152 bnxt_fill_l2_rewrite_fields(struct bnxt_tc_actions *actions, in bnxt_fill_l2_rewrite_fields() argument
167 actions->l2_rewrite_dmac[j] = cpu_to_be16(*(p + j)); in bnxt_fill_l2_rewrite_fields()
176 actions->l2_rewrite_smac[j] = cpu_to_be16(*(p + j)); in bnxt_fill_l2_rewrite_fields()
183 bnxt_tc_parse_pedit(struct bnxt *bp, struct bnxt_tc_actions *actions, in bnxt_tc_parse_pedit() argument
205 actions->flags |= BNXT_TC_ACTION_FLAG_L2_REWRITE; in bnxt_tc_parse_pedit()
211 actions->flags |= BNXT_TC_ACTION_FLAG_NAT_XLATE; in bnxt_tc_parse_pedit()
212 actions->nat.l3_is_ipv4 = true; in bnxt_tc_parse_pedit()
214 actions->nat.src_xlate = true; in bnxt_tc_parse_pedit()
215 actions->nat.l3.ipv4.saddr.s_addr = htonl(val); in bnxt_tc_parse_pedit()
217 actions->nat.src_xlate = false; in bnxt_tc_parse_pedit()
218 actions->nat.l3.ipv4.daddr.s_addr = htonl(val); in bnxt_tc_parse_pedit()
227 actions->nat.src_xlate, &actions->nat.l3.ipv4.saddr, in bnxt_tc_parse_pedit()
228 &actions->nat.l3.ipv4.daddr); in bnxt_tc_parse_pedit()
232 actions->flags |= BNXT_TC_ACTION_FLAG_NAT_XLATE; in bnxt_tc_parse_pedit()
233 actions->nat.l3_is_ipv4 = false; in bnxt_tc_parse_pedit()
239 actions->nat.src_xlate = true; in bnxt_tc_parse_pedit()
242 actions->nat.l3.ipv6.saddr.s6_addr32[idx] = htonl(val); in bnxt_tc_parse_pedit()
245 actions->nat.src_xlate = false; in bnxt_tc_parse_pedit()
247 actions->nat.l3.ipv6.saddr.s6_addr32[idx] = htonl(val); in bnxt_tc_parse_pedit()
260 if (!(actions->flags & BNXT_TC_ACTION_FLAG_NAT_XLATE)) { in bnxt_tc_parse_pedit()
265 if (actions->nat.src_xlate) in bnxt_tc_parse_pedit()
266 actions->nat.l4.ports.sport = htons(val); in bnxt_tc_parse_pedit()
268 actions->nat.l4.ports.dport = htons(val); in bnxt_tc_parse_pedit()
270 actions->nat.l4.ports.sport, in bnxt_tc_parse_pedit()
271 actions->nat.l4.ports.dport); in bnxt_tc_parse_pedit()
282 struct bnxt_tc_actions *actions, in bnxt_tc_parse_actions() argument
310 actions->flags |= BNXT_TC_ACTION_FLAG_DROP; in bnxt_tc_parse_actions()
313 rc = bnxt_tc_parse_redir(bp, actions, act); in bnxt_tc_parse_actions()
320 rc = bnxt_tc_parse_vlan(bp, actions, act); in bnxt_tc_parse_actions()
325 rc = bnxt_tc_parse_tunnel_set(bp, actions, act); in bnxt_tc_parse_actions()
330 actions->flags |= BNXT_TC_ACTION_FLAG_TUNNEL_DECAP; in bnxt_tc_parse_actions()
334 rc = bnxt_tc_parse_pedit(bp, actions, act, i, in bnxt_tc_parse_actions()
345 if (actions->flags & BNXT_TC_ACTION_FLAG_L2_REWRITE) { in bnxt_tc_parse_actions()
346 rc = bnxt_fill_l2_rewrite_fields(actions, eth_addr, in bnxt_tc_parse_actions()
352 if (actions->flags & BNXT_TC_ACTION_FLAG_FWD) { in bnxt_tc_parse_actions()
353 if (actions->flags & BNXT_TC_ACTION_FLAG_TUNNEL_ENCAP) { in bnxt_tc_parse_actions()
355 actions->dst_fid = bp->pf.fw_fid; in bnxt_tc_parse_actions()
358 actions->dst_fid = in bnxt_tc_parse_actions()
359 bnxt_flow_get_dst_fid(bp, actions->dst_dev); in bnxt_tc_parse_actions()
360 if (actions->dst_fid == BNXT_FID_INVALID) in bnxt_tc_parse_actions()
499 return bnxt_tc_parse_actions(bp, &flow->actions, &rule->action, in bnxt_tc_parse_flow()
590 struct bnxt_tc_actions *actions = &flow->actions; in bnxt_hwrm_cfa_flow_alloc() local
605 if (actions->flags & BNXT_TC_ACTION_FLAG_L2_REWRITE) { in bnxt_hwrm_cfa_flow_alloc()
606 memcpy(req->l2_rewrite_dmac, actions->l2_rewrite_dmac, in bnxt_hwrm_cfa_flow_alloc()
608 memcpy(req->l2_rewrite_smac, actions->l2_rewrite_smac, in bnxt_hwrm_cfa_flow_alloc()
614 if (actions->flags & BNXT_TC_ACTION_FLAG_NAT_XLATE) { in bnxt_hwrm_cfa_flow_alloc()
615 if (actions->nat.l3_is_ipv4) { in bnxt_hwrm_cfa_flow_alloc()
619 if (actions->nat.src_xlate) { in bnxt_hwrm_cfa_flow_alloc()
624 actions->nat.l3.ipv4.saddr.s_addr; in bnxt_hwrm_cfa_flow_alloc()
626 if (actions->nat.l4.ports.sport) in bnxt_hwrm_cfa_flow_alloc()
628 actions->nat.l4.ports.sport; in bnxt_hwrm_cfa_flow_alloc()
634 actions->nat.l3.ipv4.daddr.s_addr; in bnxt_hwrm_cfa_flow_alloc()
636 if (actions->nat.l4.ports.dport) in bnxt_hwrm_cfa_flow_alloc()
638 actions->nat.l4.ports.dport; in bnxt_hwrm_cfa_flow_alloc()
642 req->nat_ip_address, actions->nat.src_xlate, in bnxt_hwrm_cfa_flow_alloc()
645 if (actions->nat.src_xlate) { in bnxt_hwrm_cfa_flow_alloc()
650 actions->nat.l3.ipv6.saddr.s6_addr32, in bnxt_hwrm_cfa_flow_alloc()
653 if (actions->nat.l4.ports.sport) in bnxt_hwrm_cfa_flow_alloc()
655 actions->nat.l4.ports.sport; in bnxt_hwrm_cfa_flow_alloc()
661 actions->nat.l3.ipv6.daddr.s6_addr32, in bnxt_hwrm_cfa_flow_alloc()
664 if (actions->nat.l4.ports.dport) in bnxt_hwrm_cfa_flow_alloc()
666 actions->nat.l4.ports.dport; in bnxt_hwrm_cfa_flow_alloc()
670 req->nat_ip_address, actions->nat.src_xlate, in bnxt_hwrm_cfa_flow_alloc()
675 if (actions->flags & BNXT_TC_ACTION_FLAG_TUNNEL_DECAP || in bnxt_hwrm_cfa_flow_alloc()
676 actions->flags & BNXT_TC_ACTION_FLAG_TUNNEL_ENCAP) { in bnxt_hwrm_cfa_flow_alloc()
741 if (actions->flags & BNXT_TC_ACTION_FLAG_DROP) { in bnxt_hwrm_cfa_flow_alloc()
744 if (actions->flags & BNXT_TC_ACTION_FLAG_FWD) { in bnxt_hwrm_cfa_flow_alloc()
746 req->dst_fid = cpu_to_le16(actions->dst_fid); in bnxt_hwrm_cfa_flow_alloc()
748 if (actions->flags & BNXT_TC_ACTION_FLAG_PUSH_VLAN) { in bnxt_hwrm_cfa_flow_alloc()
751 req->l2_rewrite_vlan_tpid = actions->push_vlan_tpid; in bnxt_hwrm_cfa_flow_alloc()
752 req->l2_rewrite_vlan_tci = actions->push_vlan_tci; in bnxt_hwrm_cfa_flow_alloc()
756 if (actions->flags & BNXT_TC_ACTION_FLAG_POP_VLAN) { in bnxt_hwrm_cfa_flow_alloc()
1402 struct ip_tunnel_key *encap_key = &flow->actions.tun_encap_key; in bnxt_tc_get_encap_handle()
1446 if (flow->actions.flags & BNXT_TC_ACTION_FLAG_TUNNEL_DECAP) in bnxt_tc_put_tunnel_handle()
1448 else if (flow->actions.flags & BNXT_TC_ACTION_FLAG_TUNNEL_ENCAP) in bnxt_tc_put_tunnel_handle()
1457 if (flow->actions.flags & BNXT_TC_ACTION_FLAG_TUNNEL_DECAP) in bnxt_tc_get_tunnel_handle()
1460 else if (flow->actions.flags & BNXT_TC_ACTION_FLAG_TUNNEL_ENCAP) in bnxt_tc_get_tunnel_handle()
1504 if (flow->actions.flags & BNXT_TC_ACTION_FLAG_TUNNEL_DECAP) in bnxt_tc_set_src_fid()