Skip to content

Commit

Permalink
Merge "AT&T Juniper Case 2019-0211-0762, HIGH -P2 , Contrail Networki…
Browse files Browse the repository at this point in the history
…ng, Contrail Network Policy Mirror Action not working-DPA2a Issue fixed by creating a new memory buffer and chained to existing memory buffer. Backported DPDK checksum from latest release to support mbuf chaining. Closes-jira-bug: JCB-219327 Merged from commit: https://review.opencontrail.org/#/c/50219/"
  • Loading branch information
Zuul v3 CI authored and opencontrail-ci-admin committed Apr 26, 2019
2 parents 41eb69c + 94c402c commit 698dc5c
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion dpdk/vr_dpdk_host.c
Expand Up @@ -824,6 +824,7 @@ dpdk_pcow(struct vr_packet **pktp, unsigned short head_room)
struct rte_mbuf *mbuf = vr_dpdk_pkt_to_mbuf(pkt);
struct rte_mbuf *m_copy;
struct vr_packet *p_copy;
struct rte_mbuf *mbuf_new;

/*
* If this is an indirect mbuf, allocate a new mbuf and copy
Expand All @@ -845,7 +846,26 @@ dpdk_pcow(struct vr_packet **pktp, unsigned short head_room)
}

if (head_room > rte_pktmbuf_headroom(mbuf)) {
return -ENOMEM;

/* When requested headroom is higher than configured pktmuf_headroom,
* Create a new memory buffer and link to the old mbuf */
mbuf_new = rte_pktmbuf_alloc(vr_dpdk.rss_mempool);
if (!mbuf_new) {
return -ENOMEM;
}

pkt = vr_dpdk_packet_get(mbuf_new, pkt->vp_if);
if(!pkt)
return -ENOMEM;

mbuf_new->next = mbuf;
mbuf_new->nb_segs++;
mbuf_new->ol_flags = mbuf->ol_flags;
mbuf_new->data_off += head_room;
mbuf_new->pkt_len += mbuf->data_len;

pkt->vp_data = mbuf_new->data_off;
*pktp = pkt;
}

return 0;
Expand Down

0 comments on commit 698dc5c

Please sign in to comment.