1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2010-2014 Intel Corporation
13 #include <sys/types.h>
14 #include <sys/epoll.h>
15 #include <sys/queue.h>
17 #include <sys/socket.h>
18 #include <sys/select.h>
22 #pragma message "Jansson dev libs unavailable, not including JSON parsing"
25 #include <rte_memory.h>
26 #include <rte_malloc.h>
27 #include <rte_atomic.h>
28 #include <rte_cycles.h>
29 #include <rte_ethdev.h>
30 #include <rte_pmd_i40e.h>
32 #include <libvirt/libvirt.h>
33 #include "channel_monitor.h"
34 #include "channel_commands.h"
35 #include "channel_manager.h"
36 #include "power_manager.h"
37 #include "oob_monitor.h"
39 #define RTE_LOGTYPE_CHANNEL_MONITOR RTE_LOGTYPE_USER1
41 #define MAX_EVENTS 256
43 uint64_t vsi_pkt_count_prev[384];
44 uint64_t rdtsc_prev[384];
45 #define MAX_JSON_STRING_LEN 1024
46 char json_data[MAX_JSON_STRING_LEN];
48 double time_period_ms = 1;
49 static volatile unsigned run_loop = 1;
50 static int global_event_fd;
51 static unsigned int policy_is_set;
52 static struct epoll_event *global_events_list;
53 static struct policy policies[MAX_CLIENTS];
58 struct ether_addr addr;
63 str_to_ether_addr(const char *a, struct ether_addr *ether_addr)
67 unsigned long o[ETHER_ADDR_LEN];
72 o[i] = strtoul(a, &end, 16);
73 if (errno != 0 || end == a || (end[0] != ':' && end[0] != 0))
76 } while (++i != RTE_DIM(o) / sizeof(o[0]) && end[0] != 0);
78 /* Junk at the end of line */
82 /* Support the format XX:XX:XX:XX:XX:XX */
83 if (i == ETHER_ADDR_LEN) {
87 ether_addr->addr_bytes[i] = (uint8_t)o[i];
89 /* Support the format XXXX:XXXX:XXXX */
90 } else if (i == ETHER_ADDR_LEN / 2) {
92 if (o[i] > UINT16_MAX)
94 ether_addr->addr_bytes[i * 2] =
96 ether_addr->addr_bytes[i * 2 + 1] =
97 (uint8_t)(o[i] & 0xff);
107 set_policy_mac(struct channel_packet *pkt, int idx, char *mac)
112 /* Use port MAC address as the vfid */
113 ret = str_to_ether_addr(mac, &pfid.addr);
116 RTE_LOG(ERR, CHANNEL_MONITOR,
117 "Invalid mac address received in JSON\n");
122 printf("Received MAC Address: %02" PRIx8 ":%02" PRIx8 ":%02" PRIx8 ":"
123 "%02" PRIx8 ":%02" PRIx8 ":%02" PRIx8 "\n",
124 pfid.addr.addr_bytes[0], pfid.addr.addr_bytes[1],
125 pfid.addr.addr_bytes[2], pfid.addr.addr_bytes[3],
126 pfid.addr.addr_bytes[4], pfid.addr.addr_bytes[5]);
128 pkt->vfid[idx] = pfid.pfid;
134 parse_json_to_pkt(json_t *element, struct channel_packet *pkt)
140 memset(pkt, 0, sizeof(struct channel_packet));
142 pkt->nb_mac_to_monitor = 0;
143 pkt->t_boost_status.tbEnabled = false;
145 pkt->policy_to_use = TIME;
146 pkt->command = PKT_POLICY;
147 pkt->core_type = CORE_TYPE_PHYSICAL;
149 json_object_foreach(element, key, value) {
150 if (!strcmp(key, "policy")) {
151 /* Recurse in to get the contents of profile */
152 ret = parse_json_to_pkt(value, pkt);
155 } else if (!strcmp(key, "instruction")) {
156 /* Recurse in to get the contents of instruction */
157 ret = parse_json_to_pkt(value, pkt);
160 } else if (!strcmp(key, "name")) {
161 strcpy(pkt->vm_name, json_string_value(value));
162 } else if (!strcmp(key, "command")) {
164 snprintf(command, 32, "%s", json_string_value(value));
165 if (!strcmp(command, "power")) {
166 pkt->command = CPU_POWER;
167 } else if (!strcmp(command, "create")) {
168 pkt->command = PKT_POLICY;
169 } else if (!strcmp(command, "destroy")) {
170 pkt->command = PKT_POLICY_REMOVE;
172 RTE_LOG(ERR, CHANNEL_MONITOR,
173 "Invalid command received in JSON\n");
176 } else if (!strcmp(key, "policy_type")) {
178 snprintf(command, 32, "%s", json_string_value(value));
179 if (!strcmp(command, "TIME")) {
180 pkt->policy_to_use = TIME;
181 } else if (!strcmp(command, "TRAFFIC")) {
182 pkt->policy_to_use = TRAFFIC;
183 } else if (!strcmp(command, "WORKLOAD")) {
184 pkt->policy_to_use = WORKLOAD;
185 } else if (!strcmp(command, "BRANCH_RATIO")) {
186 pkt->policy_to_use = BRANCH_RATIO;
188 RTE_LOG(ERR, CHANNEL_MONITOR,
189 "Wrong policy_type received in JSON\n");
192 } else if (!strcmp(key, "workload")) {
194 snprintf(command, 32, "%s", json_string_value(value));
195 if (!strcmp(command, "HIGH")) {
196 pkt->workload = HIGH;
197 } else if (!strcmp(command, "MEDIUM")) {
198 pkt->workload = MEDIUM;
199 } else if (!strcmp(command, "LOW")) {
202 RTE_LOG(ERR, CHANNEL_MONITOR,
203 "Wrong workload received in JSON\n");
206 } else if (!strcmp(key, "busy_hours")) {
208 size_t size = json_array_size(value);
210 for (i = 0; i < size; i++) {
211 int hour = (int)json_integer_value(
212 json_array_get(value, i));
213 pkt->timer_policy.busy_hours[i] = hour;
215 } else if (!strcmp(key, "quiet_hours")) {
217 size_t size = json_array_size(value);
219 for (i = 0; i < size; i++) {
220 int hour = (int)json_integer_value(
221 json_array_get(value, i));
222 pkt->timer_policy.quiet_hours[i] = hour;
224 } else if (!strcmp(key, "core_list")) {
226 size_t size = json_array_size(value);
228 for (i = 0; i < size; i++) {
229 int core = (int)json_integer_value(
230 json_array_get(value, i));
231 pkt->vcpu_to_control[i] = core;
233 pkt->num_vcpu = size;
234 } else if (!strcmp(key, "mac_list")) {
236 size_t size = json_array_size(value);
238 for (i = 0; i < size; i++) {
240 snprintf(mac, 32, "%s", json_string_value(
241 json_array_get(value, i)));
242 set_policy_mac(pkt, i, mac);
244 pkt->nb_mac_to_monitor = size;
245 } else if (!strcmp(key, "avg_packet_thresh")) {
246 pkt->traffic_policy.avg_max_packet_thresh =
247 (uint32_t)json_integer_value(value);
248 } else if (!strcmp(key, "max_packet_thresh")) {
249 pkt->traffic_policy.max_max_packet_thresh =
250 (uint32_t)json_integer_value(value);
251 } else if (!strcmp(key, "unit")) {
253 snprintf(unit, 32, "%s", json_string_value(value));
254 if (!strcmp(unit, "SCALE_UP")) {
255 pkt->unit = CPU_POWER_SCALE_UP;
256 } else if (!strcmp(unit, "SCALE_DOWN")) {
257 pkt->unit = CPU_POWER_SCALE_DOWN;
258 } else if (!strcmp(unit, "SCALE_MAX")) {
259 pkt->unit = CPU_POWER_SCALE_MAX;
260 } else if (!strcmp(unit, "SCALE_MIN")) {
261 pkt->unit = CPU_POWER_SCALE_MIN;
262 } else if (!strcmp(unit, "ENABLE_TURBO")) {
263 pkt->unit = CPU_POWER_ENABLE_TURBO;
264 } else if (!strcmp(unit, "DISABLE_TURBO")) {
265 pkt->unit = CPU_POWER_DISABLE_TURBO;
267 RTE_LOG(ERR, CHANNEL_MONITOR,
268 "Invalid command received in JSON\n");
271 } else if (!strcmp(key, "resource_id")) {
272 pkt->resource_id = (uint32_t)json_integer_value(value);
274 RTE_LOG(ERR, CHANNEL_MONITOR,
275 "Unknown key received in JSON string: %s\n",
283 void channel_monitor_exit(void)
286 rte_free(global_events_list);
290 core_share(int pNo, int z, int x, int t)
292 if (policies[pNo].core_share[z].pcpu == lvm_info[x].pcpus[t]) {
293 if (strcmp(policies[pNo].pkt.vm_name,
294 lvm_info[x].vm_name) != 0) {
295 policies[pNo].core_share[z].status = 1;
296 power_manager_scale_core_max(
297 policies[pNo].core_share[z].pcpu);
303 core_share_status(int pNo)
306 int noVms = 0, noVcpus = 0, z, x, t;
308 get_all_vm(&noVms, &noVcpus);
310 /* Reset Core Share Status. */
311 for (z = 0; z < noVcpus; z++)
312 policies[pNo].core_share[z].status = 0;
314 /* Foreach vcpu in a policy. */
315 for (z = 0; z < policies[pNo].pkt.num_vcpu; z++) {
316 /* Foreach VM on the platform. */
317 for (x = 0; x < noVms; x++) {
318 /* Foreach vcpu of VMs on platform. */
319 for (t = 0; t < lvm_info[x].num_cpus; t++)
320 core_share(pNo, z, x, t);
327 pcpu_monitor(struct policy *pol, struct core_info *ci, int pcpu, int count)
331 if (pol->pkt.policy_to_use == BRANCH_RATIO) {
332 ci->cd[pcpu].oob_enabled = 1;
333 ret = add_core_to_monitor(pcpu);
335 RTE_LOG(INFO, CHANNEL_MONITOR,
336 "Monitoring pcpu %d OOB for %s\n",
337 pcpu, pol->pkt.vm_name);
339 RTE_LOG(ERR, CHANNEL_MONITOR,
340 "Error monitoring pcpu %d OOB for %s\n",
341 pcpu, pol->pkt.vm_name);
344 pol->core_share[count].pcpu = pcpu;
345 RTE_LOG(INFO, CHANNEL_MONITOR,
346 "Monitoring pcpu %d for %s\n",
347 pcpu, pol->pkt.vm_name);
353 get_pcpu_to_control(struct policy *pol)
356 /* Convert vcpu to pcpu. */
360 struct core_info *ci;
362 ci = get_core_info();
364 RTE_LOG(DEBUG, CHANNEL_MONITOR,
365 "Looking for pcpu for %s\n", pol->pkt.vm_name);
368 * So now that we're handling virtual and physical cores, we need to
369 * differenciate between them when adding them to the branch monitor.
370 * Virtual cores need to be converted to physical cores.
372 if (pol->pkt.core_type == CORE_TYPE_VIRTUAL) {
374 * If the cores in the policy are virtual, we need to map them
375 * to physical core. We look up the vm info and use that for
378 get_info_vm(pol->pkt.vm_name, &info);
379 for (count = 0; count < pol->pkt.num_vcpu; count++) {
381 info.pcpu_mask[pol->pkt.vcpu_to_control[count]];
382 for (pcpu = 0; mask_u64b;
383 mask_u64b &= ~(1ULL << pcpu++)) {
384 if ((mask_u64b >> pcpu) & 1)
385 pcpu_monitor(pol, ci, pcpu, count);
390 * If the cores in the policy are physical, we just use
391 * those core id's directly.
393 for (count = 0; count < pol->pkt.num_vcpu; count++) {
394 pcpu = pol->pkt.vcpu_to_control[count];
395 pcpu_monitor(pol, ci, pcpu, count);
401 get_pfid(struct policy *pol)
406 for (i = 0; i < pol->pkt.nb_mac_to_monitor; i++) {
408 RTE_ETH_FOREACH_DEV(x) {
409 ret = rte_pmd_i40e_query_vfid_by_mac(x,
410 (struct ether_addr *)&(pol->pkt.vfid[i]));
411 if (ret != -EINVAL) {
416 if (ret == -EINVAL || ret == -ENOTSUP || ret == ENODEV) {
417 RTE_LOG(INFO, CHANNEL_MONITOR,
418 "Error with Policy. MAC not found on "
429 update_policy(struct channel_packet *pkt)
432 unsigned int updated = 0;
436 RTE_LOG(INFO, CHANNEL_MONITOR,
437 "Applying policy for %s\n", pkt->vm_name);
439 for (i = 0; i < MAX_CLIENTS; i++) {
440 if (strcmp(policies[i].pkt.vm_name, pkt->vm_name) == 0) {
441 /* Copy the contents of *pkt into the policy.pkt */
442 policies[i].pkt = *pkt;
443 get_pcpu_to_control(&policies[i]);
444 if (get_pfid(&policies[i]) == -1) {
448 core_share_status(i);
449 policies[i].enabled = 1;
454 for (i = 0; i < MAX_CLIENTS; i++) {
455 if (policies[i].enabled == 0) {
456 policies[i].pkt = *pkt;
457 get_pcpu_to_control(&policies[i]);
458 if (get_pfid(&policies[i]) == -1)
460 core_share_status(i);
461 policies[i].enabled = 1;
470 remove_policy(struct channel_packet *pkt __rte_unused)
475 * Disabling the policy is simply a case of setting
478 for (i = 0; i < MAX_CLIENTS; i++) {
479 if (strcmp(policies[i].pkt.vm_name, pkt->vm_name) == 0) {
480 policies[i].enabled = 0;
488 get_pkt_diff(struct policy *pol)
491 uint64_t vsi_pkt_count,
493 vsi_pkt_count_prev_total = 0;
494 double rdtsc_curr, rdtsc_diff, diff;
496 struct rte_eth_stats vf_stats;
498 for (x = 0; x < pol->pkt.nb_mac_to_monitor; x++) {
501 if (rte_pmd_i40e_get_vf_stats(x, pol->pfid[x], &vf_stats) == 0)
502 vsi_pkt_count = vf_stats.ipackets;
506 vsi_pkt_total += vsi_pkt_count;
508 vsi_pkt_count_prev_total += vsi_pkt_count_prev[pol->pfid[x]];
509 vsi_pkt_count_prev[pol->pfid[x]] = vsi_pkt_count;
512 rdtsc_curr = rte_rdtsc_precise();
513 rdtsc_diff = rdtsc_curr - rdtsc_prev[pol->pfid[x-1]];
514 rdtsc_prev[pol->pfid[x-1]] = rdtsc_curr;
516 diff = (vsi_pkt_total - vsi_pkt_count_prev_total) *
517 ((double)rte_get_tsc_hz() / rdtsc_diff);
523 apply_traffic_profile(struct policy *pol)
529 diff = get_pkt_diff(pol);
531 if (diff >= (pol->pkt.traffic_policy.max_max_packet_thresh)) {
532 for (count = 0; count < pol->pkt.num_vcpu; count++) {
533 if (pol->core_share[count].status != 1)
534 power_manager_scale_core_max(
535 pol->core_share[count].pcpu);
537 } else if (diff >= (pol->pkt.traffic_policy.avg_max_packet_thresh)) {
538 for (count = 0; count < pol->pkt.num_vcpu; count++) {
539 if (pol->core_share[count].status != 1)
540 power_manager_scale_core_med(
541 pol->core_share[count].pcpu);
543 } else if (diff < (pol->pkt.traffic_policy.avg_max_packet_thresh)) {
544 for (count = 0; count < pol->pkt.num_vcpu; count++) {
545 if (pol->core_share[count].status != 1)
546 power_manager_scale_core_min(
547 pol->core_share[count].pcpu);
553 apply_time_profile(struct policy *pol)
559 char time_string[40];
561 /* Obtain the time of day, and convert it to a tm struct. */
562 gettimeofday(&tv, NULL);
563 ptm = localtime(&tv.tv_sec);
564 /* Format the date and time, down to a single second. */
565 strftime(time_string, sizeof(time_string), "%Y-%m-%d %H:%M:%S", ptm);
567 for (x = 0; x < HOURS; x++) {
569 if (ptm->tm_hour == pol->pkt.timer_policy.busy_hours[x]) {
570 for (count = 0; count < pol->pkt.num_vcpu; count++) {
571 if (pol->core_share[count].status != 1) {
572 power_manager_scale_core_max(
573 pol->core_share[count].pcpu);
577 } else if (ptm->tm_hour ==
578 pol->pkt.timer_policy.quiet_hours[x]) {
579 for (count = 0; count < pol->pkt.num_vcpu; count++) {
580 if (pol->core_share[count].status != 1) {
581 power_manager_scale_core_min(
582 pol->core_share[count].pcpu);
586 } else if (ptm->tm_hour ==
587 pol->pkt.timer_policy.hours_to_use_traffic_profile[x]) {
588 apply_traffic_profile(pol);
595 apply_workload_profile(struct policy *pol)
600 if (pol->pkt.workload == HIGH) {
601 for (count = 0; count < pol->pkt.num_vcpu; count++) {
602 if (pol->core_share[count].status != 1)
603 power_manager_scale_core_max(
604 pol->core_share[count].pcpu);
606 } else if (pol->pkt.workload == MEDIUM) {
607 for (count = 0; count < pol->pkt.num_vcpu; count++) {
608 if (pol->core_share[count].status != 1)
609 power_manager_scale_core_med(
610 pol->core_share[count].pcpu);
612 } else if (pol->pkt.workload == LOW) {
613 for (count = 0; count < pol->pkt.num_vcpu; count++) {
614 if (pol->core_share[count].status != 1)
615 power_manager_scale_core_min(
616 pol->core_share[count].pcpu);
622 apply_policy(struct policy *pol)
625 struct channel_packet *pkt = &pol->pkt;
627 /*Check policy to use*/
628 if (pkt->policy_to_use == TRAFFIC)
629 apply_traffic_profile(pol);
630 else if (pkt->policy_to_use == TIME)
631 apply_time_profile(pol);
632 else if (pkt->policy_to_use == WORKLOAD)
633 apply_workload_profile(pol);
637 process_request(struct channel_packet *pkt, struct channel_info *chan_info)
641 if (chan_info == NULL)
644 if (rte_atomic32_cmpset(&(chan_info->status), CHANNEL_MGR_CHANNEL_CONNECTED,
645 CHANNEL_MGR_CHANNEL_PROCESSING) == 0)
648 if (pkt->command == CPU_POWER) {
649 core_mask = get_pcpus_mask(chan_info, pkt->resource_id);
650 if (core_mask == 0) {
652 * Core mask will be 0 in the case where
653 * hypervisor is not available so we're working in
654 * the host, so use the core as the mask.
656 core_mask = 1ULL << pkt->resource_id;
658 if (__builtin_popcountll(core_mask) == 1) {
660 unsigned core_num = __builtin_ffsll(core_mask) - 1;
663 case(CPU_POWER_SCALE_MIN):
664 power_manager_scale_core_min(core_num);
666 case(CPU_POWER_SCALE_MAX):
667 power_manager_scale_core_max(core_num);
669 case(CPU_POWER_SCALE_DOWN):
670 power_manager_scale_core_down(core_num);
672 case(CPU_POWER_SCALE_UP):
673 power_manager_scale_core_up(core_num);
675 case(CPU_POWER_ENABLE_TURBO):
676 power_manager_enable_turbo_core(core_num);
678 case(CPU_POWER_DISABLE_TURBO):
679 power_manager_disable_turbo_core(core_num);
686 case(CPU_POWER_SCALE_MIN):
687 power_manager_scale_mask_min(core_mask);
689 case(CPU_POWER_SCALE_MAX):
690 power_manager_scale_mask_max(core_mask);
692 case(CPU_POWER_SCALE_DOWN):
693 power_manager_scale_mask_down(core_mask);
695 case(CPU_POWER_SCALE_UP):
696 power_manager_scale_mask_up(core_mask);
698 case(CPU_POWER_ENABLE_TURBO):
699 power_manager_enable_turbo_mask(core_mask);
701 case(CPU_POWER_DISABLE_TURBO):
702 power_manager_disable_turbo_mask(core_mask);
711 if (pkt->command == PKT_POLICY) {
712 RTE_LOG(INFO, CHANNEL_MONITOR, "Processing policy request %s\n",
718 if (pkt->command == PKT_POLICY_REMOVE) {
719 RTE_LOG(INFO, CHANNEL_MONITOR,
720 "Removing policy %s\n", pkt->vm_name);
725 * Return is not checked as channel status may have been set to DISABLED
726 * from management thread
728 rte_atomic32_cmpset(&(chan_info->status), CHANNEL_MGR_CHANNEL_PROCESSING,
729 CHANNEL_MGR_CHANNEL_CONNECTED);
735 add_channel_to_monitor(struct channel_info **chan_info)
737 struct channel_info *info = *chan_info;
738 struct epoll_event event;
740 event.events = EPOLLIN;
741 event.data.ptr = info;
742 if (epoll_ctl(global_event_fd, EPOLL_CTL_ADD, info->fd, &event) < 0) {
743 RTE_LOG(ERR, CHANNEL_MONITOR, "Unable to add channel '%s' "
744 "to epoll\n", info->channel_path);
747 RTE_LOG(ERR, CHANNEL_MONITOR, "Added channel '%s' "
748 "to monitor\n", info->channel_path);
753 remove_channel_from_monitor(struct channel_info *chan_info)
755 if (epoll_ctl(global_event_fd, EPOLL_CTL_DEL,
756 chan_info->fd, NULL) < 0) {
757 RTE_LOG(ERR, CHANNEL_MONITOR, "Unable to remove channel '%s' "
758 "from epoll\n", chan_info->channel_path);
765 channel_monitor_init(void)
767 global_event_fd = epoll_create1(0);
768 if (global_event_fd == 0) {
769 RTE_LOG(ERR, CHANNEL_MONITOR,
770 "Error creating epoll context with error %s\n",
774 global_events_list = rte_malloc("epoll_events",
775 sizeof(*global_events_list)
776 * MAX_EVENTS, RTE_CACHE_LINE_SIZE);
777 if (global_events_list == NULL) {
778 RTE_LOG(ERR, CHANNEL_MONITOR, "Unable to rte_malloc for "
786 read_binary_packet(struct channel_info *chan_info)
788 struct channel_packet pkt;
790 int buffer_len = sizeof(pkt);
791 int n_bytes, err = 0;
793 while (buffer_len > 0) {
794 n_bytes = read(chan_info->fd,
796 if (n_bytes == buffer_len)
800 RTE_LOG(DEBUG, CHANNEL_MONITOR,
802 "channel '%s' read: %s\n",
803 chan_info->channel_path,
805 remove_channel(&chan_info);
808 buffer = (char *)buffer + n_bytes;
809 buffer_len -= n_bytes;
812 process_request(&pkt, chan_info);
817 read_json_packet(struct channel_info *chan_info)
819 struct channel_packet pkt;
824 /* read opening brace to closing brace */
829 n_bytes = read(chan_info->fd, &json_data[idx], 1);
832 if (json_data[idx] == '{')
834 if (json_data[idx] == '}')
836 if ((indent > 0) || (idx > 0))
840 if (idx >= MAX_JSON_STRING_LEN-1)
842 } while (indent > 0);
846 * We've broken out of the read loop without getting
847 * a closing brace, so throw away the data
851 if (strlen(json_data) == 0)
854 printf("got [%s]\n", json_data);
856 root = json_loads(json_data, 0, &error);
860 * Because our data is now in the json
861 * object, we can overwrite the pkt
862 * with a channel_packet struct, using
863 * parse_json_to_pkt()
865 ret = parse_json_to_pkt(root, &pkt);
868 RTE_LOG(ERR, CHANNEL_MONITOR,
869 "Error validating JSON profile data\n");
872 process_request(&pkt, chan_info);
874 RTE_LOG(ERR, CHANNEL_MONITOR,
875 "JSON error on line %d: %s\n",
876 error.line, error.text);
878 } while (n_bytes > 0);
883 run_channel_monitor(void)
888 n_events = epoll_wait(global_event_fd, global_events_list,
892 for (i = 0; i < n_events; i++) {
893 struct channel_info *chan_info = (struct channel_info *)
894 global_events_list[i].data.ptr;
895 if ((global_events_list[i].events & EPOLLERR) ||
896 (global_events_list[i].events & EPOLLHUP)) {
897 RTE_LOG(INFO, CHANNEL_MONITOR,
898 "Remote closed connection for "
900 chan_info->channel_path);
901 remove_channel(&chan_info);
904 if (global_events_list[i].events & EPOLLIN) {
906 switch (chan_info->type) {
907 case CHANNEL_TYPE_BINARY:
908 read_binary_packet(chan_info);
911 case CHANNEL_TYPE_JSON:
912 read_json_packet(chan_info);
920 rte_delay_us(time_period_ms*1000);
924 for (j = 0; j < MAX_CLIENTS; j++) {
925 if (policies[j].enabled == 1)
926 apply_policy(&policies[j]);