| .. | .. |
|---|
| 52 | 52 | |
|---|
| 53 | 53 | enum sched_fw_ops { |
|---|
| 54 | 54 | SCHED_FW_OP_ADD, |
|---|
| 55 | + SCHED_FW_OP_DEL, |
|---|
| 55 | 56 | }; |
|---|
| 56 | 57 | |
|---|
| 57 | 58 | enum sched_bind_type { |
|---|
| 58 | 59 | SCHED_QUEUE, |
|---|
| 60 | + SCHED_FLOWC, |
|---|
| 59 | 61 | }; |
|---|
| 60 | 62 | |
|---|
| 61 | 63 | struct sched_queue_entry { |
|---|
| .. | .. |
|---|
| 64 | 66 | struct ch_sched_queue param; |
|---|
| 65 | 67 | }; |
|---|
| 66 | 68 | |
|---|
| 69 | +struct sched_flowc_entry { |
|---|
| 70 | + struct list_head list; |
|---|
| 71 | + struct ch_sched_flowc param; |
|---|
| 72 | +}; |
|---|
| 73 | + |
|---|
| 67 | 74 | struct sched_class { |
|---|
| 68 | 75 | u8 state; |
|---|
| 69 | 76 | u8 idx; |
|---|
| 70 | 77 | struct ch_sched_params info; |
|---|
| 71 | | - struct list_head queue_list; |
|---|
| 72 | | - spinlock_t lock; /* Per class lock */ |
|---|
| 78 | + enum sched_bind_type bind_type; |
|---|
| 79 | + struct list_head entry_list; |
|---|
| 73 | 80 | atomic_t refcnt; |
|---|
| 74 | 81 | }; |
|---|
| 75 | 82 | |
|---|
| 76 | 83 | struct sched_table { /* per port scheduling table */ |
|---|
| 77 | 84 | u8 sched_size; |
|---|
| 78 | | - rwlock_t rw_lock; /* Table lock */ |
|---|
| 79 | | - struct sched_class tab[0]; |
|---|
| 85 | + struct sched_class tab[]; |
|---|
| 80 | 86 | }; |
|---|
| 81 | 87 | |
|---|
| 82 | 88 | static inline bool can_sched(struct net_device *dev) |
|---|
| .. | .. |
|---|
| 97 | 103 | return true; |
|---|
| 98 | 104 | } |
|---|
| 99 | 105 | |
|---|
| 106 | +struct sched_class *cxgb4_sched_queue_lookup(struct net_device *dev, |
|---|
| 107 | + struct ch_sched_queue *p); |
|---|
| 100 | 108 | int cxgb4_sched_class_bind(struct net_device *dev, void *arg, |
|---|
| 101 | 109 | enum sched_bind_type type); |
|---|
| 102 | 110 | int cxgb4_sched_class_unbind(struct net_device *dev, void *arg, |
|---|
| .. | .. |
|---|
| 104 | 112 | |
|---|
| 105 | 113 | struct sched_class *cxgb4_sched_class_alloc(struct net_device *dev, |
|---|
| 106 | 114 | struct ch_sched_params *p); |
|---|
| 115 | +void cxgb4_sched_class_free(struct net_device *dev, u8 classid); |
|---|
| 107 | 116 | |
|---|
| 108 | 117 | struct sched_table *t4_init_sched(unsigned int size); |
|---|
| 109 | 118 | void t4_cleanup_sched(struct adapter *adap); |
|---|