Hi Stephen, On Thu, Jun 29, 2017 at 10:51:50AM -0700, Stephen Hemminger wrote: > On Thu, 29 Jun 2017 18:58:59 +0800 > Jiayu Hu <jiayu...@intel.com> 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?
The reason why I try to use the min value is to reduce the overhead of array initialization. But I ignore the clang issue. Thanks for your reminder. I will replace it with the max value. > > > + > > + 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. Thanks, I will modify it. BRs, Jiayu