X-Git-Url: https://gerrit.fd.io/r/gitweb?p=deb_dpdk.git;a=blobdiff_plain;f=examples%2Fserver_node_efd%2Fnode%2Fnode.c;h=5aa1258e1aca364ae7320fa14740c8702c8bec6b;hp=86e57c890c16c619d146db1e57b1d5ec8fd0e0a2;hb=055c52583a2794da8ba1e85a48cce3832372b12f;hpb=f239aed5e674965691846e8ce3f187dd47523689 diff --git a/examples/server_node_efd/node/node.c b/examples/server_node_efd/node/node.c index 86e57c89..5aa1258e 100644 --- a/examples/server_node_efd/node/node.c +++ b/examples/server_node_efd/node/node.c @@ -57,7 +57,6 @@ #include #include #include -#include #include #include #include @@ -77,7 +76,7 @@ static uint8_t node_id; #define MBQ_CAPACITY 32 /* maps input ports to output ports for packets */ -static uint8_t output_ports[RTE_MAX_ETHPORTS]; +static uint16_t output_ports[RTE_MAX_ETHPORTS]; /* buffers up a set of packet that are ready to send */ struct rte_eth_dev_tx_buffer *tx_buffer[RTE_MAX_ETHPORTS]; @@ -154,7 +153,7 @@ static void flush_tx_error_callback(struct rte_mbuf **unsent, uint16_t count, void *userdata) { int i; - uint8_t port_id = (uintptr_t)userdata; + uint16_t port_id = (uintptr_t)userdata; tx_stats->tx_drop[port_id] += count; @@ -165,7 +164,7 @@ flush_tx_error_callback(struct rte_mbuf **unsent, uint16_t count, } static void -configure_tx_buffer(uint8_t port_id, uint16_t size) +configure_tx_buffer(uint16_t port_id, uint16_t size) { int ret; @@ -174,16 +173,17 @@ configure_tx_buffer(uint8_t port_id, uint16_t size) RTE_ETH_TX_BUFFER_SIZE(size), 0, rte_eth_dev_socket_id(port_id)); if (tx_buffer[port_id] == NULL) - rte_exit(EXIT_FAILURE, "Cannot allocate buffer for tx " - "on port %u\n", (unsigned int) port_id); + rte_exit(EXIT_FAILURE, + "Cannot allocate buffer for tx on port %u\n", port_id); rte_eth_tx_buffer_init(tx_buffer[port_id], size); ret = rte_eth_tx_buffer_set_err_callback(tx_buffer[port_id], flush_tx_error_callback, (void *)(intptr_t)port_id); if (ret < 0) - rte_exit(EXIT_FAILURE, "Cannot set error callback for " - "tx buffer on port %u\n", (unsigned int) port_id); + rte_exit(EXIT_FAILURE, + "Cannot set error callback for tx buffer on port %u\n", + port_id); } /* @@ -282,8 +282,8 @@ static inline void transmit_packet(struct rte_mbuf *buf) { int sent; - const uint8_t in_port = buf->port; - const uint8_t out_port = output_ports[in_port]; + const uint16_t in_port = buf->port; + const uint16_t out_port = output_ports[in_port]; struct rte_eth_dev_tx_buffer *buffer = tx_buffer[out_port]; sent = rte_eth_tx_buffer(out_port, node_id, buffer, buf); @@ -381,7 +381,7 @@ main(int argc, char *argv[]) for (;;) { uint16_t rx_pkts = PKT_READ_SIZE; - uint8_t port; + uint16_t port; /* * Try dequeuing max possible packets first, if that fails,