On Mon, 9 Oct 2017 19:12:49 +0530 Shailja Pandey <csz168...@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), ... };