diff mbox

[ovs-dev] dp-packet: use dp_packet_reset_offsets during initialisation

Message ID 1448949789-16076-1-git-send-email-simon.horman@netronome.com
State Accepted
Headers show

Commit Message

Simon Horman Dec. 1, 2015, 6:03 a.m. UTC
Use dp_packet_reset_offsets() in dp_packet_init__() to make it
clearer that initialisation includes a reset of packets
packets the same way as callers to dp_packet_reset_offsets() reset packets.

Signed-off-by: Simon Horman <simon.horman@netronome.com>
---
 lib/dp-packet.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Thadeu Lima de Souza Cascardo Dec. 1, 2015, 4:32 p.m. UTC | #1
On Tue, Dec 01, 2015 at 03:03:09PM +0900, Simon Horman wrote:
> Use dp_packet_reset_offsets() in dp_packet_init__() to make it
> clearer that initialisation includes a reset of packets
> packets the same way as callers to dp_packet_reset_offsets() reset packets.
> 
> Signed-off-by: Simon Horman <simon.horman@netronome.com>
> ---
>  lib/dp-packet.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/lib/dp-packet.c b/lib/dp-packet.c
> index 098f816563bd..1d166e15cf6c 100644
> --- a/lib/dp-packet.c
> +++ b/lib/dp-packet.c
> @@ -27,8 +27,7 @@ dp_packet_init__(struct dp_packet *b, size_t allocated, enum dp_packet_source so
>  {
>      dp_packet_set_allocated(b, allocated);
>      b->source = source;
> -    b->l2_pad_size = 0;
> -    b->l2_5_ofs = b->l3_ofs = b->l4_ofs = UINT16_MAX;
> +    dp_packet_reset_offsets(b);
>      pkt_metadata_init(&b->md, 0);
>  }
>  
> -- 
> 2.1.4

Acked-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
Ben Pfaff Dec. 1, 2015, 6:28 p.m. UTC | #2
On Tue, Dec 01, 2015 at 03:03:09PM +0900, Simon Horman wrote:
> Use dp_packet_reset_offsets() in dp_packet_init__() to make it
> clearer that initialisation includes a reset of packets
> packets the same way as callers to dp_packet_reset_offsets() reset packets.
> 
> Signed-off-by: Simon Horman <simon.horman@netronome.com>

Thanks Simon, applied.
diff mbox

Patch

diff --git a/lib/dp-packet.c b/lib/dp-packet.c
index 098f816563bd..1d166e15cf6c 100644
--- a/lib/dp-packet.c
+++ b/lib/dp-packet.c
@@ -27,8 +27,7 @@  dp_packet_init__(struct dp_packet *b, size_t allocated, enum dp_packet_source so
 {
     dp_packet_set_allocated(b, allocated);
     b->source = source;
-    b->l2_pad_size = 0;
-    b->l2_5_ofs = b->l3_ofs = b->l4_ofs = UINT16_MAX;
+    dp_packet_reset_offsets(b);
     pkt_metadata_init(&b->md, 0);
 }