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

Function nfp_flow_compile_metadata

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

Source from the content-addressed store, hash-verified

757}
758
759static void
760nfp_flow_compile_metadata(struct nfp_flow_priv *priv,
761 struct rte_flow *nfp_flow,
762 struct nfp_fl_key_ls *key_layer,
763 uint32_t stats_ctx,
764 uint64_t cookie)
765{
766 char *mbuf_off_mask;
767 char *mbuf_off_exact;
768 struct nfp_fl_rule_metadata *nfp_flow_meta;
769
770 /*
771 * Convert to long words as firmware expects
772 * lengths in units of NFP_FL_LW_SIZ.
773 */
774 nfp_flow_meta = nfp_flow->payload.meta;
775 nfp_flow_meta->key_len = key_layer->key_size >> NFP_FL_LW_SIZ;
776 nfp_flow_meta->mask_len = key_layer->key_size >> NFP_FL_LW_SIZ;
777 nfp_flow_meta->act_len = key_layer->act_size >> NFP_FL_LW_SIZ;
778 nfp_flow_meta->flags = 0;
779 nfp_flow_meta->host_ctx_id = rte_cpu_to_be_32(stats_ctx);
780 nfp_flow_meta->host_cookie = rte_cpu_to_be_64(cookie);
781 nfp_flow_meta->flow_version = rte_cpu_to_be_64(priv->flower_version);
782
783 mbuf_off_exact = nfp_flow->payload.unmasked_data;
784 mbuf_off_mask = nfp_flow->payload.mask_data;
785
786 /* Populate Metadata */
787 nfp_flower_compile_meta_tci(mbuf_off_exact, key_layer);
788 nfp_flower_compile_meta_tci(mbuf_off_mask, key_layer);
789 mbuf_off_exact += sizeof(struct nfp_flower_meta_tci);
790 mbuf_off_mask += sizeof(struct nfp_flower_meta_tci);
791
792 /* Populate Extended Metadata if required */
793 if ((key_layer->key_layer & NFP_FLOWER_LAYER_EXT_META) != 0) {
794 nfp_flower_compile_ext_meta(mbuf_off_exact, key_layer);
795 nfp_flower_compile_ext_meta(mbuf_off_mask, key_layer);
796 mbuf_off_exact += sizeof(struct nfp_flower_ext_meta);
797 mbuf_off_mask += sizeof(struct nfp_flower_ext_meta);
798 }
799
800 /* Populate Port Data */
801 nfp_compile_meta_port(mbuf_off_exact, key_layer, false);
802 nfp_compile_meta_port(mbuf_off_mask, key_layer, true);
803 mbuf_off_exact += sizeof(struct nfp_flower_in_port);
804 mbuf_off_mask += sizeof(struct nfp_flower_in_port);
805}
806
807static int
808nfp_flow_key_layers_calculate_items(const struct rte_flow_item items[],

Callers 1

nfp_flow_processFunction · 0.85

Calls 3

nfp_compile_meta_portFunction · 0.85

Tested by

no test coverage detected