diff options
author | Rahul Lakkireddy <rahul.lakkireddy@chelsio.com> | 2016-08-22 12:59:07 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-08-23 03:29:13 +0200 |
commit | 6cede1f17f51333ecf9cd4c9fca5565842f1bf55 (patch) | |
tree | 532509974f67df7dda469a9cdf1abf32792bdbb7 /drivers/net/ethernet/chelsio/cxgb4/sched.h | |
parent | cxgb4: add support for tx traffic scheduling classes (diff) | |
download | linux-6cede1f17f51333ecf9cd4c9fca5565842f1bf55.tar.xz linux-6cede1f17f51333ecf9cd4c9fca5565842f1bf55.zip |
cxgb4: add support for per queue tx scheduling
Add support to bind/unbind specified tx queues to/from scheduling
classes. If a queue is already bound to a scheduling class, it is
unbound first and then bound to a new specified class.
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/chelsio/cxgb4/sched.h')
-rw-r--r-- | drivers/net/ethernet/chelsio/cxgb4/sched.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/net/ethernet/chelsio/cxgb4/sched.h b/drivers/net/ethernet/chelsio/cxgb4/sched.h index 60b09e965d34..ac415eb24ac7 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/sched.h +++ b/drivers/net/ethernet/chelsio/cxgb4/sched.h @@ -40,6 +40,8 @@ #define SCHED_CLS_NONE 0xff +#define FW_SCHED_CLS_NONE 0xffffffff + enum { SCHED_STATE_ACTIVE, SCHED_STATE_UNUSED, @@ -49,10 +51,21 @@ enum sched_fw_ops { SCHED_FW_OP_ADD, }; +enum sched_bind_type { + SCHED_QUEUE, +}; + +struct sched_queue_entry { + struct list_head list; + unsigned int cntxt_id; + struct ch_sched_queue param; +}; + struct sched_class { u8 state; u8 idx; struct ch_sched_params info; + struct list_head queue_list; spinlock_t lock; /* Per class lock */ atomic_t refcnt; }; @@ -81,6 +94,11 @@ static inline bool valid_class_id(struct net_device *dev, u8 class_id) return true; } +int cxgb4_sched_class_bind(struct net_device *dev, void *arg, + enum sched_bind_type type); +int cxgb4_sched_class_unbind(struct net_device *dev, void *arg, + enum sched_bind_type type); + struct sched_class *cxgb4_sched_class_alloc(struct net_device *dev, struct ch_sched_params *p); |