From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH v8 2/3] lib/gro: add TCP/IPv4 GRO support Date: Thu, 29 Jun 2017 10:51:50 -0700 Message-ID: <20170629105150.74b8bf88@xeon-e3> References: <1498459430-116048-1-git-send-email-jiayu.hu@intel.com> <1498733940-117800-1-git-send-email-jiayu.hu@intel.com> <1498733940-117800-3-git-send-email-jiayu.hu@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org, konstantin.ananyev@intel.com, jianfeng.tan@intel.com, yliu@fridaylinux.org, jingjing.wu@intel.com, tiwei.bie@intel.com, lei.a.yao@intel.com To: Jiayu Hu Return-path: Received: from mail-pg0-f53.google.com (mail-pg0-f53.google.com [74.125.83.53]) by dpdk.org (Postfix) with ESMTP id DDEA658EC for ; Thu, 29 Jun 2017 19:51:53 +0200 (CEST) Received: by mail-pg0-f53.google.com with SMTP id f127so51365724pgc.0 for ; Thu, 29 Jun 2017 10:51:53 -0700 (PDT) In-Reply-To: <1498733940-117800-3-git-send-email-jiayu.hu@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 Thu, 29 Jun 2017 18:58:59 +0800 Jiayu Hu wrote: > + /* allocate a reassembly table for TCP/IPv4 GRO */ > + uint32_t tcp_item_num = RTE_MIN(item_num, > + RTE_GRO_MAX_BURST_ITEM_NUM); > + struct gro_tcp_tbl tcp_tbl; > + struct gro_tcp_key tcp_keys[tcp_item_num]; > + struct gro_tcp_item tcp_items[tcp_item_num]; Variable size structures on stack were not supported by CLANG, last time I checked. Why not always max size? > + > + struct rte_mbuf *unprocess_pkts[nb_pkts]; > + uint16_t unprocess_num = 0; > + int32_t ret; > + uint64_t current_time; > + > + if ((param->desired_gro_types & RTE_GRO_TCP_IPV4) == 0) > + return nb_pkts; > + > + memset(tcp_keys, 0, sizeof(struct gro_tcp_key) * > + tcp_item_num); > + memset(tcp_items, 0, sizeof(struct gro_tcp_item) * > + tcp_item_num); Variable size memset's are slow. They generate 'rep; stoz' last I checked in GCC and because of rep instruction it kills multi-execution pipeline.