From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH v5 2/3] lib/gro: add TCP/IPv4 GRO support Date: Tue, 20 Jun 2017 16:55:15 -0700 Message-ID: <20170620165515.1e4387cd@xeon-e3> References: <1496833731-53653-1-git-send-email-jiayu.hu@intel.com> <1497770469-16661-1-git-send-email-jiayu.hu@intel.com> <1497770469-16661-3-git-send-email-jiayu.hu@intel.com> <20fd3a2c-9b61-2732-5a34-5acb8fc639a0@intel.com> <20170620032220.GB12728@localhost.localdomain> <21e9e28b-ba41-b88d-1f9a-b022b0d2c5ce@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Jiayu Hu , dev@dpdk.org, konstantin.ananyev@intel.com, yliu@fridaylinux.org, keith.wiles@intel.com, tiwei.bie@intel.com, lei.a.yao@intel.com To: "Tan, Jianfeng" Return-path: Received: from mail-pg0-f52.google.com (mail-pg0-f52.google.com [74.125.83.52]) by dpdk.org (Postfix) with ESMTP id 293C93256 for ; Wed, 21 Jun 2017 01:55:23 +0200 (CEST) Received: by mail-pg0-f52.google.com with SMTP id u62so50095900pgb.3 for ; Tue, 20 Jun 2017 16:55:22 -0700 (PDT) In-Reply-To: <21e9e28b-ba41-b88d-1f9a-b022b0d2c5ce@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Wed, 21 Jun 2017 07:30:08 +0800 "Tan, Jianfeng" wrote: > >>> To process an incoming packet, we need three steps: > >>> a. check if the packet should be processed. Packets with the following > >>> properties won't be processed: > >>> - packets without data; > >>> - packets with wrong checksums; > >> Why do we care to check this kind of error? Can we just suppose the > >> applications have already dropped the packets with wrong cksum? > > Indeed, if we assume all inputted packets are correct, we can avoid > > checksum checking overhead. But as a library, I think a more flexible > > way is to enable applications to tell GRO API if checksum checking > > is needed. For example, we can add a flag to struct rte_gro_tbl > > and struct rte_gro_param, which indicates if the checksum checking > > is needed. If applications set this flag, reassembly function won't > > check packet checksum. Otherwise, we check the checksum. How do you > > think? > > My opinion is to keep the library focusing on what it does, and make > clear its dependency. This flag thing will differ for different GRO > engines, which makes it a little complicated to me. As long as it is documented behavior. GIGO is fine. IMHO a well designed library does as little as possible and nothing more.