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

Function encap_apply_check

dpdk/lib/pipeline/rte_table_action.c:566–603  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

564}
565
566static int
567encap_apply_check(struct rte_table_action_encap_params *p,
568 struct rte_table_action_encap_config *cfg)
569{
570 if ((encap_valid(p->type) == 0) ||
571 ((cfg->encap_mask & (1LLU << p->type)) == 0))
572 return -EINVAL;
573
574 switch (p->type) {
575 case RTE_TABLE_ACTION_ENCAP_ETHER:
576 return 0;
577
578 case RTE_TABLE_ACTION_ENCAP_VLAN:
579 return 0;
580
581 case RTE_TABLE_ACTION_ENCAP_QINQ:
582 return 0;
583
584 case RTE_TABLE_ACTION_ENCAP_MPLS:
585 if ((p->mpls.mpls_count == 0) ||
586 (p->mpls.mpls_count > RTE_TABLE_ACTION_MPLS_LABELS_MAX))
587 return -EINVAL;
588
589 return 0;
590
591 case RTE_TABLE_ACTION_ENCAP_PPPOE:
592 return 0;
593
594 case RTE_TABLE_ACTION_ENCAP_VXLAN:
595 return 0;
596
597 case RTE_TABLE_ACTION_ENCAP_QINQ_PPPOE:
598 return 0;
599
600 default:
601 return -EINVAL;
602 }
603}
604
605static int
606encap_ether_apply(void *data,

Callers 1

encap_applyFunction · 0.85

Calls 1

encap_validFunction · 0.85

Tested by

no test coverage detected