X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fdpdk_qat%2Fmain.c;h=a96119cde5e620cbd0b8f13917541407642823ac;hb=c281019bfb01fdd1865a3ac029497184ac72dfc8;hp=c66a8cca5bdfb7e9e618b4a441c9ed95c4342a67;hpb=824cb29c0e7b8a2b3ed285546c3a39a8e0b3cd44;p=dpdk.git diff --git a/examples/dpdk_qat/main.c b/examples/dpdk_qat/main.c index c66a8cca5b..a96119cde5 100644 --- a/examples/dpdk_qat/main.c +++ b/examples/dpdk_qat/main.c @@ -62,7 +62,6 @@ #include #include #include -#include #include #include #include @@ -325,8 +324,9 @@ main_loop(__attribute__((unused)) void *dummy) continue; /* Send packet to either QAT encrypt, QAT decrypt or NIC TX */ if (pkt_from_nic_rx) { - struct ipv4_hdr *ip = (struct ipv4_hdr *) (rte_pktmbuf_mtod(pkt, unsigned char *) + - sizeof(struct ether_hdr)); + struct ipv4_hdr *ip = rte_pktmbuf_mtod_offset(pkt, + struct ipv4_hdr *, + sizeof(struct ether_hdr)); if (ip->src_addr & rte_cpu_to_be_32(ACTION_ENCRYPT)) { if (CRYPTO_RESULT_FAIL == crypto_encrypt(pkt, (enum cipher_alg)((ip->src_addr >> 16) & 0xFF), @@ -582,7 +582,7 @@ parse_args(int argc, char **argv) argv[optind-1] = prgname; ret = optind-1; - optind = 0; /* reset getopt lib */ + optind = 1; /* reset getopt lib */ return ret; } @@ -660,8 +660,6 @@ main(int argc, char **argv) return -1; nb_ports = rte_eth_dev_count(); - if (nb_ports > RTE_MAX_ETHPORTS) - nb_ports = RTE_MAX_ETHPORTS; if (check_port_config(nb_ports) < 0) rte_panic("check_port_config failed\n");