[dpdk-dev] How to update the sequence number in TCP packets using DPDK-pktgen?

Wiles, Keith keith.wiles at intel.com
Wed Oct 11 02:10:23 CEST 2017



> On Oct 10, 2017, at 6:00 PM, Stephen Hemminger <stephen at networkplumber.org> wrote:
> 
> On Mon, 9 Oct 2017 19:12:49 +0530
> Shailja Pandey <csz168117 at 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.

Thanks for the info, will try and find some time to update pktgen.

> 
> 	*tip = (tcpi_ip_t) {
> 		.ip.src = htonl(pkt->ip_src_addr.addr.ipv4_saddr),
> 	...
> 	};
> 

Regards,
Keith



More information about the dev mailing list