X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=doc%2Fguides%2Fsample_app_ug%2Fflow_filtering.rst;h=5e5a6cd8a07dd13df97d10522b3c1224434e2ae5;hb=5a2ab34d81c2bd07539ae7cb5167498617909d42;hp=9dba85acff605f7e6b7add4ad2a932717aead243;hpb=d67b3f11d352544063fbdf2a8232563d88870d6a;p=dpdk.git diff --git a/doc/guides/sample_app_ug/flow_filtering.rst b/doc/guides/sample_app_ug/flow_filtering.rst index 9dba85acff..5e5a6cd8a0 100644 --- a/doc/guides/sample_app_ug/flow_filtering.rst +++ b/doc/guides/sample_app_ug/flow_filtering.rst @@ -26,7 +26,7 @@ Set the target, for example: .. code-block:: console - export RTE_TARGET=x86_64-native-linuxapp-gcc + export RTE_TARGET=x86_64-native-linux-gcc See the *DPDK Getting Started* Guide for possible ``RTE_TARGET`` values. @@ -40,7 +40,7 @@ Build the application as follows: Running the Application ----------------------- -To run the example in a ``linuxapp`` environment: +To run the example in a ``linux`` environment: .. code-block:: console @@ -193,7 +193,13 @@ application is shown below: } } - rte_eth_promiscuous_enable(port_id); + ret = rte_eth_promiscuous_enable(port_id); + if (ret != 0) { + rte_exit(EXIT_FAILURE, + ":: cannot enable promiscuous mode: err=%d, port=%u\n", + ret, port_id); + } + ret = rte_eth_dev_start(port_id); if (ret < 0) { rte_exit(EXIT_FAILURE, @@ -278,7 +284,12 @@ We are setting the RX port to promiscuous mode: .. code-block:: c - rte_eth_promiscuous_enable(port_id); + ret = rte_eth_promiscuous_enable(port_id); + if (ret != 0) { + rte_exit(EXIT_FAILURE, + ":: cannot enable promiscuous mode: err=%d, port=%u\n", + ret, port_id); + } The last step is to start the port. @@ -304,7 +315,7 @@ looks like the following: main_loop(void) { struct rte_mbuf *mbufs[32]; - struct ether_hdr *eth_hdr; + struct rte_ether_hdr *eth_hdr; uint16_t nb_rx; uint16_t i; uint16_t j; @@ -318,7 +329,7 @@ looks like the following: struct rte_mbuf *m = mbufs[j]; eth_hdr = rte_pktmbuf_mtod(m, - struct ether_hdr *); + struct rte_ether_hdr *); print_ether_addr("src=", ð_hdr->s_addr); print_ether_addr(" - dst=", @@ -348,7 +359,7 @@ queues and printing for each packet the destination queue: if (nb_rx) { for (j = 0; j < nb_rx; j++) { struct rte_mbuf *m = mbufs[j]; - eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *); + eth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *); print_ether_addr("src=", ð_hdr->s_addr); print_ether_addr(" - dst=", ð_hdr->d_addr); printf(" - queue=0x%x", (unsigned int)i); @@ -502,4 +513,3 @@ The last part of the function is to validate the rule and create it. int res = rte_flow_validate(port_id, &attr, pattern, action, &error); if (!res) flow = rte_flow_create(port_id, &attr, pattern, action, &error); -