summaryrefslogtreecommitdiffstats
path: root/src/vnet/ip
diff options
context:
space:
mode:
authorMohsin Kazmi <sykazmi@cisco.com>2019-12-03 18:56:26 +0100
committerAndrew Yourtchenko <ayourtch@gmail.com>2019-12-04 15:54:48 +0000
commit3f5594d89f583d12c0fcf586f2c3c7e2b008ea7d (patch)
tree034075745cdadd0ffa46da95ae8c7df6acd87229 /src/vnet/ip
parentdeb268febb3a06102f55259e57c54f0e02b1613e (diff)
gso: remove the interface count
Type: refactor Change-Id: I51405b9d09fb6fb03d08569369fdd4e11c647908 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Diffstat (limited to 'src/vnet/ip')
-rw-r--r--src/vnet/ip/ip4_forward.c22
-rw-r--r--src/vnet/ip/ip6_forward.c20
2 files changed, 13 insertions, 29 deletions
diff --git a/src/vnet/ip/ip4_forward.c b/src/vnet/ip/ip4_forward.c
index a67b0618f86..bb036c8e969 100644
--- a/src/vnet/ip/ip4_forward.c
+++ b/src/vnet/ip/ip4_forward.c
@@ -2394,8 +2394,7 @@ always_inline uword
ip4_rewrite_inline_with_gso (vlib_main_t * vm,
vlib_node_runtime_t * node,
vlib_frame_t * frame,
- int do_counters, int is_midchain, int is_mcast,
- int do_gso)
+ int do_counters, int is_midchain, int is_mcast)
{
ip_lookup_main_t *lm = &ip4_main.lookup_main;
u32 *from = vlib_frame_vector_args (frame);
@@ -2477,9 +2476,9 @@ ip4_rewrite_inline_with_gso (vlib_main_t * vm,
u16 ip0_len = clib_net_to_host_u16 (ip0->length);
u16 ip1_len = clib_net_to_host_u16 (ip1->length);
- if (do_gso && (b[0]->flags & VNET_BUFFER_F_GSO))
+ if (b[0]->flags & VNET_BUFFER_F_GSO)
ip0_len = gso_mtu_sz (b[0]);
- if (do_gso && (b[1]->flags & VNET_BUFFER_F_GSO))
+ if (b[1]->flags & VNET_BUFFER_F_GSO)
ip1_len = gso_mtu_sz (b[1]);
ip4_mtu_check (b[0], ip0_len,
@@ -2653,7 +2652,7 @@ ip4_rewrite_inline_with_gso (vlib_main_t * vm,
/* Check MTU of outgoing interface. */
u16 ip0_len = clib_net_to_host_u16 (ip0->length);
- if (do_gso && (b[0]->flags & VNET_BUFFER_F_GSO))
+ if (b[0]->flags & VNET_BUFFER_F_GSO)
ip0_len = gso_mtu_sz (b[0]);
ip4_mtu_check (b[0], ip0_len,
@@ -2751,7 +2750,7 @@ ip4_rewrite_inline_with_gso (vlib_main_t * vm,
/* Check MTU of outgoing interface. */
u16 ip0_len = clib_net_to_host_u16 (ip0->length);
- if (do_gso && (b[0]->flags & VNET_BUFFER_F_GSO))
+ if (b[0]->flags & VNET_BUFFER_F_GSO)
ip0_len = gso_mtu_sz (b[0]);
ip4_mtu_check (b[0], ip0_len,
@@ -2833,15 +2832,8 @@ ip4_rewrite_inline (vlib_main_t * vm,
vlib_frame_t * frame,
int do_counters, int is_midchain, int is_mcast)
{
- vnet_main_t *vnm = vnet_get_main ();
- if (PREDICT_FALSE (vnm->interface_main.gso_interface_count > 0))
- return ip4_rewrite_inline_with_gso (vm, node, frame, do_counters,
- is_midchain, is_mcast,
- 1 /* do_gso */ );
- else
- return ip4_rewrite_inline_with_gso (vm, node, frame, do_counters,
- is_midchain, is_mcast,
- 0 /* no do_gso */ );
+ return ip4_rewrite_inline_with_gso (vm, node, frame, do_counters,
+ is_midchain, is_mcast);
}
diff --git a/src/vnet/ip/ip6_forward.c b/src/vnet/ip/ip6_forward.c
index acf650189dd..ae7083ba27b 100644
--- a/src/vnet/ip/ip6_forward.c
+++ b/src/vnet/ip/ip6_forward.c
@@ -1680,8 +1680,7 @@ always_inline uword
ip6_rewrite_inline_with_gso (vlib_main_t * vm,
vlib_node_runtime_t * node,
vlib_frame_t * frame,
- int do_counters, int is_midchain, int is_mcast,
- int do_gso)
+ int do_counters, int is_midchain, int is_mcast)
{
ip_lookup_main_t *lm = &ip6_main.lookup_main;
u32 *from = vlib_frame_vector_args (frame);
@@ -1833,9 +1832,9 @@ ip6_rewrite_inline_with_gso (vlib_main_t * vm,
u16 ip1_len =
clib_net_to_host_u16 (ip1->payload_length) +
sizeof (ip6_header_t);
- if (do_gso && (p0->flags & VNET_BUFFER_F_GSO))
+ if (p0->flags & VNET_BUFFER_F_GSO)
ip0_len = gso_mtu_sz (p0);
- if (do_gso && (p1->flags & VNET_BUFFER_F_GSO))
+ if (p1->flags & VNET_BUFFER_F_GSO)
ip1_len = gso_mtu_sz (p1);
@@ -2010,7 +2009,7 @@ ip6_rewrite_inline_with_gso (vlib_main_t * vm,
u16 ip0_len =
clib_net_to_host_u16 (ip0->payload_length) +
sizeof (ip6_header_t);
- if (do_gso && (p0->flags & VNET_BUFFER_F_GSO))
+ if (p0->flags & VNET_BUFFER_F_GSO)
ip0_len = gso_mtu_sz (p0);
ip6_mtu_check (p0, ip0_len,
@@ -2081,15 +2080,8 @@ ip6_rewrite_inline (vlib_main_t * vm,
vlib_frame_t * frame,
int do_counters, int is_midchain, int is_mcast)
{
- vnet_main_t *vnm = vnet_get_main ();
- if (PREDICT_FALSE (vnm->interface_main.gso_interface_count > 0))
- return ip6_rewrite_inline_with_gso (vm, node, frame, do_counters,
- is_midchain, is_mcast,
- 1 /* do_gso */ );
- else
- return ip6_rewrite_inline_with_gso (vm, node, frame, do_counters,
- is_midchain, is_mcast,
- 0 /* no do_gso */ );
+ return ip6_rewrite_inline_with_gso (vm, node, frame, do_counters,
+ is_midchain, is_mcast);
}
VLIB_NODE_FN (ip6_rewrite_node) (vlib_main_t * vm,