From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f170.google.com (mail-pf0-f170.google.com [209.85.192.170]) by dpdk.org (Postfix) with ESMTP id 3A45A1B2E0 for ; Wed, 11 Oct 2017 01:00:03 +0200 (CEST) Received: by mail-pf0-f170.google.com with SMTP id n73so89024pfg.10 for ; Tue, 10 Oct 2017 16:00:03 -0700 (PDT) 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=EHV8q3+yMeLCqXOhsax+vuAQeF+YqkuxK5nr+NX3k6E=; b=a4/bbkcFs9dtTt/jkzmUy55+YMt8NJ0yF6wFOxGysr4thx7FnkXiV/LIyY4SpLLkN5 9wjKjvYO47BetZba4oZy12mlf0RvyyOS9zbTUsdvdpSwCEJGv8bNvU7h48OFnvn3CBlx wq+ceFOqB3C+hgDyzv8g2BLGpTzsbxLzMKIkNNpsAQiPbEFB/IsFvLkyHLfbX7DFlTKy nkoy1Z24k/i/ft/XiXXJDwlcOzv5kuO7HZ7yGFrYpV8rygIvybyY39oFLFwF1Kb9QssS h6u4hjTLk31rgEoXmaUDFuFsToGWb5PGbl94RcrZJt01HD3m08cs7Tm0QN3tHEIOLe+T tEKg== 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=EHV8q3+yMeLCqXOhsax+vuAQeF+YqkuxK5nr+NX3k6E=; b=XMMsRrZMUeMMuAgMgYWKPbnZbxk3NftGRlMdqPQRnnBapSX7lkNe8R2Bp5SVGXD0Dv QxWPRW2kKid3OxpkbPhJ1hsoF8T91jALsKSTv2MkjIPoXxK8qg9O++oPZNX8DvsxLr51 TV4qbrHwe4mSpzl230dysi65VoBC5g2PhHFo7BYlebaZy7pnhvvDng3Hm3DEExRKqKiQ TeKmfKJ2+pT8zNKNn2VOpF7gOwOJ1i2L5hn5HXVuy1HUPx1Umhgy63EWp6+fNtQ0yfIv Qo8Aga9rdE7IHMcnHbi+3n/2pAAxlEtNtsqF/hgBDIUssUmgng1dDyTRSIAVycznEB1b 4nkQ== X-Gm-Message-State: AMCzsaVnmNyrhUl86CWiLMkVaNa4SrCz0aPKA4so8k0g+bLnQFFzNxX6 mDMi87DS4A8omF5RqNLYyitATAJlVVY= X-Google-Smtp-Source: AOwi7QBfaHSyGCqhOGQrSJqyzxbeWKD4U4spDsjt97C3HJASE3Io+XZvEf7CQJ2LOhP44VE0Uj2ZgQ== X-Received: by 10.84.136.1 with SMTP id 1mr13292020plk.101.1507676402476; Tue, 10 Oct 2017 16:00:02 -0700 (PDT) Received: from shemminger-XPS-13-9360 (76-14-207-240.or.wavecable.com. [76.14.207.240]) by smtp.gmail.com with ESMTPSA id o22sm9702447pfi.85.2017.10.10.16.00.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Oct 2017 16:00:02 -0700 (PDT) Date: Tue, 10 Oct 2017 16:00:00 -0700 From: Stephen Hemminger To: Shailja Pandey Cc: dev@dpdk.org Message-ID: <20171010160000.348d2930@shemminger-XPS-13-9360> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [dpdk-dev] How to update the sequence number in TCP packets using DPDK-pktgen? 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: Tue, 10 Oct 2017 23:00:03 -0000 On Mon, 9 Oct 2017 19:12:49 +0530 Shailja Pandey wrote: > pktgen_tcp_hdr_ctor(pkt_seq_t *pkt, tcpip_t *tip, int type __rte_unused) > { > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 uint16_t tlen; >=20 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* Zero out the header space = */ > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 memset((char *)tip, 0, sizeof= (tcpip_t)); >=20 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* Create the TCP header */ > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 tip->ip.src=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D htonl(pkt-> FYI memset is a performance hit. Gcc generates a rep string instruction which slows down CPU.. Better to do either set all fields individually or fill in the pad values by doing structure assignment. *tip =3D (tcpi_ip_t) { .ip.src =3D htonl(pkt->ip_src_addr.addr.ipv4_saddr), ... };