gso: fix number of buffers required for segmentation

Type: fix

Change-Id: I73ef0ce81b2d6a799f6a6e59908ec24cc2290a2c
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
diff --git a/src/vnet/gso/node.c b/src/vnet/gso/node.c
index d7248c9..a48a8b6 100644
--- a/src/vnet/gso/node.c
+++ b/src/vnet/gso/node.c
@@ -55,10 +55,11 @@
 tso_alloc_tx_bufs (vlib_main_t * vm,
 		   vnet_interface_per_thread_data_t * ptd,
 		   vlib_buffer_t * b0, u32 n_bytes_b0, u16 l234_sz,
-		   u16 gso_size)
+		   u16 gso_size, gso_header_offset_t * gho)
 {
   u16 size =
-    clib_min (gso_size, vlib_buffer_get_default_data_size (vm) - l234_sz);
+    clib_min (gso_size, vlib_buffer_get_default_data_size (vm) - l234_sz
+	      - gho->l2_hdr_offset);
 
   /* rounded-up division */
   u16 n_bufs = (n_bytes_b0 - l234_sz + (size - 1)) / size;
@@ -170,7 +171,7 @@
   next_tcp_seq += first_data_size;
 
   if (PREDICT_FALSE
-      (!tso_alloc_tx_bufs (vm, ptd, sb0, n_bytes_b0, l234_sz, gso_size)))
+      (!tso_alloc_tx_bufs (vm, ptd, sb0, n_bytes_b0, l234_sz, gso_size, gho)))
     return 0;
 
   vlib_buffer_t *b0 = vlib_get_buffer (vm, ptd->split_buffers[0]);