<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:DengXian;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"\@DengXian";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
span.EmailStyle19
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">From my experience, inline is used with “static” as a compiler hint.<o:p></o:p></p>
<p class="MsoNormal">In case of a raw inline, which is used by both insert_new_tcp_item()<o:p></o:p></p>
<p class="MsoNormal">and delete_tcp_item() now, it seems you need to provide an external<o:p></o:p></p>
<p class="MsoNormal">one to avoid linking error. But I haven’t used it in this way before.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">If inline is the root cause of window compiler errors, defining the two<o:p></o:p></p>
<p class="MsoNormal">functions as static inline in gro_tcp_internal.h may be a solution.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks,<o:p></o:p></p>
<p class="MsoNormal">Jiayu<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> kumaraparameshwaran rathinavel <kumaraparamesh92@gmail.com>
<br>
<b>Sent:</b> Wednesday, June 14, 2023 11:43 AM<br>
<b>To:</b> Hu, Jiayu <jiayu.hu@intel.com><br>
<b>Cc:</b> dev@dpdk.org<br>
<b>Subject:</b> Re: [PATCH v7] gro : ipv6 changes to support GRO for TCP/ipv6<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">On Tue, Jun 13, 2023 at 7:56 AM Hu, Jiayu <<a href="mailto:jiayu.hu@intel.com">jiayu.hu@intel.com</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal">Hi Kumara,<br>
<br>
Overall, the patch looks good to me. But you need to update the doc and there <br>
are some minor changes needed to be made. Please see replies inline.<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal">Thanks Jiayu. I see some linking errors for windows. It was a for inesert_new_tcp_item which is now in *.c file. Earlier this was inert_new_item in *.h file. The error is that the insert_new_tcp_item function is undefined. Was there a reason
 why it was in a header file earlier ? Just wanted to check with you if you had encountered this before. Will try it on a windows setup as well.
<o:p></o:p></p>
</blockquote>
</blockquote>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal"><br>
After all comments are addressed, you can add "Reviewed-by: Jiayu Hu <<a href="mailto:jiayu.hu@intel.com" target="_blank">jiayu.hu@intel.com</a>>".<br>
<br>
Thanks,<br>
Jiayu<br>
<br>
> -----Original Message-----<br>
> From: Kumara Parameshwaran <<a href="mailto:kumaraparamesh92@gmail.com" target="_blank">kumaraparamesh92@gmail.com</a>><br>
> Sent: Monday, June 12, 2023 7:31 PM<br>
> To: Hu, Jiayu <<a href="mailto:jiayu.hu@intel.com" target="_blank">jiayu.hu@intel.com</a>><br>
> Cc: <a href="mailto:dev@dpdk.org" target="_blank">dev@dpdk.org</a>; Kumara Parameshwaran<br>
> <<a href="mailto:kumaraparamesh92@gmail.com" target="_blank">kumaraparamesh92@gmail.com</a>><br>
> Subject: [PATCH v7] gro : ipv6 changes to support GRO for TCP/ipv6<br>
> <br>
> The patch adds GRO support for TCP/ipv6 packets. This does not include the<br>
> support for vxlan, udp ipv6 packets.<br>
> <br>
> Signed-off-by: Kumara Parameshwaran <<a href="mailto:kumaraparamesh92@gmail.com" target="_blank">kumaraparamesh92@gmail.com</a>><br>
> ---<br>
> v1:<br>
>       * Changes to support GRO for TCP/ipv6 packets. This does not<br>
> include<br>
>         vxlan changes.<br>
>       * The GRO is performed only for ipv6 packets that does not contain<br>
>        extension headers.<br>
>       * The logic for the TCP coalescing remains the same, in ipv6 header<br>
>         the source address, destination address, flow label, version fields<br>
>         are expected to be the same.<br>
>       * Re-organised the code to reuse certain tcp functions for both ipv4<br>
> and<br>
>         ipv6 flows.<br>
> v2:<br>
>       * Fix comments in gro_tcp6.h header file.<br>
> <br>
> v3:<br>
>       * Adderess review comments to fix code duplication for v4 and v6<br>
> <br>
> v4:<br>
>       * Addresses review comments for v3, do not use callbacks<br>
> <br>
> v5:<br>
>       * Address review comments<br>
> <br>
> v6:<br>
>       * Fix warning and coding style issues<br>
> <br>
> v7:<br>
>       * Fix build compilation issue<br>
>  lib/gro/gro_tcp4.c         | 178 ++++++-------------------<br>
>  lib/gro/gro_tcp4.h         | 170 +----------------------<br>
>  lib/gro/gro_tcp6.c         | 267 +++++++++++++++++++++++++++++++++++++<br>
>  lib/gro/gro_tcp6.h         | 161 ++++++++++++++++++++++<br>
>  lib/gro/gro_tcp_internal.c | 128 ++++++++++++++++++<br>
> lib/gro/gro_tcp_internal.h | 212 +++++++++++++++++++++++++++++<br>
>  lib/gro/gro_vxlan_tcp4.c   |  23 ++--<br>
>  lib/gro/gro_vxlan_tcp4.h   |   3 +-<br>
>  lib/gro/meson.build        |   2 +<br>
>  lib/gro/rte_gro.c          |  83 ++++++++++--<br>
>  lib/gro/rte_gro.h          |   3 +<br>
>  11 files changed, 897 insertions(+), 333 deletions(-)  create mode 100644<br>
> lib/gro/gro_tcp6.c  create mode 100644 lib/gro/gro_tcp6.h  create mode<br>
> 100644 lib/gro/gro_tcp_internal.c  create mode 100644<br>
> lib/gro/gro_tcp_internal.h<br>
> <br>
> diff --git a/lib/gro/gro_tcp4.c b/lib/gro/gro_tcp4.c index<br>
> 0014096e63..42fee78f30 100644<br>
> --- a/lib/gro/gro_tcp4.c<br>
> +++ b/lib/gro/gro_tcp4.c<br>
> -<br>
>  int32_t<br>
>  gro_tcp4_reassemble(struct rte_mbuf *pkt,<br>
>               struct gro_tcp4_tbl *tbl,<br>
> @@ -202,9 +122,8 @@ gro_tcp4_reassemble(struct rte_mbuf *pkt,<br>
>       uint8_t is_atomic;<br>
> <br>
>       struct tcp4_flow_key key;<br>
> -     uint32_t cur_idx, prev_idx, item_idx;<br>
> +     uint32_t item_idx;<br>
>       uint32_t i, max_flow_num, remaining_flow_num;<br>
> -     int cmp;<br>
>       uint8_t find;<br>
> <br>
>       /*<br>
> @@ -216,7 +135,7 @@ gro_tcp4_reassemble(struct rte_mbuf *pkt,<br>
> <br>
>       eth_hdr = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *);<br>
>       ipv4_hdr = (struct rte_ipv4_hdr *)((char *)eth_hdr + pkt->l2_len);<br>
> -     tcp_hdr = (struct rte_tcp_hdr *)((char *)ipv4_hdr + pkt->l3_len);<br>
> +     tcp_hdr = rte_pktmbuf_mtod_offset(pkt, struct rte_tcp_hdr *,<br>
> +pkt->l2_len + pkt->l3_len);<br>
<br>
No need to change the method to obtain tcp_hdr.<br>
<br>
>       hdr_len = pkt->l2_len + pkt->l3_len + pkt->l4_len;<br>
> <br>
>       /*<br>
> @@ -230,7 +149,6 @@ gro_tcp4_reassemble(struct rte_mbuf *pkt,<br>
>       ip_tlen = rte_be_to_cpu_16(ipv4_hdr->total_length);<br>
>       if (pkt->pkt_len > (uint32_t)(ip_tlen + pkt->l2_len))<br>
>               rte_pktmbuf_trim(pkt, pkt->pkt_len - ip_tlen - pkt->l2_len);<br>
> -<br>
No need to delete the blank line.<br>
<br>
>       /*<br>
>        * Don't process the packet whose payload length is less than or<br>
>        * equal to 0.<br>
> @@ -239,6 +157,13 @@ gro_tcp4_reassemble(struct rte_mbuf *pkt,<br>
>       if (tcp_dl <= 0)<br>
>               return -1;<br>
> <br>
> +     rte_ether_addr_copy(&(eth_hdr->src_addr),<br>
> &(key.cmn_key.eth_saddr));<br>
> +     rte_ether_addr_copy(&(eth_hdr->dst_addr),<br>
> &(key.cmn_key.eth_daddr));<br>
> +     key.ip_src_addr = ipv4_hdr->src_addr;<br>
> +     key.ip_dst_addr = ipv4_hdr->dst_addr;<br>
> +     key.cmn_key.src_port = tcp_hdr->src_port;<br>
> +     key.cmn_key.dst_port = tcp_hdr->dst_port;<br>
> +     key.cmn_key.recv_ack = tcp_hdr->recv_ack;<br>
<br>
Add a blank line between key.cmn_key.recv_ack assignment and annotation.<br>
<br>
>       /*<br>
>        * Save IPv4 ID for the packet whose DF bit is 0. For the packet<br>
>        * whose DF bit is 1, IPv4 ID is ignored.<br>
> @@ -246,15 +171,6 @@ gro_tcp4_reassemble(struct rte_mbuf *pkt,<br>
>       frag_off = rte_be_to_cpu_16(ipv4_hdr->fragment_offset);<br>
>       is_atomic = (frag_off & RTE_IPV4_HDR_DF_FLAG) ==<br>
> RTE_IPV4_HDR_DF_FLAG;<br>
>       ip_id = is_atomic ? 0 : rte_be_to_cpu_16(ipv4_hdr->packet_id);<br>
> -     sent_seq = rte_be_to_cpu_32(tcp_hdr->sent_seq);<br>
> -<br>
> -     rte_ether_addr_copy(&(eth_hdr->src_addr), &(key.eth_saddr));<br>
> -     rte_ether_addr_copy(&(eth_hdr->dst_addr), &(key.eth_daddr));<br>
> -     key.ip_src_addr = ipv4_hdr->src_addr;<br>
> -     key.ip_dst_addr = ipv4_hdr->dst_addr;<br>
> -     key.src_port = tcp_hdr->src_port;<br>
> -     key.dst_port = tcp_hdr->dst_port;<br>
> -     key.recv_ack = tcp_hdr->recv_ack;<br>
> <br>
>       /* Search for a matched flow. */<br>
>       max_flow_num = tbl->max_flow_num;<br>
> @@ -270,63 +186,44 @@ gro_tcp4_reassemble(struct rte_mbuf *pkt,<br>
>               }<br>
>       }<br>
> <br>
> -     /*<br>
> -      * Fail to find a matched flow. Insert a new flow and store the<br>
> -      * packet into the flow.<br>
> -      */<br>
>       if (find == 0) {<br>
> -             item_idx = insert_new_item(tbl, pkt, start_time,<br>
> -                             INVALID_ARRAY_INDEX, sent_seq, ip_id,<br>
> -                             is_atomic);<br>
> +             sent_seq = rte_be_to_cpu_32(tcp_hdr->sent_seq);<br>
> +             item_idx = insert_new_tcp_item(pkt, tbl->items, &tbl-<br>
> >item_num,<br>
> +                                             tbl->max_item_num,<br>
> start_time,<br>
> +                                             INVALID_ARRAY_INDEX,<br>
> sent_seq, ip_id,<br>
> +                                             is_atomic);<br>
>               if (item_idx == INVALID_ARRAY_INDEX)<br>
>                       return -1;<br>
>               if (insert_new_flow(tbl, &key, item_idx) ==<br>
> -                             INVALID_ARRAY_INDEX) {<br>
> +                     INVALID_ARRAY_INDEX) {<br>
>                       /*<br>
>                        * Fail to insert a new flow, so delete the<br>
>                        * stored packet.<br>
> -                      */<br>
> -                     delete_item(tbl, item_idx, INVALID_ARRAY_INDEX);<br>
> +                     */<br>
> +                     delete_tcp_item(tbl->items, item_idx, &tbl-<br>
> >item_num,<br>
> +INVALID_ARRAY_INDEX);<br>
>                       return -1;<br>
>               }<br>
>               return 0;<br>
>       }<br>
> <br>
> -     /*<br>
> -      * Check all packets in the flow and try to find a neighbor for<br>
> -      * the input packet.<br>
> -      */<br>
> -     cur_idx = tbl->flows[i].start_index;<br>
> -     prev_idx = cur_idx;<br>
> -     do {<br>
> -             cmp = check_seq_option(&(tbl->items[cur_idx]), tcp_hdr,<br>
> -                             sent_seq, ip_id, pkt->l4_len, tcp_dl, 0,<br>
> -                             is_atomic);<br>
> -             if (cmp) {<br>
> -                     if (merge_two_tcp4_packets(&(tbl->items[cur_idx]),<br>
> -                                             pkt, cmp, sent_seq, ip_id, 0))<br>
> -                             return 1;<br>
> -                     /*<br>
> -                      * Fail to merge the two packets, as the packet<br>
> -                      * length is greater than the max value. Store<br>
> -                      * the packet into the flow.<br>
> -                      */<br>
> -                     if (insert_new_item(tbl, pkt, start_time, cur_idx,<br>
> -                                             sent_seq, ip_id, is_atomic) ==<br>
> -                                     INVALID_ARRAY_INDEX)<br>
> -                             return -1;<br>
> -                     return 0;<br>
> -             }<br>
> -             prev_idx = cur_idx;<br>
> -             cur_idx = tbl->items[cur_idx].next_pkt_idx;<br>
> -     } while (cur_idx != INVALID_ARRAY_INDEX);<br>
> +     return process_tcp_item(pkt, tcp_hdr, tcp_dl, tbl->items, tbl-<br>
> >flows[i].start_index,<br>
> +                                             &tbl->item_num, tbl-<br>
> >max_item_num,<br>
> +                                             ip_id, is_atomic, start_time);<br>
> +}<br>
> <br>
> -     /* Fail to find a neighbor, so store the packet into the flow. */<br>
> -     if (insert_new_item(tbl, pkt, start_time, prev_idx, sent_seq,<br>
> -                             ip_id, is_atomic) == INVALID_ARRAY_INDEX)<br>
> -             return -1;<br>
> +/*<br>
> + * update the packet length for the flushed packet.<br>
> + */<br>
> +static inline void<br>
> +update_header(struct gro_tcp_item *item) {<br>
> +     struct rte_ipv4_hdr *ipv4_hdr;<br>
> +     struct rte_mbuf *pkt = item->firstseg;<br>
> <br>
> -     return 0;<br>
> +     ipv4_hdr = (struct rte_ipv4_hdr *)(rte_pktmbuf_mtod(pkt, char *) +<br>
> +                     pkt->l2_len);<br>
> +     ipv4_hdr->total_length = rte_cpu_to_be_16(pkt->pkt_len -<br>
> +                     pkt->l2_len);<br>
>  }<br>
> <br>
>  uint16_t<br>
> @@ -353,7 +250,8 @@ gro_tcp4_tbl_timeout_flush(struct gro_tcp4_tbl *tbl,<br>
>                                * Delete the packet and get the next<br>
>                                * packet in the flow.<br>
>                                */<br>
> -                             j = delete_item(tbl, j, INVALID_ARRAY_INDEX);<br>
> +                             j = delete_tcp_item(tbl->items, j,<br>
> +                                                     &tbl->item_num,<br>
> INVALID_ARRAY_INDEX);<br>
>                               tbl->flows[i].start_index = j;<br>
>                               if (j == INVALID_ARRAY_INDEX)<br>
>                                       tbl->flow_num--;<br>
> diff --git a/lib/gro/gro_tcp4.h b/lib/gro/gro_tcp4.h index<br>
> 212f97a042..c0154afa24 100644<br>
> --- a/lib/gro/gro_tcp4.h<br>
> +++ b/lib/gro/gro_tcp4.h<br>
> @@ -5,32 +5,15 @@<br>
>  #ifndef _GRO_TCP4_H_<br>
>  #define _GRO_TCP4_H_<br>
> <br>
> -#include <rte_tcp.h><br>
> +#include <gro_tcp_internal.h><br>
<br>
Use "#include "gro_tcp_internal.h"".<br>
<br>
> <br>
> -#define INVALID_ARRAY_INDEX 0xffffffffUL  #define<br>
> GRO_TCP4_TBL_MAX_ITEM_NUM (1024UL * 1024UL)<br>
> <br>
> diff --git a/lib/gro/gro_tcp6.c b/lib/gro/gro_tcp6.c new file mode 100644<br>
> index 0000000000..0ea73741c1<br>
> --- /dev/null<br>
> +++ b/lib/gro/gro_tcp6.c<br>
> @@ -0,0 +1,267 @@<br>
> +/* SPDX-License-Identifier: BSD-3-Clause<br>
> + * Copyright(c) 2017 Intel Corporation<br>
> + */<br>
<br>
The license header is incorrect, and please update. Same and similar issue happens<br>
in the new added files, like gro_tcp_internal.h.<br>
<br>
> +<br>
> diff --git a/lib/gro/gro_tcp6.h b/lib/gro/gro_tcp6.h new file mode 100644<br>
> index 0000000000..cc02b0004a<br>
> --- /dev/null<br>
> +++ b/lib/gro/gro_tcp6.h<br>
> @@ -0,0 +1,161 @@<br>
> +/* SPDX-License-Identifier: BSD-3-Clause<br>
> + * Copyright(c) 2017 Intel Corporation<br>
> + */<br>
<br>
Ditto.<br>
<br>
> +<br>
> +#ifndef _GRO_TCP6_H_<br>
> +#define _GRO_TCP6_H_<br>
> +<br>
> +#include <gro_tcp_internal.h><br>
<br>
Use "#include "gro_tcp_internal.h"".<br>
<br>
> +<br>
> +#define INVALID_ARRAY_INDEX 0xffffffffUL #define<br>
<br>
Duplicate definition for INVALID_ARRAY_INDEX in both gro_tcp6.h<br>
and gro_tcp_internal.h.<br>
<br>
> +GRO_TCP6_TBL_MAX_ITEM_NUM (1024UL * 1024UL)<br>
> +<br>
> +/* Header fields representing a TCP/IPv6 flow */ struct tcp6_flow_key {<br>
> +     struct cmn_tcp_key cmn_key;<br>
> +     uint8_t  src_addr[16];<br>
> +     uint8_t  dst_addr[16];<br>
> +     rte_be32_t vtc_flow;<br>
> +};<br>
> +<br>
> diff --git a/lib/gro/gro_tcp_internal.c b/lib/gro/gro_tcp_internal.c new file<br>
> mode 100644 index 0000000000..5a21bca7f8<br>
> --- /dev/null<br>
> +++ b/lib/gro/gro_tcp_internal.c<br>
> @@ -0,0 +1,128 @@<br>
> +/* SPDX-License-Identifier: BSD-3-Clause<br>
> + * Copyright(c) 2017 Intel Corporation<br>
> + */<br>
<br>
Update license header.<br>
<br>
> +#include <rte_malloc.h><br>
> +#include <rte_mbuf.h><br>
> +#include <rte_ethdev.h><br>
> +<br>
> +#include "gro_tcp_internal.h"<br>
> +<br>
> diff --git a/lib/gro/gro_tcp_internal.h b/lib/gro/gro_tcp_internal.h new file<br>
> mode 100644 index 0000000000..072b7aea13<br>
> --- /dev/null<br>
> +++ b/lib/gro/gro_tcp_internal.h<br>
> @@ -0,0 +1,212 @@<br>
> +#ifndef _GRO_TCP_H_<br>
> +#define _GRO_TCP_H_<br>
> +<br>
<br>
Add license header in this file.<br>
<br>
> +#define INVALID_ARRAY_INDEX 0xffffffffUL<br>
> +<br>
> +#include <rte_tcp.h><br>
> +<br>
> +/*<br>
> + * The max length of a IPv4 packet, which includes the length of the L3<br>
> + * header, the L4 header and the data payload.<br>
> + */<br>
> +#define MAX_IP_PKT_LENGTH UINT16_MAX<br>
> +<br>
> +/* The maximum TCP header length */<br>
> +#define MAX_TCP_HLEN 60<br>
> +#define INVALID_TCP_HDRLEN(len) \<br>
> +     (((len) < sizeof(struct rte_tcp_hdr)) || ((len) > MAX_TCP_HLEN))<br>
> +<br>
> +/*<br>
> + * Check if two TCP/IPv4 packets are neighbors.<br>
> + */<br>
<br>
This function is not only for TCP4, so use "Check if two TCP packets are neighbors".<br>
<br>
> +static inline int<br>
> +check_seq_option(struct gro_tcp_item *item,<br>
> +             struct rte_tcp_hdr *tcph,<br>
> +             uint32_t sent_seq,<br>
> +             uint16_t ip_id,<br>
> +             uint16_t tcp_hl,<br>
> +             uint16_t tcp_dl,<br>
> +             uint16_t l2_offset,<br>
> +             uint8_t is_atomic)<br>
> +{<br>
> +     struct rte_mbuf *pkt_orig = item->firstseg;<br>
> +     char *iph_orig;<br>
> +     struct rte_tcp_hdr *tcph_orig;<br>
> +     uint16_t len, tcp_hl_orig;<br>
> +<br>
> +     iph_orig = (char *)(rte_pktmbuf_mtod(pkt_orig, char *) +<br>
> +                     l2_offset + pkt_orig->l2_len);<br>
> +     tcph_orig = (struct rte_tcp_hdr *)(iph_orig + pkt_orig->l3_len);<br>
> +     tcp_hl_orig = pkt_orig->l4_len;<br>
> +<br>
> +     /* Check if TCP option fields equal */<br>
> +     len = RTE_MAX(tcp_hl, tcp_hl_orig) - sizeof(struct rte_tcp_hdr);<br>
> +     if ((tcp_hl != tcp_hl_orig) || ((len > 0) &&<br>
> +                             (memcmp(tcph + 1, tcph_orig + 1,<br>
> +                                     len) != 0)))<br>
> +             return 0;<br>
> +<br>
> +     /* Don't merge packets whose DF bits are different */<br>
> +     if (unlikely(item->is_atomic ^ is_atomic))<br>
> +             return 0;<br>
> +<br>
> +     /* check if the two packets are neighbors */<br>
> +     len = pkt_orig->pkt_len - l2_offset - pkt_orig->l2_len -<br>
> +             pkt_orig->l3_len - tcp_hl_orig;<br>
> +     if ((sent_seq == item->sent_seq + len) && (is_atomic ||<br>
> +                             (ip_id == item->l3.ip_id + 1)))<br>
> +             /* append the new packet */<br>
> +             return 1;<br>
> +     else if ((sent_seq + tcp_dl == item->sent_seq) && (is_atomic ||<br>
> +                             (ip_id + item->nb_merged == item->l3.ip_id)))<br>
> +             /* pre-pend the new packet */<br>
> +             return -1;<br>
> +<br>
> +     return 0;<br>
> +}<br>
> +<br>
> +static inline int<br>
> +is_common_tcp_key(struct cmn_tcp_key *k1, struct cmn_tcp_key *k2) {<br>
<br>
Rename it to "is_same_common_tcp_key()"?<br>
<br>
> +     return (!memcmp(k1, k2, sizeof(struct cmn_tcp_key))); }<br>
> +<br>
> +#endif<o:p></o:p></p>
</blockquote>
</div>
</div>
</div>
</div>
</body>
</html>