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

Function sw_port_link

dpdk/drivers/event/sw/sw_evdev.c:31–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29sw_info_get(struct rte_eventdev *dev, struct rte_event_dev_info *info);
30
31static int
32sw_port_link(struct rte_eventdev *dev, void *port, const uint8_t queues[],
33 const uint8_t priorities[], uint16_t num)
34{
35 struct sw_port *p = port;
36 struct sw_evdev *sw = sw_pmd_priv(dev);
37 int i;
38
39 RTE_SET_USED(priorities);
40 for (i = 0; i < num; i++) {
41 struct sw_qid *q = &sw->qids[queues[i]];
42 unsigned int j;
43
44 /* check for qid map overflow */
45 if (q->cq_num_mapped_cqs >= RTE_DIM(q->cq_map)) {
46 rte_errno = EDQUOT;
47 break;
48 }
49
50 if (p->is_directed && p->num_qids_mapped > 0) {
51 rte_errno = EDQUOT;
52 break;
53 }
54
55 for (j = 0; j < q->cq_num_mapped_cqs; j++) {
56 if (q->cq_map[j] == p->id)
57 break;
58 }
59
60 /* check if port is already linked */
61 if (j < q->cq_num_mapped_cqs)
62 continue;
63
64 if (q->type == SW_SCHED_TYPE_DIRECT) {
65 /* check directed qids only map to one port */
66 if (p->num_qids_mapped > 0) {
67 rte_errno = EDQUOT;
68 break;
69 }
70 /* check port only takes a directed flow */
71 if (num > 1) {
72 rte_errno = EDQUOT;
73 break;
74 }
75
76 p->is_directed = 1;
77 p->num_qids_mapped = 1;
78 } else if (q->type == RTE_SCHED_TYPE_ORDERED) {
79 p->num_ordered_qids++;
80 p->num_qids_mapped++;
81 } else if (q->type == RTE_SCHED_TYPE_ATOMIC ||
82 q->type == RTE_SCHED_TYPE_PARALLEL) {
83 p->num_qids_mapped++;
84 }
85
86 q->cq_map[q->cq_num_mapped_cqs] = p->id;
87 rte_smp_wmb();
88 q->cq_num_mapped_cqs++;

Callers

nothing calls this directly

Calls 1

sw_pmd_privFunction · 0.85

Tested by

no test coverage detected