MCPcopy Index your code
hub / github.com/F-Stack/f-stack / create_default_flow

Function create_default_flow

dpdk/app/test/test_security_inline_proto.c:545–584  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

543}
544
545static int
546create_default_flow(uint16_t portid)
547{
548 struct rte_flow_action action[2];
549 struct rte_flow_item pattern[2];
550 struct rte_flow_attr attr = {0};
551 struct rte_flow_error err;
552 struct rte_flow *flow;
553 int ret;
554
555 /* Add the default rte_flow to enable SECURITY for all ESP packets */
556
557 pattern[0].type = RTE_FLOW_ITEM_TYPE_ESP;
558 pattern[0].spec = NULL;
559 pattern[0].mask = NULL;
560 pattern[0].last = NULL;
561 pattern[1].type = RTE_FLOW_ITEM_TYPE_END;
562
563 action[0].type = RTE_FLOW_ACTION_TYPE_SECURITY;
564 action[0].conf = NULL;
565 action[1].type = RTE_FLOW_ACTION_TYPE_END;
566 action[1].conf = NULL;
567
568 attr.ingress = 1;
569
570 ret = rte_flow_validate(portid, &attr, pattern, action, &err);
571 if (ret) {
572 printf("\nValidate flow failed, ret = %d\n", ret);
573 return -1;
574 }
575 flow = rte_flow_create(portid, &attr, pattern, action, &err);
576 if (flow == NULL) {
577 printf("\nDefault flow rule create failed\n");
578 return -1;
579 }
580
581 default_flow[portid] = flow;
582
583 return 0;
584}
585
586static void
587destroy_default_flow(uint16_t portid)

Calls 3

rte_flow_validateFunction · 0.85
rte_flow_createFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected