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

Function kni_set_bitmap

lib/ff_dpdk_kni.c:109–134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107}
108
109static void
110kni_set_bitmap(const char *p, unsigned char *port_bitmap)
111{
112 int i;
113 const char *head, *tail, *tail_num;
114 if(!p)
115 return;
116
117 head = p;
118 while (1) {
119 tail = strstr(head, ",");
120 tail_num = strstr(head, "-");
121 if(tail_num && (!tail || tail_num < tail - 1)) {
122 for(i = atoi(head); i <= atoi(tail_num + 1); ++i) {
123 set_bitmap(i, port_bitmap);
124 }
125 } else {
126 set_bitmap(atoi(head), port_bitmap);
127 }
128
129 if(!tail)
130 break;
131
132 head = tail + 1;
133 }
134}
135
136static int
137kni_process_tx(uint16_t port_id, __rte_unused uint16_t queue_id,

Callers 1

ff_kni_initFunction · 0.85

Calls 2

strstrFunction · 0.85
set_bitmapFunction · 0.85

Tested by

no test coverage detected