diff mbox series

[ovs-dev,4/5] dp-packet: Include inner offsets in adjustments and checks.

Message ID 20240125214657.734291-4-mkp@redhat.com
State Changes Requested
Headers show
Series [ovs-dev,1/5] dp-packet: Reset offload/offsets when clearing a packet. | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/intel-ovs-compilation fail test: fail
ovsrobot/github-robot-_Build_and_Test success github build: passed

Commit Message

Mike Pattrick Jan. 25, 2024, 9:46 p.m. UTC
Include inner offsets in functions where l3 and l4 offsets are either
modified or checked.

Signed-off-by: Mike Pattrick <mkp@redhat.com>
Fixes: 084c8087292c ("userspace: Support VXLAN and GENEVE TSO.")
---
 lib/dp-packet.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Ilya Maximets Jan. 26, 2024, 2:35 p.m. UTC | #1
On 1/25/24 22:46, Mike Pattrick wrote:
> Include inner offsets in functions where l3 and l4 offsets are either
> modified or checked.
> 
> Signed-off-by: Mike Pattrick <mkp@redhat.com>
> Fixes: 084c8087292c ("userspace: Support VXLAN and GENEVE TSO.")
> ---
>  lib/dp-packet.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/dp-packet.c b/lib/dp-packet.c
> index 0e23c766e..502a102ef 100644
> --- a/lib/dp-packet.c
> +++ b/lib/dp-packet.c
> @@ -507,6 +507,8 @@ dp_packet_resize_l2_5(struct dp_packet *b, int increment)
>      /* Adjust layer offsets after l2_5. */
>      dp_packet_adjust_layer_offset(&b->l3_ofs, increment);
>      dp_packet_adjust_layer_offset(&b->l4_ofs, increment);
> +    dp_packet_adjust_layer_offset(&b->inner_l3_ofs, increment);
> +    dp_packet_adjust_layer_offset(&b->inner_l4_ofs, increment);
>  
>      return dp_packet_data(b);
>  }
> @@ -529,7 +531,9 @@ dp_packet_compare_offsets(struct dp_packet *b1, struct dp_packet *b2,
>      if ((b1->l2_pad_size != b2->l2_pad_size) ||
>          (b1->l2_5_ofs != b2->l2_5_ofs) ||
>          (b1->l3_ofs != b2->l3_ofs) ||
> -        (b1->l4_ofs != b2->l4_ofs)) {
> +        (b1->l4_ofs != b2->l4_ofs) ||
> +        (b1->inner_l3_ofs != b2->inner_l3_ofs) ||
> +        (b1->inner_l4_ofs != b2->inner_l4_ofs)) {
>          if (err_str) {
>              ds_put_format(err_str, "Packet offset comparison failed\n");
>              ds_put_format(err_str, "Buffer 1 offsets: l2_pad_size %u,"

Should print out the difference to the log as well.
diff mbox series

Patch

diff --git a/lib/dp-packet.c b/lib/dp-packet.c
index 0e23c766e..502a102ef 100644
--- a/lib/dp-packet.c
+++ b/lib/dp-packet.c
@@ -507,6 +507,8 @@  dp_packet_resize_l2_5(struct dp_packet *b, int increment)
     /* Adjust layer offsets after l2_5. */
     dp_packet_adjust_layer_offset(&b->l3_ofs, increment);
     dp_packet_adjust_layer_offset(&b->l4_ofs, increment);
+    dp_packet_adjust_layer_offset(&b->inner_l3_ofs, increment);
+    dp_packet_adjust_layer_offset(&b->inner_l4_ofs, increment);
 
     return dp_packet_data(b);
 }
@@ -529,7 +531,9 @@  dp_packet_compare_offsets(struct dp_packet *b1, struct dp_packet *b2,
     if ((b1->l2_pad_size != b2->l2_pad_size) ||
         (b1->l2_5_ofs != b2->l2_5_ofs) ||
         (b1->l3_ofs != b2->l3_ofs) ||
-        (b1->l4_ofs != b2->l4_ofs)) {
+        (b1->l4_ofs != b2->l4_ofs) ||
+        (b1->inner_l3_ofs != b2->inner_l3_ofs) ||
+        (b1->inner_l4_ofs != b2->inner_l4_ofs)) {
         if (err_str) {
             ds_put_format(err_str, "Packet offset comparison failed\n");
             ds_put_format(err_str, "Buffer 1 offsets: l2_pad_size %u,"