[dpdk-dev] [PATCH v8 2/3] lib/gro: add TCP/IPv4 GRO support

Stephen Hemminger stephen at networkplumber.org
Thu Jun 29 19:51:50 CEST 2017


On Thu, 29 Jun 2017 18:58:59 +0800
Jiayu Hu <jiayu.hu at 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?

> +
> +	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.


More information about the dev mailing list