X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fqos_sched%2Fapp_thread.c;h=dbc878b55394f0e22f64a123308a8fdcbdae25d6;hb=d3c9274f76826d4e88eb178f1f353b983c2c11e6;hp=18b734a1420e2e690298edefa6357e8d20724406;hpb=be1e533238c0293c1f15f1b14e613b0bba643222;p=dpdk.git diff --git a/examples/qos_sched/app_thread.c b/examples/qos_sched/app_thread.c index 18b734a142..dbc878b553 100644 --- a/examples/qos_sched/app_thread.c +++ b/examples/qos_sched/app_thread.c @@ -35,15 +35,25 @@ get_pkt_sched(struct rte_mbuf *m, uint32_t *subport, uint32_t *pipe, uint16_t *pdata = rte_pktmbuf_mtod(m, uint16_t *); uint16_t pipe_queue; + /* Outer VLAN ID*/ *subport = (rte_be_to_cpu_16(pdata[SUBPORT_OFFSET]) & 0x0FFF) & - (port_params.n_subports_per_port - 1); /* Outer VLAN ID*/ + (port_params.n_subports_per_port - 1); + + /* Inner VLAN ID */ *pipe = (rte_be_to_cpu_16(pdata[PIPE_OFFSET]) & 0x0FFF) & - (port_params.n_pipes_per_subport - 1); /* Inner VLAN ID */ + (subport_params[*subport].n_pipes_per_subport_enabled - 1); + pipe_queue = active_queues[(pdata[QUEUE_OFFSET] >> 8) % n_active_queues]; + + /* Traffic class (Destination IP) */ *traffic_class = pipe_queue > RTE_SCHED_TRAFFIC_CLASS_BE ? - RTE_SCHED_TRAFFIC_CLASS_BE : pipe_queue; /* Destination IP */ - *queue = pipe_queue - *traffic_class; /* Destination IP */ - *color = pdata[COLOR_OFFSET] & 0x03; /* Destination IP */ + RTE_SCHED_TRAFFIC_CLASS_BE : pipe_queue; + + /* Traffic class queue (Destination IP) */ + *queue = pipe_queue - *traffic_class; + + /* Color (Destination IP) */ + *color = pdata[COLOR_OFFSET] & 0x03; return 0; }