1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* Copyright (C) 2021, Intel Corporation. */
4 #ifndef _ICE_VIRTCHNL_FDIR_H_
5 #define _ICE_VIRTCHNL_FDIR_H_
11 enum ice_fdir_ctx_stat {
17 struct ice_vf_fdir_ctx {
18 struct timer_list rx_tmr;
19 enum virtchnl_ops v_opcode;
20 enum ice_fdir_ctx_stat stat;
21 union ice_32b_rx_flex_desc rx_desc;
22 #define ICE_VF_FDIR_CTX_VALID BIT(0)
28 /* VF FDIR information structure */
30 u16 fdir_fltr_cnt[ICE_FLTR_PTYPE_MAX][ICE_FD_HW_SEG_MAX];
31 int prof_entry_cnt[ICE_FLTR_PTYPE_MAX][ICE_FD_HW_SEG_MAX];
32 u16 fdir_fltr_cnt_total;
33 struct ice_fd_hw_prof **fdir_prof;
35 struct idr fdir_rule_idr;
36 struct list_head fdir_rule_list;
38 spinlock_t ctx_lock; /* protects FDIR context info */
39 struct ice_vf_fdir_ctx ctx_irq;
40 struct ice_vf_fdir_ctx ctx_done;
44 int ice_vc_add_fdir_fltr(struct ice_vf *vf, u8 *msg);
45 int ice_vc_del_fdir_fltr(struct ice_vf *vf, u8 *msg);
46 void ice_vf_fdir_init(struct ice_vf *vf);
47 void ice_vf_fdir_exit(struct ice_vf *vf);
49 ice_vc_fdir_irq_handler(struct ice_vsi *ctrl_vsi,
50 union ice_32b_rx_flex_desc *rx_desc);
51 void ice_flush_fdir_ctx(struct ice_pf *pf);
54 ice_vc_fdir_irq_handler(struct ice_vsi *ctrl_vsi, union ice_32b_rx_flex_desc *rx_desc) { }
55 static inline void ice_flush_fdir_ctx(struct ice_pf *pf) { }
56 #endif /* CONFIG_PCI_IOV */
57 #endif /* _ICE_VIRTCHNL_FDIR_H_ */