From: Stephen Hemminger <stephen@networkplumber.org>
To: Shailja Pandey <csz168117@iitd.ac.in>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] How to update the sequence number in TCP packets using DPDK-pktgen?
Date: Tue, 10 Oct 2017 16:00:00 -0700 [thread overview]
Message-ID: <20171010160000.348d2930@shemminger-XPS-13-9360> (raw)
In-Reply-To: <c8dde074-7192-e7dd-b8b8-857f370e4649@iitd.ac.in>
On Mon, 9 Oct 2017 19:12:49 +0530
Shailja Pandey <csz168117@iitd.ac.in> wrote:
> pktgen_tcp_hdr_ctor(pkt_seq_t *pkt, tcpip_t *tip, int type __rte_unused)
> {
> uint16_t tlen;
>
> /* Zero out the header space */
> memset((char *)tip, 0, sizeof(tcpip_t));
>
> /* Create the TCP header */
> tip->ip.src = 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 = (tcpi_ip_t) {
.ip.src = htonl(pkt->ip_src_addr.addr.ipv4_saddr),
...
};
next prev parent reply other threads:[~2017-10-10 23:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-09 13:42 Shailja Pandey
2017-10-09 17:12 ` Wiles, Keith
2017-10-10 23:00 ` Stephen Hemminger [this message]
2017-10-11 0:10 ` Wiles, Keith
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171010160000.348d2930@shemminger-XPS-13-9360 \
--to=stephen@networkplumber.org \
--cc=csz168117@iitd.ac.in \
--cc=dev@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).