Message ID | 1497850143-3116-2-git-send-email-qdy220091330@gmail.com |
---|---|
State | Deferred |
Headers | show |
>From: Michael Qiu [mailto:qdy220091330@gmail.com] >Sent: Monday, June 19, 2017 6:29 AM >To: dev@openvswitch.org >Cc: Kavanagh, Mark B <mark.b.kavanagh@intel.com>; blp@ovn.org; dball@vmware.com; Michael Qiu ><qiudayu@chinac.com> >Subject: [PATCH 1/5] lib/dp-packet: init the mbuf to zero when build with DPDK > >From: Michael Qiu <qiudayu@chinac.com> > >When building with DPDK, and using xmalloc() to get a new packet, >field mbuf of the packet will not be initialized, but it's very important for >DPDK port when copying the data to DPDK mbuf, because if ol_flags >and other info are random values, DPDK driver may hang. > >Signed-off-by: Michael Qiu <qiudayu@chinac.com> Hi Michael, Thanks for the updated version of the patchset. This patch LGTM - I also compiled this with gcc, clang, and sparse without issue. Checkpatch reports no obvious problems either. Acked-by: Mark Kavanagh <mark.b.kavanagh@intel.com Cheers, Mark >--- > lib/dp-packet.c | 3 +++ > 1 file changed, 3 insertions(+) > >diff --git a/lib/dp-packet.c b/lib/dp-packet.c >index 67aa406..ee2c449 100644 >--- a/lib/dp-packet.c >+++ b/lib/dp-packet.c >@@ -134,6 +134,9 @@ struct dp_packet * > dp_packet_new(size_t size) > { > struct dp_packet *b = xmalloc(sizeof *b); >+#ifdef DPDK_NETDEV >+ memset(&(b->mbuf), 0, sizeof(struct rte_mbuf)); >+#endif > dp_packet_init(b, size); > return b; > } >-- >1.8.3.1
diff --git a/lib/dp-packet.c b/lib/dp-packet.c index 67aa406..ee2c449 100644 --- a/lib/dp-packet.c +++ b/lib/dp-packet.c @@ -134,6 +134,9 @@ struct dp_packet * dp_packet_new(size_t size) { struct dp_packet *b = xmalloc(sizeof *b); +#ifdef DPDK_NETDEV + memset(&(b->mbuf), 0, sizeof(struct rte_mbuf)); +#endif dp_packet_init(b, size); return b; }