DPAA Parse switch propietary Ethernet header for PCD

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

DPAA Parse switch propietary Ethernet header for PCD

521 Views
MGonzalo
Contributor I

Hello,

I'm developing an application with the DPAA for a T1024 SoC that parses and classifies packets into flows that are enqueued to different frame queues so they can be proccessed by a single core at a time, ensuring order preservation.

I'm facing a problem when parsing the Ethernet header from the frames that arrive through the switch device at the Parser module. This interface modifies the frame Ethernet header to include some information relevant to the switch (like the port it came from), and this modification made to the Ethernet header causes a failure when parsing this header at the Parser module. I guess that the frame format no longer matches the formats that are hardcoded to be parsed and results in a parsing error.

I think that a possible solution for this problem would be to add a Soft Parser program that is invoked after the Ethernet HXS has failed. This Soft Parser function would be able to recognize the switch modified Ethernet header and proceed to parse the next header in the frame. The problem that I'm facing is that I don't find any information about how can I design such Soft Parser function. In the DPAA reference manual it only says that this functionality is available through configuration tools but, in this case, I would develop the program without using any tool.

I have seen the following structure in the code but I don't know how to properly fulfill it.

typedef struct ioc_fm_pcd_prs_sw_params_t {
bool override; /**< FALSE to invoke a check that nothing else
was loaded to this address, including
internal patches.
TRUE to override any existing code.*/
uint32_t size; /**< SW parser code size */
uint16_t base; /**< SW parser base (in instruction counts!
must be larger than 0x20)*/
uint8_t *p_code; /**< SW parser code */
uint32_t sw_prs_data_params[IOC_FM_PCD_PRS_NUM_OF_HDRS];
/**< SW parser data (parameters) */
uint8_t num_of_labels; /**< Number of labels for SW parser. */
ioc_fm_pcd_prs_label_params_t labels_table[IOC_FM_PCD_PRS_NUM_OF_LABELS];
/**< SW parser labels table,
containing num_of_labels entries */
} ioc_fm_pcd_prs_sw_params_t;

I have the following questions:

  • I assume that 'p_code' is a pointer to the function, 'size' is the length of the function in bytes but I don't know what the parameter 'base' would be. What does this parameter mean?
  • I don't know how to define the arguments that are passed to the function. I guess it would be the pointer to the start of the Ethernet header in my case. How can I define this using the 'sw_prs_data_params' parameter?
  • In the function I define, how would I indicate Parser module to branch to the next HXS pointed by Ether Type/Length field and continue its parsing when I validate the modified header?

Should I have anything else in consideration while developing this functionality? Is there a better workaround to this problem?

Thank you in advance for your help and best regards,
Mario.

0 Kudos
0 Replies