0001
0002
0003
0004 #ifndef _ICE_VIRTCHNL_FDIR_H_
0005 #define _ICE_VIRTCHNL_FDIR_H_
0006
0007 struct ice_vf;
0008 struct ice_pf;
0009 struct ice_vsi;
0010
0011 enum ice_fdir_ctx_stat {
0012 ICE_FDIR_CTX_READY,
0013 ICE_FDIR_CTX_IRQ,
0014 ICE_FDIR_CTX_TIMEOUT,
0015 };
0016
0017 struct ice_vf_fdir_ctx {
0018 struct timer_list rx_tmr;
0019 enum virtchnl_ops v_opcode;
0020 enum ice_fdir_ctx_stat stat;
0021 union ice_32b_rx_flex_desc rx_desc;
0022 #define ICE_VF_FDIR_CTX_VALID BIT(0)
0023 u32 flags;
0024
0025 void *conf;
0026 };
0027
0028
0029 struct ice_vf_fdir {
0030 u16 fdir_fltr_cnt[ICE_FLTR_PTYPE_MAX][ICE_FD_HW_SEG_MAX];
0031 int prof_entry_cnt[ICE_FLTR_PTYPE_MAX][ICE_FD_HW_SEG_MAX];
0032 struct ice_fd_hw_prof **fdir_prof;
0033
0034 struct idr fdir_rule_idr;
0035 struct list_head fdir_rule_list;
0036
0037 spinlock_t ctx_lock;
0038 struct ice_vf_fdir_ctx ctx_irq;
0039 struct ice_vf_fdir_ctx ctx_done;
0040 };
0041
0042 #ifdef CONFIG_PCI_IOV
0043 int ice_vc_add_fdir_fltr(struct ice_vf *vf, u8 *msg);
0044 int ice_vc_del_fdir_fltr(struct ice_vf *vf, u8 *msg);
0045 void ice_vf_fdir_init(struct ice_vf *vf);
0046 void ice_vf_fdir_exit(struct ice_vf *vf);
0047 void
0048 ice_vc_fdir_irq_handler(struct ice_vsi *ctrl_vsi,
0049 union ice_32b_rx_flex_desc *rx_desc);
0050 void ice_flush_fdir_ctx(struct ice_pf *pf);
0051 #else
0052 static inline void
0053 ice_vc_fdir_irq_handler(struct ice_vsi *ctrl_vsi, union ice_32b_rx_flex_desc *rx_desc) { }
0054 static inline void ice_flush_fdir_ctx(struct ice_pf *pf) { }
0055 #endif
0056 #endif