Lines Matching full:actions

67 			       struct bnxt_tc_actions *actions,  in bnxt_tc_parse_redir()  argument
77 actions->flags |= BNXT_TC_ACTION_FLAG_FWD; in bnxt_tc_parse_redir()
78 actions->dst_dev = dev; in bnxt_tc_parse_redir()
83 struct bnxt_tc_actions *actions, in bnxt_tc_parse_vlan() argument
88 actions->flags |= BNXT_TC_ACTION_FLAG_POP_VLAN; in bnxt_tc_parse_vlan()
91 actions->flags |= BNXT_TC_ACTION_FLAG_PUSH_VLAN; in bnxt_tc_parse_vlan()
92 actions->push_vlan_tci = htons(act->vlan.vid); in bnxt_tc_parse_vlan()
93 actions->push_vlan_tpid = act->vlan.proto; in bnxt_tc_parse_vlan()
102 struct bnxt_tc_actions *actions, in bnxt_tc_parse_tunnel_set() argument
113 actions->tun_encap_key = *tun_key; in bnxt_tc_parse_tunnel_set()
114 actions->flags |= BNXT_TC_ACTION_FLAG_TUNNEL_ENCAP; in bnxt_tc_parse_tunnel_set()
151 bnxt_fill_l2_rewrite_fields(struct bnxt_tc_actions *actions, in bnxt_fill_l2_rewrite_fields() argument
166 actions->l2_rewrite_dmac[j] = cpu_to_be16(*(p + j)); in bnxt_fill_l2_rewrite_fields()
175 actions->l2_rewrite_smac[j] = cpu_to_be16(*(p + j)); in bnxt_fill_l2_rewrite_fields()
182 bnxt_tc_parse_pedit(struct bnxt *bp, struct bnxt_tc_actions *actions, in bnxt_tc_parse_pedit() argument
204 actions->flags |= BNXT_TC_ACTION_FLAG_L2_REWRITE; in bnxt_tc_parse_pedit()
210 actions->flags |= BNXT_TC_ACTION_FLAG_NAT_XLATE; in bnxt_tc_parse_pedit()
211 actions->nat.l3_is_ipv4 = true; in bnxt_tc_parse_pedit()
213 actions->nat.src_xlate = true; in bnxt_tc_parse_pedit()
214 actions->nat.l3.ipv4.saddr.s_addr = htonl(val); in bnxt_tc_parse_pedit()
216 actions->nat.src_xlate = false; in bnxt_tc_parse_pedit()
217 actions->nat.l3.ipv4.daddr.s_addr = htonl(val); in bnxt_tc_parse_pedit()
226 actions->nat.src_xlate, &actions->nat.l3.ipv4.saddr, in bnxt_tc_parse_pedit()
227 &actions->nat.l3.ipv4.daddr); in bnxt_tc_parse_pedit()
231 actions->flags |= BNXT_TC_ACTION_FLAG_NAT_XLATE; in bnxt_tc_parse_pedit()
232 actions->nat.l3_is_ipv4 = false; in bnxt_tc_parse_pedit()
238 actions->nat.src_xlate = true; in bnxt_tc_parse_pedit()
241 actions->nat.l3.ipv6.saddr.s6_addr32[idx] = htonl(val); in bnxt_tc_parse_pedit()
244 actions->nat.src_xlate = false; in bnxt_tc_parse_pedit()
246 actions->nat.l3.ipv6.saddr.s6_addr32[idx] = htonl(val); in bnxt_tc_parse_pedit()
259 if (!(actions->flags & BNXT_TC_ACTION_FLAG_NAT_XLATE)) { in bnxt_tc_parse_pedit()
264 if (actions->nat.src_xlate) in bnxt_tc_parse_pedit()
265 actions->nat.l4.ports.sport = htons(val); in bnxt_tc_parse_pedit()
267 actions->nat.l4.ports.dport = htons(val); in bnxt_tc_parse_pedit()
268 netdev_dbg(bp->dev, "actions->nat.sport = %d dport = %d\n", in bnxt_tc_parse_pedit()
269 actions->nat.l4.ports.sport, in bnxt_tc_parse_pedit()
270 actions->nat.l4.ports.dport); in bnxt_tc_parse_pedit()
281 struct bnxt_tc_actions *actions, in bnxt_tc_parse_actions() argument
299 netdev_info(bp->dev, "no actions\n"); in bnxt_tc_parse_actions()
309 actions->flags |= BNXT_TC_ACTION_FLAG_DROP; in bnxt_tc_parse_actions()
310 return 0; /* don't bother with other actions */ in bnxt_tc_parse_actions()
312 rc = bnxt_tc_parse_redir(bp, actions, act); in bnxt_tc_parse_actions()
319 rc = bnxt_tc_parse_vlan(bp, actions, act); in bnxt_tc_parse_actions()
324 rc = bnxt_tc_parse_tunnel_set(bp, actions, act); in bnxt_tc_parse_actions()
329 actions->flags |= BNXT_TC_ACTION_FLAG_TUNNEL_DECAP; in bnxt_tc_parse_actions()
333 rc = bnxt_tc_parse_pedit(bp, actions, act, i, in bnxt_tc_parse_actions()
344 if (actions->flags & BNXT_TC_ACTION_FLAG_L2_REWRITE) { in bnxt_tc_parse_actions()
345 rc = bnxt_fill_l2_rewrite_fields(actions, eth_addr, in bnxt_tc_parse_actions()
351 if (actions->flags & BNXT_TC_ACTION_FLAG_FWD) { in bnxt_tc_parse_actions()
352 if (actions->flags & BNXT_TC_ACTION_FLAG_TUNNEL_ENCAP) { in bnxt_tc_parse_actions()
354 actions->dst_fid = bp->pf.fw_fid; in bnxt_tc_parse_actions()
357 actions->dst_fid = in bnxt_tc_parse_actions()
358 bnxt_flow_get_dst_fid(bp, actions->dst_dev); in bnxt_tc_parse_actions()
359 if (actions->dst_fid == BNXT_FID_INVALID) in bnxt_tc_parse_actions()
498 return bnxt_tc_parse_actions(bp, &flow->actions, &rule->action, in bnxt_tc_parse_flow()
587 struct bnxt_tc_actions *actions = &flow->actions; in bnxt_hwrm_cfa_flow_alloc() local
600 if (actions->flags & BNXT_TC_ACTION_FLAG_L2_REWRITE) { in bnxt_hwrm_cfa_flow_alloc()
601 memcpy(req.l2_rewrite_dmac, actions->l2_rewrite_dmac, in bnxt_hwrm_cfa_flow_alloc()
603 memcpy(req.l2_rewrite_smac, actions->l2_rewrite_smac, in bnxt_hwrm_cfa_flow_alloc()
609 if (actions->flags & BNXT_TC_ACTION_FLAG_NAT_XLATE) { in bnxt_hwrm_cfa_flow_alloc()
610 if (actions->nat.l3_is_ipv4) { in bnxt_hwrm_cfa_flow_alloc()
614 if (actions->nat.src_xlate) { in bnxt_hwrm_cfa_flow_alloc()
619 actions->nat.l3.ipv4.saddr.s_addr; in bnxt_hwrm_cfa_flow_alloc()
621 if (actions->nat.l4.ports.sport) in bnxt_hwrm_cfa_flow_alloc()
623 actions->nat.l4.ports.sport; in bnxt_hwrm_cfa_flow_alloc()
629 actions->nat.l3.ipv4.daddr.s_addr; in bnxt_hwrm_cfa_flow_alloc()
631 if (actions->nat.l4.ports.dport) in bnxt_hwrm_cfa_flow_alloc()
633 actions->nat.l4.ports.dport; in bnxt_hwrm_cfa_flow_alloc()
637 req.nat_ip_address, actions->nat.src_xlate, in bnxt_hwrm_cfa_flow_alloc()
640 if (actions->nat.src_xlate) { in bnxt_hwrm_cfa_flow_alloc()
645 actions->nat.l3.ipv6.saddr.s6_addr32, in bnxt_hwrm_cfa_flow_alloc()
648 if (actions->nat.l4.ports.sport) in bnxt_hwrm_cfa_flow_alloc()
650 actions->nat.l4.ports.sport; in bnxt_hwrm_cfa_flow_alloc()
656 actions->nat.l3.ipv6.daddr.s6_addr32, in bnxt_hwrm_cfa_flow_alloc()
659 if (actions->nat.l4.ports.dport) in bnxt_hwrm_cfa_flow_alloc()
661 actions->nat.l4.ports.dport; in bnxt_hwrm_cfa_flow_alloc()
665 req.nat_ip_address, actions->nat.src_xlate, in bnxt_hwrm_cfa_flow_alloc()
670 if (actions->flags & BNXT_TC_ACTION_FLAG_TUNNEL_DECAP || in bnxt_hwrm_cfa_flow_alloc()
671 actions->flags & BNXT_TC_ACTION_FLAG_TUNNEL_ENCAP) { in bnxt_hwrm_cfa_flow_alloc()
736 if (actions->flags & BNXT_TC_ACTION_FLAG_DROP) { in bnxt_hwrm_cfa_flow_alloc()
739 if (actions->flags & BNXT_TC_ACTION_FLAG_FWD) { in bnxt_hwrm_cfa_flow_alloc()
741 req.dst_fid = cpu_to_le16(actions->dst_fid); in bnxt_hwrm_cfa_flow_alloc()
743 if (actions->flags & BNXT_TC_ACTION_FLAG_PUSH_VLAN) { in bnxt_hwrm_cfa_flow_alloc()
746 req.l2_rewrite_vlan_tpid = actions->push_vlan_tpid; in bnxt_hwrm_cfa_flow_alloc()
747 req.l2_rewrite_vlan_tci = actions->push_vlan_tci; in bnxt_hwrm_cfa_flow_alloc()
751 if (actions->flags & BNXT_TC_ACTION_FLAG_POP_VLAN) { in bnxt_hwrm_cfa_flow_alloc()
1394 struct ip_tunnel_key *encap_key = &flow->actions.tun_encap_key; in bnxt_tc_get_encap_handle()
1438 if (flow->actions.flags & BNXT_TC_ACTION_FLAG_TUNNEL_DECAP) in bnxt_tc_put_tunnel_handle()
1440 else if (flow->actions.flags & BNXT_TC_ACTION_FLAG_TUNNEL_ENCAP) in bnxt_tc_put_tunnel_handle()
1449 if (flow->actions.flags & BNXT_TC_ACTION_FLAG_TUNNEL_DECAP) in bnxt_tc_get_tunnel_handle()
1452 else if (flow->actions.flags & BNXT_TC_ACTION_FLAG_TUNNEL_ENCAP) in bnxt_tc_get_tunnel_handle()
1496 if (flow->actions.flags & BNXT_TC_ACTION_FLAG_TUNNEL_DECAP) in bnxt_tc_set_src_fid()