@@ -148,10 +148,15 @@ typedef struct odp_ipsec_inbound_config_t {
/** Parse packet headers after IPSEC transformation
*
* Select header parsing level after inbound processing. Headers of the
- * resulting packet must be parsed (at least) up to this level. Parsing
- * starts from IP (layer 3). Each successfully transformed packet has
- * a valid value for L3 offset regardless of the parse configuration.
- * Default value is ODP_IPSEC_LAYER_NONE.
+ * resulting packet must be checked (at least) up to this level.
+ * Parsing starts from IP (layer 3). Packet metadata from IP to this
+ * layer is set. In addition, offset (and pointer) to the next layer
+ * is set. Other layer/protocol specific metadata have undefined
+ * values.
+ *
+ * Each successfully transformed packet has a valid value for L3 offset
+ * regardless of the parse configuration. Default value is
+ * ODP_IPSEC_LAYER_NONE. ODP_IPSEC_LAYER_L2 is not a valid value.
*/
odp_ipsec_proto_layer_t parse;
@@ -1188,7 +1188,7 @@ typedef struct odp_packet_parse_param_t {
/** Continue parsing until this layer. Must be the same or higher
* layer than the layer of 'proto'. */
- odp_proto_layer_t layer;
+ odp_proto_layer_t last_layer;
/** Flags to control payload data checks up to the selected parse
* layer. Checksum checking status can be queried for each packet with
@@ -1220,19 +1220,21 @@ typedef struct odp_packet_parse_param_t {
/**
* Parse packet
*
- * Parse protocol headers in packet data. Parsing starts at 'offset', which
- * is the first header byte of protocol 'param.proto'. Parameter 'param.layer'
- * defines the last layer application is interested about.
- * Use ODP_PROTO_LAYER_ALL for all layers. A successful operation sets or resets
- * packet metadata for all layers from the layer of 'param.proto' to the
- * application defined last layer. Metadata of other layers have undefined
- * values. When operation fails, metadata of all protocol layers have undefined
- * values.
+ * Parse protocol headers in packet data and update layer/protocol specific
+ * metadata (e.g. offsets, errors, protocols, checksum statuses, etc). Parsing
+ * starts at 'offset', which is the first header byte of protocol 'param.proto'.
+ * Parameter 'param.last_layer' defines the last layer application requests
+ * to check. Use ODP_PROTO_LAYER_ALL for all layers. A successful operation
+ * sets (or resets) packet metadata for all layers from the layer of
+ * 'param.proto' to the application defined last layer. In addition, offset
+ * (and pointer) to the next layer is set. Other layer/protocol specific
+ * metadata have undefined values. When operation fails, all layer/protocol
+ * specific metadata have undefined values.
*
* @param pkt Packet handle
* @param offset Byte offset into the packet
- * @param param Parse parameters. Proto and layer fields must be set. Clear
- * all check bits that are not used.
+ * @param param Parse parameters. Proto and last_layer fields must be set.
+ * Clear all check bits that are not used.
*
* @retval 0 on success
* @retval <0 on failure
@@ -1244,14 +1246,14 @@ int odp_packet_parse(odp_packet_t pkt, uint32_t offset,
* Parse multiple packets
*
* Otherwise like odp_packet_parse(), but parses multiple packets. Packets may
- * have unique offsets, but must start with the same protocol. Also, packets are
- * parsed up to the same protocol layer.
+ * have unique offsets, but must start with the same protocol. The same
+ * parse parameters are applied to all packets.
*
* @param pkt Packet handle array
* @param offset Byte offsets into the packets
* @param num Number of packets and offsets
- * @param param Parse parameters. Proto and layer fields must be set. Clear
- * all check bits that are not used.
+ * @param param Parse parameters. Proto and last_layer fields must be set.
+ * Clear all check bits that are not used.
*
* @return Number of packets parsed successfully (0 ... num)
* @retval <0 on failure
@@ -404,8 +404,13 @@ typedef enum odp_pktio_parser_layer_t {
typedef struct odp_pktio_parser_config_t {
/** Protocol parsing level in packet input
*
- * Parse protocol layers in minimum up to this level during packet
- * input. The default value is ODP_PKTIO_PARSER_LAYER_ALL. */
+ * Application requires that protocol headers in a packet are checked
+ * up to this layer during packet input. Use ODP_PROTO_LAYER_ALL for
+ * all layers. Packet metadata for this and all preceding layers are
+ * set. In addition, offset (and pointer) to the next layer is set.
+ * Other layer/protocol specific metadata have undefined values.
+ *
+ * The default value is ODP_PKTIO_PARSER_LAYER_ALL. */
odp_pktio_parser_layer_t layer;
} odp_pktio_parser_config_t;
@@ -2311,7 +2311,7 @@ int odp_packet_parse(odp_packet_t pkt, uint32_t offset,
uint32_t seg_len;
uint32_t packet_len = pkt_hdr->frame_len;
odp_proto_t proto = param->proto;
- odp_proto_layer_t layer = param->layer;
+ odp_proto_layer_t layer = param->last_layer;
int ret;
uint16_t ethtype;
@@ -2450,7 +2450,7 @@ void packet_test_parse(void)
}
parse.proto = ODP_PROTO_ETH;
- parse.layer = ODP_PROTO_LAYER_ALL;
+ parse.last_layer = ODP_PROTO_LAYER_ALL;
parse.all_check = 0;
CU_ASSERT(odp_packet_parse(pkt[0], offset[0], &parse) == 0);
@@ -2481,7 +2481,7 @@ void packet_test_parse(void)
}
parse.proto = ODP_PROTO_IPV4;
- parse.layer = ODP_PROTO_LAYER_L4;
+ parse.last_layer = ODP_PROTO_LAYER_L4;
parse.all_check = 0;
CU_ASSERT(odp_packet_parse(pkt[0], offset[0], &parse) == 0);
@@ -2511,7 +2511,7 @@ void packet_test_parse(void)
}
parse.proto = ODP_PROTO_ETH;
- parse.layer = ODP_PROTO_LAYER_L4;
+ parse.last_layer = ODP_PROTO_LAYER_L4;
parse.all_check = 0;
CU_ASSERT(odp_packet_parse(pkt[0], offset[0], &parse) == 0);
@@ -2541,7 +2541,7 @@ void packet_test_parse(void)
}
parse.proto = ODP_PROTO_ETH;
- parse.layer = ODP_PROTO_LAYER_L4;
+ parse.last_layer = ODP_PROTO_LAYER_L4;
parse.all_check = 0;
CU_ASSERT(odp_packet_parse(pkt[0], offset[0], &parse) == 0);
@@ -2572,7 +2572,7 @@ void packet_test_parse(void)
}
parse.proto = ODP_PROTO_ETH;
- parse.layer = ODP_PROTO_LAYER_ALL;
+ parse.last_layer = ODP_PROTO_LAYER_ALL;
parse.all_check = 0;
CU_ASSERT(odp_packet_parse(pkt[0], offset[0], &parse) == 0);