blob: 6aa9f89d073b177c8927140ba15afb37f3e0b858 [file] [log] [blame]
Govindarajulu Varadarajan63118522014-06-23 16:08:00 +05301#ifndef _ENIC_CLSF_H_
2#define _ENIC_CLSF_H_
3
4#include "vnic_dev.h"
5#include "enic.h"
6
Govindarajulu Varadarajana145df22014-06-23 16:08:02 +05307#define ENIC_CLSF_EXPIRE_COUNT 128
8
Govindarajulu Varadarajan63118522014-06-23 16:08:00 +05309int enic_addfltr_5t(struct enic *enic, struct flow_keys *keys, u16 rq);
10int enic_delfltr(struct enic *enic, u16 filter_id);
Govindarajulu Varadarajana145df22014-06-23 16:08:02 +053011void enic_rfs_flw_tbl_init(struct enic *enic);
12void enic_rfs_flw_tbl_free(struct enic *enic);
Govindarajulu Varadarajan3762ff82014-07-21 17:22:18 +053013struct enic_rfs_fltr_node *htbl_fltr_search(struct enic *enic, u16 fltr_id);
Govindarajulu Varadarajane3e5af32014-07-21 17:22:17 +053014
15#ifdef CONFIG_RFS_ACCEL
Govindarajulu Varadarajana145df22014-06-23 16:08:02 +053016int enic_rx_flow_steer(struct net_device *dev, const struct sk_buff *skb,
17 u16 rxq_index, u32 flow_id);
Govindarajulu Varadarajane3e5af32014-07-21 17:22:17 +053018void enic_flow_may_expire(unsigned long data);
19
20static inline void enic_rfs_timer_start(struct enic *enic)
21{
22 init_timer(&enic->rfs_h.rfs_may_expire);
23 enic->rfs_h.rfs_may_expire.function = enic_flow_may_expire;
24 enic->rfs_h.rfs_may_expire.data = (unsigned long)enic;
25 mod_timer(&enic->rfs_h.rfs_may_expire, jiffies + HZ/4);
26}
27
28static inline void enic_rfs_timer_stop(struct enic *enic)
29{
30 del_timer_sync(&enic->rfs_h.rfs_may_expire);
31}
Geert Uytterhoeven644a9182014-06-25 10:31:09 +020032#else
Govindarajulu Varadarajane3e5af32014-07-21 17:22:17 +053033static inline void enic_rfs_timer_start(struct enic *enic) {}
34static inline void enic_rfs_timer_stop(struct enic *enic) {}
Govindarajulu Varadarajana145df22014-06-23 16:08:02 +053035#endif /* CONFIG_RFS_ACCEL */
36
Govindarajulu Varadarajan63118522014-06-23 16:08:00 +053037#endif /* _ENIC_CLSF_H_ */