fm10k_pf.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /* Copyright(c) 2013 - 2018 Intel Corporation. */
  3. #ifndef _FM10K_PF_H_
  4. #define _FM10K_PF_H_
  5. #include "fm10k_type.h"
  6. #include "fm10k_common.h"
  7. bool fm10k_glort_valid_pf(struct fm10k_hw *hw, u16 glort);
  8. u16 fm10k_queues_per_pool(struct fm10k_hw *hw);
  9. u16 fm10k_vf_queue_index(struct fm10k_hw *hw, u16 vf_idx);
  10. enum fm10k_pf_tlv_msg_id_v1 {
  11. FM10K_PF_MSG_ID_TEST = 0x000, /* msg ID reserved */
  12. FM10K_PF_MSG_ID_XCAST_MODES = 0x001,
  13. FM10K_PF_MSG_ID_UPDATE_MAC_FWD_RULE = 0x002,
  14. FM10K_PF_MSG_ID_LPORT_MAP = 0x100,
  15. FM10K_PF_MSG_ID_LPORT_CREATE = 0x200,
  16. FM10K_PF_MSG_ID_LPORT_DELETE = 0x201,
  17. FM10K_PF_MSG_ID_CONFIG = 0x300,
  18. FM10K_PF_MSG_ID_UPDATE_PVID = 0x400,
  19. FM10K_PF_MSG_ID_CREATE_FLOW_TABLE = 0x501,
  20. FM10K_PF_MSG_ID_DELETE_FLOW_TABLE = 0x502,
  21. FM10K_PF_MSG_ID_UPDATE_FLOW = 0x503,
  22. FM10K_PF_MSG_ID_DELETE_FLOW = 0x504,
  23. FM10K_PF_MSG_ID_SET_FLOW_STATE = 0x505,
  24. };
  25. enum fm10k_pf_tlv_attr_id_v1 {
  26. FM10K_PF_ATTR_ID_ERR = 0x00,
  27. FM10K_PF_ATTR_ID_LPORT_MAP = 0x01,
  28. FM10K_PF_ATTR_ID_XCAST_MODE = 0x02,
  29. FM10K_PF_ATTR_ID_MAC_UPDATE = 0x03,
  30. FM10K_PF_ATTR_ID_VLAN_UPDATE = 0x04,
  31. FM10K_PF_ATTR_ID_CONFIG = 0x05,
  32. FM10K_PF_ATTR_ID_CREATE_FLOW_TABLE = 0x06,
  33. FM10K_PF_ATTR_ID_DELETE_FLOW_TABLE = 0x07,
  34. FM10K_PF_ATTR_ID_UPDATE_FLOW = 0x08,
  35. FM10K_PF_ATTR_ID_FLOW_STATE = 0x09,
  36. FM10K_PF_ATTR_ID_FLOW_HANDLE = 0x0A,
  37. FM10K_PF_ATTR_ID_DELETE_FLOW = 0x0B,
  38. FM10K_PF_ATTR_ID_PORT = 0x0C,
  39. FM10K_PF_ATTR_ID_UPDATE_PVID = 0x0D,
  40. };
  41. #define FM10K_MSG_LPORT_MAP_GLORT_SHIFT 0
  42. #define FM10K_MSG_LPORT_MAP_GLORT_SIZE 16
  43. #define FM10K_MSG_LPORT_MAP_MASK_SHIFT 16
  44. #define FM10K_MSG_LPORT_MAP_MASK_SIZE 16
  45. #define FM10K_MSG_UPDATE_PVID_GLORT_SHIFT 0
  46. #define FM10K_MSG_UPDATE_PVID_GLORT_SIZE 16
  47. #define FM10K_MSG_UPDATE_PVID_PVID_SHIFT 16
  48. #define FM10K_MSG_UPDATE_PVID_PVID_SIZE 16
  49. #define FM10K_MSG_ERR_PEP_NOT_SCHEDULED 280
  50. /* The following data structures are overlayed directly onto TLV mailbox
  51. * messages, and must not break 4 byte alignment. Ensure the structures line
  52. * up correctly as per their TLV definition.
  53. */
  54. struct fm10k_mac_update {
  55. __le32 mac_lower;
  56. __le16 mac_upper;
  57. __le16 vlan;
  58. __le16 glort;
  59. u8 flags;
  60. u8 action;
  61. } __aligned(4) __packed;
  62. struct fm10k_global_table_data {
  63. __le32 used;
  64. __le32 avail;
  65. } __aligned(4) __packed;
  66. struct fm10k_swapi_error {
  67. __le32 status;
  68. struct fm10k_global_table_data mac;
  69. struct fm10k_global_table_data nexthop;
  70. struct fm10k_global_table_data ffu;
  71. } __aligned(4) __packed;
  72. s32 fm10k_msg_lport_map_pf(struct fm10k_hw *, u32 **, struct fm10k_mbx_info *);
  73. extern const struct fm10k_tlv_attr fm10k_lport_map_msg_attr[];
  74. #define FM10K_PF_MSG_LPORT_MAP_HANDLER(func) \
  75. FM10K_MSG_HANDLER(FM10K_PF_MSG_ID_LPORT_MAP, \
  76. fm10k_lport_map_msg_attr, func)
  77. extern const struct fm10k_tlv_attr fm10k_update_pvid_msg_attr[];
  78. #define FM10K_PF_MSG_UPDATE_PVID_HANDLER(func) \
  79. FM10K_MSG_HANDLER(FM10K_PF_MSG_ID_UPDATE_PVID, \
  80. fm10k_update_pvid_msg_attr, func)
  81. s32 fm10k_msg_err_pf(struct fm10k_hw *, u32 **, struct fm10k_mbx_info *);
  82. extern const struct fm10k_tlv_attr fm10k_err_msg_attr[];
  83. #define FM10K_PF_MSG_ERR_HANDLER(msg, func) \
  84. FM10K_MSG_HANDLER(FM10K_PF_MSG_ID_##msg, fm10k_err_msg_attr, func)
  85. s32 fm10k_iov_select_vid(struct fm10k_vf_info *vf_info, u16 vid);
  86. s32 fm10k_iov_msg_msix_pf(struct fm10k_hw *, u32 **, struct fm10k_mbx_info *);
  87. s32 fm10k_iov_msg_mac_vlan_pf(struct fm10k_hw *, u32 **,
  88. struct fm10k_mbx_info *);
  89. s32 fm10k_iov_msg_lport_state_pf(struct fm10k_hw *, u32 **,
  90. struct fm10k_mbx_info *);
  91. extern const struct fm10k_info fm10k_pf_info;
  92. #endif /* _FM10K_PF_H */