From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f174.google.com (mail-pf0-f174.google.com [209.85.192.174]) by dpdk.org (Postfix) with ESMTP id CDBCC1C00 for ; Wed, 6 Dec 2017 19:12:05 +0100 (CET) Received: by mail-pf0-f174.google.com with SMTP id c204so2599008pfc.13 for ; Wed, 06 Dec 2017 10:12:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1M3vwvENz9EeV7BTNxK8kzqTHOoqfUCaHFl3Fs89Emc=; b=N+kganmcB5txX0mSMc0Qm2YmsFDyt0AQIEeyxXHbigYzSVr309S7Ykbc39hgEQ7D9O cmo0/z/RIx5EJrL5NaPlQNppFnmEmCM9gAkAV8HBUBUR/tkWZMiJCNLxeymDLddKA8Rs aSqFK4OZZHR0dwBlJjZGDTATmUIOQQwIujO3ERb3yNl5uc4W/Pjqrdeuz1/2GOPuMjpS RQDg4SbUKabXspXfZjdH2tYLdAoOz3+cLyZtkF/Egzi4NfPpjOKDXUs+6j6Y6A3C2aWK Y9WhvUJkiB1pUj5bH0dTnjGGYqCv1zf9bPOnex/ndPpuu/gJP4tYikycaN9YY+QH/mXQ sNKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1M3vwvENz9EeV7BTNxK8kzqTHOoqfUCaHFl3Fs89Emc=; b=uZucWXrooQVdT1BS3sKQr6pIs2qwrYYZL5gOWjkrlJRvE7F7xrniM/xy1aNHnTZaZj GE8Lv7TQAZH0cMY68x07vG5t2hqQKLW8duNoAtYRwsuBkwABylJV1NS/Uybu44u3hiMc 1CcXV504CAXFOe8Y97V867JdFECiJn2Dl8ehDb7TsZPHJm+pYAVcvf8sCbXe0Ag2CMFy sQ0ae5p7OZThG6GZppq1dxzLHmHkPRzVxE927ksGOobKgCVBp2gXZYTV0ipLVDOXkLGI 34mx5YUWiCuI5ih5A99UEtEbEBD6cGeqIprHoM7FFQo6qPzSxF3o4R3EAIBJFDFDkaN9 EXqg== X-Gm-Message-State: AJaThX58CBvnLGMdBeGtjSk05M9kCehpMrHaE+6uxUnvZjgfwXcMj+TA AkUCHYdC+iL5gLpUYkfs2IgLrg== X-Google-Smtp-Source: AGs4zMZFZO6w6nNVs7cC5n1WdKizwy+laNenhfox7Cf3v5GKf3XX2lc+DVFGhVJJZK0+NEazqiTrKw== X-Received: by 10.99.98.67 with SMTP id w64mr22405892pgb.213.1512583924645; Wed, 06 Dec 2017 10:12:04 -0800 (PST) Received: from shemminger-XPS-13-9360 (50-255-97-155-static.hfc.comcastbusiness.net. [50.255.97.155]) by smtp.gmail.com with ESMTPSA id s14sm5559539pfe.36.2017.12.06.10.12.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 06 Dec 2017 10:12:04 -0800 (PST) Date: Wed, 6 Dec 2017 10:12:00 -0800 From: Stephen Hemminger To: Ilya Matveychikov Cc: dev@dpdk.org, jiayu.hu@intel.com Message-ID: <20171206101200.031afa39@shemminger-XPS-13-9360> In-Reply-To: <4F9781B2-338C-4154-BDA1-BC24D1B2B689@gmail.com> References: <4F9781B2-338C-4154-BDA1-BC24D1B2B689@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] A question about GRO neighbor packet matching X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Dec 2017 18:12:06 -0000 On Wed, 6 Dec 2017 18:02:21 +0400 Ilya Matveychikov wrote: > Hello all, > > > My question is about neighbor packet matching algorithm for TCP. Is it > correct to expect that IP packets should have continuous ID enumeration > (i.e. iph-next.id = iph-prev.id + 1)? No. > ~~~ > lib/librte_gro/gro_tcp4.c:check_seq_option() > ... > /* check if the two packets are neighbors */ > tcp_dl0 = pkt0->pkt_len - pkt0->l2_len - pkt0->l3_len - tcp_hl0; > if ((sent_seq == (item->sent_seq + tcp_dl0)) && > (ip_id == (item->ip_id + 1))) > /* append the new packet */ > return 1; > else if (((sent_seq + tcp_dl) == item->sent_seq) && > ((ip_id + item->nb_merged) == item->ip_id)) > /* pre-pend the new packet */ > return -1; > else > return 0; > ~~~ > > As per RFC791: > > Identification: 16 bits > > An identifying value assigned by the sender to aid in assembling the > fragments of a datagram. The IP header id is meaningless in most TCP sessions. Good TCP implementations use PMTU discovery which sets the Don't Fragment bit. With DF, the IP id is unused (since no fragmentation). Many implementations just send 0 since generating unique IP id requires an atomic operation which is potential bottleneck.