Lines Matching defs:flow

585 nfp_flower_update_merge_with_actions(struct nfp_fl_payload *flow,
604 while (act_off < flow->meta.act_len) {
605 a = (struct nfp_fl_act_head *)&flow->action_data[act_off];
701 nfp_flower_populate_merge_match(struct nfp_fl_payload *flow,
706 u8 *mask = flow->mask_data;
904 /* Copy any pre-actions to the start of merge flow action list. */
967 if (link->sub_flow.flow == sub_flow) {
982 link->merge_flow.flow = merge_flow;
984 link->sub_flow.flow = sub_flow;
991 * nfp_flower_merge_offloaded_flows() - Merge 2 existing flows to single flow.
993 * @sub_flow1: Initial flow matched to produce merge hint
994 * @sub_flow2: Post recirculation flow matched in merge hint
996 * Combines 2 flows (if valid) to a single flow, removing the initial from hw
997 * and offloading the new, merged flow.
1114 * @flow: Pointer to NFP flow representation of rule
1118 * Verifies the flow as a pre-tunnel rule.
1124 struct nfp_fl_payload *flow,
1131 u8 *ext = flow->unmasked_data;
1133 u8 *mask = flow->mask_data;
1138 meta_tci = (struct nfp_flower_meta_tci *)flow->unmasked_data;
1145 flow->pre_tun_rule.vlan_tci = cpu_to_be16(vlan_tci);
1148 flow->pre_tun_rule.vlan_tci = cpu_to_be16(0xffff);
1172 flow->pre_tun_rule.is_ipv6 = true;
1174 flow->pre_tun_rule.is_ipv6 = false;
1213 if (memcmp(&mac->mac_dst[0], flow->pre_tun_rule.dev->dev_addr, 6)) {
1220 memcpy(&flow->pre_tun_rule.loc_mac, &mac->mac_dst[0], ETH_ALEN);
1221 memcpy(&flow->pre_tun_rule.rem_mac, &mac->mac_src[0], ETH_ALEN);
1260 flow->pre_tun_rule.vlan_tci = cpu_to_be16(vlan_tci);
1261 flow->pre_tun_rule.vlan_tpid = cpu_to_be16(vlan_tpid);
1264 flow->pre_tun_rule.vlan_tci = cpu_to_be16(0xffff);
1265 flow->pre_tun_rule.vlan_tpid = cpu_to_be16(0xffff);
1271 act = (struct nfp_fl_act_head *)&flow->action_data[act_offset];
1279 act = (struct nfp_fl_act_head *)&flow->action_data[act_offset];
1290 if (act_offset != flow->meta.act_len) {
1298 static bool offload_pre_check(struct flow_cls_offload *flow)
1300 struct flow_rule *rule = flow_cls_offload_flow_rule(flow);
1311 if (flow->common.chain_index)
1318 * nfp_flower_add_offload() - Adds a new flow to hardware.
1321 * @flow: TC flower classifier offload structure.
1323 * Adds a new flow to the repeated hash structure and action payload.
1329 struct flow_cls_offload *flow)
1331 struct flow_rule *rule = flow_cls_offload_flow_rule(flow);
1340 extack = flow->common.extack;
1344 if (is_pre_ct_flow(flow))
1345 return nfp_fl_ct_handle_pre_ct(priv, netdev, flow, extack, NULL);
1347 if (is_post_ct_flow(flow))
1348 return nfp_fl_ct_handle_post_ct(priv, netdev, flow, extack);
1350 if (!offload_pre_check(flow))
1383 err = nfp_compile_flow_metadata(app, flow->cookie, flow_pay, netdev, extack);
1387 flow_pay->tc_flower_cookie = flow->cookie;
1391 NL_SET_ERR_MSG_MOD(extack, "invalid entry: cannot insert flow into tables for offloads");
1427 /* Deallocate flow payload when flower rule has been destroyed. */
1465 origin = link->sub_flow.flow;
1473 nfp_flower_cmsg_warn(app, "Metadata fail for merge flow delete.\n");
1481 nfp_flower_cmsg_warn(app, "Failed to delete merged flow.\n");
1489 nfp_flower_cmsg_warn(app, "Failed to revert merge flow.\n");
1494 /* Clean any links connected with the merged flow. */
1497 u32 ctx_id = be32_to_cpu(link->sub_flow.flow->meta.host_ctx_id);
1528 /* Remove any merge flow formed from the deleted sub_flow. */
1532 link->merge_flow.flow);
1536 * nfp_flower_del_offload() - Removes a flow from hardware.
1539 * @flow: TC flower classifier offload structure
1541 * Removes a flow from the repeated hash��structure and clears the
1548 struct flow_cls_offload *flow)
1557 extack = flow->common.extack;
1562 ct_map_ent = rhashtable_lookup_fast(&priv->ct_map_table, &flow->cookie,
1569 nfp_flow = nfp_flower_search_fl_table(app, flow->cookie, netdev);
1571 NL_SET_ERR_MSG_MOD(extack, "invalid entry: cannot remove flow that does not exist");
1643 /* Reset stats for the merge flow. */
1647 /* The merge flow has received stats updates from firmware.
1652 sub_flow = link->sub_flow.flow;
1669 __nfp_flower_update_merge_stats(app, link->merge_flow.flow);
1673 * nfp_flower_get_stats() - Populates flow stats obtained from hardware.
1676 * @flow: TC flower classifier offload structure
1678 * Populates a flow statistics structure which��which corresponds to a
1679 * specific flow.
1685 struct flow_cls_offload *flow)
1694 ct_map_ent = rhashtable_lookup_fast(&priv->ct_map_table, &flow->cookie,
1697 return nfp_fl_ct_stats(flow, ct_map_ent);
1699 extack = flow->common.extack;
1700 nfp_flow = nfp_flower_search_fl_table(app, flow->cookie, netdev);
1702 NL_SET_ERR_MSG_MOD(extack, "invalid entry: cannot dump stats for flow that does not exist");
1713 flow_stats_update(&flow->stats, priv->stats[ctx_id].bytes,