[v2,1/2] examples/qos_sched: fixup colors value overrun

Message ID 20210318115613.5503-1-konstantin.ananyev@intel.com (mailing list archive)
State Rejected, archived
Delegated to: Thomas Monjalon
Headers
Series [v2,1/2] examples/qos_sched: fixup colors value overrun |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Ananyev, Konstantin March 18, 2021, 11:56 a.m. UTC
  '3' is not valid RTE_COLOR_ enum value.

Fixes: de3cfa2c9823 ("sched: initial import")
Cc: stable@dpdk.org

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
---
 examples/qos_sched/app_thread.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/examples/qos_sched/app_thread.c b/examples/qos_sched/app_thread.c
index dbc878b55..a5f402190 100644
--- a/examples/qos_sched/app_thread.c
+++ b/examples/qos_sched/app_thread.c
@@ -53,7 +53,7 @@  get_pkt_sched(struct rte_mbuf *m, uint32_t *subport, uint32_t *pipe,
 	*queue = pipe_queue - *traffic_class;
 
 	/* Color (Destination IP) */
-	*color = pdata[COLOR_OFFSET] & 0x03;
+	*color = pdata[COLOR_OFFSET] % RTE_COLORS;
 
 	return 0;
 }