mae_counter_format.h 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /****************************************************************************
  3. * Driver for Solarflare network controllers and boards
  4. * Copyright 2020 Xilinx, Inc.
  5. *
  6. * This program is free software; you can redistribute it and/or modify it
  7. * under the terms of the GNU General Public License version 2 as published
  8. * by the Free Software Foundation, incorporated herein by reference.
  9. */
  10. /* Format of counter packets (version 2) from the ef100 Match-Action Engine */
  11. #ifndef EFX_MAE_COUNTER_FORMAT_H
  12. #define EFX_MAE_COUNTER_FORMAT_H
  13. /*------------------------------------------------------------*/
  14. /*
  15. * ER_RX_SL_PACKETISER_HEADER_WORD(160bit):
  16. *
  17. */
  18. #define ER_RX_SL_PACKETISER_HEADER_WORD_SIZE 20
  19. #define ER_RX_SL_PACKETISER_HEADER_WORD_WIDTH 160
  20. #define ERF_SC_PACKETISER_HEADER_VERSION_LBN 0
  21. #define ERF_SC_PACKETISER_HEADER_VERSION_WIDTH 8
  22. #define ERF_SC_PACKETISER_HEADER_VERSION_VALUE 2
  23. #define ERF_SC_PACKETISER_HEADER_IDENTIFIER_LBN 8
  24. #define ERF_SC_PACKETISER_HEADER_IDENTIFIER_WIDTH 8
  25. #define ERF_SC_PACKETISER_HEADER_IDENTIFIER_AR 0
  26. #define ERF_SC_PACKETISER_HEADER_IDENTIFIER_CT 1
  27. #define ERF_SC_PACKETISER_HEADER_IDENTIFIER_OR 2
  28. #define ERF_SC_PACKETISER_HEADER_HEADER_OFFSET_LBN 16
  29. #define ERF_SC_PACKETISER_HEADER_HEADER_OFFSET_WIDTH 8
  30. #define ERF_SC_PACKETISER_HEADER_HEADER_OFFSET_DEFAULT 0x4
  31. #define ERF_SC_PACKETISER_HEADER_PAYLOAD_OFFSET_LBN 24
  32. #define ERF_SC_PACKETISER_HEADER_PAYLOAD_OFFSET_WIDTH 8
  33. #define ERF_SC_PACKETISER_HEADER_PAYLOAD_OFFSET_DEFAULT 0x14
  34. #define ERF_SC_PACKETISER_HEADER_INDEX_LBN 32
  35. #define ERF_SC_PACKETISER_HEADER_INDEX_WIDTH 16
  36. #define ERF_SC_PACKETISER_HEADER_COUNT_LBN 48
  37. #define ERF_SC_PACKETISER_HEADER_COUNT_WIDTH 16
  38. #define ERF_SC_PACKETISER_HEADER_RESERVED_0_LBN 64
  39. #define ERF_SC_PACKETISER_HEADER_RESERVED_0_WIDTH 32
  40. #define ERF_SC_PACKETISER_HEADER_RESERVED_1_LBN 96
  41. #define ERF_SC_PACKETISER_HEADER_RESERVED_1_WIDTH 32
  42. #define ERF_SC_PACKETISER_HEADER_RESERVED_2_LBN 128
  43. #define ERF_SC_PACKETISER_HEADER_RESERVED_2_WIDTH 32
  44. /*------------------------------------------------------------*/
  45. /*
  46. * ER_RX_SL_PACKETISER_PAYLOAD_WORD(128bit):
  47. *
  48. */
  49. #define ER_RX_SL_PACKETISER_PAYLOAD_WORD_SIZE 16
  50. #define ER_RX_SL_PACKETISER_PAYLOAD_WORD_WIDTH 128
  51. #define ERF_SC_PACKETISER_PAYLOAD_COUNTER_INDEX_LBN 0
  52. #define ERF_SC_PACKETISER_PAYLOAD_COUNTER_INDEX_WIDTH 24
  53. #define ERF_SC_PACKETISER_PAYLOAD_RESERVED_LBN 24
  54. #define ERF_SC_PACKETISER_PAYLOAD_RESERVED_WIDTH 8
  55. #define ERF_SC_PACKETISER_PAYLOAD_PACKET_COUNT_OFST 4
  56. #define ERF_SC_PACKETISER_PAYLOAD_PACKET_COUNT_SIZE 6
  57. #define ERF_SC_PACKETISER_PAYLOAD_PACKET_COUNT_LBN 32
  58. #define ERF_SC_PACKETISER_PAYLOAD_PACKET_COUNT_WIDTH 48
  59. #define ERF_SC_PACKETISER_PAYLOAD_BYTE_COUNT_OFST 10
  60. #define ERF_SC_PACKETISER_PAYLOAD_BYTE_COUNT_SIZE 6
  61. #define ERF_SC_PACKETISER_PAYLOAD_BYTE_COUNT_LBN 80
  62. #define ERF_SC_PACKETISER_PAYLOAD_BYTE_COUNT_WIDTH 48
  63. #endif /* EFX_MAE_COUNTER_FORMAT_H */