Loading...
1/* SPDX-License-Identifier: GPL-2.0 */
2/* Copyright (C) 2021, Intel Corporation. */
3
4#ifndef _ICE_VIRTCHNL_FDIR_H_
5#define _ICE_VIRTCHNL_FDIR_H_
6
7struct ice_vf;
8struct ice_pf;
9struct ice_vsi;
10
11enum ice_fdir_ctx_stat {
12 ICE_FDIR_CTX_READY,
13 ICE_FDIR_CTX_IRQ,
14 ICE_FDIR_CTX_TIMEOUT,
15};
16
17struct 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)
23 u32 flags;
24
25 void *conf;
26};
27
28/* VF FDIR information structure */
29struct ice_vf_fdir {
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 struct ice_fd_hw_prof **fdir_prof;
33
34 struct idr fdir_rule_idr;
35 struct list_head fdir_rule_list;
36
37 spinlock_t ctx_lock; /* protects FDIR context info */
38 struct ice_vf_fdir_ctx ctx_irq;
39 struct ice_vf_fdir_ctx ctx_done;
40};
41
42#ifdef CONFIG_PCI_IOV
43int ice_vc_add_fdir_fltr(struct ice_vf *vf, u8 *msg);
44int ice_vc_del_fdir_fltr(struct ice_vf *vf, u8 *msg);
45void ice_vf_fdir_init(struct ice_vf *vf);
46void ice_vf_fdir_exit(struct ice_vf *vf);
47void
48ice_vc_fdir_irq_handler(struct ice_vsi *ctrl_vsi,
49 union ice_32b_rx_flex_desc *rx_desc);
50void ice_flush_fdir_ctx(struct ice_pf *pf);
51#else
52static inline void
53ice_vc_fdir_irq_handler(struct ice_vsi *ctrl_vsi, union ice_32b_rx_flex_desc *rx_desc) { }
54static inline void ice_flush_fdir_ctx(struct ice_pf *pf) { }
55#endif /* CONFIG_PCI_IOV */
56#endif /* _ICE_VIRTCHNL_FDIR_H_ */
1/* SPDX-License-Identifier: GPL-2.0 */
2/* Copyright (C) 2021, Intel Corporation. */
3
4#ifndef _ICE_VIRTCHNL_FDIR_H_
5#define _ICE_VIRTCHNL_FDIR_H_
6
7struct ice_vf;
8struct ice_pf;
9
10enum ice_fdir_ctx_stat {
11 ICE_FDIR_CTX_READY,
12 ICE_FDIR_CTX_IRQ,
13 ICE_FDIR_CTX_TIMEOUT,
14};
15
16struct ice_vf_fdir_ctx {
17 struct timer_list rx_tmr;
18 enum virtchnl_ops v_opcode;
19 enum ice_fdir_ctx_stat stat;
20 union ice_32b_rx_flex_desc rx_desc;
21#define ICE_VF_FDIR_CTX_VALID BIT(0)
22 u32 flags;
23
24 void *conf;
25};
26
27/* VF FDIR information structure */
28struct ice_vf_fdir {
29 u16 fdir_fltr_cnt[ICE_FLTR_PTYPE_MAX][ICE_FD_HW_SEG_MAX];
30 int prof_entry_cnt[ICE_FLTR_PTYPE_MAX][ICE_FD_HW_SEG_MAX];
31 struct ice_fd_hw_prof **fdir_prof;
32
33 struct idr fdir_rule_idr;
34 struct list_head fdir_rule_list;
35
36 spinlock_t ctx_lock; /* protects FDIR context info */
37 struct ice_vf_fdir_ctx ctx_irq;
38 struct ice_vf_fdir_ctx ctx_done;
39};
40
41#ifdef CONFIG_PCI_IOV
42int ice_vc_add_fdir_fltr(struct ice_vf *vf, u8 *msg);
43int ice_vc_del_fdir_fltr(struct ice_vf *vf, u8 *msg);
44void ice_vf_fdir_init(struct ice_vf *vf);
45void ice_vf_fdir_exit(struct ice_vf *vf);
46void
47ice_vc_fdir_irq_handler(struct ice_vsi *ctrl_vsi,
48 union ice_32b_rx_flex_desc *rx_desc);
49void ice_flush_fdir_ctx(struct ice_pf *pf);
50#else
51static inline void
52ice_vc_fdir_irq_handler(struct ice_vsi *ctrl_vsi, union ice_32b_rx_flex_desc *rx_desc) { }
53static inline void ice_flush_fdir_ctx(struct ice_pf *pf) { }
54#endif /* CONFIG_PCI_IOV */
55#endif /* _ICE_VIRTCHNL_FDIR_H_ */