MCPcopy Create free account
hub / github.com/F-Stack/f-stack / nfp_flow_process

Function nfp_flow_process

dpdk/drivers/net/nfp/nfp_flow.c:3756–3855  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3754}
3755
3756struct rte_flow *
3757nfp_flow_process(struct nfp_flower_representor *representor,
3758 const struct rte_flow_item items[],
3759 const struct rte_flow_action actions[],
3760 bool validate_flag,
3761 uint64_t cookie,
3762 bool install_flag,
3763 bool merge_flag)
3764{
3765 int ret;
3766 char *hash_data;
3767 char *mask_data;
3768 uint32_t mask_len;
3769 uint32_t stats_ctx = 0;
3770 uint8_t new_mask_id = 0;
3771 struct rte_flow *nfp_flow;
3772 struct rte_flow *flow_find;
3773 struct nfp_flow_priv *priv;
3774 struct nfp_fl_key_ls key_layer;
3775 struct nfp_fl_rule_metadata *nfp_flow_meta;
3776
3777 ret = nfp_flow_key_layers_calculate(items, actions, &key_layer);
3778 if (ret != 0) {
3779 PMD_DRV_LOG(ERR, "Key layers calculate failed.");
3780 return NULL;
3781 }
3782
3783 if (key_layer.port == (uint32_t)~0)
3784 key_layer.port = representor->port_id;
3785
3786 priv = representor->app_fw_flower->flow_priv;
3787 ret = nfp_stats_id_alloc(priv, &stats_ctx);
3788 if (ret != 0) {
3789 PMD_DRV_LOG(ERR, "nfp stats id alloc failed.");
3790 return NULL;
3791 }
3792
3793 nfp_flow = nfp_flow_alloc(&key_layer, representor->port_id);
3794 if (nfp_flow == NULL) {
3795 PMD_DRV_LOG(ERR, "Alloc nfp flow failed.");
3796 goto free_stats;
3797 }
3798
3799 nfp_flow->install_flag = install_flag;
3800 nfp_flow->merge_flag = merge_flag;
3801
3802 nfp_flow_compile_metadata(priv, nfp_flow, &key_layer, stats_ctx, cookie);
3803
3804 ret = nfp_flow_compile_items(representor, items, nfp_flow);
3805 if (ret != 0) {
3806 PMD_DRV_LOG(ERR, "nfp flow item process failed.");
3807 goto free_flow;
3808 }
3809
3810 ret = nfp_flow_compile_action(representor, actions, nfp_flow);
3811 if (ret != 0) {
3812 PMD_DRV_LOG(ERR, "nfp flow action process failed.");
3813 goto free_flow;

Callers 3

nfp_flow_setupFunction · 0.85
nfp_ct_offload_addFunction · 0.85
nfp_ct_flow_setupFunction · 0.85

Calls 13

nfp_stats_id_allocFunction · 0.85
nfp_flow_allocFunction · 0.85
nfp_flow_compile_itemsFunction · 0.85
nfp_flow_compile_actionFunction · 0.85
nfp_check_mask_addFunction · 0.85
nfp_flow_table_searchFunction · 0.85
nfp_check_mask_removeFunction · 0.85
nfp_flow_freeFunction · 0.85
nfp_stats_id_freeFunction · 0.85

Tested by

no test coverage detected