Lines Matching refs:enic
21 int enic_addfltr_5t(struct enic *enic, struct flow_keys *keys, u16 rq) in enic_addfltr_5t() argument
44 spin_lock_bh(&enic->devcmd_lock); in enic_addfltr_5t()
45 res = vnic_dev_classifier(enic->vdev, CLSF_ADD, &rq, &data); in enic_addfltr_5t()
46 spin_unlock_bh(&enic->devcmd_lock); in enic_addfltr_5t()
59 int enic_delfltr(struct enic *enic, u16 filter_id) in enic_delfltr() argument
63 spin_lock_bh(&enic->devcmd_lock); in enic_delfltr()
64 ret = vnic_dev_classifier(enic->vdev, CLSF_DEL, &filter_id, NULL); in enic_delfltr()
65 spin_unlock_bh(&enic->devcmd_lock); in enic_delfltr()
73 void enic_rfs_flw_tbl_init(struct enic *enic) in enic_rfs_flw_tbl_init() argument
77 spin_lock_init(&enic->rfs_h.lock); in enic_rfs_flw_tbl_init()
79 INIT_HLIST_HEAD(&enic->rfs_h.ht_head[i]); in enic_rfs_flw_tbl_init()
80 enic->rfs_h.max = enic->config.num_arfs; in enic_rfs_flw_tbl_init()
81 enic->rfs_h.free = enic->rfs_h.max; in enic_rfs_flw_tbl_init()
82 enic->rfs_h.toclean = 0; in enic_rfs_flw_tbl_init()
85 void enic_rfs_flw_tbl_free(struct enic *enic) in enic_rfs_flw_tbl_free() argument
89 enic_rfs_timer_stop(enic); in enic_rfs_flw_tbl_free()
90 spin_lock_bh(&enic->rfs_h.lock); in enic_rfs_flw_tbl_free()
96 hhead = &enic->rfs_h.ht_head[i]; in enic_rfs_flw_tbl_free()
98 enic_delfltr(enic, n->fltr_id); in enic_rfs_flw_tbl_free()
101 enic->rfs_h.free++; in enic_rfs_flw_tbl_free()
104 spin_unlock_bh(&enic->rfs_h.lock); in enic_rfs_flw_tbl_free()
107 struct enic_rfs_fltr_node *htbl_fltr_search(struct enic *enic, u16 fltr_id) in htbl_fltr_search() argument
116 hhead = &enic->rfs_h.ht_head[i]; in htbl_fltr_search()
128 struct enic *enic = from_timer(enic, t, rfs_h.rfs_may_expire); in enic_flow_may_expire() local
132 spin_lock_bh(&enic->rfs_h.lock); in enic_flow_may_expire()
138 hhead = &enic->rfs_h.ht_head[enic->rfs_h.toclean++]; in enic_flow_may_expire()
140 res = rps_may_expire_flow(enic->netdev, n->rq_id, in enic_flow_may_expire()
143 res = enic_delfltr(enic, n->fltr_id); in enic_flow_may_expire()
148 enic->rfs_h.free++; in enic_flow_may_expire()
152 spin_unlock_bh(&enic->rfs_h.lock); in enic_flow_may_expire()
153 mod_timer(&enic->rfs_h.rfs_may_expire, jiffies + HZ/4); in enic_flow_may_expire()
176 struct enic *enic; in enic_rx_flow_steer() local
180 enic = netdev_priv(dev); in enic_rx_flow_steer()
188 spin_lock_bh(&enic->rfs_h.lock); in enic_rx_flow_steer()
189 n = htbl_key_search(&enic->rfs_h.ht_head[tbl_idx], &keys); in enic_rx_flow_steer()
207 i = --enic->rfs_h.free; in enic_rx_flow_steer()
210 enic->rfs_h.free++; in enic_rx_flow_steer()
211 res = enic_delfltr(enic, n->fltr_id); in enic_rx_flow_steer()
214 res = enic_addfltr_5t(enic, &keys, rxq_index); in enic_rx_flow_steer()
217 enic->rfs_h.free++; in enic_rx_flow_steer()
224 res = enic_addfltr_5t(enic, &keys, rxq_index); in enic_rx_flow_steer()
226 enic->rfs_h.free++; in enic_rx_flow_steer()
229 ret = enic_delfltr(enic, n->fltr_id); in enic_rx_flow_steer()
237 head = &enic->rfs_h.ht_head[tbl_idx]; in enic_rx_flow_steer()
245 enic->rfs_h.free++; in enic_rx_flow_steer()
253 i = --enic->rfs_h.free; in enic_rx_flow_steer()
255 enic->rfs_h.free++; in enic_rx_flow_steer()
263 enic->rfs_h.free++; in enic_rx_flow_steer()
267 res = enic_addfltr_5t(enic, &keys, rxq_index); in enic_rx_flow_steer()
270 enic->rfs_h.free++; in enic_rx_flow_steer()
278 hlist_add_head(&n->node, &enic->rfs_h.ht_head[tbl_idx]); in enic_rx_flow_steer()
282 spin_unlock_bh(&enic->rfs_h.lock); in enic_rx_flow_steer()