> On Oct 10, 2017, at 6:00 PM, Stephen Hemminger <[email protected]>
> wrote:
>
> On Mon, 9 Oct 2017 19:12:49 +0530
> Shailja Pandey <[email protected]> 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