diff mbox

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

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

Commit Message

Zoltan Kiss March 19, 2015, 7:13 p.m. UTC
For odp_packet_push_tail

Signed-off-by: Zoltan Kiss <zoltan.kiss@linaro.org>
---
 lib/netdev-odp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Maxim Uvarov March 20, 2015, 3:41 p.m. UTC | #1
On 03/19/15 22:13, Zoltan Kiss wrote:
> For odp_packet_push_tail
>
> Signed-off-by: Zoltan Kiss <zoltan.kiss@linaro.org>
> ---
>   lib/netdev-odp.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/lib/netdev-odp.c b/lib/netdev-odp.c
> index 4b13bfe..87f6ec4 100644
> --- a/lib/netdev-odp.c
> +++ b/lib/netdev-odp.c
> @@ -329,7 +329,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 (!odp_packet_push_tail(pkt, size))
odp_unlikely() is good to be here.

Maxim.
> +            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++;
Zoltan Kiss March 20, 2015, 4:44 p.m. UTC | #2
On 20/03/15 15:41, Maxim Uvarov wrote:
> On 03/19/15 22:13, Zoltan Kiss wrote:
>> For odp_packet_push_tail
>>
>> Signed-off-by: Zoltan Kiss <zoltan.kiss@linaro.org>
>> ---
>>   lib/netdev-odp.c | 3 ++-
>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/lib/netdev-odp.c b/lib/netdev-odp.c
>> index 4b13bfe..87f6ec4 100644
>> --- a/lib/netdev-odp.c
>> +++ b/lib/netdev-odp.c
>> @@ -329,7 +329,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 (!odp_packet_push_tail(pkt, size))
> odp_unlikely() is good to be here.
Ok
>
> Maxim.
>> +            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++;
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
diff mbox

Patch

diff --git a/lib/netdev-odp.c b/lib/netdev-odp.c
index 4b13bfe..87f6ec4 100644
--- a/lib/netdev-odp.c
+++ b/lib/netdev-odp.c
@@ -329,7 +329,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 (!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++;