1 /* Copyright (c) 2008-2012 Freescale Semiconductor, Inc.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are met:
6 * * Redistributions of source code must retain the above copyright
7 * notice, this list of conditions and the following disclaimer.
8 * * Redistributions in binary form must reproduce the above copyright
9 * notice, this list of conditions and the following disclaimer in the
10 * documentation and/or other materials provided with the distribution.
11 * * Neither the name of Freescale Semiconductor nor the
12 * names of its contributors may be used to endorse or promote products
13 * derived from this software without specific prior written permission.
16 * ALTERNATIVELY, this software may be distributed under the terms of the
17 * GNU General Public License ("GPL") as published by the Free Software
18 * Foundation, either version 2 of that License or (at your option) any
21 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
22 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
23 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
25 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
28 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 /**************************************************************************//**
37 @Description FM-Port Application Programming Interface.
38 *//***************************************************************************/
42 #include "error_ext.h"
44 #include "fm_pcd_ext.h"
49 /**************************************************************************//**
51 @Group FM_grp Frame Manager API
53 @Description FM API functions, definitions and enums
56 *//***************************************************************************/
58 /**************************************************************************//**
59 @Group FM_PORT_grp FM Port
61 @Description FM Port API
63 The FM uses a general module called "port" to represent a Tx port
64 (MAC), an Rx port (MAC) or Offline Parsing port.
65 The number of ports in an FM varies between SOCs.
66 The SW driver manages these ports as sub-modules of the FM, i.e.
67 after an FM is initialized, its ports may be initialized and
70 The port is initialized aware of its type, but other functions on
71 a port may be indifferent to its type. When necessary, the driver
72 verifies coherence and returns error if applicable.
74 On initialization, user specifies the port type and it's index
75 (relative to the port's type) - always starting at 0.
78 *//***************************************************************************/
80 /**************************************************************************//**
81 @Description An enum for defining port PCD modes.
82 This enum defines the superset of PCD engines support - i.e. not
83 all engines have to be used, but all have to be enabled. The real
84 flow of a specific frame depends on the PCD configuration and the
85 frame headers and payload.
86 Note: the first engine and the first engine after the parser (if
87 exists) should be in order, the order is important as it will
88 define the flow of the port. However, as for the rest engines
89 (the ones that follows), the order is not important anymore as
90 it is defined by the PCD graph itself.
91 *//***************************************************************************/
92 typedef enum e_FmPortPcdSupport {
93 e_FM_PORT_PCD_SUPPORT_NONE = 0 /**< BMI to BMI, PCD is not used */
94 , e_FM_PORT_PCD_SUPPORT_PRS_ONLY /**< Use only Parser */
95 , e_FM_PORT_PCD_SUPPORT_PLCR_ONLY /**< Use only Policer */
96 , e_FM_PORT_PCD_SUPPORT_PRS_AND_PLCR /**< Use Parser and Policer */
97 , e_FM_PORT_PCD_SUPPORT_PRS_AND_KG /**< Use Parser and Keygen */
98 , e_FM_PORT_PCD_SUPPORT_PRS_AND_KG_AND_CC /**< Use Parser, Keygen and Coarse Classification */
99 , e_FM_PORT_PCD_SUPPORT_PRS_AND_KG_AND_CC_AND_PLCR
100 /**< Use all PCD engines */
101 , e_FM_PORT_PCD_SUPPORT_PRS_AND_KG_AND_PLCR /**< Use Parser, Keygen and Policer */
102 , e_FM_PORT_PCD_SUPPORT_PRS_AND_CC /**< Use Parser and Coarse Classification */
103 , e_FM_PORT_PCD_SUPPORT_PRS_AND_CC_AND_PLCR /**< Use Parser and Coarse Classification and Policer */
104 , e_FM_PORT_PCD_SUPPORT_CC_ONLY /**< Use only Coarse Classification */
105 #ifdef FM_CAPWAP_SUPPORT
106 , e_FM_PORT_PCD_SUPPORT_CC_AND_KG /**< Use Coarse Classification,and Keygen */
107 , e_FM_PORT_PCD_SUPPORT_CC_AND_KG_AND_PLCR /**< Use Coarse Classification, Keygen and Policer */
108 #endif /* FM_CAPWAP_SUPPORT */
109 } e_FmPortPcdSupport;
111 /**************************************************************************//**
112 @Description Port interrupts
113 *//***************************************************************************/
114 typedef enum e_FmPortExceptions {
115 e_FM_PORT_EXCEPTION_IM_BUSY /**< Independent-Mode Rx-BUSY */
116 } e_FmPortExceptions;
119 /**************************************************************************//**
120 @Collection General FM Port defines
121 *//***************************************************************************/
122 #define FM_PORT_PRS_RESULT_NUM_OF_WORDS 8 /**< Number of 4 bytes words in parser result */
125 /**************************************************************************//**
126 @Collection FM Frame error
127 *//***************************************************************************/
128 typedef uint32_t fmPortFrameErrSelect_t; /**< typedef for defining Frame Descriptor errors */
130 #define FM_PORT_FRM_ERR_UNSUPPORTED_FORMAT FM_FD_ERR_UNSUPPORTED_FORMAT /**< Not for Rx-Port! Unsupported Format */
131 #define FM_PORT_FRM_ERR_LENGTH FM_FD_ERR_LENGTH /**< Not for Rx-Port! Length Error */
132 #define FM_PORT_FRM_ERR_DMA FM_FD_ERR_DMA /**< DMA Data error */
133 #define FM_PORT_FRM_ERR_NON_FM FM_FD_RX_STATUS_ERR_NON_FM /**< non Frame-Manager error; probably come from SEC that
136 #define FM_PORT_FRM_ERR_IPRE (FM_FD_ERR_IPR & ~FM_FD_IPR) /**< IPR error */
137 #define FM_PORT_FRM_ERR_IPR_NCSP (FM_FD_ERR_IPR_NCSP & ~FM_FD_IPR) /**< IPR non-consistent-sp */
139 #define FM_PORT_FRM_ERR_IPFE 0 /**< Obsolete; will be removed in the future */
141 #ifdef FM_CAPWAP_SUPPORT
142 #define FM_PORT_FRM_ERR_CRE FM_FD_ERR_CRE
143 #define FM_PORT_FRM_ERR_CHE FM_FD_ERR_CHE
144 #endif /* FM_CAPWAP_SUPPORT */
146 #define FM_PORT_FRM_ERR_PHYSICAL FM_FD_ERR_PHYSICAL /**< Rx FIFO overflow, FCS error, code error, running disparity
147 error (SGMII and TBI modes), FIFO parity error. PHY
148 Sequence error, PHY error control character detected. */
149 #define FM_PORT_FRM_ERR_SIZE FM_FD_ERR_SIZE /**< Frame too long OR Frame size exceeds max_length_frame */
150 #define FM_PORT_FRM_ERR_CLS_DISCARD FM_FD_ERR_CLS_DISCARD /**< indicates a classifier "drop" operation */
151 #define FM_PORT_FRM_ERR_EXTRACTION FM_FD_ERR_EXTRACTION /**< Extract Out of Frame */
152 #define FM_PORT_FRM_ERR_NO_SCHEME FM_FD_ERR_NO_SCHEME /**< No Scheme Selected */
153 #define FM_PORT_FRM_ERR_KEYSIZE_OVERFLOW FM_FD_ERR_KEYSIZE_OVERFLOW /**< Keysize Overflow */
154 #define FM_PORT_FRM_ERR_COLOR_RED FM_FD_ERR_COLOR_RED /**< Frame color is red */
155 #define FM_PORT_FRM_ERR_COLOR_YELLOW FM_FD_ERR_COLOR_YELLOW /**< Frame color is yellow */
156 #define FM_PORT_FRM_ERR_ILL_PLCR FM_FD_ERR_ILL_PLCR /**< Illegal Policer Profile selected */
157 #define FM_PORT_FRM_ERR_PLCR_FRAME_LEN FM_FD_ERR_PLCR_FRAME_LEN /**< Policer frame length error */
158 #define FM_PORT_FRM_ERR_PRS_TIMEOUT FM_FD_ERR_PRS_TIMEOUT /**< Parser Time out Exceed */
159 #define FM_PORT_FRM_ERR_PRS_ILL_INSTRUCT FM_FD_ERR_PRS_ILL_INSTRUCT /**< Invalid Soft Parser instruction */
160 #define FM_PORT_FRM_ERR_PRS_HDR_ERR FM_FD_ERR_PRS_HDR_ERR /**< Header error was identified during parsing */
161 #define FM_PORT_FRM_ERR_BLOCK_LIMIT_EXCEEDED FM_FD_ERR_BLOCK_LIMIT_EXCEEDED /**< Frame parsed beyind 256 first bytes */
162 #define FM_PORT_FRM_ERR_PROCESS_TIMEOUT 0x00000001 /**< FPM Frame Processing Timeout Exceeded */
167 /**************************************************************************//**
168 @Group FM_PORT_init_grp FM Port Initialization Unit
170 @Description FM Port Initialization Unit
173 *//***************************************************************************/
175 /**************************************************************************//**
176 @Description Exceptions user callback routine, will be called upon an
177 exception passing the exception identification.
179 @Param[in] h_App - User's application descriptor.
180 @Param[in] exception - The exception.
181 *//***************************************************************************/
182 typedef void (t_FmPortExceptionCallback) (t_Handle h_App, e_FmPortExceptions exception);
184 /**************************************************************************//**
185 @Description User callback function called by driver with received data.
187 User provides this function. Driver invokes it.
189 @Param[in] h_App Application's handle originally specified to
190 the API Config function
191 @Param[in] p_Data A pointer to data received
192 @Param[in] length length of received data
193 @Param[in] status receive status and errors
194 @Param[in] position position of buffer in frame
195 @Param[in] h_BufContext A handle of the user acossiated with this buffer
197 @Retval e_RX_STORE_RESPONSE_CONTINUE - order the driver to continue Rx
198 operation for all ready data.
199 @Retval e_RX_STORE_RESPONSE_PAUSE - order the driver to stop Rx operation.
200 *//***************************************************************************/
201 typedef e_RxStoreResponse (t_FmPortImRxStoreCallback) (t_Handle h_App,
206 t_Handle h_BufContext);
208 /**************************************************************************//**
209 @Description User callback function called by driver when transmit completed.
211 User provides this function. Driver invokes it.
213 @Param[in] h_App Application's handle originally specified to
214 the API Config function
215 @Param[in] p_Data A pointer to data received
216 @Param[in] status transmit status and errors
217 @Param[in] lastBuffer is last buffer in frame
218 @Param[in] h_BufContext A handle of the user acossiated with this buffer
219 *//***************************************************************************/
220 typedef void (t_FmPortImTxConfCallback) (t_Handle h_App,
223 t_Handle h_BufContext);
225 /**************************************************************************//**
226 @Description A structure for additional Rx port parameters
227 *//***************************************************************************/
228 typedef struct t_FmPortRxParams {
229 uint32_t errFqid; /**< Error Queue Id. */
230 uint32_t dfltFqid; /**< Default Queue Id. */
231 uint16_t liodnOffset; /**< Port's LIODN offset. */
232 t_FmExtPools extBufPools; /**< Which external buffer pools are used
233 (up to FM_PORT_MAX_NUM_OF_EXT_POOLS), and their sizes. */
236 /**************************************************************************//**
237 @Description A structure for additional non-Rx port parameters
238 *//***************************************************************************/
239 typedef struct t_FmPortNonRxParams {
240 uint32_t errFqid; /**< Error Queue Id. */
241 uint32_t dfltFqid; /**< For Tx - Default Confirmation queue,
242 0 means no Tx confirmation for processed
243 frames. For OP port - default Rx queue. */
244 uint32_t qmChannel; /**< QM-channel dedicated to this port; will be used
245 by the FM for dequeue. */
246 } t_FmPortNonRxParams;
248 /**************************************************************************//**
249 @Description A structure for additional Rx port parameters
250 *//***************************************************************************/
251 typedef struct t_FmPortImRxTxParams {
252 t_Handle h_FmMuram; /**< A handle of the FM-MURAM partition */
253 uint16_t liodnOffset; /**< For Rx ports only. Port's LIODN Offset. */
254 uint8_t dataMemId; /**< Memory partition ID for data buffers */
255 uint32_t dataMemAttributes; /**< Memory attributes for data buffers */
256 t_BufferPoolInfo rxPoolParams; /**< For Rx ports only. */
257 t_FmPortImRxStoreCallback *f_RxStore; /**< For Rx ports only. */
258 t_FmPortImTxConfCallback *f_TxConf; /**< For Tx ports only. */
259 } t_FmPortImRxTxParams;
261 /**************************************************************************//**
262 @Description A union for additional parameters depending on port type
263 *//***************************************************************************/
264 typedef union u_FmPortSpecificParams {
265 t_FmPortImRxTxParams imRxTxParams; /**< Rx/Tx Independent-Mode port parameter structure */
266 t_FmPortRxParams rxParams; /**< Rx port parameters structure */
267 t_FmPortNonRxParams nonRxParams; /**< Non-Rx port parameters structure */
268 } u_FmPortSpecificParams;
270 /**************************************************************************//**
271 @Description A structure representing FM initialization parameters
272 *//***************************************************************************/
273 typedef struct t_FmPortParams {
274 uintptr_t baseAddr; /**< Virtual Address of memory mapped FM Port registers.*/
275 t_Handle h_Fm; /**< A handle to the FM object this port related to */
276 e_FmPortType portType; /**< Port type */
277 uint8_t portId; /**< Port Id - relative to type;
278 NOTE: When configuring Offline Parsing port for
279 FMANv3 devices (DPAA_VERSION 11 and higher),
280 it is highly recommended NOT to use portId=0 due to lack
281 of HW resources on portId=0. */
282 bool independentModeEnable;
283 /**< This port is Independent-Mode - Used for Rx/Tx ports only! */
284 uint16_t liodnBase; /**< Irrelevant for P4080 rev 1. LIODN base for this port, to be
285 used together with LIODN offset. */
286 u_FmPortSpecificParams specificParams; /**< Additional parameters depending on port
289 t_FmPortExceptionCallback *f_Exception; /**< Relevant for IM only Callback routine to be called on BUSY exception */
290 t_Handle h_App; /**< A handle to an application layer object; This handle will
291 be passed by the driver upon calling the above callbacks */
295 /**************************************************************************//**
296 @Function FM_PORT_Config
298 @Description Creates a descriptor for the FM PORT module.
300 The routine returns a handle (descriptor) to the FM PORT object.
301 This descriptor must be passed as first parameter to all other
302 FM PORT function calls.
304 No actual initialization or configuration of FM hardware is
305 done by this routine.
307 @Param[in] p_FmPortParams - Pointer to data structure of parameters
309 @Retval Handle to FM object, or NULL for Failure.
310 *//***************************************************************************/
311 t_Handle FM_PORT_Config(t_FmPortParams *p_FmPortParams);
313 /**************************************************************************//**
314 @Function FM_PORT_Init
316 @Description Initializes the FM PORT module by defining the software structure
317 and configuring the hardware registers.
319 @Param[in] h_FmPort - FM PORT module descriptor
321 @Return E_OK on success; Error code otherwise.
322 *//***************************************************************************/
323 t_Error FM_PORT_Init(t_Handle h_FmPort);
325 /**************************************************************************//**
326 @Function FM_PORT_Free
328 @Description Frees all resources that were assigned to FM PORT module.
330 Calling this routine invalidates the descriptor.
332 @Param[in] h_FmPort - FM PORT module descriptor
334 @Return E_OK on success; Error code otherwise.
335 *//***************************************************************************/
336 t_Error FM_PORT_Free(t_Handle h_FmPort);
339 /**************************************************************************//**
340 @Group FM_PORT_advanced_init_grp FM Port Advanced Configuration Unit
342 @Description Configuration functions used to change default values.
345 *//***************************************************************************/
347 /**************************************************************************//**
348 @Description enum for defining QM frame dequeue
349 *//***************************************************************************/
350 typedef enum e_FmPortDeqType {
351 e_FM_PORT_DEQ_TYPE1, /**< Dequeue from the SP channel - with priority precedence,
352 and Intra-Class Scheduling respected. */
353 e_FM_PORT_DEQ_TYPE2, /**< Dequeue from the SP channel - with active FQ precedence,
354 and Intra-Class Scheduling respected. */
355 e_FM_PORT_DEQ_TYPE3 /**< Dequeue from the SP channel - with active FQ precedence,
356 and override Intra-Class Scheduling */
359 /**************************************************************************//**
360 @Description enum for defining QM frame dequeue
361 *//***************************************************************************/
362 typedef enum e_FmPortDeqPrefetchOption {
363 e_FM_PORT_DEQ_NO_PREFETCH, /**< QMI preforms a dequeue action for a single frame
364 only when a dedicated portID Tnum is waiting. */
365 e_FM_PORT_DEQ_PARTIAL_PREFETCH, /**< QMI preforms a dequeue action for 3 frames when
366 one dedicated portId tnum is waiting. */
367 e_FM_PORT_DEQ_FULL_PREFETCH /**< QMI preforms a dequeue action for 3 frames when
368 no dedicated portId tnums are waiting. */
370 } e_FmPortDeqPrefetchOption;
372 /**************************************************************************//**
373 @Description enum for defining port default color
374 *//***************************************************************************/
375 typedef enum e_FmPortColor {
376 e_FM_PORT_COLOR_GREEN, /**< Default port color is green */
377 e_FM_PORT_COLOR_YELLOW, /**< Default port color is yellow */
378 e_FM_PORT_COLOR_RED, /**< Default port color is red */
379 e_FM_PORT_COLOR_OVERRIDE /**< Ignore color */
382 /**************************************************************************//**
383 @Description A structure for defining Dual Tx rate limiting scale
384 *//***************************************************************************/
385 typedef enum e_FmPortDualRateLimiterScaleDown {
386 e_FM_PORT_DUAL_RATE_LIMITER_NONE = 0, /**< Use only single rate limiter */
387 e_FM_PORT_DUAL_RATE_LIMITER_SCALE_DOWN_BY_2, /**< Divide high rate limiter by 2 */
388 e_FM_PORT_DUAL_RATE_LIMITER_SCALE_DOWN_BY_4, /**< Divide high rate limiter by 4 */
389 e_FM_PORT_DUAL_RATE_LIMITER_SCALE_DOWN_BY_8 /**< Divide high rate limiter by 8 */
390 } e_FmPortDualRateLimiterScaleDown;
393 /**************************************************************************//**
394 @Description A structure for defining FM port resources
395 *//***************************************************************************/
396 typedef struct t_FmPortRsrc {
397 uint32_t num; /**< Committed required resource */
398 uint32_t extra; /**< Extra (not committed) required resource */
401 /**************************************************************************//**
402 @Description A structure for defining observed pool depletion
403 *//***************************************************************************/
404 typedef struct t_FmPortObservedBufPoolDepletion {
405 t_FmBufPoolDepletion poolDepletionParams;/**< parameters to define pool depletion */
406 t_FmExtPools poolsParams; /**< Which external buffer pools are observed
407 (up to FM_PORT_MAX_NUM_OF_OBSERVED_EXT_POOLS),
409 } t_FmPortObservedBufPoolDepletion;
411 /**************************************************************************//**
412 @Description A structure for defining Tx rate limiting
413 *//***************************************************************************/
414 typedef struct t_FmPortRateLimit {
415 uint16_t maxBurstSize; /**< in KBytes for Tx ports, in frames
416 for OP ports. (note that
417 for early chips burst size is
418 rounded up to a multiply of 1000 frames).*/
419 uint32_t rateLimit; /**< in Kb/sec for Tx ports, in frame/sec for
420 OP ports. Rate limit refers to
421 data rate (rather than line rate). */
422 e_FmPortDualRateLimiterScaleDown rateLimitDivider; /**< For OP ports only. Not-valid
423 for some earlier chip revisions */
426 /**************************************************************************//**
427 @Description A structure for defining the parameters of
428 the Rx port performance counters
429 *//***************************************************************************/
430 typedef struct t_FmPortPerformanceCnt {
431 uint8_t taskCompVal; /**< Task compare value */
432 uint8_t queueCompVal; /**< Rx queue/Tx confirm queue compare
433 value (unused for H/O) */
434 uint8_t dmaCompVal; /**< Dma compare value */
435 uint32_t fifoCompVal; /**< Fifo compare value (in bytes) */
436 } t_FmPortPerformanceCnt;
439 /**************************************************************************//**
440 @Description A structure for defining the sizes of the Deep Sleep
441 the Auto Response tables
442 *//***************************************************************************/
443 typedef struct t_FmPortDsarTablesSizes
445 uint16_t maxNumOfArpEntries;
446 uint16_t maxNumOfEchoIpv4Entries;
447 uint16_t maxNumOfNdpEntries;
448 uint16_t maxNumOfEchoIpv6Entries;
449 uint16_t maxNumOfSnmpIPV4Entries;
450 uint16_t maxNumOfSnmpIPV6Entries;
451 uint16_t maxNumOfSnmpOidEntries;
452 uint16_t maxNumOfSnmpOidChar; /* total amount of character needed for the snmp table */
454 uint16_t maxNumOfIpProtFiltering;
455 uint16_t maxNumOfTcpPortFiltering;
456 uint16_t maxNumOfUdpPortFiltering;
457 } t_FmPortDsarTablesSizes;
460 /**************************************************************************//**
461 @Function FM_PORT_ConfigDsarSupport
463 @Description This function will allocate the amount of MURAM needed for
464 this max number of entries for Deep Sleep Auto Response.
465 it will calculate all needed MURAM for autoresponse including
466 necesary common stuff.
469 @Param[in] h_FmPort A handle to a FM Port module.
470 @Param[in] params A pointer to a structure containing the maximum
471 sizes of the auto response tables
473 @Return E_OK on success; Error code otherwise.
475 @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().
476 *//***************************************************************************/
477 t_Error FM_PORT_ConfigDsarSupport(t_Handle h_FmPortRx, t_FmPortDsarTablesSizes *params);
479 /**************************************************************************//**
480 @Function FM_PORT_ConfigNumOfOpenDmas
482 @Description Calling this routine changes the max number of open DMA's
483 available for this port. It changes this parameter in the
484 internal driver data base from its default configuration
486 [1G-RX, 1G-TX: 1 (+1)]
487 [10G-RX, 10G-TX: 8 (+8)]
489 @Param[in] h_FmPort A handle to a FM Port module.
490 @Param[in] p_OpenDmas A pointer to a structure of parameters defining
491 the open DMA allocation.
493 @Return E_OK on success; Error code otherwise.
495 @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().
496 *//***************************************************************************/
497 t_Error FM_PORT_ConfigNumOfOpenDmas(t_Handle h_FmPort, t_FmPortRsrc *p_OpenDmas);
499 /**************************************************************************//**
500 @Function FM_PORT_ConfigNumOfTasks
502 @Description Calling this routine changes the max number of tasks
503 available for this port. It changes this parameter in the
504 internal driver data base from its default configuration
506 [1G-RX, 1G-TX: 3 (+2)]
507 [10G-RX, 10G-TX: 16 (+8)]
509 @Param[in] h_FmPort A handle to a FM Port module.
510 @Param[in] p_NumOfTasks A pointer to a structure of parameters defining
511 the tasks allocation.
513 @Return E_OK on success; Error code otherwise.
515 @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().
516 *//***************************************************************************/
517 t_Error FM_PORT_ConfigNumOfTasks(t_Handle h_FmPort, t_FmPortRsrc *p_NumOfTasks);
519 /**************************************************************************//**
520 @Function FM_PORT_ConfigSizeOfFifo
522 @Description Calling this routine changes the max FIFO size configured for this port.
524 This function changes the internal driver data base from its
525 default configuration. Please refer to the driver's User Guide for
526 information on default FIFO sizes in the various devices.
529 [10G-RX, 10G-TX: 12KB]
531 @Param[in] h_FmPort A handle to a FM Port module.
532 @Param[in] p_SizeOfFifo A pointer to a structure of parameters defining
535 @Return E_OK on success; Error code otherwise.
537 @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().
538 *//***************************************************************************/
539 t_Error FM_PORT_ConfigSizeOfFifo(t_Handle h_FmPort, t_FmPortRsrc *p_SizeOfFifo);
541 /**************************************************************************//**
542 @Function FM_PORT_ConfigDeqHighPriority
544 @Description Calling this routine changes the dequeue priority in the
545 internal driver data base from its default configuration
546 1G: [DEFAULT_PORT_deqHighPriority_1G]
547 10G: [DEFAULT_PORT_deqHighPriority_10G]
549 May be used for Non-Rx ports only
551 @Param[in] h_FmPort A handle to a FM Port module.
552 @Param[in] highPri TRUE to select high priority, FALSE for normal operation.
554 @Return E_OK on success; Error code otherwise.
556 @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().
557 *//***************************************************************************/
558 t_Error FM_PORT_ConfigDeqHighPriority(t_Handle h_FmPort, bool highPri);
560 /**************************************************************************//**
561 @Function FM_PORT_ConfigDeqType
563 @Description Calling this routine changes the dequeue type parameter in the
564 internal driver data base from its default configuration
565 [DEFAULT_PORT_deqType].
567 May be used for Non-Rx ports only
569 @Param[in] h_FmPort A handle to a FM Port module.
570 @Param[in] deqType According to QM definition.
572 @Return E_OK on success; Error code otherwise.
574 @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().
575 *//***************************************************************************/
576 t_Error FM_PORT_ConfigDeqType(t_Handle h_FmPort, e_FmPortDeqType deqType);
578 /**************************************************************************//**
579 @Function FM_PORT_ConfigDeqPrefetchOption
581 @Description Calling this routine changes the dequeue prefetch option parameter in the
582 internal driver data base from its default configuration
583 [DEFAULT_PORT_deqPrefetchOption]
584 Note: Available for some chips only
586 May be used for Non-Rx ports only
588 @Param[in] h_FmPort A handle to a FM Port module.
589 @Param[in] deqPrefetchOption New option
591 @Return E_OK on success; Error code otherwise.
593 @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().
594 *//***************************************************************************/
595 t_Error FM_PORT_ConfigDeqPrefetchOption(t_Handle h_FmPort, e_FmPortDeqPrefetchOption deqPrefetchOption);
597 /**************************************************************************//**
598 @Function FM_PORT_ConfigDeqByteCnt
600 @Description Calling this routine changes the dequeue byte count parameter in
601 the internal driver data base from its default configuration
602 1G:[DEFAULT_PORT_deqByteCnt_1G].
603 10G:[DEFAULT_PORT_deqByteCnt_10G].
605 May be used for Non-Rx ports only
607 @Param[in] h_FmPort A handle to a FM Port module.
608 @Param[in] deqByteCnt New byte count
610 @Return E_OK on success; Error code otherwise.
612 @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().
613 *//***************************************************************************/
614 t_Error FM_PORT_ConfigDeqByteCnt(t_Handle h_FmPort, uint16_t deqByteCnt);
616 /**************************************************************************//**
617 @Function FM_PORT_ConfigBufferPrefixContent
619 @Description Defines the structure, size and content of the application buffer.
621 In Tx ports, if 'passPrsResult', the application
622 should set a value to their offsets in the prefix of
623 the FM will save the first 'privDataSize', than,
624 depending on 'passPrsResult' and 'passTimeStamp', copy parse result
625 and timeStamp, and the packet itself (in this order), to the
626 application buffer, and to offset.
627 Calling this routine changes the buffer margins definitions
628 in the internal driver data base from its default
629 configuration: Data size: [DEFAULT_PORT_bufferPrefixContent_privDataSize]
630 Pass Parser result: [DEFAULT_PORT_bufferPrefixContent_passPrsResult].
631 Pass timestamp: [DEFAULT_PORT_bufferPrefixContent_passTimeStamp].
633 May be used for all ports
635 @Param[in] h_FmPort A handle to a FM Port module.
636 @Param[in,out] p_FmBufferPrefixContent A structure of parameters describing the
637 structure of the buffer.
638 Out parameter: Start margin - offset
639 of data from start of external buffer.
641 @Return E_OK on success; Error code otherwise.
643 @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().
644 *//***************************************************************************/
645 t_Error FM_PORT_ConfigBufferPrefixContent(t_Handle h_FmPort,
646 t_FmBufferPrefixContent *p_FmBufferPrefixContent);
648 /**************************************************************************//**
649 @Function FM_PORT_ConfigCheksumLastBytesIgnore
651 @Description Calling this routine changes the number of checksum bytes to ignore
652 parameter in the internal driver data base from its default configuration
653 [DEFAULT_PORT_cheksumLastBytesIgnore]
655 May be used by Tx & Rx ports only
657 @Param[in] h_FmPort A handle to a FM Port module.
658 @Param[in] cheksumLastBytesIgnore New value
660 @Return E_OK on success; Error code otherwise.
662 @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().
663 *//***************************************************************************/
664 t_Error FM_PORT_ConfigCheksumLastBytesIgnore(t_Handle h_FmPort, uint8_t cheksumLastBytesIgnore);
666 /**************************************************************************//**
667 @Function FM_PORT_ConfigCutBytesFromEnd
669 @Description Calling this routine changes the number of bytes to cut from a
670 frame's end parameter in the internal driver data base
671 from its default configuration [DEFAULT_PORT_cutBytesFromEnd]
672 Note that if the result of (frame length before chop - cutBytesFromEnd) is
673 less than 14 bytes, the chop operation is not executed.
675 May be used for Rx ports only
677 @Param[in] h_FmPort A handle to a FM Port module.
678 @Param[in] cutBytesFromEnd New value
680 @Return E_OK on success; Error code otherwise.
682 @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().
683 *//***************************************************************************/
684 t_Error FM_PORT_ConfigCutBytesFromEnd(t_Handle h_FmPort, uint8_t cutBytesFromEnd);
686 /**************************************************************************//**
687 @Function FM_PORT_ConfigPoolDepletion
689 @Description Calling this routine enables pause frame generation depending on the
690 depletion status of BM pools. It also defines the conditions to activate
691 this functionality. By default, this functionality is disabled.
693 May be used for Rx ports only
695 @Param[in] h_FmPort A handle to a FM Port module.
696 @Param[in] p_BufPoolDepletion A structure of pool depletion parameters
698 @Return E_OK on success; Error code otherwise.
700 @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().
701 *//***************************************************************************/
702 t_Error FM_PORT_ConfigPoolDepletion(t_Handle h_FmPort, t_FmBufPoolDepletion *p_BufPoolDepletion);
704 /**************************************************************************//**
705 @Function FM_PORT_ConfigObservedPoolDepletion
707 @Description Calling this routine enables a mechanism to stop port enqueue
708 depending on the depletion status of selected BM pools.
709 It also defines the conditions to activate
710 this functionality. By default, this functionality is disabled.
712 Note: Available for some chips only
714 May be used for OP ports only
716 @Param[in] h_FmPort A handle to a FM Port module.
717 @Param[in] p_FmPortObservedBufPoolDepletion A structure of parameters for pool depletion.
719 @Return E_OK on success; Error code otherwise.
721 @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().
722 *//***************************************************************************/
723 t_Error FM_PORT_ConfigObservedPoolDepletion(t_Handle h_FmPort,
724 t_FmPortObservedBufPoolDepletion *p_FmPortObservedBufPoolDepletion);
726 /**************************************************************************//**
727 @Function FM_PORT_ConfigExtBufPools
729 @Description This routine should be called for OP ports
730 that internally use BM buffer pools. In such cases, e.g. for fragmentation and
731 re-assembly, the FM needs new BM buffers. By calling this routine the user
732 specifies the BM buffer pools that should be used.
734 Note: Available for some chips only
736 May be used for OP ports only
738 @Param[in] h_FmPort A handle to a FM Port module.
739 @Param[in] p_FmExtPools A structure of parameters for the external pools.
741 @Return E_OK on success; Error code otherwise.
743 @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().
744 *//***************************************************************************/
745 t_Error FM_PORT_ConfigExtBufPools(t_Handle h_FmPort, t_FmExtPools *p_FmExtPools);
747 /**************************************************************************//**
748 @Function FM_PORT_ConfigBackupPools
750 @Description Calling this routine allows the configuration of some of the BM pools
751 defined for this port as backup pools.
752 A pool configured to be a backup pool will be used only if all other
753 enabled non-backup pools are depleted.
755 May be used for Rx ports only
757 @Param[in] h_FmPort A handle to a FM Port module.
758 @Param[in] p_FmPortBackupBmPools An array of pool id's. All pools specified here will
759 be defined as backup pools.
761 @Return E_OK on success; Error code otherwise.
763 @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().
764 *//***************************************************************************/
765 t_Error FM_PORT_ConfigBackupPools(t_Handle h_FmPort, t_FmBackupBmPools *p_FmPortBackupBmPools);
767 /**************************************************************************//**
768 @Function FM_PORT_ConfigFrmDiscardOverride
770 @Description Calling this routine changes the error frames destination parameter
771 in the internal driver data base from its default configuration:
772 override = [DEFAULT_PORT_frmDiscardOverride]
774 May be used for Rx and OP ports only
776 @Param[in] h_FmPort A handle to a FM Port module.
777 @Param[in] override TRUE to override discarding of error frames and
778 enqueueing them to error queue.
780 @Return E_OK on success; Error code otherwise.
782 @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().
783 *//***************************************************************************/
784 t_Error FM_PORT_ConfigFrmDiscardOverride(t_Handle h_FmPort, bool override);
786 /**************************************************************************//**
787 @Function FM_PORT_ConfigErrorsToDiscard
789 @Description Calling this routine changes the behaviour on error parameter
790 in the internal driver data base from its default configuration:
791 [DEFAULT_PORT_errorsToDiscard].
792 If a requested error was previously defined as "ErrorsToEnqueue" it's
793 definition will change and the frame will be discarded.
794 Errors that were not defined either as "ErrorsToEnqueue" nor as
795 "ErrorsToDiscard", will be forwarded to CPU.
797 May be used for Rx and OP ports only
799 @Param[in] h_FmPort A handle to a FM Port module.
800 @Param[in] errs A list of errors to discard
802 @Return E_OK on success; Error code otherwise.
804 @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().
805 *//***************************************************************************/
806 t_Error FM_PORT_ConfigErrorsToDiscard(t_Handle h_FmPort, fmPortFrameErrSelect_t errs);
808 /**************************************************************************//**
809 @Function FM_PORT_ConfigDmaSwapData
811 @Description Calling this routine changes the DMA swap data aparameter
812 in the internal driver data base from its default
813 configuration [DEFAULT_PORT_dmaSwapData]
815 May be used for all port types
817 @Param[in] h_FmPort A handle to a FM Port module.
818 @Param[in] swapData New selection
820 @Return E_OK on success; Error code otherwise.
822 @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().
823 *//***************************************************************************/
824 t_Error FM_PORT_ConfigDmaSwapData(t_Handle h_FmPort, e_FmDmaSwapOption swapData);
826 /**************************************************************************//**
827 @Function FM_PORT_ConfigDmaIcCacheAttr
829 @Description Calling this routine changes the internal context cache
830 attribute parameter in the internal driver data base
831 from its default configuration [DEFAULT_PORT_dmaIntContextCacheAttr]
833 May be used for all port types
835 @Param[in] h_FmPort A handle to a FM Port module.
836 @Param[in] intContextCacheAttr New selection
838 @Return E_OK on success; Error code otherwise.
840 @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().
841 *//***************************************************************************/
842 t_Error FM_PORT_ConfigDmaIcCacheAttr(t_Handle h_FmPort, e_FmDmaCacheOption intContextCacheAttr);
844 /**************************************************************************//**
845 @Function FM_PORT_ConfigDmaHdrAttr
847 @Description Calling this routine changes the header cache
848 attribute parameter in the internal driver data base
849 from its default configuration [DEFAULT_PORT_dmaHeaderCacheAttr]
851 May be used for all port types
853 @Param[in] h_FmPort A handle to a FM Port module.
854 @Param[in] headerCacheAttr New selection
856 @Return E_OK on success; Error code otherwise.
858 @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().
859 *//***************************************************************************/
860 t_Error FM_PORT_ConfigDmaHdrAttr(t_Handle h_FmPort, e_FmDmaCacheOption headerCacheAttr);
862 /**************************************************************************//**
863 @Function FM_PORT_ConfigDmaScatterGatherAttr
865 @Description Calling this routine changes the scatter gather cache
866 attribute parameter in the internal driver data base
867 from its default configuration [DEFAULT_PORT_dmaScatterGatherCacheAttr]
869 May be used for all port types
871 @Param[in] h_FmPort A handle to a FM Port module.
872 @Param[in] scatterGatherCacheAttr New selection
874 @Return E_OK on success; Error code otherwise.
876 @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().
877 *//***************************************************************************/
878 t_Error FM_PORT_ConfigDmaScatterGatherAttr(t_Handle h_FmPort, e_FmDmaCacheOption scatterGatherCacheAttr);
880 /**************************************************************************//**
881 @Function FM_PORT_ConfigDmaWriteOptimize
883 @Description Calling this routine changes the write optimization
884 parameter in the internal driver data base
885 from its default configuration: By default optimize = [DEFAULT_PORT_dmaWriteOptimize].
888 1. For head optimization, data alignment must be >= 16 (supported by default).
890 3. For tail optimization, note that the optimization is performed by extending the write transaction
891 of the frame payload at the tail as needed to achieve optimal bus transfers, so that the last write
892 is extended to be on 16/64 bytes aligned block (chip dependent).
894 Relevant for non-Tx port types
896 @Param[in] h_FmPort A handle to a FM Port module.
897 @Param[in] optimize TRUE to enable optimization, FALSE for normal operation
899 @Return E_OK on success; Error code otherwise.
901 @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().
902 *//***************************************************************************/
903 t_Error FM_PORT_ConfigDmaWriteOptimize(t_Handle h_FmPort, bool optimize);
905 /**************************************************************************//**
906 @Function FM_PORT_ConfigNoScatherGather
908 @Description Calling this routine changes the noScatherGather parameter in internal driver data base
909 from its default configuration.
911 @Param[in] h_FmPort A handle to a FM Port module.
912 @Param[in] noScatherGather (TRUE - frame is discarded if can not be stored in single buffer,
913 FALSE - frame can be stored in scatter gather (S/G) format).
915 @Return E_OK on success; Error code otherwise.
917 @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().
918 *//***************************************************************************/
919 t_Error FM_PORT_ConfigNoScatherGather(t_Handle h_FmPort, bool noScatherGather);
921 /**************************************************************************//**
922 @Function FM_PORT_ConfigDfltColor
924 @Description Calling this routine changes the internal default color parameter
925 in the internal driver data base
926 from its default configuration [DEFAULT_PORT_color]
928 May be used for all port types
930 @Param[in] h_FmPort A handle to a FM Port module.
931 @Param[in] color New selection
933 @Return E_OK on success; Error code otherwise.
935 @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().
936 *//***************************************************************************/
937 t_Error FM_PORT_ConfigDfltColor(t_Handle h_FmPort, e_FmPortColor color);
939 /**************************************************************************//**
940 @Function FM_PORT_ConfigSyncReq
942 @Description Calling this routine changes the synchronization attribute parameter
943 in the internal driver data base from its default configuration:
944 syncReq = [DEFAULT_PORT_syncReq]
946 May be used for all port types
948 @Param[in] h_FmPort A handle to a FM Port module.
949 @Param[in] syncReq TRUE to request synchronization, FALSE otherwize.
951 @Return E_OK on success; Error code otherwise.
953 @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().
954 *//***************************************************************************/
955 t_Error FM_PORT_ConfigSyncReq(t_Handle h_FmPort, bool syncReq);
957 /**************************************************************************//**
958 @Function FM_PORT_ConfigForwardReuseIntContext
960 @Description This routine is relevant for Rx ports that are routed to OP port.
961 It changes the internal context reuse option in the internal
962 driver data base from its default configuration:
963 reuse = [DEFAULT_PORT_forwardIntContextReuse]
965 May be used for Rx ports only
967 @Param[in] h_FmPort A handle to a FM Port module.
968 @Param[in] reuse TRUE to reuse internal context on frames
969 forwarded to OP port.
971 @Return E_OK on success; Error code otherwise.
973 @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().
974 *//***************************************************************************/
975 t_Error FM_PORT_ConfigForwardReuseIntContext(t_Handle h_FmPort, bool reuse);
977 /**************************************************************************//**
978 @Function FM_PORT_ConfigDontReleaseTxBufToBM
980 @Description This routine should be called if no Tx confirmation
981 is done, and yet buffers should not be released to the BM.
982 Normally, buffers are returned using the Tx confirmation
983 process. When Tx confirmation is not used (defFqid=0),
984 buffers are typically released to the BM. This routine
985 may be called to avoid this behavior and not release the
988 May be used for Tx ports only
990 @Param[in] h_FmPort A handle to a FM Port module.
992 @Return E_OK on success; Error code otherwise.
994 @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().
995 *//***************************************************************************/
996 t_Error FM_PORT_ConfigDontReleaseTxBufToBM(t_Handle h_FmPort);
998 /**************************************************************************//**
999 @Function FM_PORT_ConfigIMMaxRxBufLength
1001 @Description Changes the maximum receive buffer length from its default
1002 configuration: Closest rounded down power of 2 value of the
1005 The maximum receive buffer length directly affects the structure
1006 of received frames (single- or multi-buffered) and the performance
1007 of both the FM and the driver.
1009 The selection between single- or multi-buffered frames should be
1010 done according to the characteristics of the specific application.
1011 The recommended mode is to use a single data buffer per packet,
1012 as this mode provides the best performance. However, the user can
1013 select to use multiple data buffers per packet.
1015 @Param[in] h_FmPort A handle to a FM Port module.
1016 @Param[in] newVal Maximum receive buffer length (in bytes).
1018 @Return E_OK on success; Error code otherwise.
1020 @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().
1021 This routine is to be used only if Independent-Mode is enabled.
1022 *//***************************************************************************/
1023 t_Error FM_PORT_ConfigIMMaxRxBufLength(t_Handle h_FmPort, uint16_t newVal);
1025 /**************************************************************************//**
1026 @Function FM_PORT_ConfigIMRxBdRingLength
1028 @Description Changes the receive BD ring length from its default
1029 configuration:[DEFAULT_PORT_rxBdRingLength]
1031 @Param[in] h_FmPort A handle to a FM Port module.
1032 @Param[in] newVal The desired BD ring length.
1034 @Return E_OK on success; Error code otherwise.
1036 @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().
1037 This routine is to be used only if Independent-Mode is enabled.
1038 *//***************************************************************************/
1039 t_Error FM_PORT_ConfigIMRxBdRingLength(t_Handle h_FmPort, uint16_t newVal);
1041 /**************************************************************************//**
1042 @Function FM_PORT_ConfigIMTxBdRingLength
1044 @Description Changes the transmit BD ring length from its default
1045 configuration:[DEFAULT_PORT_txBdRingLength]
1047 @Param[in] h_FmPort A handle to a FM Port module.
1048 @Param[in] newVal The desired BD ring length.
1050 @Return E_OK on success; Error code otherwise.
1052 @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().
1053 This routine is to be used only if Independent-Mode is enabled.
1054 *//***************************************************************************/
1055 t_Error FM_PORT_ConfigIMTxBdRingLength(t_Handle h_FmPort, uint16_t newVal);
1057 /**************************************************************************//**
1058 @Function FM_PORT_ConfigIMFmanCtrlExternalStructsMemory
1060 @Description Configures memory partition and attributes for FMan-Controller
1061 data structures (e.g. BD rings).
1062 Calling this routine changes the internal driver data base
1063 from its default configuration
1064 [DEFAULT_PORT_ImfwExtStructsMemId, DEFAULT_PORT_ImfwExtStructsMemAttr].
1066 @Param[in] h_FmPort A handle to a FM Port module.
1067 @Param[in] memId Memory partition ID.
1068 @Param[in] memAttributes Memory attributes mask (a combination of MEMORY_ATTR_x flags).
1070 @Return E_OK on success; Error code otherwise.
1071 *//***************************************************************************/
1072 t_Error FM_PORT_ConfigIMFmanCtrlExternalStructsMemory(t_Handle h_FmPort,
1074 uint32_t memAttributes);
1076 /**************************************************************************//**
1077 @Function FM_PORT_ConfigIMPolling
1079 @Description Changes the Rx flow from interrupt driven (default) to polling.
1081 @Param[in] h_FmPort A handle to a FM Port module.
1083 @Return E_OK on success; Error code otherwise.
1085 @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().
1086 This routine is to be used only if Independent-Mode is enabled.
1087 *//***************************************************************************/
1088 t_Error FM_PORT_ConfigIMPolling(t_Handle h_FmPort);
1090 /**************************************************************************//**
1091 @Function FM_PORT_ConfigMaxFrameLength
1093 @Description Changes the definition of the max size of frame that should be
1094 transmitted/received on this port from its default value [DEFAULT_PORT_maxFrameLength].
1095 This parameter is used for confirmation of the minimum Fifo
1096 size calculations and only for Tx ports or ports working in
1097 independent mode. This should be larger than the maximum possible
1098 MTU that will be used for this port (i.e. its MAC).
1100 @Param[in] h_FmPort A handle to a FM Port module.
1101 @Param[in] length Max size of frame
1103 @Return E_OK on success; Error code otherwise.
1105 @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().
1106 This routine is to be used only if Independent-Mode is enabled.
1107 *//***************************************************************************/
1108 t_Error FM_PORT_ConfigMaxFrameLength(t_Handle h_FmPort, uint16_t length);
1110 /**************************************************************************//*
1111 @Function FM_PORT_ConfigTxFifoMinFillLevel
1113 @Description Calling this routine changes the fifo minimum
1114 fill level parameter in the internal driver data base
1115 from its default configuration [DEFAULT_PORT_txFifoMinFillLevel]
1117 May be used for Tx ports only
1119 @Param[in] h_FmPort A handle to a FM Port module.
1120 @Param[in] minFillLevel New value
1122 @Return E_OK on success; Error code otherwise.
1124 @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().
1125 *//***************************************************************************/
1126 t_Error FM_PORT_ConfigTxFifoMinFillLevel(t_Handle h_FmPort, uint32_t minFillLevel);
1128 /**************************************************************************//*
1129 @Function FM_PORT_ConfigFifoDeqPipelineDepth
1131 @Description Calling this routine changes the fifo dequeue
1132 pipeline depth parameter in the internal driver data base
1134 from its default configuration: 1G ports: [DEFAULT_PORT_fifoDeqPipelineDepth_1G],
1135 10G port: [DEFAULT_PORT_fifoDeqPipelineDepth_10G],
1136 OP port: [DEFAULT_PORT_fifoDeqPipelineDepth_OH]
1138 May be used for Tx/OP ports only
1140 @Param[in] h_FmPort A handle to a FM Port module.
1141 @Param[in] deqPipelineDepth New value
1143 @Return E_OK on success; Error code otherwise.
1145 @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().
1146 *//***************************************************************************/
1147 t_Error FM_PORT_ConfigFifoDeqPipelineDepth(t_Handle h_FmPort, uint8_t deqPipelineDepth);
1149 /**************************************************************************//*
1150 @Function FM_PORT_ConfigTxFifoLowComfLevel
1152 @Description Calling this routine changes the fifo low comfort level
1153 parameter in internal driver data base
1154 from its default configuration [DEFAULT_PORT_txFifoLowComfLevel]
1156 May be used for Tx ports only
1158 @Param[in] h_FmPort A handle to a FM Port module.
1159 @Param[in] fifoLowComfLevel New value
1161 @Return E_OK on success; Error code otherwise.
1163 @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().
1164 *//***************************************************************************/
1165 t_Error FM_PORT_ConfigTxFifoLowComfLevel(t_Handle h_FmPort, uint32_t fifoLowComfLevel);
1167 /**************************************************************************//*
1168 @Function FM_PORT_ConfigRxFifoThreshold
1170 @Description Calling this routine changes the threshold of the FIFO
1171 fill level parameter in the internal driver data base
1172 from its default configuration [DEFAULT_PORT_rxFifoThreshold]
1174 If the total number of buffers which are
1175 currently in use and associated with the
1176 specific RX port exceed this threshold, the
1177 BMI will signal the MAC to send a pause frame
1180 May be used for Rx ports only
1182 @Param[in] h_FmPort A handle to a FM Port module.
1183 @Param[in] fifoThreshold New value
1185 @Return E_OK on success; Error code otherwise.
1187 @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().
1188 *//***************************************************************************/
1189 t_Error FM_PORT_ConfigRxFifoThreshold(t_Handle h_FmPort, uint32_t fifoThreshold);
1191 /**************************************************************************//*
1192 @Function FM_PORT_ConfigRxFifoPriElevationLevel
1194 @Description Calling this routine changes the priority elevation level
1195 parameter in the internal driver data base from its default
1196 configuration [DEFAULT_PORT_rxFifoPriElevationLevel]
1198 If the total number of buffers which are currently in use and
1199 associated with the specific RX port exceed the amount specified
1200 in priElevationLevel, BMI will signal the main FM's DMA to
1201 elevate the FM priority on the system bus.
1203 May be used for Rx ports only
1205 @Param[in] h_FmPort A handle to a FM Port module.
1206 @Param[in] priElevationLevel New value
1208 @Return E_OK on success; Error code otherwise.
1210 @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().
1211 *//***************************************************************************/
1212 t_Error FM_PORT_ConfigRxFifoPriElevationLevel(t_Handle h_FmPort, uint32_t priElevationLevel);
1214 #ifdef FM_HEAVY_TRAFFIC_HANG_ERRATA_FMAN_A005669
1215 /**************************************************************************//*
1216 @Function FM_PORT_ConfigBCBWorkaround
1218 @Description Configures BCB errata workaround.
1220 When BCB errata is applicable, the workaround is always
1221 performed by FM Controller. Thus, this functions doesn't
1222 actually enable errata workaround but rather allows driver
1223 to perform adjustments required due to errata workaround
1224 execution in FM controller.
1226 Applying BCB workaround also configures FM_PORT_FRM_ERR_PHYSICAL
1227 errors to be discarded. Thus FM_PORT_FRM_ERR_PHYSICAL can't be
1228 set by FM_PORT_SetErrorsRoute() function.
1230 @Param[in] h_FmPort A handle to a FM Port module.
1232 @Return E_OK on success; Error code otherwise.
1234 @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().
1235 *//***************************************************************************/
1236 t_Error FM_PORT_ConfigBCBWorkaround(t_Handle h_FmPort);
1237 #endif /* FM_HEAVY_TRAFFIC_HANG_ERRATA_FMAN_A005669 */
1239 #if (DPAA_VERSION >= 11)
1240 /**************************************************************************//*
1241 @Function FM_PORT_ConfigInternalBuffOffset
1243 @Description Configures internal buffer offset.
1245 May be used for Rx and OP ports only
1247 @Param[in] h_FmPort A handle to a FM Port module.
1248 @Param[in] val New value
1250 @Return E_OK on success; Error code otherwise.
1252 @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().
1253 *//***************************************************************************/
1254 t_Error FM_PORT_ConfigInternalBuffOffset(t_Handle h_FmPort, uint8_t val);
1255 #endif /* (DPAA_VERSION >= 11) */
1257 /** @} */ /* end of FM_PORT_advanced_init_grp group */
1258 /** @} */ /* end of FM_PORT_init_grp group */
1261 /**************************************************************************//**
1262 @Group FM_PORT_runtime_control_grp FM Port Runtime Control Unit
1264 @Description FM Port Runtime control unit API functions, definitions and enums.
1267 *//***************************************************************************/
1269 /**************************************************************************//**
1270 @Description enum for defining FM Port counters
1271 *//***************************************************************************/
1272 typedef enum e_FmPortCounters {
1273 e_FM_PORT_COUNTERS_CYCLE, /**< BMI performance counter */
1274 e_FM_PORT_COUNTERS_TASK_UTIL, /**< BMI performance counter */
1275 e_FM_PORT_COUNTERS_QUEUE_UTIL, /**< BMI performance counter */
1276 e_FM_PORT_COUNTERS_DMA_UTIL, /**< BMI performance counter */
1277 e_FM_PORT_COUNTERS_FIFO_UTIL, /**< BMI performance counter */
1278 e_FM_PORT_COUNTERS_RX_PAUSE_ACTIVATION, /**< BMI Rx only performance counter */
1279 e_FM_PORT_COUNTERS_FRAME, /**< BMI statistics counter */
1280 e_FM_PORT_COUNTERS_DISCARD_FRAME, /**< BMI statistics counter */
1281 e_FM_PORT_COUNTERS_DEALLOC_BUF, /**< BMI deallocate buffer statistics counter */
1282 e_FM_PORT_COUNTERS_RX_BAD_FRAME, /**< BMI Rx only statistics counter */
1283 e_FM_PORT_COUNTERS_RX_LARGE_FRAME, /**< BMI Rx only statistics counter */
1284 e_FM_PORT_COUNTERS_RX_FILTER_FRAME, /**< BMI Rx & OP only statistics counter */
1285 e_FM_PORT_COUNTERS_RX_LIST_DMA_ERR, /**< BMI Rx, OP & HC only statistics counter */
1286 e_FM_PORT_COUNTERS_RX_OUT_OF_BUFFERS_DISCARD, /**< BMI Rx, OP & HC statistics counter */
1287 e_FM_PORT_COUNTERS_PREPARE_TO_ENQUEUE_COUNTER, /**< BMI Rx, OP & HC only statistics counter */
1288 e_FM_PORT_COUNTERS_WRED_DISCARD, /**< BMI OP & HC only statistics counter */
1289 e_FM_PORT_COUNTERS_LENGTH_ERR, /**< BMI non-Rx statistics counter */
1290 e_FM_PORT_COUNTERS_UNSUPPRTED_FORMAT, /**< BMI non-Rx statistics counter */
1291 e_FM_PORT_COUNTERS_DEQ_TOTAL, /**< QMI total QM dequeues counter */
1292 e_FM_PORT_COUNTERS_ENQ_TOTAL, /**< QMI total QM enqueues counter */
1293 e_FM_PORT_COUNTERS_DEQ_FROM_DEFAULT, /**< QMI counter */
1294 e_FM_PORT_COUNTERS_DEQ_CONFIRM /**< QMI counter */
1297 typedef struct t_FmPortBmiStats {
1299 uint32_t cntTaskUtil;
1300 uint32_t cntQueueUtil;
1301 uint32_t cntDmaUtil;
1302 uint32_t cntFifoUtil;
1303 uint32_t cntRxPauseActivation;
1305 uint32_t cntDiscardFrame;
1306 uint32_t cntDeallocBuf;
1307 uint32_t cntRxBadFrame;
1308 uint32_t cntRxLargeFrame;
1309 uint32_t cntRxFilterFrame;
1310 uint32_t cntRxListDmaErr;
1311 uint32_t cntRxOutOfBuffersDiscard;
1312 uint32_t cntWredDiscard;
1313 uint32_t cntLengthErr;
1314 uint32_t cntUnsupportedFormat;
1317 /**************************************************************************//**
1318 @Description Structure for Port id parameters.
1319 Fields commented 'IN' are passed by the port module to be used
1321 Fields commented 'OUT' will be filled by FM before returning to port.
1322 *//***************************************************************************/
1323 typedef struct t_FmPortCongestionGrps {
1324 uint16_t numOfCongestionGrpsToConsider; /**< The number of required CGs
1325 to define the size of the following array */
1326 uint8_t congestionGrpsToConsider[FM_PORT_NUM_OF_CONGESTION_GRPS];
1327 /**< An array of CG indexes;
1328 Note that the size of the array should be
1329 'numOfCongestionGrpsToConsider'. */
1330 #if (DPAA_VERSION >= 11)
1331 bool pfcPrioritiesEn[FM_PORT_NUM_OF_CONGESTION_GRPS][FM_MAX_NUM_OF_PFC_PRIORITIES];
1332 /**< a matrix that represents the map between the CG ids
1333 defined in 'congestionGrpsToConsider' to the priorties
1335 #endif /* (DPAA_VERSION >= 11) */
1336 } t_FmPortCongestionGrps;
1338 /**************************************************************************//**
1339 @Description Structure for Deep Sleep Auto Response ARP Entry
1340 *//***************************************************************************/
1341 typedef struct t_FmPortDsarArpEntry
1347 } t_FmPortDsarArpEntry;
1349 /**************************************************************************//**
1350 @Description Structure for Deep Sleep Auto Response ARP info
1351 *//***************************************************************************/
1352 typedef struct t_FmPortDsarArpInfo
1355 t_FmPortDsarArpEntry *p_AutoResTable;
1356 bool enableConflictDetection; /* when TRUE Conflict Detection will be checked and wake the host if needed */
1357 } t_FmPortDsarArpInfo;
1359 /**************************************************************************//**
1360 @Description Structure for Deep Sleep Auto Response NDP Entry
1361 *//***************************************************************************/
1362 typedef struct t_FmPortDsarNdpEntry
1364 uint32_t ipAddress[4];
1368 } t_FmPortDsarNdpEntry;
1370 /**************************************************************************//**
1371 @Description Structure for Deep Sleep Auto Response NDP info
1372 *//***************************************************************************/
1373 typedef struct t_FmPortDsarNdpInfo
1375 uint32_t multicastGroup;
1377 uint8_t tableSizeAssigned;
1378 t_FmPortDsarNdpEntry *p_AutoResTableAssigned; /* This list refer to solicitation IP addresses.
1379 Note that all IP adresses must be from the same multicast group.
1380 This will be checked and if not operation will fail. */
1381 uint8_t tableSizeTmp;
1382 t_FmPortDsarNdpEntry *p_AutoResTableTmp; /* This list refer to temp IP addresses.
1383 Note that all temp IP adresses must be from the same multicast group.
1384 This will be checked and if not operation will fail. */
1386 bool enableConflictDetection; /* when TRUE Conflict Detection will be checked and wake the host if needed */
1388 } t_FmPortDsarNdpInfo;
1390 /**************************************************************************//**
1391 @Description Structure for Deep Sleep Auto Response ICMPV4 info
1392 *//***************************************************************************/
1393 typedef struct t_FmPortDsarEchoIpv4Info
1396 t_FmPortDsarArpEntry *p_AutoResTable;
1397 } t_FmPortDsarEchoIpv4Info;
1399 /**************************************************************************//**
1400 @Description Structure for Deep Sleep Auto Response ICMPV6 info
1401 *//***************************************************************************/
1402 typedef struct t_FmPortDsarEchoIpv6Info
1405 t_FmPortDsarNdpEntry *p_AutoResTable;
1406 } t_FmPortDsarEchoIpv6Info;
1408 /**************************************************************************//**
1409 @Description Deep Sleep Auto Response SNMP OIDs table entry
1411 *//***************************************************************************/
1414 uint8_t *oidVal; /* only the oid string */
1416 uint8_t *resVal; /* resVal will be the entire reply,
1417 i.e. "Type|Length|Value" */
1418 } t_FmPortDsarOidsEntry;
1420 /**************************************************************************//**
1421 @Description Deep Sleep Auto Response SNMP IPv4 Addresses Table Entry
1422 Refer to the FMan Controller spec for more details.
1423 *//***************************************************************************/
1426 uint32_t ipv4Addr; /*!< 32 bit IPv4 Address. */
1428 uint16_t vid; /*!< 12 bits VLAN ID. The 4 left-most bits should be cleared */
1429 /*!< This field should be 0x0000 for an entry with no VLAN tag or a null VLAN ID. */
1430 } t_FmPortDsarSnmpIpv4AddrTblEntry;
1432 /**************************************************************************//**
1433 @Description Deep Sleep Auto Response SNMP IPv6 Addresses Table Entry
1434 Refer to the FMan Controller spec for more details.
1435 *//***************************************************************************/
1438 uint32_t ipv6Addr[4]; /*!< 4 * 32 bit IPv6 Address. */
1440 uint16_t vid; /*!< 12 bits VLAN ID. The 4 left-most bits should be cleared */
1441 /*!< This field should be 0x0000 for an entry with no VLAN tag or a null VLAN ID. */
1442 } t_FmPortDsarSnmpIpv6AddrTblEntry;
1444 /**************************************************************************//**
1445 @Description Deep Sleep Auto Response SNMP Descriptor
1447 *//***************************************************************************/
1450 uint16_t control; /**< Control bits [0-15]. */
1451 uint16_t maxSnmpMsgLength; /**< Maximal allowed SNMP message length. */
1452 uint16_t numOfIpv4Addresses; /**< Number of entries in IPv4 addresses table. */
1453 uint16_t numOfIpv6Addresses; /**< Number of entries in IPv6 addresses table. */
1454 t_FmPortDsarSnmpIpv4AddrTblEntry *p_Ipv4AddrTbl; /**< Pointer to IPv4 addresses table. */
1455 t_FmPortDsarSnmpIpv6AddrTblEntry *p_Ipv6AddrTbl; /**< Pointer to IPv6 addresses table. */
1456 uint8_t *p_RdOnlyCommunityStr; /**< Pointer to the Read Only Community String. */
1457 uint8_t *p_RdWrCommunityStr; /**< Pointer to the Read Write Community String. */
1458 t_FmPortDsarOidsEntry *p_OidsTbl; /**< Pointer to OIDs table. */
1459 uint32_t oidsTblSize; /**< Number of entries in OIDs table. */
1460 } t_FmPortDsarSnmpInfo;
1462 /**************************************************************************//**
1463 @Description Structure for Deep Sleep Auto Response filtering Entry
1464 *//***************************************************************************/
1465 typedef struct t_FmPortDsarFilteringEntry
1469 uint16_t srcPortMask;
1470 uint16_t dstPortMask;
1471 } t_FmPortDsarFilteringEntry;
1473 /**************************************************************************//**
1474 @Description Structure for Deep Sleep Auto Response filtering info
1475 *//***************************************************************************/
1476 typedef struct t_FmPortDsarFilteringInfo
1478 /* IP protocol filtering parameters */
1479 uint8_t ipProtTableSize;
1480 uint8_t *p_IpProtTablePtr;
1481 bool ipProtPassOnHit; /* when TRUE, miss in the table will cause the packet to be droped,
1482 hit will pass the packet to UDP/TCP filters if needed and if not
1483 to the classification tree. If the classification tree will pass
1484 the packet to a queue it will cause a wake interupt.
1485 When FALSE it the other way around. */
1486 /* UDP port filtering parameters */
1487 uint8_t udpPortsTableSize;
1488 t_FmPortDsarFilteringEntry *p_UdpPortsTablePtr;
1489 bool udpPortPassOnHit; /* when TRUE, miss in the table will cause the packet to be droped,
1490 hit will pass the packet to classification tree.
1491 If the classification tree will pass the packet to a queue it
1492 will cause a wake interupt.
1493 When FALSE it the other way around. */
1494 /* TCP port filtering parameters */
1495 uint16_t tcpFlagsMask;
1496 uint8_t tcpPortsTableSize;
1497 t_FmPortDsarFilteringEntry *p_TcpPortsTablePtr;
1498 bool tcpPortPassOnHit; /* when TRUE, miss in the table will cause the packet to be droped,
1499 hit will pass the packet to classification tree.
1500 If the classification tree will pass the packet to a queue it
1501 will cause a wake interupt.
1502 When FALSE it the other way around. */
1503 } t_FmPortDsarFilteringInfo;
1505 /**************************************************************************//**
1506 @Description Structure for Deep Sleep Auto Response parameters
1507 *//***************************************************************************/
1508 typedef struct t_FmPortDsarParams
1510 t_Handle h_FmPortTx;
1511 t_FmPortDsarArpInfo *p_AutoResArpInfo;
1512 t_FmPortDsarEchoIpv4Info *p_AutoResEchoIpv4Info;
1513 t_FmPortDsarNdpInfo *p_AutoResNdpInfo;
1514 t_FmPortDsarEchoIpv6Info *p_AutoResEchoIpv6Info;
1515 t_FmPortDsarSnmpInfo *p_AutoResSnmpInfo;
1516 t_FmPortDsarFilteringInfo *p_AutoResFilteringInfo;
1517 } t_FmPortDsarParams;
1519 /**************************************************************************//**
1520 @Function FM_PORT_EnterDsar
1522 @Description Enter Deep Sleep Auto Response mode.
1523 This function write the apropriate values to in the relevant
1524 tables in the MURAM.
1526 @Param[in] h_FmPortRx - FM PORT module descriptor
1527 @Param[in] params - Auto Response parameters
1529 @Return E_OK on success; Error code otherwise.
1531 @Cautions Allowed only following FM_PORT_Init().
1532 *//***************************************************************************/
1533 t_Error FM_PORT_EnterDsar(t_Handle h_FmPortRx, t_FmPortDsarParams *params);
1535 /**************************************************************************//**
1536 @Function FM_PORT_EnterDsarFinal
1538 @Description Enter Deep Sleep Auto Response mode.
1539 This function sets the Tx port in independent mode as needed
1540 and redirect the receive flow to go through the
1543 @Param[in] h_DsarRxPort - FM Rx PORT module descriptor
1544 @Param[in] h_DsarTxPort - FM Tx PORT module descriptor
1546 @Return E_OK on success; Error code otherwise.
1548 @Cautions Allowed only following FM_PORT_Init().
1549 *//***************************************************************************/
1550 t_Error FM_PORT_EnterDsarFinal(t_Handle h_DsarRxPort, t_Handle h_DsarTxPort);
1552 /**************************************************************************//**
1553 @Function FM_PORT_ExitDsar
1555 @Description Exit Deep Sleep Auto Response mode.
1556 This function reverse the AR mode and put the ports back into
1557 their original wake mode
1559 @Param[in] h_FmPortRx - FM PORT Rx module descriptor
1560 @Param[in] h_FmPortTx - FM PORT Tx module descriptor
1562 @Return E_OK on success; Error code otherwise.
1564 @Cautions Allowed only following FM_PORT_EnterDsar().
1565 *//***************************************************************************/
1566 void FM_PORT_ExitDsar(t_Handle h_FmPortRx, t_Handle h_FmPortTx);
1568 /**************************************************************************//**
1569 @Function FM_PORT_IsInDsar
1571 @Description This function returns TRUE if the port was set as Auto Response
1572 and FALSE if not. Once Exit AR mode it will return FALSE as well
1573 until re-enabled once more.
1575 @Param[in] h_FmPort - FM PORT module descriptor
1577 @Return E_OK on success; Error code otherwise.
1578 *//***************************************************************************/
1579 bool FM_PORT_IsInDsar(t_Handle h_FmPort);
1581 typedef struct t_FmPortDsarStats
1584 uint32_t echoIcmpv4ArCnt;
1586 uint32_t echoIcmpv6ArCnt;
1587 uint32_t snmpGetCnt;
1588 uint32_t snmpGetNextCnt;
1589 } t_FmPortDsarStats;
1591 /**************************************************************************//**
1592 @Function FM_PORT_GetDsarStats
1594 @Description Return statistics for Deep Sleep Auto Response
1596 @Param[in] h_FmPortRx - FM PORT module descriptor
1597 @Param[out] stats - structure containing the statistics counters
1599 @Return E_OK on success; Error code otherwise.
1600 *//***************************************************************************/
1601 t_Error FM_PORT_GetDsarStats(t_Handle h_FmPortRx, t_FmPortDsarStats *stats);
1603 #if (defined(DEBUG_ERRORS) && (DEBUG_ERRORS > 0))
1604 /**************************************************************************//**
1605 @Function FM_PORT_DumpRegs
1607 @Description Dump all regs.
1609 Calling this routine invalidates the descriptor.
1611 @Param[in] h_FmPort - FM PORT module descriptor
1613 @Return E_OK on success; Error code otherwise.
1615 @Cautions Allowed only following FM_PORT_Init().
1616 *//***************************************************************************/
1617 t_Error FM_PORT_DumpRegs(t_Handle h_FmPort);
1618 #endif /* (defined(DEBUG_ERRORS) && ... */
1620 /**************************************************************************//**
1621 @Function FM_PORT_GetBufferDataOffset
1623 @Description Relevant for Rx ports.
1624 Returns the data offset from the beginning of the data buffer
1626 @Param[in] h_FmPort - FM PORT module descriptor
1628 @Return data offset.
1630 @Cautions Allowed only following FM_PORT_Init().
1631 *//***************************************************************************/
1632 uint32_t FM_PORT_GetBufferDataOffset(t_Handle h_FmPort);
1634 /**************************************************************************//**
1635 @Function FM_PORT_GetBufferICInfo
1637 @Description Returns the Internal Context offset from the beginning of the data buffer
1639 @Param[in] h_FmPort - FM PORT module descriptor
1640 @Param[in] p_Data - A pointer to the data buffer.
1642 @Return Internal context info pointer on success, NULL if 'allOtherInfo' was not
1643 configured for this port.
1645 @Cautions Allowed only following FM_PORT_Init().
1646 *//***************************************************************************/
1647 uint8_t * FM_PORT_GetBufferICInfo(t_Handle h_FmPort, char *p_Data);
1649 /**************************************************************************//**
1650 @Function FM_PORT_GetBufferPrsResult
1652 @Description Returns the pointer to the parse result in the data buffer.
1653 In Rx ports this is relevant after reception, if parse
1654 result is configured to be part of the data passed to the
1655 application. For non Rx ports it may be used to get the pointer
1656 of the area in the buffer where parse result should be
1657 initialized - if so configured.
1658 See FM_PORT_ConfigBufferPrefixContent for data buffer prefix
1661 @Param[in] h_FmPort - FM PORT module descriptor
1662 @Param[in] p_Data - A pointer to the data buffer.
1664 @Return Parse result pointer on success, NULL if parse result was not
1665 configured for this port.
1667 @Cautions Allowed only following FM_PORT_Init().
1668 *//***************************************************************************/
1669 t_FmPrsResult * FM_PORT_GetBufferPrsResult(t_Handle h_FmPort, char *p_Data);
1671 /**************************************************************************//**
1672 @Function FM_PORT_GetBufferTimeStamp
1674 @Description Returns the time stamp in the data buffer.
1675 Relevant for Rx ports for getting the buffer time stamp.
1676 See FM_PORT_ConfigBufferPrefixContent for data buffer prefix
1679 @Param[in] h_FmPort - FM PORT module descriptor
1680 @Param[in] p_Data - A pointer to the data buffer.
1682 @Return A pointer to the hash result on success, NULL otherwise.
1684 @Cautions Allowed only following FM_PORT_Init().
1685 *//***************************************************************************/
1686 uint64_t * FM_PORT_GetBufferTimeStamp(t_Handle h_FmPort, char *p_Data);
1688 /**************************************************************************//**
1689 @Function FM_PORT_GetBufferHashResult
1691 @Description Given a data buffer, on the condition that hash result was defined
1692 as a part of the buffer content (see FM_PORT_ConfigBufferPrefixContent)
1693 this routine will return the pointer to the hash result location in the
1696 @Param[in] h_FmPort - FM PORT module descriptor
1697 @Param[in] p_Data - A pointer to the data buffer.
1699 @Return A pointer to the hash result on success, NULL otherwise.
1701 @Cautions Allowed only following FM_PORT_Init().
1702 *//***************************************************************************/
1703 uint8_t * FM_PORT_GetBufferHashResult(t_Handle h_FmPort, char *p_Data);
1705 /**************************************************************************//**
1706 @Function FM_PORT_Disable
1708 @Description Gracefully disable an FM port. The port will not start new tasks after all
1709 tasks associated with the port are terminated.
1711 @Param[in] h_FmPort A handle to a FM Port module.
1713 @Return E_OK on success; Error code otherwise.
1715 @Cautions Allowed only following FM_PORT_Init().
1716 This is a blocking routine, it returns after port is
1717 gracefully stopped, i.e. the port will not except new frames,
1718 but it will finish all frames or tasks which were already began
1719 *//***************************************************************************/
1720 t_Error FM_PORT_Disable(t_Handle h_FmPort);
1722 /**************************************************************************//**
1723 @Function FM_PORT_Enable
1725 @Description A runtime routine provided to allow disable/enable of port.
1727 @Param[in] h_FmPort A handle to a FM Port module.
1729 @Return E_OK on success; Error code otherwise.
1731 @Cautions Allowed only following FM_PORT_Init().
1732 *//***************************************************************************/
1733 t_Error FM_PORT_Enable(t_Handle h_FmPort);
1735 /**************************************************************************//**
1736 @Function FM_PORT_SetRateLimit
1738 @Description Calling this routine enables rate limit algorithm.
1739 By default, this functionality is disabled.
1740 Note that rate-limit mechanism uses the FM time stamp.
1741 The selected rate limit specified here would be
1742 rounded DOWN to the nearest 16M.
1744 May be used for Tx and OP ports only
1746 @Param[in] h_FmPort A handle to a FM Port module.
1747 @Param[in] p_RateLimit A structure of rate limit parameters
1749 @Return E_OK on success; Error code otherwise.
1751 @Cautions Allowed only following FM_PORT_Init().
1752 If rate limit is set on a port that need to send PFC frames,
1753 it might violate the stop transmit timing.
1754 *//***************************************************************************/
1755 t_Error FM_PORT_SetRateLimit(t_Handle h_FmPort, t_FmPortRateLimit *p_RateLimit);
1757 /**************************************************************************//**
1758 @Function FM_PORT_DeleteRateLimit
1760 @Description Calling this routine disables and clears rate limit
1763 May be used for Tx and OP ports only
1765 @Param[in] h_FmPort A handle to a FM Port module.
1767 @Return E_OK on success; Error code otherwise.
1769 @Cautions Allowed only following FM_PORT_Init().
1770 *//***************************************************************************/
1771 t_Error FM_PORT_DeleteRateLimit(t_Handle h_FmPort);
1773 /**************************************************************************//**
1774 @Function FM_PORT_SetPfcPrioritiesMappingToQmanWQ
1776 @Description Calling this routine maps each PFC received priority to the transmit WQ.
1777 This WQ will be blocked upon receiving a PFC frame with this priority.
1779 May be used for Tx ports only.
1781 @Param[in] h_FmPort A handle to a FM Port module.
1782 @Param[in] prio PFC priority (0-7).
1783 @Param[in] wq Work Queue (0-7).
1785 @Return E_OK on success; Error code otherwise.
1787 @Cautions Allowed only following FM_PORT_Init().
1788 *//***************************************************************************/
1789 t_Error FM_PORT_SetPfcPrioritiesMappingToQmanWQ(t_Handle h_FmPort, uint8_t prio, uint8_t wq);
1791 /**************************************************************************//**
1792 @Function FM_PORT_SetStatisticsCounters
1794 @Description Calling this routine enables/disables port's statistics counters.
1795 By default, counters are enabled.
1797 May be used for all port types
1799 @Param[in] h_FmPort A handle to a FM Port module.
1800 @Param[in] enable TRUE to enable, FALSE to disable.
1802 @Return E_OK on success; Error code otherwise.
1804 @Cautions Allowed only following FM_PORT_Init().
1805 *//***************************************************************************/
1806 t_Error FM_PORT_SetStatisticsCounters(t_Handle h_FmPort, bool enable);
1808 /**************************************************************************//**
1809 @Function FM_PORT_SetFrameQueueCounters
1811 @Description Calling this routine enables/disables port's enqueue/dequeue counters.
1812 By default, counters are enabled.
1814 May be used for all ports
1816 @Param[in] h_FmPort A handle to a FM Port module.
1817 @Param[in] enable TRUE to enable, FALSE to disable.
1819 @Return E_OK on success; Error code otherwise.
1821 @Cautions Allowed only following FM_PORT_Init().
1822 *//***************************************************************************/
1823 t_Error FM_PORT_SetFrameQueueCounters(t_Handle h_FmPort, bool enable);
1825 /**************************************************************************//**
1826 @Function FM_PORT_AnalyzePerformanceParams
1828 @Description User may call this routine to so the driver will analyze if the
1829 basic performance parameters are correct and also the driver may
1830 suggest of improvements; The basic parameters are FIFO sizes, number
1831 of DMAs and number of TNUMs for the port.
1833 May be used for all port types
1835 @Param[in] h_FmPort A handle to a FM Port module.
1837 @Return E_OK on success; Error code otherwise.
1839 @Cautions Allowed only following FM_PORT_Init().
1840 *//***************************************************************************/
1841 t_Error FM_PORT_AnalyzePerformanceParams(t_Handle h_FmPort);
1844 /**************************************************************************//**
1845 @Function FM_PORT_SetAllocBufCounter
1847 @Description Calling this routine enables/disables BM pool allocate
1849 By default, counters are enabled.
1851 May be used for Rx ports only
1853 @Param[in] h_FmPort A handle to a FM Port module.
1854 @Param[in] poolId BM pool id.
1855 @Param[in] enable TRUE to enable, FALSE to disable.
1857 @Return E_OK on success; Error code otherwise.
1859 @Cautions Allowed only following FM_PORT_Init().
1860 *//***************************************************************************/
1861 t_Error FM_PORT_SetAllocBufCounter(t_Handle h_FmPort, uint8_t poolId, bool enable);
1863 /**************************************************************************//**
1864 @Function FM_PORT_GetBmiCounters
1866 @Description Read port's BMI stat counters and place them into
1867 a designated structure of counters.
1869 @Param[in] h_FmPort A handle to a FM Port module.
1870 @Param[out] p_BmiStats counters structure
1872 @Return E_OK on success; Error code otherwise.
1874 @Cautions Allowed only following FM_PORT_Init().
1875 *//***************************************************************************/
1876 t_Error FM_PORT_GetBmiCounters(t_Handle h_FmPort, t_FmPortBmiStats *p_BmiStats);
1878 /**************************************************************************//**
1879 @Function FM_PORT_GetCounter
1881 @Description Reads one of the FM PORT counters.
1883 @Param[in] h_FmPort A handle to a FM Port module.
1884 @Param[in] fmPortCounter The requested counter.
1886 @Return Counter's current value.
1888 @Cautions Allowed only following FM_PORT_Init().
1889 Note that it is user's responsibility to call this routine only
1890 for enabled counters, and there will be no indication if a
1891 disabled counter is accessed.
1892 *//***************************************************************************/
1893 uint32_t FM_PORT_GetCounter(t_Handle h_FmPort, e_FmPortCounters fmPortCounter);
1895 /**************************************************************************//**
1896 @Function FM_PORT_ModifyCounter
1898 @Description Sets a value to an enabled counter. Use "0" to reset the counter.
1900 @Param[in] h_FmPort A handle to a FM Port module.
1901 @Param[in] fmPortCounter The requested counter.
1902 @Param[in] value The requested value to be written into the counter.
1904 @Return E_OK on success; Error code otherwise.
1906 @Cautions Allowed only following FM_PORT_Init().
1907 *//***************************************************************************/
1908 t_Error FM_PORT_ModifyCounter(t_Handle h_FmPort, e_FmPortCounters fmPortCounter, uint32_t value);
1910 /**************************************************************************//**
1911 @Function FM_PORT_GetAllocBufCounter
1913 @Description Reads one of the FM PORT buffer counters.
1915 @Param[in] h_FmPort A handle to a FM Port module.
1916 @Param[in] poolId The requested pool.
1918 @Return Counter's current value.
1920 @Cautions Allowed only following FM_PORT_Init().
1921 Note that it is user's responsibility to call this routine only
1922 for enabled counters, and there will be no indication if a
1923 disabled counter is accessed.
1924 *//***************************************************************************/
1925 uint32_t FM_PORT_GetAllocBufCounter(t_Handle h_FmPort, uint8_t poolId);
1927 /**************************************************************************//**
1928 @Function FM_PORT_ModifyAllocBufCounter
1930 @Description Sets a value to an enabled counter. Use "0" to reset the counter.
1932 @Param[in] h_FmPort A handle to a FM Port module.
1933 @Param[in] poolId The requested pool.
1934 @Param[in] value The requested value to be written into the counter.
1936 @Return E_OK on success; Error code otherwise.
1938 @Cautions Allowed only following FM_PORT_Init().
1939 *//***************************************************************************/
1940 t_Error FM_PORT_ModifyAllocBufCounter(t_Handle h_FmPort, uint8_t poolId, uint32_t value);
1942 /**************************************************************************//**
1943 @Function FM_PORT_AddCongestionGrps
1945 @Description This routine effects the corresponding Tx port.
1946 It should be called in order to enable pause
1947 frame transmission in case of congestion in one or more
1948 of the congestion groups relevant to this port.
1949 Each call to this routine may add one or more congestion
1950 groups to be considered relevant to this port.
1952 May be used for Rx, or RX+OP ports only (depending on chip)
1954 @Param[in] h_FmPort A handle to a FM Port module.
1955 @Param[in] p_CongestionGrps A pointer to an array of congestion groups
1958 @Return E_OK on success; Error code otherwise.
1960 @Cautions Allowed only following FM_PORT_Init().
1961 *//***************************************************************************/
1962 t_Error FM_PORT_AddCongestionGrps(t_Handle h_FmPort, t_FmPortCongestionGrps *p_CongestionGrps);
1964 /**************************************************************************//**
1965 @Function FM_PORT_RemoveCongestionGrps
1967 @Description This routine effects the corresponding Tx port. It should be
1968 called when congestion groups were
1969 defined for this port and are no longer relevant, or pause
1970 frames transmitting is not required on their behalf.
1971 Each call to this routine may remove one or more congestion
1972 groups to be considered relevant to this port.
1974 May be used for Rx, or RX+OP ports only (depending on chip)
1976 @Param[in] h_FmPort A handle to a FM Port module.
1977 @Param[in] p_CongestionGrps A pointer to an array of congestion groups
1980 @Return E_OK on success; Error code otherwise.
1982 @Cautions Allowed only following FM_PORT_Init().
1983 *//***************************************************************************/
1984 t_Error FM_PORT_RemoveCongestionGrps(t_Handle h_FmPort, t_FmPortCongestionGrps *p_CongestionGrps);
1986 /**************************************************************************//**
1987 @Function FM_PORT_IsStalled
1989 @Description A routine for checking whether the specified port is stalled.
1991 @Param[in] h_FmPort A handle to a FM Port module.
1993 @Return TRUE if port is stalled, FALSE otherwize
1995 @Cautions Allowed only following FM_PORT_Init().
1996 *//***************************************************************************/
1997 bool FM_PORT_IsStalled(t_Handle h_FmPort);
1999 /**************************************************************************//**
2000 @Function FM_PORT_ReleaseStalled
2002 @Description This routine may be called in case the port was stalled and may
2004 Note that this routine is available only on older FMan revisions
2005 (FMan v2, DPAA v1.0 only).
2007 @Param[in] h_FmPort A handle to a FM Port module.
2009 @Return E_OK on success; Error code otherwise.
2011 @Cautions Allowed only following FM_PORT_Init().
2012 *//***************************************************************************/
2013 t_Error FM_PORT_ReleaseStalled(t_Handle h_FmPort);
2015 /**************************************************************************//**
2016 @Function FM_PORT_SetRxL4ChecksumVerify
2018 @Description This routine is relevant for Rx ports (1G and 10G). The routine
2019 set/clear the L3/L4 checksum verification (on RX side).
2020 Note that this takes affect only if hw-parser is enabled!
2022 @Param[in] h_FmPort A handle to a FM Port module.
2023 @Param[in] l4Checksum boolean indicates whether to do L3/L4 checksum
2026 @Return E_OK on success; Error code otherwise.
2028 @Cautions Allowed only following FM_PORT_Init().
2029 *//***************************************************************************/
2030 t_Error FM_PORT_SetRxL4ChecksumVerify(t_Handle h_FmPort, bool l4Checksum);
2032 /**************************************************************************//**
2033 @Function FM_PORT_SetErrorsRoute
2035 @Description Errors selected for this routine will cause a frame with that error
2036 to be enqueued to error queue.
2037 Errors not selected for this routine will cause a frame with that error
2038 to be enqueued to the one of the other port queues.
2039 By default all errors are defined to be enqueued to error queue.
2040 Errors that were configured to be discarded (at initialization)
2041 may not be selected here.
2043 May be used for Rx and OP ports only
2045 @Param[in] h_FmPort A handle to a FM Port module.
2046 @Param[in] errs A list of errors to enqueue to error queue
2048 @Return E_OK on success; Error code otherwise.
2050 @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().
2051 *//***************************************************************************/
2052 t_Error FM_PORT_SetErrorsRoute(t_Handle h_FmPort, fmPortFrameErrSelect_t errs);
2054 /**************************************************************************//**
2055 @Function FM_PORT_SetIMExceptions
2057 @Description Calling this routine enables/disables FM PORT interrupts.
2059 @Param[in] h_FmPort FM PORT module descriptor.
2060 @Param[in] exception The exception to be selected.
2061 @Param[in] enable TRUE to enable interrupt, FALSE to mask it.
2063 @Return E_OK on success; Error code otherwise.
2065 @Cautions Allowed only following FM_PORT_Init().
2066 This routine should NOT be called from guest-partition
2067 (i.e. guestId != NCSW_MASTER_ID)
2068 *//***************************************************************************/
2069 t_Error FM_PORT_SetIMExceptions(t_Handle h_FmPort, e_FmPortExceptions exception, bool enable);
2071 /**************************************************************************//*
2072 @Function FM_PORT_SetPerformanceCounters
2074 @Description Calling this routine enables/disables port's performance counters.
2075 By default, counters are enabled.
2077 May be used for all port types
2079 @Param[in] h_FmPort A handle to a FM Port module.
2080 @Param[in] enable TRUE to enable, FALSE to disable.
2082 @Return E_OK on success; Error code otherwise.
2084 @Cautions Allowed only following FM_PORT_Init().
2085 *//***************************************************************************/
2086 t_Error FM_PORT_SetPerformanceCounters(t_Handle h_FmPort, bool enable);
2088 /**************************************************************************//*
2089 @Function FM_PORT_SetPerformanceCountersParams
2091 @Description Calling this routine defines port's performance
2092 counters parameters.
2094 May be used for all port types
2096 @Param[in] h_FmPort A handle to a FM Port module.
2097 @Param[in] p_FmPortPerformanceCnt A pointer to a structure of performance
2098 counters parameters.
2100 @Return E_OK on success; Error code otherwise.
2102 @Cautions Allowed only following FM_PORT_Init().
2103 *//***************************************************************************/
2104 t_Error FM_PORT_SetPerformanceCountersParams(t_Handle h_FmPort, t_FmPortPerformanceCnt *p_FmPortPerformanceCnt);
2106 /**************************************************************************//**
2107 @Group FM_PORT_pcd_runtime_control_grp FM Port PCD Runtime Control Unit
2109 @Description FM Port PCD Runtime control unit API functions, definitions and enums.
2112 *//***************************************************************************/
2114 /**************************************************************************//**
2115 @Description A structure defining the KG scheme after the parser.
2116 This is relevant only to change scheme selection mode - from
2117 direct to indirect and vice versa, or when the scheme is selected directly,
2118 to select the scheme id.
2120 *//***************************************************************************/
2121 typedef struct t_FmPcdKgSchemeSelect {
2122 bool direct; /**< TRUE to use 'h_Scheme' directly, FALSE to use LCV. */
2123 t_Handle h_DirectScheme; /**< Scheme handle, selects the scheme after parser;
2124 Relevant only when 'direct' is TRUE. */
2125 } t_FmPcdKgSchemeSelect;
2127 /**************************************************************************//**
2128 @Description A structure of scheme parameters
2129 *//***************************************************************************/
2130 typedef struct t_FmPcdPortSchemesParams {
2131 uint8_t numOfSchemes; /**< Number of schemes for port to be bound to. */
2132 t_Handle h_Schemes[FM_PCD_KG_NUM_OF_SCHEMES]; /**< Array of 'numOfSchemes' schemes for the
2133 port to be bound to */
2134 } t_FmPcdPortSchemesParams;
2136 /**************************************************************************//**
2137 @Description Union for defining port protocol parameters for parser
2138 *//***************************************************************************/
2139 typedef union u_FmPcdHdrPrsOpts {
2142 bool labelInterpretationEnable; /**< When this bit is set, the last MPLS label will be
2143 interpreted as described in HW spec table. When the bit
2144 is cleared, the parser will advance to MPLS next parse */
2145 e_NetHeaderType nextParse; /**< must be equal or higher than IPv4 */
2149 uint16_t tagProtocolId1; /**< User defined Tag Protocol Identifier, to be recognized
2150 on VLAN TAG on top of 0x8100 and 0x88A8 */
2151 uint16_t tagProtocolId2; /**< User defined Tag Protocol Identifier, to be recognized
2152 on VLAN TAG on top of 0x8100 and 0x88A8 */
2156 bool enableMTUCheck; /**< Check validity of MTU according to RFC2516 */
2161 bool routingHdrEnable; /**< TRUE to enable routing header, otherwise ignore */
2166 bool padIgnoreChecksum; /**< TRUE to ignore pad in checksum */
2171 bool padIgnoreChecksum; /**< TRUE to ignore pad in checksum */
2173 } u_FmPcdHdrPrsOpts;
2175 /**************************************************************************//**
2176 @Description A structure for defining each header for the parser
2177 *//***************************************************************************/
2178 typedef struct t_FmPcdPrsAdditionalHdrParams {
2179 e_NetHeaderType hdr; /**< Selected header; use HEADER_TYPE_NONE
2180 to indicate that sw parser is to run first
2181 (before HW parser, and independent of the
2182 existence of any protocol), in this case,
2183 swPrsEnable must be set, and all other
2184 parameters are irrelevant. */
2185 bool errDisable; /**< TRUE to disable error indication */
2186 bool swPrsEnable; /**< Enable jump to SW parser when this
2187 header is recognized by the HW parser. */
2188 uint8_t indexPerHdr; /**< Normally 0, if more than one sw parser
2189 attachments exists for the same header,
2190 (in the main sw parser code) use this
2191 index to distinguish between them. */
2192 bool usePrsOpts; /**< TRUE to use parser options. */
2193 u_FmPcdHdrPrsOpts prsOpts; /**< A union according to header type,
2194 defining the parser options selected.*/
2195 } t_FmPcdPrsAdditionalHdrParams;
2197 /**************************************************************************//**
2198 @Description struct for defining port PCD parameters
2199 *//***************************************************************************/
2200 typedef struct t_FmPortPcdPrsParams {
2201 uint8_t prsResultPrivateInfo; /**< The private info provides a method of inserting
2202 port information into the parser result. This information
2203 may be extracted by Keygen and be used for frames
2204 distribution when a per-port distinction is required,
2205 it may also be used as a port logical id for analyzing
2207 uint8_t parsingOffset; /**< Number of bytes from beginning of packet to start parsing */
2208 e_NetHeaderType firstPrsHdr; /**< The type of the first header expected at 'parsingOffset' */
2209 bool includeInPrsStatistics; /**< TRUE to include this port in the parser statistics;
2210 NOTE: this field is not valid when the FM is in "guest" mode
2211 and IPC is not available. */
2212 uint8_t numOfHdrsWithAdditionalParams; /**< Normally 0, some headers may get
2213 special parameters */
2214 t_FmPcdPrsAdditionalHdrParams additionalParams[FM_PCD_PRS_NUM_OF_HDRS];
2215 /**< 'numOfHdrsWithAdditionalParams' structures
2216 of additional parameters
2217 for each header that requires them */
2218 bool setVlanTpid1; /**< TRUE to configure user selection of Ethertype to
2219 indicate a VLAN tag (in addition to the TPID values
2220 0x8100 and 0x88A8). */
2221 uint16_t vlanTpid1; /**< extra tag to use if setVlanTpid1=TRUE. */
2222 bool setVlanTpid2; /**< TRUE to configure user selection of Ethertype to
2223 indicate a VLAN tag (in addition to the TPID values
2224 0x8100 and 0x88A8). */
2225 uint16_t vlanTpid2; /**< extra tag to use if setVlanTpid1=TRUE. */
2226 } t_FmPortPcdPrsParams;
2228 /**************************************************************************//**
2229 @Description struct for defining coarse alassification parameters
2230 *//***************************************************************************/
2231 typedef struct t_FmPortPcdCcParams {
2232 t_Handle h_CcTree; /**< A handle to a CC tree */
2233 } t_FmPortPcdCcParams;
2235 /**************************************************************************//**
2236 @Description struct for defining keygen parameters
2237 *//***************************************************************************/
2238 typedef struct t_FmPortPcdKgParams {
2239 uint8_t numOfSchemes; /**< Number of schemes for port to be bound to. */
2240 t_Handle h_Schemes[FM_PCD_KG_NUM_OF_SCHEMES];
2241 /**< Array of 'numOfSchemes' schemes handles for the
2242 port to be bound to */
2243 bool directScheme; /**< TRUE for going from parser to a specific scheme,
2244 regardless of parser result */
2245 t_Handle h_DirectScheme; /**< relevant only if direct == TRUE, Scheme handle,
2246 as returned by FM_PCD_KgSetScheme */
2247 } t_FmPortPcdKgParams;
2249 /**************************************************************************//**
2250 @Description struct for defining policer parameters
2251 *//***************************************************************************/
2252 typedef struct t_FmPortPcdPlcrParams {
2253 t_Handle h_Profile; /**< Selected profile handle */
2254 } t_FmPortPcdPlcrParams;
2256 /**************************************************************************//**
2257 @Description struct for defining port PCD parameters
2258 *//***************************************************************************/
2259 typedef struct t_FmPortPcdParams {
2260 e_FmPortPcdSupport pcdSupport; /**< Relevant for Rx and offline ports only.
2261 Describes the active PCD engines for this port. */
2262 t_Handle h_NetEnv; /**< HL Unused in PLCR only mode */
2263 t_FmPortPcdPrsParams *p_PrsParams; /**< Parser parameters for this port */
2264 t_FmPortPcdCcParams *p_CcParams; /**< Coarse classification parameters for this port */
2265 t_FmPortPcdKgParams *p_KgParams; /**< Keygen parameters for this port */
2266 t_FmPortPcdPlcrParams *p_PlcrParams; /**< Policer parameters for this port; Relevant for one of
2268 e_FM_PORT_PCD_SUPPORT_PLCR_ONLY or
2269 e_FM_PORT_PCD_SUPPORT_PRS_AND_PLCR were selected,
2270 or if any flow uses a KG scheme were policer
2271 profile is not generated
2272 ('bypassPlcrProfileGeneration selected'). */
2273 t_Handle h_IpReassemblyManip; /**< IP Reassembly manipulation */
2274 #if (DPAA_VERSION >= 11)
2275 t_Handle h_CapwapReassemblyManip;/**< CAPWAP Reassembly manipulation */
2276 #endif /* (DPAA_VERSION >= 11) */
2277 } t_FmPortPcdParams;
2279 /**************************************************************************//**
2280 @Description A structure for defining the Parser starting point
2281 *//***************************************************************************/
2282 typedef struct t_FmPcdPrsStart {
2283 uint8_t parsingOffset; /**< Number of bytes from beginning of packet to
2285 e_NetHeaderType firstPrsHdr; /**< The type of the first header axpected at
2289 #if (DPAA_VERSION >= 11)
2290 /**************************************************************************//**
2291 @Description struct for defining external buffer margins
2292 *//***************************************************************************/
2293 typedef struct t_FmPortVSPAllocParams {
2294 uint8_t numOfProfiles; /**< Number of Virtual Storage Profiles; must be a power of 2 */
2295 uint8_t dfltRelativeId; /**< The default Virtual-Storage-Profile-id dedicated to Rx/OP port
2296 The same default Virtual-Storage-Profile-id will be for coupled Tx port
2297 if relevant function called for Rx port */
2298 t_Handle h_FmTxPort; /**< Handle to coupled Tx Port; not relevant for OP port. */
2299 } t_FmPortVSPAllocParams;
2300 #endif /* (DPAA_VERSION >= 11) */
2303 /**************************************************************************//**
2304 @Function FM_PORT_SetPCD
2306 @Description Calling this routine defines the port's PCD configuration.
2307 It changes it from its default configuration which is PCD
2308 disabled (BMI to BMI) and configures it according to the passed
2311 May be used for Rx and OP ports only
2313 @Param[in] h_FmPort A handle to a FM Port module.
2314 @Param[in] p_FmPortPcd A Structure of parameters defining the port's PCD
2317 @Return E_OK on success; Error code otherwise.
2319 @Cautions Allowed only following FM_PORT_Init().
2320 *//***************************************************************************/
2321 t_Error FM_PORT_SetPCD(t_Handle h_FmPort, t_FmPortPcdParams *p_FmPortPcd);
2323 /**************************************************************************//**
2324 @Function FM_PORT_DeletePCD
2326 @Description Calling this routine releases the port's PCD configuration.
2327 The port returns to its default configuration which is PCD
2328 disabled (BMI to BMI) and all PCD configuration is removed.
2330 May be used for Rx and OP ports which are
2333 @Param[in] h_FmPort A handle to a FM Port module.
2335 @Return E_OK on success; Error code otherwise.
2337 @Cautions Allowed only following FM_PORT_Init().
2338 *//***************************************************************************/
2339 t_Error FM_PORT_DeletePCD(t_Handle h_FmPort);
2341 /**************************************************************************//**
2342 @Function FM_PORT_AttachPCD
2344 @Description This routine may be called after FM_PORT_DetachPCD was called,
2345 to return to the originally configured PCD support flow.
2346 The couple of routines are used to allow PCD configuration changes
2347 that demand that PCD will not be used while changes take place.
2349 May be used for Rx and OP ports which are
2352 @Param[in] h_FmPort A handle to a FM Port module.
2354 @Return E_OK on success; Error code otherwise.
2356 @Cautions Allowed only following FM_PORT_Init().
2357 *//***************************************************************************/
2358 t_Error FM_PORT_AttachPCD(t_Handle h_FmPort);
2360 /**************************************************************************//**
2361 @Function FM_PORT_DetachPCD
2363 @Description Calling this routine detaches the port from its PCD functionality.
2364 The port returns to its default flow which is BMI to BMI.
2366 May be used for Rx and OP ports which are
2369 @Param[in] h_FmPort A handle to a FM Port module.
2371 @Return E_OK on success; Error code otherwise.
2373 @Cautions Allowed only following FM_PORT_AttachPCD().
2374 *//***************************************************************************/
2375 t_Error FM_PORT_DetachPCD(t_Handle h_FmPort);
2377 /**************************************************************************//**
2378 @Function FM_PORT_PcdPlcrAllocProfiles
2380 @Description This routine may be called only for ports that use the Policer in
2381 order to allocate private policer profiles.
2383 @Param[in] h_FmPort A handle to a FM Port module.
2384 @Param[in] numOfProfiles The number of required policer profiles
2386 @Return E_OK on success; Error code otherwise.
2388 @Cautions Allowed only following FM_PORT_Init() and FM_PCD_Init(),
2389 and before FM_PORT_SetPCD().
2390 *//***************************************************************************/
2391 t_Error FM_PORT_PcdPlcrAllocProfiles(t_Handle h_FmPort, uint16_t numOfProfiles);
2393 /**************************************************************************//**
2394 @Function FM_PORT_PcdPlcrFreeProfiles
2396 @Description This routine should be called for freeing private policer profiles.
2398 @Param[in] h_FmPort A handle to a FM Port module.
2400 @Return E_OK on success; Error code otherwise.
2402 @Cautions Allowed only following FM_PORT_Init() and FM_PCD_Init(),
2403 and before FM_PORT_SetPCD().
2404 *//***************************************************************************/
2405 t_Error FM_PORT_PcdPlcrFreeProfiles(t_Handle h_FmPort);
2407 #if (DPAA_VERSION >= 11)
2408 /**************************************************************************//**
2409 @Function FM_PORT_VSPAlloc
2411 @Description This routine allocated VSPs per port and forces the port to work
2412 in VSP mode. Note that the port is initialized by default with the
2413 physical-storage-profile only.
2415 @Param[in] h_FmPort A handle to a FM Port module.
2416 @Param[in] p_Params A structure of parameters for allocation VSP's per port
2418 @Return E_OK on success; Error code otherwise.
2420 @Cautions Allowed only following FM_PORT_Init(), and before FM_PORT_SetPCD()
2421 and also before FM_PORT_Enable(); i.e. the port should be disabled.
2422 *//***************************************************************************/
2423 t_Error FM_PORT_VSPAlloc(t_Handle h_FmPort, t_FmPortVSPAllocParams *p_Params);
2424 #endif /* (DPAA_VERSION >= 11) */
2426 /**************************************************************************//**
2427 @Function FM_PORT_PcdKgModifyInitialScheme
2429 @Description This routine may be called only for ports that use the keygen in
2430 order to change the initial scheme frame should be routed to.
2431 The change may be of a scheme id (in case of direct mode),
2432 from direct to indirect, or from indirect to direct - specifying the scheme id.
2434 @Param[in] h_FmPort A handle to a FM Port module.
2435 @Param[in] p_FmPcdKgScheme A structure of parameters for defining whether
2436 a scheme is direct/indirect, and if direct - scheme id.
2438 @Return E_OK on success; Error code otherwise.
2440 @Cautions Allowed only following FM_PORT_Init() and FM_PORT_SetPCD().
2441 *//***************************************************************************/
2442 t_Error FM_PORT_PcdKgModifyInitialScheme (t_Handle h_FmPort, t_FmPcdKgSchemeSelect *p_FmPcdKgScheme);
2444 /**************************************************************************//**
2445 @Function FM_PORT_PcdPlcrModifyInitialProfile
2447 @Description This routine may be called for ports with flows
2448 e_FM_PORT_PCD_SUPPORT_PLCR_ONLY or e_FM_PORT_PCD_SUPPORT_PRS_AND_PLCR
2449 only, to change the initial Policer profile frame should be
2450 routed to. The change may be of a profile and/or absolute/direct
2453 @Param[in] h_FmPort A handle to a FM Port module.
2454 @Param[in] h_Profile Policer profile handle
2456 @Return E_OK on success; Error code otherwise.
2458 @Cautions Allowed only following FM_PORT_Init() and FM_PORT_SetPCD().
2459 *//***************************************************************************/
2460 t_Error FM_PORT_PcdPlcrModifyInitialProfile (t_Handle h_FmPort, t_Handle h_Profile);
2462 /**************************************************************************//**
2463 @Function FM_PORT_PcdCcModifyTree
2465 @Description This routine may be called for ports that use coarse classification tree
2466 if the user wishes to replace the tree. The routine may not be called while port
2467 receives packets using the PCD functionalities, therefor port must be first detached
2468 from the PCD, only than the routine may be called, and than port be attached to PCD again.
2470 @Param[in] h_FmPort A handle to a FM Port module.
2471 @Param[in] h_CcTree A CC tree that was already built. The tree id as returned from
2472 the BuildTree routine.
2474 @Return E_OK on success; Error code otherwise.
2476 @Cautions Allowed only following FM_PORT_Init(), FM_PORT_SetPCD() and FM_PORT_DetachPCD()
2477 *//***************************************************************************/
2478 t_Error FM_PORT_PcdCcModifyTree (t_Handle h_FmPort, t_Handle h_CcTree);
2480 /**************************************************************************//**
2481 @Function FM_PORT_PcdKgBindSchemes
2483 @Description These routines may be called for adding more schemes for the
2484 port to be bound to. The selected schemes are not added,
2485 just this specific port starts using them.
2487 @Param[in] h_FmPort A handle to a FM Port module.
2488 @Param[in] p_PortScheme A structure defining the list of schemes to be added.
2490 @Return E_OK on success; Error code otherwise.
2492 @Cautions Allowed only following FM_PORT_Init() and FM_PORT_SetPCD().
2493 *//***************************************************************************/
2494 t_Error FM_PORT_PcdKgBindSchemes (t_Handle h_FmPort, t_FmPcdPortSchemesParams *p_PortScheme);
2496 /**************************************************************************//**
2497 @Function FM_PORT_PcdKgUnbindSchemes
2499 @Description These routines may be called for adding more schemes for the
2500 port to be bound to. The selected schemes are not removed or invalidated,
2501 just this specific port stops using them.
2503 @Param[in] h_FmPort A handle to a FM Port module.
2504 @Param[in] p_PortScheme A structure defining the list of schemes to be added.
2506 @Return E_OK on success; Error code otherwise.
2508 @Cautions Allowed only following FM_PORT_Init() and FM_PORT_SetPCD().
2509 *//***************************************************************************/
2510 t_Error FM_PORT_PcdKgUnbindSchemes (t_Handle h_FmPort, t_FmPcdPortSchemesParams *p_PortScheme);
2512 /**************************************************************************//**
2513 @Function FM_PORT_GetIPv4OptionsCount
2517 @Param[in] h_FmPort A handle to a FM Port module.
2518 @Param[out] p_Ipv4OptionsCount will hold the counter value
2520 @Return E_OK on success; Error code otherwise.
2522 @Cautions Allowed only following FM_PORT_Init()
2523 *//***************************************************************************/
2524 t_Error FM_PORT_GetIPv4OptionsCount(t_Handle h_FmPort, uint32_t *p_Ipv4OptionsCount);
2526 /** @} */ /* end of FM_PORT_pcd_runtime_control_grp group */
2527 /** @} */ /* end of FM_PORT_runtime_control_grp group */
2530 /**************************************************************************//**
2531 @Group FM_PORT_runtime_data_grp FM Port Runtime Data-path Unit
2533 @Description FM Port Runtime data unit API functions, definitions and enums.
2534 This API is valid only if working in Independent-Mode.
2537 *//***************************************************************************/
2539 /**************************************************************************//**
2540 @Function FM_PORT_ImTx
2542 @Description Tx function, called to transmit a data buffer on the port.
2544 @Param[in] h_FmPort A handle to a FM Port module.
2545 @Param[in] p_Data A pointer to an LCP data buffer.
2546 @Param[in] length Size of data for transmission.
2547 @Param[in] lastBuffer Buffer position - TRUE for the last buffer
2548 of a frame, including a single buffer frame
2549 @Param[in] h_BufContext A handle of the user acossiated with this buffer
2551 @Return E_OK on success; Error code otherwise.
2553 @Cautions Allowed only following FM_PORT_Init().
2554 NOTE - This routine can be used only when working in
2555 Independent-Mode mode.
2556 *//***************************************************************************/
2557 t_Error FM_PORT_ImTx( t_Handle h_FmPort,
2561 t_Handle h_BufContext);
2563 /**************************************************************************//**
2564 @Function FM_PORT_ImTxConf
2566 @Description Tx port confirmation routine, optional, may be called to verify
2567 transmission of all frames. The procedure performed by this
2568 routine will be performed automatically on next buffer transmission,
2569 but if desired, calling this routine will invoke this action on
2572 @Param[in] h_FmPort A handle to a FM Port module.
2574 @Cautions Allowed only following FM_PORT_Init().
2575 NOTE - This routine can be used only when working in
2576 Independent-Mode mode.
2577 *//***************************************************************************/
2578 void FM_PORT_ImTxConf(t_Handle h_FmPort);
2580 /**************************************************************************//**
2581 @Function FM_PORT_ImRx
2583 @Description Rx function, may be called to poll for received buffers.
2584 Normally, Rx process is invoked by the driver on Rx interrupt.
2585 Alternatively, this routine may be called on demand.
2587 @Param[in] h_FmPort A handle to a FM Port module.
2589 @Return E_OK on success; Error code otherwise.
2591 @Cautions Allowed only following FM_PORT_Init().
2592 NOTE - This routine can be used only when working in
2593 Independent-Mode mode.
2594 *//***************************************************************************/
2595 t_Error FM_PORT_ImRx(t_Handle h_FmPort);
2597 /** @} */ /* end of FM_PORT_runtime_data_grp group */
2598 /** @} */ /* end of FM_PORT_grp group */
2599 /** @} */ /* end of FM_grp group */
2603 #ifdef NCSW_BACKWARD_COMPATIBLE_API
2604 #define FM_PORT_ConfigTxFifoDeqPipelineDepth FM_PORT_ConfigFifoDeqPipelineDepth
2605 #endif /* NCSW_BACKWARD_COMPATIBLE_API */
2608 #endif /* __FM_PORT_EXT */