X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=doc%2Fguides%2Fprog_guide%2Fgeneric_receive_offload_lib.rst;h=5b3fb91c8c050cfa3bcdf2fabdee997d5164bafb;hb=a57a71f9ffa81cf70219e36c0fc488d290038e61;hp=1652e648b71d0eb2dd654ebed252d626e33028f1;hpb=1e4cf4d6d4fb9786d2b0772867f2158ac90f55d6;p=dpdk.git diff --git a/doc/guides/prog_guide/generic_receive_offload_lib.rst b/doc/guides/prog_guide/generic_receive_offload_lib.rst index 1652e648b7..5b3fb91c8c 100644 --- a/doc/guides/prog_guide/generic_receive_offload_lib.rst +++ b/doc/guides/prog_guide/generic_receive_offload_lib.rst @@ -1,32 +1,5 @@ -.. BSD LICENSE - Copyright(c) 2017 Intel Corporation. All rights reserved. - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - * Neither the name of Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.. SPDX-License-Identifier: BSD-3-Clause + Copyright(c) 2017 Intel Corporation. Generic Receive Offload Library =============================== @@ -54,10 +27,12 @@ corresponding GRO functions by MBUF->packet_type. The GRO library doesn't check if input packets have correct checksums and doesn't re-calculate checksums for merged packets. The GRO library assumes the packets are complete (i.e., MF==0 && frag_off==0), when IP -fragmentation is possible (i.e., DF==0). Additionally, it requires IPv4 -ID to be increased by one. +fragmentation is possible (i.e., DF==0). Additionally, it complies RFC +6864 to process the IPv4 ID field. -Currently, the GRO library provides GRO supports for TCP/IPv4 packets. +Currently, the GRO library provides GRO supports for TCP/IPv4 packets and +VxLAN packets which contain an outer IPv4 header and an inner TCP/IPv4 +packet. Two Sets of API --------------- @@ -108,7 +83,8 @@ Reassembly Algorithm The reassembly algorithm is used for reassembling packets. In the GRO library, different GRO types can use different algorithms. In this -section, we will introduce an algorithm, which is used by TCP/IPv4 GRO. +section, we will introduce an algorithm, which is used by TCP/IPv4 GRO +and VxLAN GRO. Challenges ~~~~~~~~~~ @@ -182,4 +158,55 @@ Header fields deciding if two packets are neighbors include: - TCP sequence number -- IPv4 ID. The IPv4 ID fields of the packets should be increased by 1. +- IPv4 ID. The IPv4 ID fields of the packets, whose DF bit is 0, should + be increased by 1. + +VxLAN GRO +--------- + +The table structure used by VxLAN GRO, which is in charge of processing +VxLAN packets with an outer IPv4 header and inner TCP/IPv4 packet, is +similar with that of TCP/IPv4 GRO. Differently, the header fields used +to define a VxLAN flow include: + +- outer source and destination: Ethernet and IP address, UDP port + +- VxLAN header (VNI and flag) + +- inner source and destination: Ethernet and IP address, TCP port + +Header fields deciding if packets are neighbors include: + +- outer IPv4 ID. The IPv4 ID fields of the packets, whose DF bit in the + outer IPv4 header is 0, should be increased by 1. + +- inner TCP sequence number + +- inner IPv4 ID. The IPv4 ID fields of the packets, whose DF bit in the + inner IPv4 header is 0, should be increased by 1. + +.. note:: + We comply RFC 6864 to process the IPv4 ID field. Specifically, + we check IPv4 ID fields for the packets whose DF bit is 0 and + ignore IPv4 ID fields for the packets whose DF bit is 1. + Additionally, packets which have different value of DF bit can't + be merged. + +GRO Library Limitations +----------------------- + +- GRO library uses MBUF->l2_len/l3_len/l4_len/outer_l2_len/ + outer_l3_len/packet_type to get protocol headers for the + input packet, rather than parsing the packet header. Therefore, + before call GRO APIs to merge packets, user applications + must set MBUF->l2_len/l3_len/l4_len/outer_l2_len/outer_l3_len/ + packet_type to the same values as the protocol headers of the + packet. + +- GRO library doesn't support to process the packets with IPv4 + Options or VLAN tagged. + +- GRO library just supports to process the packet organized + in a single MBUF. If the input packet consists of multiple + MBUFs (i.e. chained MBUFs), GRO reassembly behaviors are + unknown.