dpni.h 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119
  1. /* SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */
  2. /* Copyright 2013-2016 Freescale Semiconductor Inc.
  3. * Copyright 2016 NXP
  4. * Copyright 2020 NXP
  5. */
  6. #ifndef __FSL_DPNI_H
  7. #define __FSL_DPNI_H
  8. #include "dpkg.h"
  9. struct fsl_mc_io;
  10. /* Data Path Network Interface API
  11. * Contains initialization APIs and runtime control APIs for DPNI
  12. */
  13. /** General DPNI macros */
  14. /**
  15. * DPNI_MAX_TC - Maximum number of traffic classes
  16. */
  17. #define DPNI_MAX_TC 8
  18. /**
  19. * DPNI_MAX_DPBP - Maximum number of buffer pools per DPNI
  20. */
  21. #define DPNI_MAX_DPBP 8
  22. /**
  23. * DPNI_ALL_TCS - All traffic classes considered; see dpni_set_queue()
  24. */
  25. #define DPNI_ALL_TCS (u8)(-1)
  26. /**
  27. * DPNI_ALL_TC_FLOWS - All flows within traffic class considered; see
  28. * dpni_set_queue()
  29. */
  30. #define DPNI_ALL_TC_FLOWS (u16)(-1)
  31. /**
  32. * DPNI_NEW_FLOW_ID - Generate new flow ID; see dpni_set_queue()
  33. */
  34. #define DPNI_NEW_FLOW_ID (u16)(-1)
  35. /**
  36. * DPNI_OPT_TX_FRM_RELEASE - Tx traffic is always released to a buffer pool on
  37. * transmit, there are no resources allocated to have the frames confirmed back
  38. * to the source after transmission.
  39. */
  40. #define DPNI_OPT_TX_FRM_RELEASE 0x000001
  41. /**
  42. * DPNI_OPT_NO_MAC_FILTER - Disables support for MAC address filtering for
  43. * addresses other than primary MAC address. This affects both unicast and
  44. * multicast. Promiscuous mode can still be enabled/disabled for both unicast
  45. * and multicast. If promiscuous mode is disabled, only traffic matching the
  46. * primary MAC address will be accepted.
  47. */
  48. #define DPNI_OPT_NO_MAC_FILTER 0x000002
  49. /**
  50. * DPNI_OPT_HAS_POLICING - Allocate policers for this DPNI. They can be used to
  51. * rate-limit traffic per traffic class (TC) basis.
  52. */
  53. #define DPNI_OPT_HAS_POLICING 0x000004
  54. /**
  55. * DPNI_OPT_SHARED_CONGESTION - Congestion can be managed in several ways,
  56. * allowing the buffer pool to deplete on ingress, taildrop on each queue or
  57. * use congestion groups for sets of queues. If set, it configures a single
  58. * congestion groups across all TCs. If reset, a congestion group is allocated
  59. * for each TC. Only relevant if the DPNI has multiple traffic classes.
  60. */
  61. #define DPNI_OPT_SHARED_CONGESTION 0x000008
  62. /**
  63. * DPNI_OPT_HAS_KEY_MASKING - Enables TCAM for Flow Steering and QoS look-ups.
  64. * If not specified, all look-ups are exact match. Note that TCAM is not
  65. * available on LS1088 and its variants. Setting this bit on these SoCs will
  66. * trigger an error.
  67. */
  68. #define DPNI_OPT_HAS_KEY_MASKING 0x000010
  69. /**
  70. * DPNI_OPT_NO_FS - Disables the flow steering table.
  71. */
  72. #define DPNI_OPT_NO_FS 0x000020
  73. /**
  74. * DPNI_OPT_SHARED_FS - Flow steering table is shared between all traffic
  75. * classes
  76. */
  77. #define DPNI_OPT_SHARED_FS 0x001000
  78. int dpni_open(struct fsl_mc_io *mc_io,
  79. u32 cmd_flags,
  80. int dpni_id,
  81. u16 *token);
  82. int dpni_close(struct fsl_mc_io *mc_io,
  83. u32 cmd_flags,
  84. u16 token);
  85. #define DPNI_POOL_ASSOC_QPRI 0
  86. #define DPNI_POOL_ASSOC_QDBIN 1
  87. /**
  88. * struct dpni_pools_cfg - Structure representing buffer pools configuration
  89. * @num_dpbp: Number of DPBPs
  90. * @pool_options: Buffer assignment options.
  91. * This field is a combination of DPNI_POOL_ASSOC_flags
  92. * @pools: Array of buffer pools parameters; The number of valid entries
  93. * must match 'num_dpbp' value
  94. * @pools.dpbp_id: DPBP object ID
  95. * @pools.priority: Priority mask that indicates TC's used with this buffer.
  96. * If set to 0x00 MC will assume value 0xff.
  97. * @pools.buffer_size: Buffer size
  98. * @pools.backup_pool: Backup pool
  99. */
  100. struct dpni_pools_cfg {
  101. u8 num_dpbp;
  102. u8 pool_options;
  103. struct {
  104. int dpbp_id;
  105. u8 priority_mask;
  106. u16 buffer_size;
  107. int backup_pool;
  108. } pools[DPNI_MAX_DPBP];
  109. };
  110. int dpni_set_pools(struct fsl_mc_io *mc_io,
  111. u32 cmd_flags,
  112. u16 token,
  113. const struct dpni_pools_cfg *cfg);
  114. int dpni_enable(struct fsl_mc_io *mc_io,
  115. u32 cmd_flags,
  116. u16 token);
  117. int dpni_disable(struct fsl_mc_io *mc_io,
  118. u32 cmd_flags,
  119. u16 token);
  120. int dpni_is_enabled(struct fsl_mc_io *mc_io,
  121. u32 cmd_flags,
  122. u16 token,
  123. int *en);
  124. int dpni_reset(struct fsl_mc_io *mc_io,
  125. u32 cmd_flags,
  126. u16 token);
  127. /* DPNI IRQ Index and Events */
  128. #define DPNI_IRQ_INDEX 0
  129. /* DPNI_IRQ_EVENT_LINK_CHANGED - indicates a change in link state */
  130. #define DPNI_IRQ_EVENT_LINK_CHANGED 0x00000001
  131. /* DPNI_IRQ_EVENT_ENDPOINT_CHANGED - indicates a change in endpoint */
  132. #define DPNI_IRQ_EVENT_ENDPOINT_CHANGED 0x00000002
  133. int dpni_set_irq_enable(struct fsl_mc_io *mc_io,
  134. u32 cmd_flags,
  135. u16 token,
  136. u8 irq_index,
  137. u8 en);
  138. int dpni_get_irq_enable(struct fsl_mc_io *mc_io,
  139. u32 cmd_flags,
  140. u16 token,
  141. u8 irq_index,
  142. u8 *en);
  143. int dpni_set_irq_mask(struct fsl_mc_io *mc_io,
  144. u32 cmd_flags,
  145. u16 token,
  146. u8 irq_index,
  147. u32 mask);
  148. int dpni_get_irq_mask(struct fsl_mc_io *mc_io,
  149. u32 cmd_flags,
  150. u16 token,
  151. u8 irq_index,
  152. u32 *mask);
  153. int dpni_get_irq_status(struct fsl_mc_io *mc_io,
  154. u32 cmd_flags,
  155. u16 token,
  156. u8 irq_index,
  157. u32 *status);
  158. int dpni_clear_irq_status(struct fsl_mc_io *mc_io,
  159. u32 cmd_flags,
  160. u16 token,
  161. u8 irq_index,
  162. u32 status);
  163. /**
  164. * struct dpni_attr - Structure representing DPNI attributes
  165. * @options: Any combination of the following options:
  166. * DPNI_OPT_TX_FRM_RELEASE
  167. * DPNI_OPT_NO_MAC_FILTER
  168. * DPNI_OPT_HAS_POLICING
  169. * DPNI_OPT_SHARED_CONGESTION
  170. * DPNI_OPT_HAS_KEY_MASKING
  171. * DPNI_OPT_NO_FS
  172. * @num_queues: Number of Tx and Rx queues used for traffic distribution.
  173. * @num_tcs: Number of traffic classes (TCs), reserved for the DPNI.
  174. * @mac_filter_entries: Number of entries in the MAC address filtering table.
  175. * @vlan_filter_entries: Number of entries in the VLAN address filtering table.
  176. * @qos_entries: Number of entries in the QoS classification table.
  177. * @fs_entries: Number of entries in the flow steering table.
  178. * @qos_key_size: Size, in bytes, of the QoS look-up key. Defining a key larger
  179. * than this when adding QoS entries will result in an error.
  180. * @fs_key_size: Size, in bytes, of the flow steering look-up key. Defining a
  181. * key larger than this when composing the hash + FS key will
  182. * result in an error.
  183. * @wriop_version: Version of WRIOP HW block. The 3 version values are stored
  184. * on 6, 5, 5 bits respectively.
  185. */
  186. struct dpni_attr {
  187. u32 options;
  188. u8 num_queues;
  189. u8 num_tcs;
  190. u8 mac_filter_entries;
  191. u8 vlan_filter_entries;
  192. u8 qos_entries;
  193. u16 fs_entries;
  194. u8 qos_key_size;
  195. u8 fs_key_size;
  196. u16 wriop_version;
  197. };
  198. int dpni_get_attributes(struct fsl_mc_io *mc_io,
  199. u32 cmd_flags,
  200. u16 token,
  201. struct dpni_attr *attr);
  202. /* DPNI errors */
  203. /**
  204. * DPNI_ERROR_EOFHE - Extract out of frame header error
  205. */
  206. #define DPNI_ERROR_EOFHE 0x00020000
  207. /**
  208. * DPNI_ERROR_FLE - Frame length error
  209. */
  210. #define DPNI_ERROR_FLE 0x00002000
  211. /**
  212. * DPNI_ERROR_FPE - Frame physical error
  213. */
  214. #define DPNI_ERROR_FPE 0x00001000
  215. /**
  216. * DPNI_ERROR_PHE - Parsing header error
  217. */
  218. #define DPNI_ERROR_PHE 0x00000020
  219. /**
  220. * DPNI_ERROR_L3CE - Parser L3 checksum error
  221. */
  222. #define DPNI_ERROR_L3CE 0x00000004
  223. /**
  224. * DPNI_ERROR_L4CE - Parser L3 checksum error
  225. */
  226. #define DPNI_ERROR_L4CE 0x00000001
  227. /**
  228. * enum dpni_error_action - Defines DPNI behavior for errors
  229. * @DPNI_ERROR_ACTION_DISCARD: Discard the frame
  230. * @DPNI_ERROR_ACTION_CONTINUE: Continue with the normal flow
  231. * @DPNI_ERROR_ACTION_SEND_TO_ERROR_QUEUE: Send the frame to the error queue
  232. */
  233. enum dpni_error_action {
  234. DPNI_ERROR_ACTION_DISCARD = 0,
  235. DPNI_ERROR_ACTION_CONTINUE = 1,
  236. DPNI_ERROR_ACTION_SEND_TO_ERROR_QUEUE = 2
  237. };
  238. /**
  239. * struct dpni_error_cfg - Structure representing DPNI errors treatment
  240. * @errors: Errors mask; use 'DPNI_ERROR__<X>
  241. * @error_action: The desired action for the errors mask
  242. * @set_frame_annotation: Set to '1' to mark the errors in frame annotation
  243. * status (FAS); relevant only for the non-discard action
  244. */
  245. struct dpni_error_cfg {
  246. u32 errors;
  247. enum dpni_error_action error_action;
  248. int set_frame_annotation;
  249. };
  250. int dpni_set_errors_behavior(struct fsl_mc_io *mc_io,
  251. u32 cmd_flags,
  252. u16 token,
  253. struct dpni_error_cfg *cfg);
  254. /* DPNI buffer layout modification options */
  255. /**
  256. * DPNI_BUF_LAYOUT_OPT_TIMESTAMP - Select to modify the time-stamp setting
  257. */
  258. #define DPNI_BUF_LAYOUT_OPT_TIMESTAMP 0x00000001
  259. /**
  260. * DPNI_BUF_LAYOUT_OPT_PARSER_RESULT - Select to modify the parser-result
  261. * setting; not applicable for Tx
  262. */
  263. #define DPNI_BUF_LAYOUT_OPT_PARSER_RESULT 0x00000002
  264. /**
  265. * DPNI_BUF_LAYOUT_OPT_FRAME_STATUS - Select to modify the frame-status setting
  266. */
  267. #define DPNI_BUF_LAYOUT_OPT_FRAME_STATUS 0x00000004
  268. /**
  269. * DPNI_BUF_LAYOUT_OPT_PRIVATE_DATA_SIZE - Select to modify the private-data-size setting
  270. */
  271. #define DPNI_BUF_LAYOUT_OPT_PRIVATE_DATA_SIZE 0x00000008
  272. /**
  273. * DPNI_BUF_LAYOUT_OPT_DATA_ALIGN - Select to modify the data-alignment setting
  274. */
  275. #define DPNI_BUF_LAYOUT_OPT_DATA_ALIGN 0x00000010
  276. /**
  277. * DPNI_BUF_LAYOUT_OPT_DATA_HEAD_ROOM - Select to modify the data-head-room setting
  278. */
  279. #define DPNI_BUF_LAYOUT_OPT_DATA_HEAD_ROOM 0x00000020
  280. /**
  281. * DPNI_BUF_LAYOUT_OPT_DATA_TAIL_ROOM - Select to modify the data-tail-room setting
  282. */
  283. #define DPNI_BUF_LAYOUT_OPT_DATA_TAIL_ROOM 0x00000040
  284. /**
  285. * struct dpni_buffer_layout - Structure representing DPNI buffer layout
  286. * @options: Flags representing the suggested modifications to the buffer
  287. * layout; Use any combination of 'DPNI_BUF_LAYOUT_OPT_<X>' flags
  288. * @pass_timestamp: Pass timestamp value
  289. * @pass_parser_result: Pass parser results
  290. * @pass_frame_status: Pass frame status
  291. * @private_data_size: Size kept for private data (in bytes)
  292. * @data_align: Data alignment
  293. * @data_head_room: Data head room
  294. * @data_tail_room: Data tail room
  295. */
  296. struct dpni_buffer_layout {
  297. u32 options;
  298. int pass_timestamp;
  299. int pass_parser_result;
  300. int pass_frame_status;
  301. u16 private_data_size;
  302. u16 data_align;
  303. u16 data_head_room;
  304. u16 data_tail_room;
  305. };
  306. /**
  307. * enum dpni_queue_type - Identifies a type of queue targeted by the command
  308. * @DPNI_QUEUE_RX: Rx queue
  309. * @DPNI_QUEUE_TX: Tx queue
  310. * @DPNI_QUEUE_TX_CONFIRM: Tx confirmation queue
  311. * @DPNI_QUEUE_RX_ERR: Rx error queue
  312. */
  313. enum dpni_queue_type {
  314. DPNI_QUEUE_RX,
  315. DPNI_QUEUE_TX,
  316. DPNI_QUEUE_TX_CONFIRM,
  317. DPNI_QUEUE_RX_ERR,
  318. };
  319. int dpni_get_buffer_layout(struct fsl_mc_io *mc_io,
  320. u32 cmd_flags,
  321. u16 token,
  322. enum dpni_queue_type qtype,
  323. struct dpni_buffer_layout *layout);
  324. int dpni_set_buffer_layout(struct fsl_mc_io *mc_io,
  325. u32 cmd_flags,
  326. u16 token,
  327. enum dpni_queue_type qtype,
  328. const struct dpni_buffer_layout *layout);
  329. /**
  330. * enum dpni_offload - Identifies a type of offload targeted by the command
  331. * @DPNI_OFF_RX_L3_CSUM: Rx L3 checksum validation
  332. * @DPNI_OFF_RX_L4_CSUM: Rx L4 checksum validation
  333. * @DPNI_OFF_TX_L3_CSUM: Tx L3 checksum generation
  334. * @DPNI_OFF_TX_L4_CSUM: Tx L4 checksum generation
  335. */
  336. enum dpni_offload {
  337. DPNI_OFF_RX_L3_CSUM,
  338. DPNI_OFF_RX_L4_CSUM,
  339. DPNI_OFF_TX_L3_CSUM,
  340. DPNI_OFF_TX_L4_CSUM,
  341. };
  342. int dpni_set_offload(struct fsl_mc_io *mc_io,
  343. u32 cmd_flags,
  344. u16 token,
  345. enum dpni_offload type,
  346. u32 config);
  347. int dpni_get_offload(struct fsl_mc_io *mc_io,
  348. u32 cmd_flags,
  349. u16 token,
  350. enum dpni_offload type,
  351. u32 *config);
  352. int dpni_get_qdid(struct fsl_mc_io *mc_io,
  353. u32 cmd_flags,
  354. u16 token,
  355. enum dpni_queue_type qtype,
  356. u16 *qdid);
  357. int dpni_get_tx_data_offset(struct fsl_mc_io *mc_io,
  358. u32 cmd_flags,
  359. u16 token,
  360. u16 *data_offset);
  361. #define DPNI_STATISTICS_CNT 7
  362. /**
  363. * union dpni_statistics - Union describing the DPNI statistics
  364. * @page_0: Page_0 statistics structure
  365. * @page_0.ingress_all_frames: Ingress frame count
  366. * @page_0.ingress_all_bytes: Ingress byte count
  367. * @page_0.ingress_multicast_frames: Ingress multicast frame count
  368. * @page_0.ingress_multicast_bytes: Ingress multicast byte count
  369. * @page_0.ingress_broadcast_frames: Ingress broadcast frame count
  370. * @page_0.ingress_broadcast_bytes: Ingress broadcast byte count
  371. * @page_1: Page_1 statistics structure
  372. * @page_1.egress_all_frames: Egress frame count
  373. * @page_1.egress_all_bytes: Egress byte count
  374. * @page_1.egress_multicast_frames: Egress multicast frame count
  375. * @page_1.egress_multicast_bytes: Egress multicast byte count
  376. * @page_1.egress_broadcast_frames: Egress broadcast frame count
  377. * @page_1.egress_broadcast_bytes: Egress broadcast byte count
  378. * @page_2: Page_2 statistics structure
  379. * @page_2.ingress_filtered_frames: Ingress filtered frame count
  380. * @page_2.ingress_discarded_frames: Ingress discarded frame count
  381. * @page_2.ingress_nobuffer_discards: Ingress discarded frame count due to
  382. * lack of buffers
  383. * @page_2.egress_discarded_frames: Egress discarded frame count
  384. * @page_2.egress_confirmed_frames: Egress confirmed frame count
  385. * @page_3: Page_3 statistics structure
  386. * @page_3.egress_dequeue_bytes: Cumulative count of the number of bytes
  387. * dequeued from egress FQs
  388. * @page_3.egress_dequeue_frames: Cumulative count of the number of frames
  389. * dequeued from egress FQs
  390. * @page_3.egress_reject_bytes: Cumulative count of the number of bytes in
  391. * egress frames whose enqueue was rejected
  392. * @page_3.egress_reject_frames: Cumulative count of the number of egress
  393. * frames whose enqueue was rejected
  394. * @page_4: Page_4 statistics structure: congestion points
  395. * @page_4.cgr_reject_frames: number of rejected frames due to congestion point
  396. * @page_4.cgr_reject_bytes: number of rejected bytes due to congestion point
  397. * @page_5: Page_5 statistics structure: policer
  398. * @page_5.policer_cnt_red: NUmber of red colored frames
  399. * @page_5.policer_cnt_yellow: number of yellow colored frames
  400. * @page_5.policer_cnt_green: number of green colored frames
  401. * @page_5.policer_cnt_re_red: number of recolored red frames
  402. * @page_5.policer_cnt_re_yellow: number of recolored yellow frames
  403. * @page_6: Page_6 statistics structure
  404. * @page_6.tx_pending_frames: total number of frames pending in egress FQs
  405. * @raw: raw statistics structure, used to index counters
  406. */
  407. union dpni_statistics {
  408. struct {
  409. u64 ingress_all_frames;
  410. u64 ingress_all_bytes;
  411. u64 ingress_multicast_frames;
  412. u64 ingress_multicast_bytes;
  413. u64 ingress_broadcast_frames;
  414. u64 ingress_broadcast_bytes;
  415. } page_0;
  416. struct {
  417. u64 egress_all_frames;
  418. u64 egress_all_bytes;
  419. u64 egress_multicast_frames;
  420. u64 egress_multicast_bytes;
  421. u64 egress_broadcast_frames;
  422. u64 egress_broadcast_bytes;
  423. } page_1;
  424. struct {
  425. u64 ingress_filtered_frames;
  426. u64 ingress_discarded_frames;
  427. u64 ingress_nobuffer_discards;
  428. u64 egress_discarded_frames;
  429. u64 egress_confirmed_frames;
  430. } page_2;
  431. struct {
  432. u64 egress_dequeue_bytes;
  433. u64 egress_dequeue_frames;
  434. u64 egress_reject_bytes;
  435. u64 egress_reject_frames;
  436. } page_3;
  437. struct {
  438. u64 cgr_reject_frames;
  439. u64 cgr_reject_bytes;
  440. } page_4;
  441. struct {
  442. u64 policer_cnt_red;
  443. u64 policer_cnt_yellow;
  444. u64 policer_cnt_green;
  445. u64 policer_cnt_re_red;
  446. u64 policer_cnt_re_yellow;
  447. } page_5;
  448. struct {
  449. u64 tx_pending_frames;
  450. } page_6;
  451. struct {
  452. u64 counter[DPNI_STATISTICS_CNT];
  453. } raw;
  454. };
  455. int dpni_get_statistics(struct fsl_mc_io *mc_io,
  456. u32 cmd_flags,
  457. u16 token,
  458. u8 page,
  459. union dpni_statistics *stat);
  460. #define DPNI_LINK_OPT_AUTONEG 0x0000000000000001ULL
  461. #define DPNI_LINK_OPT_HALF_DUPLEX 0x0000000000000002ULL
  462. #define DPNI_LINK_OPT_PAUSE 0x0000000000000004ULL
  463. #define DPNI_LINK_OPT_ASYM_PAUSE 0x0000000000000008ULL
  464. #define DPNI_LINK_OPT_PFC_PAUSE 0x0000000000000010ULL
  465. /**
  466. * struct dpni_link_cfg - Structure representing DPNI link configuration
  467. * @rate: Rate
  468. * @options: Mask of available options; use 'DPNI_LINK_OPT_<X>' values
  469. */
  470. struct dpni_link_cfg {
  471. u32 rate;
  472. u64 options;
  473. };
  474. int dpni_set_link_cfg(struct fsl_mc_io *mc_io,
  475. u32 cmd_flags,
  476. u16 token,
  477. const struct dpni_link_cfg *cfg);
  478. int dpni_get_link_cfg(struct fsl_mc_io *mc_io,
  479. u32 cmd_flags,
  480. u16 token,
  481. struct dpni_link_cfg *cfg);
  482. /**
  483. * struct dpni_link_state - Structure representing DPNI link state
  484. * @rate: Rate
  485. * @options: Mask of available options; use 'DPNI_LINK_OPT_<X>' values
  486. * @up: Link state; '0' for down, '1' for up
  487. */
  488. struct dpni_link_state {
  489. u32 rate;
  490. u64 options;
  491. int up;
  492. };
  493. int dpni_get_link_state(struct fsl_mc_io *mc_io,
  494. u32 cmd_flags,
  495. u16 token,
  496. struct dpni_link_state *state);
  497. int dpni_set_max_frame_length(struct fsl_mc_io *mc_io,
  498. u32 cmd_flags,
  499. u16 token,
  500. u16 max_frame_length);
  501. int dpni_get_max_frame_length(struct fsl_mc_io *mc_io,
  502. u32 cmd_flags,
  503. u16 token,
  504. u16 *max_frame_length);
  505. int dpni_set_multicast_promisc(struct fsl_mc_io *mc_io,
  506. u32 cmd_flags,
  507. u16 token,
  508. int en);
  509. int dpni_get_multicast_promisc(struct fsl_mc_io *mc_io,
  510. u32 cmd_flags,
  511. u16 token,
  512. int *en);
  513. int dpni_set_unicast_promisc(struct fsl_mc_io *mc_io,
  514. u32 cmd_flags,
  515. u16 token,
  516. int en);
  517. int dpni_get_unicast_promisc(struct fsl_mc_io *mc_io,
  518. u32 cmd_flags,
  519. u16 token,
  520. int *en);
  521. int dpni_set_primary_mac_addr(struct fsl_mc_io *mc_io,
  522. u32 cmd_flags,
  523. u16 token,
  524. const u8 mac_addr[6]);
  525. int dpni_get_primary_mac_addr(struct fsl_mc_io *mc_io,
  526. u32 cmd_flags,
  527. u16 token,
  528. u8 mac_addr[6]);
  529. int dpni_get_port_mac_addr(struct fsl_mc_io *mc_io,
  530. u32 cm_flags,
  531. u16 token,
  532. u8 mac_addr[6]);
  533. int dpni_add_mac_addr(struct fsl_mc_io *mc_io,
  534. u32 cmd_flags,
  535. u16 token,
  536. const u8 mac_addr[6]);
  537. int dpni_remove_mac_addr(struct fsl_mc_io *mc_io,
  538. u32 cmd_flags,
  539. u16 token,
  540. const u8 mac_addr[6]);
  541. int dpni_clear_mac_filters(struct fsl_mc_io *mc_io,
  542. u32 cmd_flags,
  543. u16 token,
  544. int unicast,
  545. int multicast);
  546. /**
  547. * enum dpni_dist_mode - DPNI distribution mode
  548. * @DPNI_DIST_MODE_NONE: No distribution
  549. * @DPNI_DIST_MODE_HASH: Use hash distribution; only relevant if
  550. * the 'DPNI_OPT_DIST_HASH' option was set at DPNI creation
  551. * @DPNI_DIST_MODE_FS: Use explicit flow steering; only relevant if
  552. * the 'DPNI_OPT_DIST_FS' option was set at DPNI creation
  553. */
  554. enum dpni_dist_mode {
  555. DPNI_DIST_MODE_NONE = 0,
  556. DPNI_DIST_MODE_HASH = 1,
  557. DPNI_DIST_MODE_FS = 2
  558. };
  559. /**
  560. * enum dpni_fs_miss_action - DPNI Flow Steering miss action
  561. * @DPNI_FS_MISS_DROP: In case of no-match, drop the frame
  562. * @DPNI_FS_MISS_EXPLICIT_FLOWID: In case of no-match, use explicit flow-id
  563. * @DPNI_FS_MISS_HASH: In case of no-match, distribute using hash
  564. */
  565. enum dpni_fs_miss_action {
  566. DPNI_FS_MISS_DROP = 0,
  567. DPNI_FS_MISS_EXPLICIT_FLOWID = 1,
  568. DPNI_FS_MISS_HASH = 2
  569. };
  570. /**
  571. * struct dpni_fs_tbl_cfg - Flow Steering table configuration
  572. * @miss_action: Miss action selection
  573. * @default_flow_id: Used when 'miss_action = DPNI_FS_MISS_EXPLICIT_FLOWID'
  574. */
  575. struct dpni_fs_tbl_cfg {
  576. enum dpni_fs_miss_action miss_action;
  577. u16 default_flow_id;
  578. };
  579. int dpni_prepare_key_cfg(const struct dpkg_profile_cfg *cfg,
  580. u8 *key_cfg_buf);
  581. /**
  582. * struct dpni_rx_tc_dist_cfg - Rx traffic class distribution configuration
  583. * @dist_size: Set the distribution size;
  584. * supported values: 1,2,3,4,6,7,8,12,14,16,24,28,32,48,56,64,96,
  585. * 112,128,192,224,256,384,448,512,768,896,1024
  586. * @dist_mode: Distribution mode
  587. * @key_cfg_iova: I/O virtual address of 256 bytes DMA-able memory filled with
  588. * the extractions to be used for the distribution key by calling
  589. * dpni_prepare_key_cfg() relevant only when
  590. * 'dist_mode != DPNI_DIST_MODE_NONE', otherwise it can be '0'
  591. * @fs_cfg: Flow Steering table configuration; only relevant if
  592. * 'dist_mode = DPNI_DIST_MODE_FS'
  593. */
  594. struct dpni_rx_tc_dist_cfg {
  595. u16 dist_size;
  596. enum dpni_dist_mode dist_mode;
  597. u64 key_cfg_iova;
  598. struct dpni_fs_tbl_cfg fs_cfg;
  599. };
  600. int dpni_set_rx_tc_dist(struct fsl_mc_io *mc_io,
  601. u32 cmd_flags,
  602. u16 token,
  603. u8 tc_id,
  604. const struct dpni_rx_tc_dist_cfg *cfg);
  605. /**
  606. * DPNI_FS_MISS_DROP - When used for fs_miss_flow_id in function
  607. * dpni_set_rx_dist, will signal to dpni to drop all unclassified frames
  608. */
  609. #define DPNI_FS_MISS_DROP ((uint16_t)-1)
  610. /**
  611. * struct dpni_rx_dist_cfg - Rx distribution configuration
  612. * @dist_size: distribution size
  613. * @key_cfg_iova: I/O virtual address of 256 bytes DMA-able memory filled with
  614. * the extractions to be used for the distribution key by calling
  615. * dpni_prepare_key_cfg(); relevant only when enable!=0 otherwise
  616. * it can be '0'
  617. * @enable: enable/disable the distribution.
  618. * @tc: TC id for which distribution is set
  619. * @fs_miss_flow_id: when packet misses all rules from flow steering table and
  620. * hash is disabled it will be put into this queue id; use
  621. * DPNI_FS_MISS_DROP to drop frames. The value of this field is
  622. * used only when flow steering distribution is enabled and hash
  623. * distribution is disabled
  624. */
  625. struct dpni_rx_dist_cfg {
  626. u16 dist_size;
  627. u64 key_cfg_iova;
  628. u8 enable;
  629. u8 tc;
  630. u16 fs_miss_flow_id;
  631. };
  632. int dpni_set_rx_fs_dist(struct fsl_mc_io *mc_io,
  633. u32 cmd_flags,
  634. u16 token,
  635. const struct dpni_rx_dist_cfg *cfg);
  636. int dpni_set_rx_hash_dist(struct fsl_mc_io *mc_io,
  637. u32 cmd_flags,
  638. u16 token,
  639. const struct dpni_rx_dist_cfg *cfg);
  640. /**
  641. * struct dpni_qos_tbl_cfg - Structure representing QOS table configuration
  642. * @key_cfg_iova: I/O virtual address of 256 bytes DMA-able memory filled with
  643. * key extractions to be used as the QoS criteria by calling
  644. * dpkg_prepare_key_cfg()
  645. * @discard_on_miss: Set to '1' to discard frames in case of no match (miss);
  646. * '0' to use the 'default_tc' in such cases
  647. * @default_tc: Used in case of no-match and 'discard_on_miss'= 0
  648. */
  649. struct dpni_qos_tbl_cfg {
  650. u64 key_cfg_iova;
  651. int discard_on_miss;
  652. u8 default_tc;
  653. };
  654. int dpni_set_qos_table(struct fsl_mc_io *mc_io,
  655. u32 cmd_flags,
  656. u16 token,
  657. const struct dpni_qos_tbl_cfg *cfg);
  658. /**
  659. * enum dpni_dest - DPNI destination types
  660. * @DPNI_DEST_NONE: Unassigned destination; The queue is set in parked mode and
  661. * does not generate FQDAN notifications; user is expected to
  662. * dequeue from the queue based on polling or other user-defined
  663. * method
  664. * @DPNI_DEST_DPIO: The queue is set in schedule mode and generates FQDAN
  665. * notifications to the specified DPIO; user is expected to dequeue
  666. * from the queue only after notification is received
  667. * @DPNI_DEST_DPCON: The queue is set in schedule mode and does not generate
  668. * FQDAN notifications, but is connected to the specified DPCON
  669. * object; user is expected to dequeue from the DPCON channel
  670. */
  671. enum dpni_dest {
  672. DPNI_DEST_NONE = 0,
  673. DPNI_DEST_DPIO = 1,
  674. DPNI_DEST_DPCON = 2
  675. };
  676. /**
  677. * struct dpni_queue - Queue structure
  678. * @destination: - Destination structure
  679. * @destination.id: ID of the destination, only relevant if DEST_TYPE is > 0.
  680. * Identifies either a DPIO or a DPCON object.
  681. * Not relevant for Tx queues.
  682. * @destination.type: May be one of the following:
  683. * 0 - No destination, queue can be manually
  684. * queried, but will not push traffic or
  685. * notifications to a DPIO;
  686. * 1 - The destination is a DPIO. When traffic
  687. * becomes available in the queue a FQDAN
  688. * (FQ data available notification) will be
  689. * generated to selected DPIO;
  690. * 2 - The destination is a DPCON. The queue is
  691. * associated with a DPCON object for the
  692. * purpose of scheduling between multiple
  693. * queues. The DPCON may be independently
  694. * configured to generate notifications.
  695. * Not relevant for Tx queues.
  696. * @destination.hold_active: Hold active, maintains a queue scheduled for longer
  697. * in a DPIO during dequeue to reduce spread of traffic.
  698. * Only relevant if queues are
  699. * not affined to a single DPIO.
  700. * @user_context: User data, presented to the user along with any frames
  701. * from this queue. Not relevant for Tx queues.
  702. * @flc: FD FLow Context structure
  703. * @flc.value: Default FLC value for traffic dequeued from
  704. * this queue. Please check description of FD
  705. * structure for more information.
  706. * Note that FLC values set using dpni_add_fs_entry,
  707. * if any, take precedence over values per queue.
  708. * @flc.stash_control: Boolean, indicates whether the 6 lowest
  709. * - significant bits are used for stash control.
  710. * significant bits are used for stash control. If set, the 6
  711. * least significant bits in value are interpreted as follows:
  712. * - bits 0-1: indicates the number of 64 byte units of context
  713. * that are stashed. FLC value is interpreted as a memory address
  714. * in this case, excluding the 6 LS bits.
  715. * - bits 2-3: indicates the number of 64 byte units of frame
  716. * annotation to be stashed. Annotation is placed at FD[ADDR].
  717. * - bits 4-5: indicates the number of 64 byte units of frame
  718. * data to be stashed. Frame data is placed at FD[ADDR] +
  719. * FD[OFFSET].
  720. * For more details check the Frame Descriptor section in the
  721. * hardware documentation.
  722. */
  723. struct dpni_queue {
  724. struct {
  725. u16 id;
  726. enum dpni_dest type;
  727. char hold_active;
  728. u8 priority;
  729. } destination;
  730. u64 user_context;
  731. struct {
  732. u64 value;
  733. char stash_control;
  734. } flc;
  735. };
  736. /**
  737. * struct dpni_queue_id - Queue identification, used for enqueue commands
  738. * or queue control
  739. * @fqid: FQID used for enqueueing to and/or configuration of this specific FQ
  740. * @qdbin: Queueing bin, used to enqueue using QDID, DQBIN, QPRI. Only relevant
  741. * for Tx queues.
  742. */
  743. struct dpni_queue_id {
  744. u32 fqid;
  745. u16 qdbin;
  746. };
  747. /* Set User Context */
  748. #define DPNI_QUEUE_OPT_USER_CTX 0x00000001
  749. #define DPNI_QUEUE_OPT_DEST 0x00000002
  750. #define DPNI_QUEUE_OPT_FLC 0x00000004
  751. #define DPNI_QUEUE_OPT_HOLD_ACTIVE 0x00000008
  752. int dpni_set_queue(struct fsl_mc_io *mc_io,
  753. u32 cmd_flags,
  754. u16 token,
  755. enum dpni_queue_type qtype,
  756. u8 tc,
  757. u8 index,
  758. u8 options,
  759. const struct dpni_queue *queue);
  760. int dpni_get_queue(struct fsl_mc_io *mc_io,
  761. u32 cmd_flags,
  762. u16 token,
  763. enum dpni_queue_type qtype,
  764. u8 tc,
  765. u8 index,
  766. struct dpni_queue *queue,
  767. struct dpni_queue_id *qid);
  768. /**
  769. * enum dpni_congestion_unit - DPNI congestion units
  770. * @DPNI_CONGESTION_UNIT_BYTES: bytes units
  771. * @DPNI_CONGESTION_UNIT_FRAMES: frames units
  772. */
  773. enum dpni_congestion_unit {
  774. DPNI_CONGESTION_UNIT_BYTES = 0,
  775. DPNI_CONGESTION_UNIT_FRAMES
  776. };
  777. /**
  778. * enum dpni_congestion_point - Structure representing congestion point
  779. * @DPNI_CP_QUEUE: Set taildrop per queue, identified by QUEUE_TYPE, TC and
  780. * QUEUE_INDEX
  781. * @DPNI_CP_GROUP: Set taildrop per queue group. Depending on options used to
  782. * define the DPNI this can be either per TC (default) or per
  783. * interface (DPNI_OPT_SHARED_CONGESTION set at DPNI create).
  784. * QUEUE_INDEX is ignored if this type is used.
  785. */
  786. enum dpni_congestion_point {
  787. DPNI_CP_QUEUE,
  788. DPNI_CP_GROUP,
  789. };
  790. /**
  791. * struct dpni_dest_cfg - Structure representing DPNI destination parameters
  792. * @dest_type: Destination type
  793. * @dest_id: Either DPIO ID or DPCON ID, depending on the destination type
  794. * @priority: Priority selection within the DPIO or DPCON channel; valid
  795. * values are 0-1 or 0-7, depending on the number of priorities
  796. * in that channel; not relevant for 'DPNI_DEST_NONE' option
  797. */
  798. struct dpni_dest_cfg {
  799. enum dpni_dest dest_type;
  800. int dest_id;
  801. u8 priority;
  802. };
  803. /* DPNI congestion options */
  804. /**
  805. * DPNI_CONG_OPT_FLOW_CONTROL - This congestion will trigger flow control or
  806. * priority flow control. This will have effect only if flow control is
  807. * enabled with dpni_set_link_cfg().
  808. */
  809. #define DPNI_CONG_OPT_FLOW_CONTROL 0x00000040
  810. /**
  811. * struct dpni_congestion_notification_cfg - congestion notification
  812. * configuration
  813. * @units: Units type
  814. * @threshold_entry: Above this threshold we enter a congestion state.
  815. * set it to '0' to disable it
  816. * @threshold_exit: Below this threshold we exit the congestion state.
  817. * @message_ctx: The context that will be part of the CSCN message
  818. * @message_iova: I/O virtual address (must be in DMA-able memory),
  819. * must be 16B aligned; valid only if 'DPNI_CONG_OPT_WRITE_MEM_<X>'
  820. * is contained in 'options'
  821. * @dest_cfg: CSCN can be send to either DPIO or DPCON WQ channel
  822. * @notification_mode: Mask of available options; use 'DPNI_CONG_OPT_<X>' values
  823. */
  824. struct dpni_congestion_notification_cfg {
  825. enum dpni_congestion_unit units;
  826. u32 threshold_entry;
  827. u32 threshold_exit;
  828. u64 message_ctx;
  829. u64 message_iova;
  830. struct dpni_dest_cfg dest_cfg;
  831. u16 notification_mode;
  832. };
  833. int dpni_set_congestion_notification(
  834. struct fsl_mc_io *mc_io,
  835. u32 cmd_flags,
  836. u16 token,
  837. enum dpni_queue_type qtype,
  838. u8 tc_id,
  839. const struct dpni_congestion_notification_cfg *cfg);
  840. /**
  841. * struct dpni_taildrop - Structure representing the taildrop
  842. * @enable: Indicates whether the taildrop is active or not.
  843. * @units: Indicates the unit of THRESHOLD. Queue taildrop only supports
  844. * byte units, this field is ignored and assumed = 0 if
  845. * CONGESTION_POINT is 0.
  846. * @threshold: Threshold value, in units identified by UNITS field. Value 0
  847. * cannot be used as a valid taildrop threshold, THRESHOLD must
  848. * be > 0 if the taildrop is enabled.
  849. */
  850. struct dpni_taildrop {
  851. char enable;
  852. enum dpni_congestion_unit units;
  853. u32 threshold;
  854. };
  855. int dpni_set_taildrop(struct fsl_mc_io *mc_io,
  856. u32 cmd_flags,
  857. u16 token,
  858. enum dpni_congestion_point cg_point,
  859. enum dpni_queue_type q_type,
  860. u8 tc,
  861. u8 q_index,
  862. struct dpni_taildrop *taildrop);
  863. int dpni_get_taildrop(struct fsl_mc_io *mc_io,
  864. u32 cmd_flags,
  865. u16 token,
  866. enum dpni_congestion_point cg_point,
  867. enum dpni_queue_type q_type,
  868. u8 tc,
  869. u8 q_index,
  870. struct dpni_taildrop *taildrop);
  871. /**
  872. * struct dpni_rule_cfg - Rule configuration for table lookup
  873. * @key_iova: I/O virtual address of the key (must be in DMA-able memory)
  874. * @mask_iova: I/O virtual address of the mask (must be in DMA-able memory)
  875. * @key_size: key and mask size (in bytes)
  876. */
  877. struct dpni_rule_cfg {
  878. u64 key_iova;
  879. u64 mask_iova;
  880. u8 key_size;
  881. };
  882. /**
  883. * DPNI_FS_OPT_DISCARD - Discard matching traffic. If set, this takes
  884. * precedence over any other configuration and matching traffic is always
  885. * discarded.
  886. */
  887. #define DPNI_FS_OPT_DISCARD 0x1
  888. /**
  889. * DPNI_FS_OPT_SET_FLC - Set FLC value. If set, flc member of struct
  890. * dpni_fs_action_cfg is used to override the FLC value set per queue.
  891. * For more details check the Frame Descriptor section in the hardware
  892. * documentation.
  893. */
  894. #define DPNI_FS_OPT_SET_FLC 0x2
  895. /**
  896. * DPNI_FS_OPT_SET_STASH_CONTROL - Indicates whether the 6 lowest significant
  897. * bits of FLC are used for stash control. If set, the 6 least significant bits
  898. * in value are interpreted as follows:
  899. * - bits 0-1: indicates the number of 64 byte units of context that are
  900. * stashed. FLC value is interpreted as a memory address in this case,
  901. * excluding the 6 LS bits.
  902. * - bits 2-3: indicates the number of 64 byte units of frame annotation
  903. * to be stashed. Annotation is placed at FD[ADDR].
  904. * - bits 4-5: indicates the number of 64 byte units of frame data to be
  905. * stashed. Frame data is placed at FD[ADDR] + FD[OFFSET].
  906. * This flag is ignored if DPNI_FS_OPT_SET_FLC is not specified.
  907. */
  908. #define DPNI_FS_OPT_SET_STASH_CONTROL 0x4
  909. /**
  910. * struct dpni_fs_action_cfg - Action configuration for table look-up
  911. * @flc: FLC value for traffic matching this rule. Please check the
  912. * Frame Descriptor section in the hardware documentation for
  913. * more information.
  914. * @flow_id: Identifies the Rx queue used for matching traffic. Supported
  915. * values are in range 0 to num_queue-1.
  916. * @options: Any combination of DPNI_FS_OPT_ values.
  917. */
  918. struct dpni_fs_action_cfg {
  919. u64 flc;
  920. u16 flow_id;
  921. u16 options;
  922. };
  923. int dpni_add_fs_entry(struct fsl_mc_io *mc_io,
  924. u32 cmd_flags,
  925. u16 token,
  926. u8 tc_id,
  927. u16 index,
  928. const struct dpni_rule_cfg *cfg,
  929. const struct dpni_fs_action_cfg *action);
  930. int dpni_remove_fs_entry(struct fsl_mc_io *mc_io,
  931. u32 cmd_flags,
  932. u16 token,
  933. u8 tc_id,
  934. const struct dpni_rule_cfg *cfg);
  935. int dpni_add_qos_entry(struct fsl_mc_io *mc_io,
  936. u32 cmd_flags,
  937. u16 token,
  938. const struct dpni_rule_cfg *cfg,
  939. u8 tc_id,
  940. u16 index);
  941. int dpni_remove_qos_entry(struct fsl_mc_io *mc_io,
  942. u32 cmd_flags,
  943. u16 token,
  944. const struct dpni_rule_cfg *cfg);
  945. int dpni_clear_qos_table(struct fsl_mc_io *mc_io,
  946. u32 cmd_flags,
  947. u16 token);
  948. int dpni_get_api_version(struct fsl_mc_io *mc_io,
  949. u32 cmd_flags,
  950. u16 *major_ver,
  951. u16 *minor_ver);
  952. /**
  953. * struct dpni_tx_shaping_cfg - Structure representing DPNI tx shaping configuration
  954. * @rate_limit: Rate in Mbps
  955. * @max_burst_size: Burst size in bytes (up to 64KB)
  956. */
  957. struct dpni_tx_shaping_cfg {
  958. u32 rate_limit;
  959. u16 max_burst_size;
  960. };
  961. int dpni_set_tx_shaping(struct fsl_mc_io *mc_io,
  962. u32 cmd_flags,
  963. u16 token,
  964. const struct dpni_tx_shaping_cfg *tx_cr_shaper,
  965. const struct dpni_tx_shaping_cfg *tx_er_shaper,
  966. int coupled);
  967. /**
  968. * struct dpni_single_step_cfg - configure single step PTP (IEEE 1588)
  969. * @en: enable single step PTP. When enabled the PTPv1 functionality
  970. * will not work. If the field is zero, offset and ch_update
  971. * parameters will be ignored
  972. * @offset: start offset from the beginning of the frame where
  973. * timestamp field is found. The offset must respect all MAC
  974. * headers, VLAN tags and other protocol headers
  975. * @ch_update: when set UDP checksum will be updated inside packet
  976. * @peer_delay: For peer-to-peer transparent clocks add this value to the
  977. * correction field in addition to the transient time update.
  978. * The value expresses nanoseconds.
  979. * @ptp_onestep_reg_base: 1588 SINGLE_STEP register base address. This address
  980. * is used to update directly the register contents.
  981. * User has to create an address mapping for it.
  982. *
  983. *
  984. */
  985. struct dpni_single_step_cfg {
  986. u8 en;
  987. u8 ch_update;
  988. u16 offset;
  989. u32 peer_delay;
  990. u32 ptp_onestep_reg_base;
  991. };
  992. int dpni_set_single_step_cfg(struct fsl_mc_io *mc_io,
  993. u32 cmd_flags,
  994. u16 token,
  995. struct dpni_single_step_cfg *ptp_cfg);
  996. int dpni_get_single_step_cfg(struct fsl_mc_io *mc_io,
  997. u32 cmd_flags,
  998. u16 token,
  999. struct dpni_single_step_cfg *ptp_cfg);
  1000. int dpni_enable_vlan_filter(struct fsl_mc_io *mc_io, u32 cmd_flags, u16 token,
  1001. u32 en);
  1002. int dpni_add_vlan_id(struct fsl_mc_io *mc_io, u32 cmd_flags, u16 token,
  1003. u16 vlan_id, u8 flags, u8 tc_id, u8 flow_id);
  1004. int dpni_remove_vlan_id(struct fsl_mc_io *mc_io, u32 cmd_flags, u16 token,
  1005. u16 vlan_id);
  1006. #endif /* __FSL_DPNI_H */