diff mbox

[v2,5/6] netdev-odp: add error checking to clone_pkts

Message ID 1427397805-27395-6-git-send-email-zoltan.kiss@linaro.org
State New
Headers show

Commit Message

Zoltan Kiss March 26, 2015, 7:23 p.m. UTC
For odp_packet_push_tail

Signed-off-by: Zoltan Kiss <zoltan.kiss@linaro.org>
---
v2: add OVS_UNLIKELY

 lib/netdev-odp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/lib/netdev-odp.c b/lib/netdev-odp.c
index b77eea0..fa325faa 100644
--- a/lib/netdev-odp.c
+++ b/lib/netdev-odp.c
@@ -326,7 +326,8 @@  clone_pkts(struct netdev_odp *dev, struct dpif_packet **pkts,
 
         odp_packet_l2_offset_set(pkt, 0);
 
-        odp_packet_push_tail(pkt, size);
+        if (OVS_UNLIKELY(!odp_packet_push_tail(pkt, size)))
+            VLOG_WARN_RL(&rl, "Can't push tail with %lu", size);
         odp_packet_copydata_in(pkt, 0, size, ofpbuf_data(&pkts[i]->ofpbuf));
         odp_pkts[newcnt] = pkt;
         newcnt++;