Skip to content

Commit

Permalink
Merge "DPDK: fix KNI kernel crash for indirect mbufs"
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Feb 10, 2016
2 parents 60334bc + 1aca6b9 commit 426c31c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion dpdk/vr_dpdk_knidev.c
Expand Up @@ -227,7 +227,11 @@ dpdk_knidev_writer_tx(void *port, struct rte_mbuf *pkt)
* So we make sure the packet is from the RSS mempool. If not, we make
* a copy to the RSS mempool.
*/
if (unlikely(pkt->pool != vr_dpdk.rss_mempool)) {
if (unlikely(pkt->pool != vr_dpdk.rss_mempool ||
/* Check indirect mbuf's data is within the RSS mempool. */
rte_pktmbuf_mtod(pkt, uintptr_t) < vr_dpdk.rss_mempool->elt_va_start ||
rte_pktmbuf_mtod(pkt, uintptr_t) > vr_dpdk.rss_mempool->elt_va_end
)) {
pkt_copy = vr_dpdk_pktmbuf_copy(pkt, vr_dpdk.rss_mempool);
/* The original mbuf is no longer needed. */
vr_dpdk_pfree(pkt, VP_DROP_CLONED_ORIGINAL);
Expand Down

0 comments on commit 426c31c

Please sign in to comment.