ice_virtchnl_fdir.h 1.5 KB

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