summaryrefslogtreecommitdiffstats
path: root/include/net/sch_generic.h
diff options
context:
space:
mode:
authorAmritha Nambiar2017-10-27 11:35:34 +0200
committerJeff Kirsher2017-10-31 18:45:45 +0100
commit384c181e3780ddc45e70483e29d84495b484730d (patch)
tree8f063cca3ae12f55d566c07115b43ee13b71cfb9 /include/net/sch_generic.h
parenti40e/i40evf: Revert "i40e/i40evf: bump tail only in multiples of 8" (diff)
downloadkernel-qcow2-linux-384c181e3780ddc45e70483e29d84495b484730d.tar.gz
kernel-qcow2-linux-384c181e3780ddc45e70483e29d84495b484730d.tar.xz
kernel-qcow2-linux-384c181e3780ddc45e70483e29d84495b484730d.zip
net: sched: Identify hardware traffic classes using classid
This patch offloads the classid to hardware and uses the classid reserved in the range :ffe0 - :ffef to identify hardware traffic classes reported via dev->num_tc. tcf_result structure contains the class ID of the class to which the packet belongs and is offloaded to hardware via flower filter. A new helper function is introduced to represent HW traffic classes 0 through 15 using the reserved classid values :ffe0 - :ffef. Signed-off-by: Amritha Nambiar <amritha.nambiar@intel.com> Acked-by: Shannon Nelson <shannon.nelson@oracle.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'include/net/sch_generic.h')
-rw-r--r--include/net/sch_generic.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index 07c179dab478..c23e938f5b19 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -411,6 +411,13 @@ qdisc_class_find(const struct Qdisc_class_hash *hash, u32 id)
return NULL;
}
+static inline int tc_classid_to_hwtc(struct net_device *dev, u32 classid)
+{
+ u32 hwtc = TC_H_MIN(classid) - TC_H_MIN_PRIORITY;
+
+ return (hwtc < netdev_get_num_tc(dev)) ? hwtc : -EINVAL;
+}
+
int qdisc_class_hash_init(struct Qdisc_class_hash *);
void qdisc_class_hash_insert(struct Qdisc_class_hash *,
struct Qdisc_class_common *);