/* Copy meta-data from input jumbo packet to its fragments */
for (i = 0; i < p->n_frags; i++) {
- uint8_t *src = RTE_MBUF_METADATA_UINT8_PTR(pkt, 0);
+ uint8_t *src =
+ RTE_MBUF_METADATA_UINT8_PTR(pkt, sizeof(struct rte_mbuf));
uint8_t *dst =
- RTE_MBUF_METADATA_UINT8_PTR(p->frags[i], 0);
+ RTE_MBUF_METADATA_UINT8_PTR(p->frags[i], sizeof(struct rte_mbuf));
memcpy(dst, src, p->metadata_size);
}
port->tx_burst_sz = conf->tx_burst_sz;
port->tx_buf_count = 0;
- port->f_ras = (is_ipv4 == 0) ? process_ipv4 : process_ipv6;
+ port->f_ras = (is_ipv4 == 1) ? process_ipv4 : process_ipv6;
return port;
}
/* Assume there is no ethernet header */
struct ipv4_hdr *pkt_hdr = rte_pktmbuf_mtod(pkt, struct ipv4_hdr *);
- /* Get "Do not fragment" flag and fragment offset */
+ /* Get "More fragments" flag and fragment offset */
uint16_t frag_field = rte_be_to_cpu_16(pkt_hdr->fragment_offset);
uint16_t frag_offset = (uint16_t)(frag_field & IPV4_HDR_OFFSET_MASK);
uint16_t frag_flag = (uint16_t)(frag_field & IPV4_HDR_MF_FLAG);
struct rte_ip_frag_tbl *tbl = p->frag_tbl;
struct rte_ip_frag_death_row *dr = &p->death_row;
+ pkt->l3_len = sizeof(*pkt_hdr);
+
/* Process this fragment */
mo = rte_ipv4_frag_reassemble_packet(tbl, dr, pkt, rte_rdtsc(),
pkt_hdr);
struct rte_ip_frag_tbl *tbl = p->frag_tbl;
struct rte_ip_frag_death_row *dr = &p->death_row;
+ pkt->l3_len = sizeof(*pkt_hdr) + sizeof(*frag_hdr);
+
/* Process this fragment */
mo = rte_ipv6_frag_reassemble_packet(tbl, dr, pkt, rte_rdtsc(), pkt_hdr,
frag_hdr);