src/dpdk/lib/librte_ipsec/esp_inb.c
static inline int32_t
trs_process_check(struct rte_mbuf *mb, struct rte_mbuf **ml,
	uint32_t *tofs, struct rte_esp_tail espt, uint32_t hlen, uint32_t tlen)
{
	if ((mb->ol_flags & PKT_RX_SEC_OFFLOAD_FAILED) != 0 ||
			tlen + hlen > mb->pkt_len)
		return -EBADMSG;

	/* padding bytes are spread over multiple segments */
	if (tofs[0] < espt.pad_len) {
		tofs[0] = mb->pkt_len - tlen;
		ml[0] = mbuf_get_seg_ofs(mb, tofs);
	} else
		tofs[0] -= espt.pad_len;

	return check_pad_bytes(ml[0], tofs[0], espt.pad_len);
}
/*
 * packet checks for transport mode:
 * - no reported IPsec related failures in ol_flags
 * - tail and header lengths are valid
 * - padding bytes are valid
 * apart from checks, function also updates tail offset (and segment)
 * by taking into account pad length.
 */
packet checks for transport mode:
- no reported IPsec related failures in ol_flags
- tail and header lengths are valid
- padding bytes are valid
apart from checks, function also updates tail offset (and segment)
by taking into account pad length.
packet checks for transport mode : - no reported IPsec related failures in ol_flags - tail and header lengths are valid - padding bytes are valid apart from checks function also updates tail offset ( and segment ) by taking into account pad length .
static inline int32_t
trs_process_check(struct rte_mbuf *mb, struct rte_mbuf **ml,
	uint32_t *tofs, struct rte_esp_tail espt, uint32_t hlen, uint32_t tlen)
{
	if ((mb->ol_flags & PKT_RX_SEC_OFFLOAD_FAILED) != 0 ||
			tlen + hlen > mb->pkt_len)
		return -EBADMSG;
	if (tofs[0] < espt.pad_len) {
		tofs[0] = mb->pkt_len - tlen;
		ml[0] = mbuf_get_seg_ofs(mb, tofs);
	} else
		tofs[0] -= espt.pad_len;
	return check_pad_bytes(ml[0], tofs[0], espt.pad_len);
}
static inline int32_t trs_process_check ( struct rte_mbuf * mb , struct rte_mbuf * * ml , uint32_t * tofs , struct rte_esp_tail espt , uint32_t hlen , uint32_t tlen ) { if ( ( mb -> ol_flags & PKT_RX_SEC_OFFLOAD_FAILED ) != 0 || tlen + hlen > mb -> pkt_len ) return - EBADMSG ; if ( tofs [ 0 ] < espt . pad_len ) { tofs [ 0 ] = mb -> pkt_len - tlen ; ml [ 0 ] = mbuf_get_seg_ofs ( mb , tofs ) ; } else tofs [ 0 ] -= espt . pad_len ; return check_pad_bytes ( ml [ 0 ] , tofs [ 0 ] , espt . pad_len ) ; }
packet checks for transport mode:
 - no reported IPsec related failures in ol_flags
 - tail and header lengths are valid
 - padding bytes are valid
 apart from checks, function also updates tail offset (and segment)
 by taking into account pad length.
packet checks for transport mode : - no reported IPsec related failures in ol_flags - tail and header lengths are valid - padding bytes are valid apart from checks function also updates tail offset ( and segment ) by taking into account pad length .
/* padding bytes are spread over multiple segments */