aboutsummaryrefslogtreecommitdiff
path: root/helper
diff options
context:
space:
mode:
authorBalasubramanian Manoharan <bala.manoharan@linaro.org>2014-12-08 17:32:56 +0530
committerMaxim Uvarov <maxim.uvarov@linaro.org>2014-12-10 16:09:13 +0300
commit5b0cb951dc3d9732496cb7d18cd0c9fe5d6375c6 (patch)
tree132f08ca4913a1e6abc7ade9f5a5894407de087b /helper
parent08c99facf9962c0dd2d0ef2e4b4e21cee2d6735c (diff)
linux-generic: classification initial implementation
The following features are implemented in this classification implementation: * Attaches PMR, PMR_SET to a Pktio entry * Adds classifier object to pktio entry * Attaches CoS values for L2 and L3 QoS to a Pktio entry * Selects ClassOfService for a packet based on PMR, L2 QoS and L3 QoS values * Selects a default CoS if packet does not match any of the assigned rules * Selects an Error CoS for an Error packet * Enqueues the packet to the queue associated with the selected CoS Signed-off-by: Balasubramanian Manoharan <bala.manoharan@linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org> Reviewed-by: Ciprian Barbu <ciprian.barbu@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'helper')
-rw-r--r--helper/include/odph_ip.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/helper/include/odph_ip.h b/helper/include/odph_ip.h
index 2c83c0faa..f78724e11 100644
--- a/helper/include/odph_ip.h
+++ b/helper/include/odph_ip.h
@@ -35,6 +35,9 @@ extern "C" {
/** @internal Returns IPv4 header length */
#define ODPH_IPV4HDR_IHL(ver_ihl) ((ver_ihl) & 0x0f)
+/** @internal Returns IPv4 DSCP */
+#define ODPH_IPV4HDR_DSCP(tos) (((tos) & 0xfc) >> 2)
+
/** @internal Returns IPv4 Don't fragment */
#define ODPH_IPV4HDR_FLAGS_DONT_FRAG(frag_offset) ((frag_offset) & 0x4000)
@@ -47,6 +50,9 @@ extern "C" {
/** @internal Returns true if IPv4 packet is a fragment */
#define ODPH_IPV4HDR_IS_FRAGMENT(frag_offset) ((frag_offset) & 0x3fff)
+/** @internal Returns IPv4 DSCP */
+#define ODPH_IPV6HDR_DSCP(ver_tc_flow) (uint8_t)((((ver_tc_flow) & 0x0fc00000) >> 22) & 0xff)
+
/** IPv4 header */
typedef struct ODP_PACKED {
uint8_t ver_ihl; /**< Version / Header length */