From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ig0-f180.google.com (mail-ig0-f180.google.com [209.85.213.180]) by dpdk.org (Postfix) with ESMTP id 680F1B4FB for ; Sat, 14 Feb 2015 20:34:36 +0100 (CET) Received: by mail-ig0-f180.google.com with SMTP id b16so16913290igk.1 for ; Sat, 14 Feb 2015 11:34:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=aBckh3rXntUzoXPnjl6n+etOYYfmNl26AZH4oW6I+LE=; b=R8xdbApxNyNN/fySHU5oqrMzB3uEZLg2xz872G9E0BkzSsVXh51UTUykSInPErEnzV xLW9l0WT/4mFAHMEj2wlFE5e2SmkD+Tpk/oW4eYQHBFbYwiHu9wWVkQMz1FpFQOW8eo9 Gy88/nNSFNRSRZYL3OOxW+0DrX5HTSwo7bXYFjnyI3hZrdw46f46RdKp8xCDBBwX1+Vj Op3eQ6g6jy3iOXMX99oEx/MAfj0B6UtBusZqRk7g4S9xII0JDssTHuYtHHOxFI/0ZUDL t7bwVPkw0SfjzXiTEsYcX9kXk3B/cFMkuBqO1za0xT8E6f5KaMxQdkYve7q5biUMYESJ u+Nw== MIME-Version: 1.0 X-Received: by 10.107.7.93 with SMTP id 90mr20612126ioh.69.1423942475806; Sat, 14 Feb 2015 11:34:35 -0800 (PST) Received: by 10.64.73.66 with HTTP; Sat, 14 Feb 2015 11:34:35 -0800 (PST) Received: by 10.64.73.66 with HTTP; Sat, 14 Feb 2015 11:34:35 -0800 (PST) In-Reply-To: References: Date: Sat, 14 Feb 2015 14:34:35 -0500 Message-ID: From: Aws Ismail To: dev@dpdk.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [dpdk-dev] Explanation of the QoS offset values used in the QoS scheduler example app. X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Feb 2015 19:34:36 -0000 Hi everyone, I am looking at this portion of the code in the app_thread.c file of the QoS scheduler example application: /* * QoS parameters are encoded as follows: * Outer VLAN ID defines subport * Inner VLAN ID defines pipe * Destination IP 0.0.XXX.0 defines traffic class * Destination IP host (0.0.0.XXX) defines queue * Values below define offset to each field from start of frame */ #define SUBPORT_OFFSET 7 #define PIPE_OFFSET 9 #define TC_OFFSET 20 #define QUEUE_OFFSET 20 #define COLOR_OFFSET 19 static inline int get_pkt_sched(struct rte_mbuf *m, uint32_t *subport, uint32_t *pipe, uint32_t *traffic_class, uint32_t *queue, uint32_t *color) { uint16_t *pdata = rte_pktmbuf_mtod(m, uint16_t *); *subport = (rte_be_to_cpu_16(pdata[SUBPORT_OFFSET]) & 0x0FFF) & (port_params.n_subports_per_port - 1); /* Outer VLAN ID*/ *pipe = (rte_be_to_cpu_16(pdata[PIPE_OFFSET]) & 0x0FFF) & (port_params.n_pipes_per_subport - 1); /* Inner VLAN ID */ *traffic_class = (pdata[QUEUE_OFFSET] & 0x0F) & (RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE - 1); /* Destination IP */ *queue = ((pdata[QUEUE_OFFSET] >> 8) & 0x0F) & (RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS - 1) ; /* Destination IP */ *color = pdata[COLOR_OFFSET] & 0x03; /* Destination IP */ return 0; } The offset values do not make sense to me. According to the programmer guide, the queue selection is SVID/CVID/TC/QID based. And those offset seem off in this case. Is this because it is assuming that the packet is being altered before it gets to this stage ? Can anyone provide a better explanation or at least the reason behind choosing those offset values shown above. Thanks.