Message ID | 1407250445-8940-1-git-send-email-venkatesh.vivekanandan@linaro.org |
---|---|
State | Accepted |
Commit | e9e7bc237086d6d07dc004e591063838a12563ed |
Headers | show |
Merged, thanks! Maxim. On 08/05/2014 06:54 PM, venkatesh.vivekanandan@linaro.org wrote: > From: Venkatesh Vivekanandan <venkatesh.vivekanandan@linaro.org> > > - Multi queue support per interface is enabled. > - odp_pktio_send with "0" packet is called in odp_pktio_recv to > give the transmitted buffers back to mempool. > - mbuf alloc failure during receive is fixed by giving more buffers to > mempool. > - mempool cache size is given equivalent to MAX_PKT_BURST. > > Signed-off-by: Venkatesh Vivekanandan <venkatesh.vivekanandan@linaro.org> > --- > platform/linux-dpdk/include/odp_packet_dpdk.h | 24 +++++ > platform/linux-dpdk/odp_buffer_pool.c | 4 +- > platform/linux-dpdk/odp_packet_dpdk.c | 136 +++++++++++++------------- > platform/linux-dpdk/odp_packet_io.c | 2 + > 4 files changed, 94 insertions(+), 72 deletions(-) > > diff --git a/platform/linux-dpdk/include/odp_packet_dpdk.h b/platform/linux-dpdk/include/odp_packet_dpdk.h > index bcbe9e8..bcf9aa5 100644 > --- a/platform/linux-dpdk/include/odp_packet_dpdk.h > +++ b/platform/linux-dpdk/include/odp_packet_dpdk.h > @@ -50,6 +50,30 @@ > > #define DPDK_BLOCKING_IO > > +/* > + * RX and TX Prefetch, Host, and Write-back threshold values should be > + * carefully set for optimal performance. Consult the network > + * controller's datasheet and supporting DPDK documentation for guidance > + * on how these parameters should be set. > + */ > +#define RX_PTHRESH 8 /**< Default values of RX prefetch threshold reg. */ > +#define RX_HTHRESH 8 /**< Default values of RX host threshold reg. */ > +#define RX_WTHRESH 4 /**< Default values of RX write-back threshold reg. */ > + > +/* > + * These default values are optimized for use with the Intel(R) 82599 10 GbE > + * Controller and the DPDK ixgbe PMD. Consider using other values for other > + * network controllers and/or network drivers. > + */ > +#define TX_PTHRESH 36 /**< Default values of TX prefetch threshold reg. */ > +#define TX_HTHRESH 0 /**< Default values of TX host threshold reg. */ > +#define TX_WTHRESH 0 /**< Default values of TX write-back threshold reg. */ > + > +#define MAX_PKT_BURST 16 > +#define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */ > +#define RTE_TEST_RX_DESC_DEFAULT 128 > +#define RTE_TEST_TX_DESC_DEFAULT 512 > + > /** Packet socket using dpdk mmaped rings for both Rx and Tx */ > typedef struct { > odp_buffer_pool_t pool; > diff --git a/platform/linux-dpdk/odp_buffer_pool.c b/platform/linux-dpdk/odp_buffer_pool.c > index de90275..805ce68 100644 > --- a/platform/linux-dpdk/odp_buffer_pool.c > +++ b/platform/linux-dpdk/odp_buffer_pool.c > @@ -23,7 +23,7 @@ > #include <odp_packet_dpdk.h> > > #define MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM) > -#define NB_MBUF 8192 > +#define NB_MBUF 32768 > > #ifdef POOL_USE_TICKETLOCK > #include <odp_ticketlock.h> > @@ -112,7 +112,7 @@ odp_buffer_pool_t odp_buffer_pool_create(const char *name, > > pktmbuf_pool = > rte_mempool_create(name, NB_MBUF, > - MBUF_SIZE, 32, > + MBUF_SIZE, MAX_PKT_BURST, > sizeof(struct rte_pktmbuf_pool_private), > rte_pktmbuf_pool_init, NULL, > rte_pktmbuf_init, NULL, > diff --git a/platform/linux-dpdk/odp_packet_dpdk.c b/platform/linux-dpdk/odp_packet_dpdk.c > index 31bfa30..d5c8e80 100644 > --- a/platform/linux-dpdk/odp_packet_dpdk.c > +++ b/platform/linux-dpdk/odp_packet_dpdk.c > @@ -26,34 +26,13 @@ > #include <odp_packet_dpdk.h> > #include <net/if.h> > > -/* > - * RX and TX Prefetch, Host, and Write-back threshold values should be > - * carefully set for optimal performance. Consult the network > - * controller's datasheet and supporting DPDK documentation for guidance > - * on how these parameters should be set. > - */ > -#define RX_PTHRESH 8 /**< Default values of RX prefetch threshold reg. */ > -#define RX_HTHRESH 8 /**< Default values of RX host threshold reg. */ > -#define RX_WTHRESH 4 /**< Default values of RX write-back threshold reg. */ > - > -/* > - * These default values are optimized for use with the Intel(R) 82599 10 GbE > - * Controller and the DPDK ixgbe PMD. Consider using other values for other > - * network controllers and/or network drivers. > - */ > -#define TX_PTHRESH 36 /**< Default values of TX prefetch threshold reg. */ > -#define TX_HTHRESH 0 /**< Default values of TX host threshold reg. */ > -#define TX_WTHRESH 0 /**< Default values of TX write-back threshold reg. */ > - > -#define MAX_PKT_BURST 16 > -#define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */ > -#define RTE_TEST_RX_DESC_DEFAULT 128 > -#define RTE_TEST_TX_DESC_DEFAULT 512 > static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT; > static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT; > > static const struct rte_eth_conf port_conf = { > .rxmode = { > + .mq_mode = ETH_MQ_RX_RSS, > + .max_rx_pkt_len = ETHER_MAX_LEN, > .split_hdr_size = 0, > .header_split = 0, /**< Header Split disabled */ > .hw_ip_checksum = 0, /**< IP checksum offload disabled */ > @@ -61,6 +40,12 @@ static const struct rte_eth_conf port_conf = { > .jumbo_frame = 0, /**< Jumbo Frame Support disabled */ > .hw_strip_crc = 0, /**< CRC stripped by hardware */ > }, > + .rx_adv_conf = { > + .rss_conf = { > + .rss_key = NULL, > + .rss_hf = ETH_RSS_IPV4 | ETH_RSS_IPV6, > + }, > + }, > .txmode = { > .mq_mode = ETH_MQ_TX_NONE, > }, > @@ -95,60 +80,71 @@ int setup_pkt_dpdk(pkt_dpdk_t * const pkt_dpdk, const char *netdev, > ODP_DBG("setup_pkt_dpdk\n"); > > static struct ether_addr eth_addr[RTE_MAX_ETHPORTS]; > - uint8_t portid = 0; > - uint16_t queueid = 0; > - int ret; > + static int portinit[RTE_MAX_ETHPORTS]; > + static int qid[RTE_MAX_ETHPORTS]; > + uint8_t portid = 0, num_intf = 2; > + uint16_t nbrxq = 0, nbtxq = 0; > + int ret, i; > + > printf("dpdk netdev: %s\n", netdev); > printf("dpdk pool: %lx\n", pool); > - > portid = atoi(netdev); > pkt_dpdk->portid = portid; > - pkt_dpdk->queueid = queueid; > pkt_dpdk->pool = pool; > printf("dpdk portid: %u\n", portid); > > - fflush(stdout); > - ret = rte_eth_dev_configure(portid, 1, 1, &port_conf); > - if (ret < 0) > - ODP_ERR("Cannot configure device: err=%d, port=%u\n", > - ret, (unsigned) portid); > - > - rte_eth_macaddr_get(portid, ð_addr[portid]); > - ODP_DBG("Port %u, MAC address: %02X:%02X:%02X:%02X:%02X:%02X\n\n", > - (unsigned) portid, > - eth_addr[portid].addr_bytes[0], > - eth_addr[portid].addr_bytes[1], > - eth_addr[portid].addr_bytes[2], > - eth_addr[portid].addr_bytes[3], > - eth_addr[portid].addr_bytes[4], > - eth_addr[portid].addr_bytes[5]); > - > - /* init one RX queue on each port */ > - fflush(stdout); > - ret = rte_eth_rx_queue_setup(portid, queueid, nb_rxd, > - rte_eth_dev_socket_id(portid), &rx_conf, > - (struct rte_mempool *)pool); > - if (ret < 0) > - ODP_ERR("rte_eth_rx_queue_setup:err=%d, port=%u\n", > - ret, (unsigned) portid); > - ODP_DBG("dpdk rx queue setup done\n"); > - > - /* init one TX queue on each port */ > - fflush(stdout); > - ret = rte_eth_tx_queue_setup(portid, queueid, nb_txd, > - rte_eth_dev_socket_id(portid), &tx_conf); > - if (ret < 0) > - ODP_ERR("rte_eth_tx_queue_setup:err=%d, port=%u\n", > - ret, (unsigned) portid); > - ODP_DBG("dpdk tx queue setup done\n"); > - > - /* Start device */ > - ret = rte_eth_dev_start(portid); > - if (ret < 0) > - ODP_ERR("rte_eth_dev_start:err=%d, port=%u\n", > - ret, (unsigned) portid); > - ODP_DBG("dpdk setup done\n\n"); > - > + nbrxq = odp_sys_core_count() / num_intf; > + nbtxq = nbrxq; > + if (portinit[portid] == 0) { > + fflush(stdout); > + ret = rte_eth_dev_configure(portid, nbrxq, nbtxq, &port_conf); > + if (ret < 0) > + ODP_ERR("Cannot configure device: err=%d, port=%u\n", > + ret, (unsigned) portid); > + > + rte_eth_macaddr_get(portid, ð_addr[portid]); > + ODP_DBG("Port %u, MAC address: %02X:%02X:%02X:%02X:%02X:%02X\n", > + (unsigned) portid, > + eth_addr[portid].addr_bytes[0], > + eth_addr[portid].addr_bytes[1], > + eth_addr[portid].addr_bytes[2], > + eth_addr[portid].addr_bytes[3], > + eth_addr[portid].addr_bytes[4], > + eth_addr[portid].addr_bytes[5]); > + > + /* init one RX queue on each port */ > + fflush(stdout); > + for (i = 0; i < nbrxq; i++) { > + ret = rte_eth_rx_queue_setup(portid, i, nb_rxd, > + rte_eth_dev_socket_id(portid), &rx_conf, > + (struct rte_mempool *)pool); > + if (ret < 0) > + ODP_ERR("%s rxq:err=%d, port=%u\n", > + __func__, ret, (unsigned) portid); > + ODP_DBG("dpdk rx queue setup done\n"); > + } > + > + /* init one TX queue on each port */ > + fflush(stdout); > + for (i = 0; i < nbtxq; i++) { > + ret = rte_eth_tx_queue_setup(portid, i, nb_txd, > + rte_eth_dev_socket_id(portid), &tx_conf); > + if (ret < 0) > + ODP_ERR("%s txq:err=%d, port=%u\n", > + __func__, ret, (unsigned) portid); > + ODP_DBG("dpdk tx queue setup done\n"); > + } > + > + /* Start device */ > + ret = rte_eth_dev_start(portid); > + if (ret < 0) > + ODP_ERR("rte_eth_dev_start:err=%d, port=%u\n", > + ret, (unsigned) portid); > + ODP_DBG("dpdk setup done\n\n"); > + > + portinit[portid] = 1; > + } > + pkt_dpdk->queueid = qid[portid]++; > > return 0; > } > diff --git a/platform/linux-dpdk/odp_packet_io.c b/platform/linux-dpdk/odp_packet_io.c > index d8d127f..3124175 100644 > --- a/platform/linux-dpdk/odp_packet_io.c > +++ b/platform/linux-dpdk/odp_packet_io.c > @@ -230,6 +230,8 @@ int odp_pktio_recv(odp_pktio_t id, odp_packet_t pkt_table[], unsigned len) > if (pktio_entry == NULL) > return -1; > > + odp_pktio_send(id, pkt_table, 0); > + > lock_entry(pktio_entry); > pkts = recv_pkt_dpdk(&pktio_entry->s.pkt_dpdk, pkt_table, len); > unlock_entry(pktio_entry);
Does this need a signoff by someone else before it is merged ? I think we want to enforce getting an ack, tested-by or reviewed-by before we merge things, we have informally moved that way over the last couple of weeks and now I think it is time we made it a formal requirement. Mike On 7 August 2014 09:15, Maxim Uvarov <maxim.uvarov@linaro.org> wrote: > Merged, thanks! > > Maxim. > > > On 08/05/2014 06:54 PM, venkatesh.vivekanandan@linaro.org wrote: > >> From: Venkatesh Vivekanandan <venkatesh.vivekanandan@linaro.org> >> >> - Multi queue support per interface is enabled. >> - odp_pktio_send with "0" packet is called in odp_pktio_recv to >> give the transmitted buffers back to mempool. >> - mbuf alloc failure during receive is fixed by giving more buffers to >> mempool. >> - mempool cache size is given equivalent to MAX_PKT_BURST. >> >> Signed-off-by: Venkatesh Vivekanandan <venkatesh.vivekanandan@linaro.org> >> --- >> platform/linux-dpdk/include/odp_packet_dpdk.h | 24 +++++ >> platform/linux-dpdk/odp_buffer_pool.c | 4 +- >> platform/linux-dpdk/odp_packet_dpdk.c | 136 >> +++++++++++++------------- >> platform/linux-dpdk/odp_packet_io.c | 2 + >> 4 files changed, 94 insertions(+), 72 deletions(-) >> >> diff --git a/platform/linux-dpdk/include/odp_packet_dpdk.h >> b/platform/linux-dpdk/include/odp_packet_dpdk.h >> index bcbe9e8..bcf9aa5 100644 >> --- a/platform/linux-dpdk/include/odp_packet_dpdk.h >> +++ b/platform/linux-dpdk/include/odp_packet_dpdk.h >> @@ -50,6 +50,30 @@ >> #define DPDK_BLOCKING_IO >> +/* >> + * RX and TX Prefetch, Host, and Write-back threshold values should be >> + * carefully set for optimal performance. Consult the network >> + * controller's datasheet and supporting DPDK documentation for guidance >> + * on how these parameters should be set. >> + */ >> +#define RX_PTHRESH 8 /**< Default values of RX prefetch threshold reg. */ >> +#define RX_HTHRESH 8 /**< Default values of RX host threshold reg. */ >> +#define RX_WTHRESH 4 /**< Default values of RX write-back threshold reg. >> */ >> + >> +/* >> + * These default values are optimized for use with the Intel(R) 82599 10 >> GbE >> + * Controller and the DPDK ixgbe PMD. Consider using other values for >> other >> + * network controllers and/or network drivers. >> + */ >> +#define TX_PTHRESH 36 /**< Default values of TX prefetch threshold reg. >> */ >> +#define TX_HTHRESH 0 /**< Default values of TX host threshold reg. */ >> +#define TX_WTHRESH 0 /**< Default values of TX write-back threshold >> reg. */ >> + >> +#define MAX_PKT_BURST 16 >> +#define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */ >> +#define RTE_TEST_RX_DESC_DEFAULT 128 >> +#define RTE_TEST_TX_DESC_DEFAULT 512 >> + >> /** Packet socket using dpdk mmaped rings for both Rx and Tx */ >> typedef struct { >> odp_buffer_pool_t pool; >> diff --git a/platform/linux-dpdk/odp_buffer_pool.c >> b/platform/linux-dpdk/odp_buffer_pool.c >> index de90275..805ce68 100644 >> --- a/platform/linux-dpdk/odp_buffer_pool.c >> +++ b/platform/linux-dpdk/odp_buffer_pool.c >> @@ -23,7 +23,7 @@ >> #include <odp_packet_dpdk.h> >> #define MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + >> RTE_PKTMBUF_HEADROOM) >> -#define NB_MBUF 8192 >> +#define NB_MBUF 32768 >> #ifdef POOL_USE_TICKETLOCK >> #include <odp_ticketlock.h> >> @@ -112,7 +112,7 @@ odp_buffer_pool_t odp_buffer_pool_create(const char >> *name, >> pktmbuf_pool = >> rte_mempool_create(name, NB_MBUF, >> - MBUF_SIZE, 32, >> + MBUF_SIZE, MAX_PKT_BURST, >> sizeof(struct >> rte_pktmbuf_pool_private), >> rte_pktmbuf_pool_init, NULL, >> rte_pktmbuf_init, NULL, >> diff --git a/platform/linux-dpdk/odp_packet_dpdk.c >> b/platform/linux-dpdk/odp_packet_dpdk.c >> index 31bfa30..d5c8e80 100644 >> --- a/platform/linux-dpdk/odp_packet_dpdk.c >> +++ b/platform/linux-dpdk/odp_packet_dpdk.c >> @@ -26,34 +26,13 @@ >> #include <odp_packet_dpdk.h> >> #include <net/if.h> >> -/* >> - * RX and TX Prefetch, Host, and Write-back threshold values should be >> - * carefully set for optimal performance. Consult the network >> - * controller's datasheet and supporting DPDK documentation for guidance >> - * on how these parameters should be set. >> - */ >> -#define RX_PTHRESH 8 /**< Default values of RX prefetch threshold reg. */ >> -#define RX_HTHRESH 8 /**< Default values of RX host threshold reg. */ >> -#define RX_WTHRESH 4 /**< Default values of RX write-back threshold reg. >> */ >> - >> -/* >> - * These default values are optimized for use with the Intel(R) 82599 10 >> GbE >> - * Controller and the DPDK ixgbe PMD. Consider using other values for >> other >> - * network controllers and/or network drivers. >> - */ >> -#define TX_PTHRESH 36 /**< Default values of TX prefetch threshold reg. >> */ >> -#define TX_HTHRESH 0 /**< Default values of TX host threshold reg. */ >> -#define TX_WTHRESH 0 /**< Default values of TX write-back threshold >> reg. */ >> - >> -#define MAX_PKT_BURST 16 >> -#define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */ >> -#define RTE_TEST_RX_DESC_DEFAULT 128 >> -#define RTE_TEST_TX_DESC_DEFAULT 512 >> static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT; >> static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT; >> static const struct rte_eth_conf port_conf = { >> .rxmode = { >> + .mq_mode = ETH_MQ_RX_RSS, >> + .max_rx_pkt_len = ETHER_MAX_LEN, >> .split_hdr_size = 0, >> .header_split = 0, /**< Header Split disabled */ >> .hw_ip_checksum = 0, /**< IP checksum offload disabled */ >> @@ -61,6 +40,12 @@ static const struct rte_eth_conf port_conf = { >> .jumbo_frame = 0, /**< Jumbo Frame Support disabled */ >> .hw_strip_crc = 0, /**< CRC stripped by hardware */ >> }, >> + .rx_adv_conf = { >> + .rss_conf = { >> + .rss_key = NULL, >> + .rss_hf = ETH_RSS_IPV4 | ETH_RSS_IPV6, >> + }, >> + }, >> .txmode = { >> .mq_mode = ETH_MQ_TX_NONE, >> }, >> @@ -95,60 +80,71 @@ int setup_pkt_dpdk(pkt_dpdk_t * const pkt_dpdk, const >> char *netdev, >> ODP_DBG("setup_pkt_dpdk\n"); >> static struct ether_addr eth_addr[RTE_MAX_ETHPORTS]; >> - uint8_t portid = 0; >> - uint16_t queueid = 0; >> - int ret; >> + static int portinit[RTE_MAX_ETHPORTS]; >> + static int qid[RTE_MAX_ETHPORTS]; >> + uint8_t portid = 0, num_intf = 2; >> + uint16_t nbrxq = 0, nbtxq = 0; >> + int ret, i; >> + >> printf("dpdk netdev: %s\n", netdev); >> printf("dpdk pool: %lx\n", pool); >> - >> portid = atoi(netdev); >> pkt_dpdk->portid = portid; >> - pkt_dpdk->queueid = queueid; >> pkt_dpdk->pool = pool; >> printf("dpdk portid: %u\n", portid); >> - fflush(stdout); >> - ret = rte_eth_dev_configure(portid, 1, 1, &port_conf); >> - if (ret < 0) >> - ODP_ERR("Cannot configure device: err=%d, port=%u\n", >> - ret, (unsigned) portid); >> - >> - rte_eth_macaddr_get(portid, ð_addr[portid]); >> - ODP_DBG("Port %u, MAC address: %02X:%02X:%02X:%02X:%02X:%02X\ >> n\n", >> - (unsigned) portid, >> - eth_addr[portid].addr_bytes[0], >> - eth_addr[portid].addr_bytes[1], >> - eth_addr[portid].addr_bytes[2], >> - eth_addr[portid].addr_bytes[3], >> - eth_addr[portid].addr_bytes[4], >> - eth_addr[portid].addr_bytes[5]); >> - >> - /* init one RX queue on each port */ >> - fflush(stdout); >> - ret = rte_eth_rx_queue_setup(portid, queueid, nb_rxd, >> - rte_eth_dev_socket_id(portid), >> &rx_conf, >> - (struct rte_mempool *)pool); >> - if (ret < 0) >> - ODP_ERR("rte_eth_rx_queue_setup:err=%d, port=%u\n", >> - ret, (unsigned) portid); >> - ODP_DBG("dpdk rx queue setup done\n"); >> - >> - /* init one TX queue on each port */ >> - fflush(stdout); >> - ret = rte_eth_tx_queue_setup(portid, queueid, nb_txd, >> - rte_eth_dev_socket_id(portid), &tx_conf); >> - if (ret < 0) >> - ODP_ERR("rte_eth_tx_queue_setup:err=%d, port=%u\n", >> - ret, (unsigned) portid); >> - ODP_DBG("dpdk tx queue setup done\n"); >> - >> - /* Start device */ >> - ret = rte_eth_dev_start(portid); >> - if (ret < 0) >> - ODP_ERR("rte_eth_dev_start:err=%d, port=%u\n", >> - ret, (unsigned) portid); >> - ODP_DBG("dpdk setup done\n\n"); >> - >> + nbrxq = odp_sys_core_count() / num_intf; >> + nbtxq = nbrxq; >> + if (portinit[portid] == 0) { >> + fflush(stdout); >> + ret = rte_eth_dev_configure(portid, nbrxq, nbtxq, >> &port_conf); >> + if (ret < 0) >> + ODP_ERR("Cannot configure device: err=%d, >> port=%u\n", >> + ret, (unsigned) portid); >> + >> + rte_eth_macaddr_get(portid, ð_addr[portid]); >> + ODP_DBG("Port %u, MAC address: >> %02X:%02X:%02X:%02X:%02X:%02X\n", >> + (unsigned) portid, >> + eth_addr[portid].addr_bytes[0], >> + eth_addr[portid].addr_bytes[1], >> + eth_addr[portid].addr_bytes[2], >> + eth_addr[portid].addr_bytes[3], >> + eth_addr[portid].addr_bytes[4], >> + eth_addr[portid].addr_bytes[5]); >> + >> + /* init one RX queue on each port */ >> + fflush(stdout); >> + for (i = 0; i < nbrxq; i++) { >> + ret = rte_eth_rx_queue_setup(portid, i, nb_rxd, >> + rte_eth_dev_socket_id(portid), >> &rx_conf, >> + (struct rte_mempool *)pool); >> + if (ret < 0) >> + ODP_ERR("%s rxq:err=%d, port=%u\n", >> + __func__, ret, (unsigned) portid); >> + ODP_DBG("dpdk rx queue setup done\n"); >> + } >> + >> + /* init one TX queue on each port */ >> + fflush(stdout); >> + for (i = 0; i < nbtxq; i++) { >> + ret = rte_eth_tx_queue_setup(portid, i, nb_txd, >> + rte_eth_dev_socket_id(portid), &tx_conf); >> + if (ret < 0) >> + ODP_ERR("%s txq:err=%d, port=%u\n", >> + __func__, ret, (unsigned) portid); >> + ODP_DBG("dpdk tx queue setup done\n"); >> + } >> + >> + /* Start device */ >> + ret = rte_eth_dev_start(portid); >> + if (ret < 0) >> + ODP_ERR("rte_eth_dev_start:err=%d, port=%u\n", >> + ret, (unsigned) portid); >> + ODP_DBG("dpdk setup done\n\n"); >> + >> + portinit[portid] = 1; >> + } >> + pkt_dpdk->queueid = qid[portid]++; >> return 0; >> } >> diff --git a/platform/linux-dpdk/odp_packet_io.c >> b/platform/linux-dpdk/odp_packet_io.c >> index d8d127f..3124175 100644 >> --- a/platform/linux-dpdk/odp_packet_io.c >> +++ b/platform/linux-dpdk/odp_packet_io.c >> @@ -230,6 +230,8 @@ int odp_pktio_recv(odp_pktio_t id, odp_packet_t >> pkt_table[], unsigned len) >> if (pktio_entry == NULL) >> return -1; >> + odp_pktio_send(id, pkt_table, 0); >> + >> lock_entry(pktio_entry); >> pkts = recv_pkt_dpdk(&pktio_entry->s.pkt_dpdk, pkt_table, len); >> unlock_entry(pktio_entry); >> > > > _______________________________________________ > lng-odp mailing list > lng-odp@lists.linaro.org > http://lists.linaro.org/mailman/listinfo/lng-odp >
On 2014-08-07 10:41, Mike Holmes wrote: > Does this need a signoff by someone else before it is merged ? > > I think we want to enforce getting an ack, tested-by or reviewed-by before > we merge things, we have informally moved that way over the last couple of > weeks and now I think it is time we made it a formal requirement. Agree. Anders > > Mike > > > On 7 August 2014 09:15, Maxim Uvarov <maxim.uvarov@linaro.org> wrote: > > > Merged, thanks! > > > > Maxim. > > > > > > On 08/05/2014 06:54 PM, venkatesh.vivekanandan@linaro.org wrote: > > > >> From: Venkatesh Vivekanandan <venkatesh.vivekanandan@linaro.org> > >> > >> - Multi queue support per interface is enabled. > >> - odp_pktio_send with "0" packet is called in odp_pktio_recv to > >> give the transmitted buffers back to mempool. > >> - mbuf alloc failure during receive is fixed by giving more buffers to > >> mempool. > >> - mempool cache size is given equivalent to MAX_PKT_BURST. > >> > >> Signed-off-by: Venkatesh Vivekanandan <venkatesh.vivekanandan@linaro.org> > >> --- > >> platform/linux-dpdk/include/odp_packet_dpdk.h | 24 +++++ > >> platform/linux-dpdk/odp_buffer_pool.c | 4 +- > >> platform/linux-dpdk/odp_packet_dpdk.c | 136 > >> +++++++++++++------------- > >> platform/linux-dpdk/odp_packet_io.c | 2 + > >> 4 files changed, 94 insertions(+), 72 deletions(-) > >> > >> diff --git a/platform/linux-dpdk/include/odp_packet_dpdk.h > >> b/platform/linux-dpdk/include/odp_packet_dpdk.h > >> index bcbe9e8..bcf9aa5 100644 > >> --- a/platform/linux-dpdk/include/odp_packet_dpdk.h > >> +++ b/platform/linux-dpdk/include/odp_packet_dpdk.h > >> @@ -50,6 +50,30 @@ > >> #define DPDK_BLOCKING_IO > >> +/* > >> + * RX and TX Prefetch, Host, and Write-back threshold values should be > >> + * carefully set for optimal performance. Consult the network > >> + * controller's datasheet and supporting DPDK documentation for guidance > >> + * on how these parameters should be set. > >> + */ > >> +#define RX_PTHRESH 8 /**< Default values of RX prefetch threshold reg. */ > >> +#define RX_HTHRESH 8 /**< Default values of RX host threshold reg. */ > >> +#define RX_WTHRESH 4 /**< Default values of RX write-back threshold reg. > >> */ > >> + > >> +/* > >> + * These default values are optimized for use with the Intel(R) 82599 10 > >> GbE > >> + * Controller and the DPDK ixgbe PMD. Consider using other values for > >> other > >> + * network controllers and/or network drivers. > >> + */ > >> +#define TX_PTHRESH 36 /**< Default values of TX prefetch threshold reg. > >> */ > >> +#define TX_HTHRESH 0 /**< Default values of TX host threshold reg. */ > >> +#define TX_WTHRESH 0 /**< Default values of TX write-back threshold > >> reg. */ > >> + > >> +#define MAX_PKT_BURST 16 > >> +#define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */ > >> +#define RTE_TEST_RX_DESC_DEFAULT 128 > >> +#define RTE_TEST_TX_DESC_DEFAULT 512 > >> + > >> /** Packet socket using dpdk mmaped rings for both Rx and Tx */ > >> typedef struct { > >> odp_buffer_pool_t pool; > >> diff --git a/platform/linux-dpdk/odp_buffer_pool.c > >> b/platform/linux-dpdk/odp_buffer_pool.c > >> index de90275..805ce68 100644 > >> --- a/platform/linux-dpdk/odp_buffer_pool.c > >> +++ b/platform/linux-dpdk/odp_buffer_pool.c > >> @@ -23,7 +23,7 @@ > >> #include <odp_packet_dpdk.h> > >> #define MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + > >> RTE_PKTMBUF_HEADROOM) > >> -#define NB_MBUF 8192 > >> +#define NB_MBUF 32768 > >> #ifdef POOL_USE_TICKETLOCK > >> #include <odp_ticketlock.h> > >> @@ -112,7 +112,7 @@ odp_buffer_pool_t odp_buffer_pool_create(const char > >> *name, > >> pktmbuf_pool = > >> rte_mempool_create(name, NB_MBUF, > >> - MBUF_SIZE, 32, > >> + MBUF_SIZE, MAX_PKT_BURST, > >> sizeof(struct > >> rte_pktmbuf_pool_private), > >> rte_pktmbuf_pool_init, NULL, > >> rte_pktmbuf_init, NULL, > >> diff --git a/platform/linux-dpdk/odp_packet_dpdk.c > >> b/platform/linux-dpdk/odp_packet_dpdk.c > >> index 31bfa30..d5c8e80 100644 > >> --- a/platform/linux-dpdk/odp_packet_dpdk.c > >> +++ b/platform/linux-dpdk/odp_packet_dpdk.c > >> @@ -26,34 +26,13 @@ > >> #include <odp_packet_dpdk.h> > >> #include <net/if.h> > >> -/* > >> - * RX and TX Prefetch, Host, and Write-back threshold values should be > >> - * carefully set for optimal performance. Consult the network > >> - * controller's datasheet and supporting DPDK documentation for guidance > >> - * on how these parameters should be set. > >> - */ > >> -#define RX_PTHRESH 8 /**< Default values of RX prefetch threshold reg. */ > >> -#define RX_HTHRESH 8 /**< Default values of RX host threshold reg. */ > >> -#define RX_WTHRESH 4 /**< Default values of RX write-back threshold reg. > >> */ > >> - > >> -/* > >> - * These default values are optimized for use with the Intel(R) 82599 10 > >> GbE > >> - * Controller and the DPDK ixgbe PMD. Consider using other values for > >> other > >> - * network controllers and/or network drivers. > >> - */ > >> -#define TX_PTHRESH 36 /**< Default values of TX prefetch threshold reg. > >> */ > >> -#define TX_HTHRESH 0 /**< Default values of TX host threshold reg. */ > >> -#define TX_WTHRESH 0 /**< Default values of TX write-back threshold > >> reg. */ > >> - > >> -#define MAX_PKT_BURST 16 > >> -#define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */ > >> -#define RTE_TEST_RX_DESC_DEFAULT 128 > >> -#define RTE_TEST_TX_DESC_DEFAULT 512 > >> static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT; > >> static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT; > >> static const struct rte_eth_conf port_conf = { > >> .rxmode = { > >> + .mq_mode = ETH_MQ_RX_RSS, > >> + .max_rx_pkt_len = ETHER_MAX_LEN, > >> .split_hdr_size = 0, > >> .header_split = 0, /**< Header Split disabled */ > >> .hw_ip_checksum = 0, /**< IP checksum offload disabled */ > >> @@ -61,6 +40,12 @@ static const struct rte_eth_conf port_conf = { > >> .jumbo_frame = 0, /**< Jumbo Frame Support disabled */ > >> .hw_strip_crc = 0, /**< CRC stripped by hardware */ > >> }, > >> + .rx_adv_conf = { > >> + .rss_conf = { > >> + .rss_key = NULL, > >> + .rss_hf = ETH_RSS_IPV4 | ETH_RSS_IPV6, > >> + }, > >> + }, > >> .txmode = { > >> .mq_mode = ETH_MQ_TX_NONE, > >> }, > >> @@ -95,60 +80,71 @@ int setup_pkt_dpdk(pkt_dpdk_t * const pkt_dpdk, const > >> char *netdev, > >> ODP_DBG("setup_pkt_dpdk\n"); > >> static struct ether_addr eth_addr[RTE_MAX_ETHPORTS]; > >> - uint8_t portid = 0; > >> - uint16_t queueid = 0; > >> - int ret; > >> + static int portinit[RTE_MAX_ETHPORTS]; > >> + static int qid[RTE_MAX_ETHPORTS]; > >> + uint8_t portid = 0, num_intf = 2; > >> + uint16_t nbrxq = 0, nbtxq = 0; > >> + int ret, i; > >> + > >> printf("dpdk netdev: %s\n", netdev); > >> printf("dpdk pool: %lx\n", pool); > >> - > >> portid = atoi(netdev); > >> pkt_dpdk->portid = portid; > >> - pkt_dpdk->queueid = queueid; > >> pkt_dpdk->pool = pool; > >> printf("dpdk portid: %u\n", portid); > >> - fflush(stdout); > >> - ret = rte_eth_dev_configure(portid, 1, 1, &port_conf); > >> - if (ret < 0) > >> - ODP_ERR("Cannot configure device: err=%d, port=%u\n", > >> - ret, (unsigned) portid); > >> - > >> - rte_eth_macaddr_get(portid, ð_addr[portid]); > >> - ODP_DBG("Port %u, MAC address: %02X:%02X:%02X:%02X:%02X:%02X\ > >> n\n", > >> - (unsigned) portid, > >> - eth_addr[portid].addr_bytes[0], > >> - eth_addr[portid].addr_bytes[1], > >> - eth_addr[portid].addr_bytes[2], > >> - eth_addr[portid].addr_bytes[3], > >> - eth_addr[portid].addr_bytes[4], > >> - eth_addr[portid].addr_bytes[5]); > >> - > >> - /* init one RX queue on each port */ > >> - fflush(stdout); > >> - ret = rte_eth_rx_queue_setup(portid, queueid, nb_rxd, > >> - rte_eth_dev_socket_id(portid), > >> &rx_conf, > >> - (struct rte_mempool *)pool); > >> - if (ret < 0) > >> - ODP_ERR("rte_eth_rx_queue_setup:err=%d, port=%u\n", > >> - ret, (unsigned) portid); > >> - ODP_DBG("dpdk rx queue setup done\n"); > >> - > >> - /* init one TX queue on each port */ > >> - fflush(stdout); > >> - ret = rte_eth_tx_queue_setup(portid, queueid, nb_txd, > >> - rte_eth_dev_socket_id(portid), &tx_conf); > >> - if (ret < 0) > >> - ODP_ERR("rte_eth_tx_queue_setup:err=%d, port=%u\n", > >> - ret, (unsigned) portid); > >> - ODP_DBG("dpdk tx queue setup done\n"); > >> - > >> - /* Start device */ > >> - ret = rte_eth_dev_start(portid); > >> - if (ret < 0) > >> - ODP_ERR("rte_eth_dev_start:err=%d, port=%u\n", > >> - ret, (unsigned) portid); > >> - ODP_DBG("dpdk setup done\n\n"); > >> - > >> + nbrxq = odp_sys_core_count() / num_intf; > >> + nbtxq = nbrxq; > >> + if (portinit[portid] == 0) { > >> + fflush(stdout); > >> + ret = rte_eth_dev_configure(portid, nbrxq, nbtxq, > >> &port_conf); > >> + if (ret < 0) > >> + ODP_ERR("Cannot configure device: err=%d, > >> port=%u\n", > >> + ret, (unsigned) portid); > >> + > >> + rte_eth_macaddr_get(portid, ð_addr[portid]); > >> + ODP_DBG("Port %u, MAC address: > >> %02X:%02X:%02X:%02X:%02X:%02X\n", > >> + (unsigned) portid, > >> + eth_addr[portid].addr_bytes[0], > >> + eth_addr[portid].addr_bytes[1], > >> + eth_addr[portid].addr_bytes[2], > >> + eth_addr[portid].addr_bytes[3], > >> + eth_addr[portid].addr_bytes[4], > >> + eth_addr[portid].addr_bytes[5]); > >> + > >> + /* init one RX queue on each port */ > >> + fflush(stdout); > >> + for (i = 0; i < nbrxq; i++) { > >> + ret = rte_eth_rx_queue_setup(portid, i, nb_rxd, > >> + rte_eth_dev_socket_id(portid), > >> &rx_conf, > >> + (struct rte_mempool *)pool); > >> + if (ret < 0) > >> + ODP_ERR("%s rxq:err=%d, port=%u\n", > >> + __func__, ret, (unsigned) portid); > >> + ODP_DBG("dpdk rx queue setup done\n"); > >> + } > >> + > >> + /* init one TX queue on each port */ > >> + fflush(stdout); > >> + for (i = 0; i < nbtxq; i++) { > >> + ret = rte_eth_tx_queue_setup(portid, i, nb_txd, > >> + rte_eth_dev_socket_id(portid), &tx_conf); > >> + if (ret < 0) > >> + ODP_ERR("%s txq:err=%d, port=%u\n", > >> + __func__, ret, (unsigned) portid); > >> + ODP_DBG("dpdk tx queue setup done\n"); > >> + } > >> + > >> + /* Start device */ > >> + ret = rte_eth_dev_start(portid); > >> + if (ret < 0) > >> + ODP_ERR("rte_eth_dev_start:err=%d, port=%u\n", > >> + ret, (unsigned) portid); > >> + ODP_DBG("dpdk setup done\n\n"); > >> + > >> + portinit[portid] = 1; > >> + } > >> + pkt_dpdk->queueid = qid[portid]++; > >> return 0; > >> } > >> diff --git a/platform/linux-dpdk/odp_packet_io.c > >> b/platform/linux-dpdk/odp_packet_io.c > >> index d8d127f..3124175 100644 > >> --- a/platform/linux-dpdk/odp_packet_io.c > >> +++ b/platform/linux-dpdk/odp_packet_io.c > >> @@ -230,6 +230,8 @@ int odp_pktio_recv(odp_pktio_t id, odp_packet_t > >> pkt_table[], unsigned len) > >> if (pktio_entry == NULL) > >> return -1; > >> + odp_pktio_send(id, pkt_table, 0); > >> + > >> lock_entry(pktio_entry); > >> pkts = recv_pkt_dpdk(&pktio_entry->s.pkt_dpdk, pkt_table, len); > >> unlock_entry(pktio_entry); > >> > > > > > > _______________________________________________ > > lng-odp mailing list > > lng-odp@lists.linaro.org > > http://lists.linaro.org/mailman/listinfo/lng-odp > > > > > > -- > *Mike Holmes* > Linaro Technical Manager / Lead > LNG - ODP > _______________________________________________ > lng-odp mailing list > lng-odp@lists.linaro.org > http://lists.linaro.org/mailman/listinfo/lng-odp
On 7 August 2014 21:10, Anders Roxell <anders.roxell@linaro.org> wrote: > On 2014-08-07 10:41, Mike Holmes wrote: > > Does this need a signoff by someone else before it is merged ? > > > > I think we want to enforce getting an ack, tested-by or reviewed-by > before > > we merge things, we have informally moved that way over the last couple > of > > weeks and now I think it is time we made it a formal requirement. > > Agree. > > If this is the case, then is it fair to say initial discussion of 24-hour window is void?. I guess Maxim was waiting for 2 days(for any comments) before he could merge this patch. Do we have any time-limit before which a patch *must *be reviewed or tested? I hope we can't wait indefinitely or is this the case?. > Anders > > > > > Mike > > > > > > On 7 August 2014 09:15, Maxim Uvarov <maxim.uvarov@linaro.org> wrote: > > > > > Merged, thanks! > > > > > > Maxim. > > > > > > > > > On 08/05/2014 06:54 PM, venkatesh.vivekanandan@linaro.org wrote: > > > > > >> From: Venkatesh Vivekanandan <venkatesh.vivekanandan@linaro.org> > > >> > > >> - Multi queue support per interface is enabled. > > >> - odp_pktio_send with "0" packet is called in odp_pktio_recv to > > >> give the transmitted buffers back to mempool. > > >> - mbuf alloc failure during receive is fixed by giving more buffers to > > >> mempool. > > >> - mempool cache size is given equivalent to MAX_PKT_BURST. > > >> > > >> Signed-off-by: Venkatesh Vivekanandan < > venkatesh.vivekanandan@linaro.org> > > >> --- > > >> platform/linux-dpdk/include/odp_packet_dpdk.h | 24 +++++ > > >> platform/linux-dpdk/odp_buffer_pool.c | 4 +- > > >> platform/linux-dpdk/odp_packet_dpdk.c | 136 > > >> +++++++++++++------------- > > >> platform/linux-dpdk/odp_packet_io.c | 2 + > > >> 4 files changed, 94 insertions(+), 72 deletions(-) > > >> > > >> diff --git a/platform/linux-dpdk/include/odp_packet_dpdk.h > > >> b/platform/linux-dpdk/include/odp_packet_dpdk.h > > >> index bcbe9e8..bcf9aa5 100644 > > >> --- a/platform/linux-dpdk/include/odp_packet_dpdk.h > > >> +++ b/platform/linux-dpdk/include/odp_packet_dpdk.h > > >> @@ -50,6 +50,30 @@ > > >> #define DPDK_BLOCKING_IO > > >> +/* > > >> + * RX and TX Prefetch, Host, and Write-back threshold values should > be > > >> + * carefully set for optimal performance. Consult the network > > >> + * controller's datasheet and supporting DPDK documentation for > guidance > > >> + * on how these parameters should be set. > > >> + */ > > >> +#define RX_PTHRESH 8 /**< Default values of RX prefetch threshold > reg. */ > > >> +#define RX_HTHRESH 8 /**< Default values of RX host threshold reg. */ > > >> +#define RX_WTHRESH 4 /**< Default values of RX write-back threshold > reg. > > >> */ > > >> + > > >> +/* > > >> + * These default values are optimized for use with the Intel(R) > 82599 10 > > >> GbE > > >> + * Controller and the DPDK ixgbe PMD. Consider using other values for > > >> other > > >> + * network controllers and/or network drivers. > > >> + */ > > >> +#define TX_PTHRESH 36 /**< Default values of TX prefetch threshold > reg. > > >> */ > > >> +#define TX_HTHRESH 0 /**< Default values of TX host threshold reg. > */ > > >> +#define TX_WTHRESH 0 /**< Default values of TX write-back threshold > > >> reg. */ > > >> + > > >> +#define MAX_PKT_BURST 16 > > >> +#define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */ > > >> +#define RTE_TEST_RX_DESC_DEFAULT 128 > > >> +#define RTE_TEST_TX_DESC_DEFAULT 512 > > >> + > > >> /** Packet socket using dpdk mmaped rings for both Rx and Tx */ > > >> typedef struct { > > >> odp_buffer_pool_t pool; > > >> diff --git a/platform/linux-dpdk/odp_buffer_pool.c > > >> b/platform/linux-dpdk/odp_buffer_pool.c > > >> index de90275..805ce68 100644 > > >> --- a/platform/linux-dpdk/odp_buffer_pool.c > > >> +++ b/platform/linux-dpdk/odp_buffer_pool.c > > >> @@ -23,7 +23,7 @@ > > >> #include <odp_packet_dpdk.h> > > >> #define MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + > > >> RTE_PKTMBUF_HEADROOM) > > >> -#define NB_MBUF 8192 > > >> +#define NB_MBUF 32768 > > >> #ifdef POOL_USE_TICKETLOCK > > >> #include <odp_ticketlock.h> > > >> @@ -112,7 +112,7 @@ odp_buffer_pool_t odp_buffer_pool_create(const > char > > >> *name, > > >> pktmbuf_pool = > > >> rte_mempool_create(name, NB_MBUF, > > >> - MBUF_SIZE, 32, > > >> + MBUF_SIZE, MAX_PKT_BURST, > > >> sizeof(struct > > >> rte_pktmbuf_pool_private), > > >> rte_pktmbuf_pool_init, NULL, > > >> rte_pktmbuf_init, NULL, > > >> diff --git a/platform/linux-dpdk/odp_packet_dpdk.c > > >> b/platform/linux-dpdk/odp_packet_dpdk.c > > >> index 31bfa30..d5c8e80 100644 > > >> --- a/platform/linux-dpdk/odp_packet_dpdk.c > > >> +++ b/platform/linux-dpdk/odp_packet_dpdk.c > > >> @@ -26,34 +26,13 @@ > > >> #include <odp_packet_dpdk.h> > > >> #include <net/if.h> > > >> -/* > > >> - * RX and TX Prefetch, Host, and Write-back threshold values should > be > > >> - * carefully set for optimal performance. Consult the network > > >> - * controller's datasheet and supporting DPDK documentation for > guidance > > >> - * on how these parameters should be set. > > >> - */ > > >> -#define RX_PTHRESH 8 /**< Default values of RX prefetch threshold > reg. */ > > >> -#define RX_HTHRESH 8 /**< Default values of RX host threshold reg. */ > > >> -#define RX_WTHRESH 4 /**< Default values of RX write-back threshold > reg. > > >> */ > > >> - > > >> -/* > > >> - * These default values are optimized for use with the Intel(R) > 82599 10 > > >> GbE > > >> - * Controller and the DPDK ixgbe PMD. Consider using other values for > > >> other > > >> - * network controllers and/or network drivers. > > >> - */ > > >> -#define TX_PTHRESH 36 /**< Default values of TX prefetch threshold > reg. > > >> */ > > >> -#define TX_HTHRESH 0 /**< Default values of TX host threshold reg. > */ > > >> -#define TX_WTHRESH 0 /**< Default values of TX write-back threshold > > >> reg. */ > > >> - > > >> -#define MAX_PKT_BURST 16 > > >> -#define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */ > > >> -#define RTE_TEST_RX_DESC_DEFAULT 128 > > >> -#define RTE_TEST_TX_DESC_DEFAULT 512 > > >> static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT; > > >> static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT; > > >> static const struct rte_eth_conf port_conf = { > > >> .rxmode = { > > >> + .mq_mode = ETH_MQ_RX_RSS, > > >> + .max_rx_pkt_len = ETHER_MAX_LEN, > > >> .split_hdr_size = 0, > > >> .header_split = 0, /**< Header Split disabled */ > > >> .hw_ip_checksum = 0, /**< IP checksum offload > disabled */ > > >> @@ -61,6 +40,12 @@ static const struct rte_eth_conf port_conf = { > > >> .jumbo_frame = 0, /**< Jumbo Frame Support > disabled */ > > >> .hw_strip_crc = 0, /**< CRC stripped by hardware */ > > >> }, > > >> + .rx_adv_conf = { > > >> + .rss_conf = { > > >> + .rss_key = NULL, > > >> + .rss_hf = ETH_RSS_IPV4 | ETH_RSS_IPV6, > > >> + }, > > >> + }, > > >> .txmode = { > > >> .mq_mode = ETH_MQ_TX_NONE, > > >> }, > > >> @@ -95,60 +80,71 @@ int setup_pkt_dpdk(pkt_dpdk_t * const pkt_dpdk, > const > > >> char *netdev, > > >> ODP_DBG("setup_pkt_dpdk\n"); > > >> static struct ether_addr eth_addr[RTE_MAX_ETHPORTS]; > > >> - uint8_t portid = 0; > > >> - uint16_t queueid = 0; > > >> - int ret; > > >> + static int portinit[RTE_MAX_ETHPORTS]; > > >> + static int qid[RTE_MAX_ETHPORTS]; > > >> + uint8_t portid = 0, num_intf = 2; > > >> + uint16_t nbrxq = 0, nbtxq = 0; > > >> + int ret, i; > > >> + > > >> printf("dpdk netdev: %s\n", netdev); > > >> printf("dpdk pool: %lx\n", pool); > > >> - > > >> portid = atoi(netdev); > > >> pkt_dpdk->portid = portid; > > >> - pkt_dpdk->queueid = queueid; > > >> pkt_dpdk->pool = pool; > > >> printf("dpdk portid: %u\n", portid); > > >> - fflush(stdout); > > >> - ret = rte_eth_dev_configure(portid, 1, 1, &port_conf); > > >> - if (ret < 0) > > >> - ODP_ERR("Cannot configure device: err=%d, port=%u\n", > > >> - ret, (unsigned) portid); > > >> - > > >> - rte_eth_macaddr_get(portid, ð_addr[portid]); > > >> - ODP_DBG("Port %u, MAC address: %02X:%02X:%02X:%02X:%02X:%02X\ > > >> n\n", > > >> - (unsigned) portid, > > >> - eth_addr[portid].addr_bytes[0], > > >> - eth_addr[portid].addr_bytes[1], > > >> - eth_addr[portid].addr_bytes[2], > > >> - eth_addr[portid].addr_bytes[3], > > >> - eth_addr[portid].addr_bytes[4], > > >> - eth_addr[portid].addr_bytes[5]); > > >> - > > >> - /* init one RX queue on each port */ > > >> - fflush(stdout); > > >> - ret = rte_eth_rx_queue_setup(portid, queueid, nb_rxd, > > >> - rte_eth_dev_socket_id(portid), > > >> &rx_conf, > > >> - (struct rte_mempool *)pool); > > >> - if (ret < 0) > > >> - ODP_ERR("rte_eth_rx_queue_setup:err=%d, port=%u\n", > > >> - ret, (unsigned) portid); > > >> - ODP_DBG("dpdk rx queue setup done\n"); > > >> - > > >> - /* init one TX queue on each port */ > > >> - fflush(stdout); > > >> - ret = rte_eth_tx_queue_setup(portid, queueid, nb_txd, > > >> - rte_eth_dev_socket_id(portid), &tx_conf); > > >> - if (ret < 0) > > >> - ODP_ERR("rte_eth_tx_queue_setup:err=%d, port=%u\n", > > >> - ret, (unsigned) portid); > > >> - ODP_DBG("dpdk tx queue setup done\n"); > > >> - > > >> - /* Start device */ > > >> - ret = rte_eth_dev_start(portid); > > >> - if (ret < 0) > > >> - ODP_ERR("rte_eth_dev_start:err=%d, port=%u\n", > > >> - ret, (unsigned) portid); > > >> - ODP_DBG("dpdk setup done\n\n"); > > >> - > > >> + nbrxq = odp_sys_core_count() / num_intf; > > >> + nbtxq = nbrxq; > > >> + if (portinit[portid] == 0) { > > >> + fflush(stdout); > > >> + ret = rte_eth_dev_configure(portid, nbrxq, nbtxq, > > >> &port_conf); > > >> + if (ret < 0) > > >> + ODP_ERR("Cannot configure device: err=%d, > > >> port=%u\n", > > >> + ret, (unsigned) portid); > > >> + > > >> + rte_eth_macaddr_get(portid, ð_addr[portid]); > > >> + ODP_DBG("Port %u, MAC address: > > >> %02X:%02X:%02X:%02X:%02X:%02X\n", > > >> + (unsigned) portid, > > >> + eth_addr[portid].addr_bytes[0], > > >> + eth_addr[portid].addr_bytes[1], > > >> + eth_addr[portid].addr_bytes[2], > > >> + eth_addr[portid].addr_bytes[3], > > >> + eth_addr[portid].addr_bytes[4], > > >> + eth_addr[portid].addr_bytes[5]); > > >> + > > >> + /* init one RX queue on each port */ > > >> + fflush(stdout); > > >> + for (i = 0; i < nbrxq; i++) { > > >> + ret = rte_eth_rx_queue_setup(portid, i, > nb_rxd, > > >> + rte_eth_dev_socket_id(portid), > > >> &rx_conf, > > >> + (struct rte_mempool *)pool); > > >> + if (ret < 0) > > >> + ODP_ERR("%s rxq:err=%d, port=%u\n", > > >> + __func__, ret, (unsigned) > portid); > > >> + ODP_DBG("dpdk rx queue setup done\n"); > > >> + } > > >> + > > >> + /* init one TX queue on each port */ > > >> + fflush(stdout); > > >> + for (i = 0; i < nbtxq; i++) { > > >> + ret = rte_eth_tx_queue_setup(portid, i, > nb_txd, > > >> + rte_eth_dev_socket_id(portid), > &tx_conf); > > >> + if (ret < 0) > > >> + ODP_ERR("%s txq:err=%d, port=%u\n", > > >> + __func__, ret, (unsigned) > portid); > > >> + ODP_DBG("dpdk tx queue setup done\n"); > > >> + } > > >> + > > >> + /* Start device */ > > >> + ret = rte_eth_dev_start(portid); > > >> + if (ret < 0) > > >> + ODP_ERR("rte_eth_dev_start:err=%d, port=%u\n", > > >> + ret, (unsigned) portid); > > >> + ODP_DBG("dpdk setup done\n\n"); > > >> + > > >> + portinit[portid] = 1; > > >> + } > > >> + pkt_dpdk->queueid = qid[portid]++; > > >> return 0; > > >> } > > >> diff --git a/platform/linux-dpdk/odp_packet_io.c > > >> b/platform/linux-dpdk/odp_packet_io.c > > >> index d8d127f..3124175 100644 > > >> --- a/platform/linux-dpdk/odp_packet_io.c > > >> +++ b/platform/linux-dpdk/odp_packet_io.c > > >> @@ -230,6 +230,8 @@ int odp_pktio_recv(odp_pktio_t id, odp_packet_t > > >> pkt_table[], unsigned len) > > >> if (pktio_entry == NULL) > > >> return -1; > > >> + odp_pktio_send(id, pkt_table, 0); > > >> + > > >> lock_entry(pktio_entry); > > >> pkts = recv_pkt_dpdk(&pktio_entry->s.pkt_dpdk, pkt_table, > len); > > >> unlock_entry(pktio_entry); > > >> > > > > > > > > > _______________________________________________ > > > lng-odp mailing list > > > lng-odp@lists.linaro.org > > > http://lists.linaro.org/mailman/listinfo/lng-odp > > > > > > > > > > > -- > > *Mike Holmes* > > Linaro Technical Manager / Lead > > LNG - ODP > > > _______________________________________________ > > lng-odp mailing list > > lng-odp@lists.linaro.org > > http://lists.linaro.org/mailman/listinfo/lng-odp > > > -- > Anders Roxell > anders.roxell@linaro.org > M: +46 709 71 42 85 | IRC: roxell > > _______________________________________________ > lng-odp mailing list > lng-odp@lists.linaro.org > http://lists.linaro.org/mailman/listinfo/lng-odp >
On 08/08/2014 05:13 PM, Venkatesh Vivekanandan wrote: > > > > On 7 August 2014 21:10, Anders Roxell <anders.roxell@linaro.org > <mailto:anders.roxell@linaro.org>> wrote: > > On 2014-08-07 10:41, Mike Holmes wrote: > > Does this need a signoff by someone else before it is merged ? > > > > I think we want to enforce getting an ack, tested-by or > reviewed-by before > > we merge things, we have informally moved that way over the last > couple of > > weeks and now I think it is time we made it a formal requirement. > > Agree. > > > If this is the case, then is it fair to say initial discussion of > 24-hour window is void?. I guess Maxim was waiting for 2 days(for any > comments) before he could merge this patch. Do we have any time-limit > before which a patch /must /be reviewed or tested? I hope we can't > wait indefinitely or is this the case?. I think if patch came from platfrom maintainer, it's not new API. No comments in 1 or 2 days, than it's ok to merge it. If patch came from somobody alse I would ask maintainer to review it. Maxim. > Anders > > > > > Mike > > > > > > On 7 August 2014 09:15, Maxim Uvarov <maxim.uvarov@linaro.org > <mailto:maxim.uvarov@linaro.org>> wrote: > > > > > Merged, thanks! > > > > > > Maxim. > > > > > > > > > On 08/05/2014 06:54 PM, venkatesh.vivekanandan@linaro.org > <mailto:venkatesh.vivekanandan@linaro.org> wrote: > > > > > >> From: Venkatesh Vivekanandan > <venkatesh.vivekanandan@linaro.org > <mailto:venkatesh.vivekanandan@linaro.org>> > > >> > > >> - Multi queue support per interface is enabled. > > >> - odp_pktio_send with "0" packet is called in odp_pktio_recv to > > >> give the transmitted buffers back to mempool. > > >> - mbuf alloc failure during receive is fixed by giving more > buffers to > > >> mempool. > > >> - mempool cache size is given equivalent to MAX_PKT_BURST. > > >> > > >> Signed-off-by: Venkatesh Vivekanandan > <venkatesh.vivekanandan@linaro.org > <mailto:venkatesh.vivekanandan@linaro.org>> > > >> --- > > >> platform/linux-dpdk/include/odp_packet_dpdk.h | 24 +++++ > > >> platform/linux-dpdk/odp_buffer_pool.c | 4 +- > > >> platform/linux-dpdk/odp_packet_dpdk.c | 136 > > >> +++++++++++++------------- > > >> platform/linux-dpdk/odp_packet_io.c | 2 + > > >> 4 files changed, 94 insertions(+), 72 deletions(-) > > >> > > >> diff --git a/platform/linux-dpdk/include/odp_packet_dpdk.h > > >> b/platform/linux-dpdk/include/odp_packet_dpdk.h > > >> index bcbe9e8..bcf9aa5 100644 > > >> --- a/platform/linux-dpdk/include/odp_packet_dpdk.h > > >> +++ b/platform/linux-dpdk/include/odp_packet_dpdk.h > > >> @@ -50,6 +50,30 @@ > > >> #define DPDK_BLOCKING_IO > > >> +/* > > >> + * RX and TX Prefetch, Host, and Write-back threshold values > should be > > >> + * carefully set for optimal performance. Consult the network > > >> + * controller's datasheet and supporting DPDK documentation > for guidance > > >> + * on how these parameters should be set. > > >> + */ > > >> +#define RX_PTHRESH 8 /**< Default values of RX prefetch > threshold reg. */ > > >> +#define RX_HTHRESH 8 /**< Default values of RX host > threshold reg. */ > > >> +#define RX_WTHRESH 4 /**< Default values of RX write-back > threshold reg. > > >> */ > > >> + > > >> +/* > > >> + * These default values are optimized for use with the > Intel(R) 82599 10 > > >> GbE > > >> + * Controller and the DPDK ixgbe PMD. Consider using other > values for > > >> other > > >> + * network controllers and/or network drivers. > > >> + */ > > >> +#define TX_PTHRESH 36 /**< Default values of TX prefetch > threshold reg. > > >> */ > > >> +#define TX_HTHRESH 0 /**< Default values of TX host > threshold reg. */ > > >> +#define TX_WTHRESH 0 /**< Default values of TX write-back > threshold > > >> reg. */ > > >> + > > >> +#define MAX_PKT_BURST 16 > > >> +#define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */ > > >> +#define RTE_TEST_RX_DESC_DEFAULT 128 > > >> +#define RTE_TEST_TX_DESC_DEFAULT 512 > > >> + > > >> /** Packet socket using dpdk mmaped rings for both Rx and Tx */ > > >> typedef struct { > > >> odp_buffer_pool_t pool; > > >> diff --git a/platform/linux-dpdk/odp_buffer_pool.c > > >> b/platform/linux-dpdk/odp_buffer_pool.c > > >> index de90275..805ce68 100644 > > >> --- a/platform/linux-dpdk/odp_buffer_pool.c > > >> +++ b/platform/linux-dpdk/odp_buffer_pool.c > > >> @@ -23,7 +23,7 @@ > > >> #include <odp_packet_dpdk.h> > > >> #define MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + > > >> RTE_PKTMBUF_HEADROOM) > > >> -#define NB_MBUF 8192 > > >> +#define NB_MBUF 32768 > > >> #ifdef POOL_USE_TICKETLOCK > > >> #include <odp_ticketlock.h> > > >> @@ -112,7 +112,7 @@ odp_buffer_pool_t > odp_buffer_pool_create(const char > > >> *name, > > >> pktmbuf_pool = > > >> rte_mempool_create(name, NB_MBUF, > > >> - MBUF_SIZE, 32, > > >> + MBUF_SIZE, MAX_PKT_BURST, > > >> sizeof(struct > > >> rte_pktmbuf_pool_private), > > >> rte_pktmbuf_pool_init, NULL, > > >> rte_pktmbuf_init, NULL, > > >> diff --git a/platform/linux-dpdk/odp_packet_dpdk.c > > >> b/platform/linux-dpdk/odp_packet_dpdk.c > > >> index 31bfa30..d5c8e80 100644 > > >> --- a/platform/linux-dpdk/odp_packet_dpdk.c > > >> +++ b/platform/linux-dpdk/odp_packet_dpdk.c > > >> @@ -26,34 +26,13 @@ > > >> #include <odp_packet_dpdk.h> > > >> #include <net/if.h> > > >> -/* > > >> - * RX and TX Prefetch, Host, and Write-back threshold values > should be > > >> - * carefully set for optimal performance. Consult the network > > >> - * controller's datasheet and supporting DPDK documentation > for guidance > > >> - * on how these parameters should be set. > > >> - */ > > >> -#define RX_PTHRESH 8 /**< Default values of RX prefetch > threshold reg. */ > > >> -#define RX_HTHRESH 8 /**< Default values of RX host > threshold reg. */ > > >> -#define RX_WTHRESH 4 /**< Default values of RX write-back > threshold reg. > > >> */ > > >> - > > >> -/* > > >> - * These default values are optimized for use with the > Intel(R) 82599 10 > > >> GbE > > >> - * Controller and the DPDK ixgbe PMD. Consider using other > values for > > >> other > > >> - * network controllers and/or network drivers. > > >> - */ > > >> -#define TX_PTHRESH 36 /**< Default values of TX prefetch > threshold reg. > > >> */ > > >> -#define TX_HTHRESH 0 /**< Default values of TX host > threshold reg. */ > > >> -#define TX_WTHRESH 0 /**< Default values of TX write-back > threshold > > >> reg. */ > > >> - > > >> -#define MAX_PKT_BURST 16 > > >> -#define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */ > > >> -#define RTE_TEST_RX_DESC_DEFAULT 128 > > >> -#define RTE_TEST_TX_DESC_DEFAULT 512 > > >> static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT; > > >> static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT; > > >> static const struct rte_eth_conf port_conf = { > > >> .rxmode = { > > >> + .mq_mode = ETH_MQ_RX_RSS, > > >> + .max_rx_pkt_len = ETHER_MAX_LEN, > > >> .split_hdr_size = 0, > > >> .header_split = 0, /**< Header Split > disabled */ > > >> .hw_ip_checksum = 0, /**< IP checksum offload > disabled */ > > >> @@ -61,6 +40,12 @@ static const struct rte_eth_conf port_conf = { > > >> .jumbo_frame = 0, /**< Jumbo Frame Support > disabled */ > > >> .hw_strip_crc = 0, /**< CRC stripped by > hardware */ > > >> }, > > >> + .rx_adv_conf = { > > >> + .rss_conf = { > > >> + .rss_key = NULL, > > >> + .rss_hf = ETH_RSS_IPV4 | ETH_RSS_IPV6, > > >> + }, > > >> + }, > > >> .txmode = { > > >> .mq_mode = ETH_MQ_TX_NONE, > > >> }, > > >> @@ -95,60 +80,71 @@ int setup_pkt_dpdk(pkt_dpdk_t * const > pkt_dpdk, const > > >> char *netdev, > > >> ODP_DBG("setup_pkt_dpdk\n"); > > >> static struct ether_addr eth_addr[RTE_MAX_ETHPORTS]; > > >> - uint8_t portid = 0; > > >> - uint16_t queueid = 0; > > >> - int ret; > > >> + static int portinit[RTE_MAX_ETHPORTS]; > > >> + static int qid[RTE_MAX_ETHPORTS]; > > >> + uint8_t portid = 0, num_intf = 2; > > >> + uint16_t nbrxq = 0, nbtxq = 0; > > >> + int ret, i; > > >> + > > >> printf("dpdk netdev: %s\n", netdev); > > >> printf("dpdk pool: %lx\n", pool); > > >> - > > >> portid = atoi(netdev); > > >> pkt_dpdk->portid = portid; > > >> - pkt_dpdk->queueid = queueid; > > >> pkt_dpdk->pool = pool; > > >> printf("dpdk portid: %u\n", portid); > > >> - fflush(stdout); > > >> - ret = rte_eth_dev_configure(portid, 1, 1, &port_conf); > > >> - if (ret < 0) > > >> - ODP_ERR("Cannot configure device: err=%d, > port=%u\n", > > >> - ret, (unsigned) portid); > > >> - > > >> - rte_eth_macaddr_get(portid, ð_addr[portid]); > > >> - ODP_DBG("Port %u, MAC address: > %02X:%02X:%02X:%02X:%02X:%02X\ > > >> n\n", > > >> - (unsigned) portid, > > >> - eth_addr[portid].addr_bytes[0], > > >> - eth_addr[portid].addr_bytes[1], > > >> - eth_addr[portid].addr_bytes[2], > > >> - eth_addr[portid].addr_bytes[3], > > >> - eth_addr[portid].addr_bytes[4], > > >> - eth_addr[portid].addr_bytes[5]); > > >> - > > >> - /* init one RX queue on each port */ > > >> - fflush(stdout); > > >> - ret = rte_eth_rx_queue_setup(portid, queueid, nb_rxd, > > >> - rte_eth_dev_socket_id(portid), > > >> &rx_conf, > > >> - (struct rte_mempool *)pool); > > >> - if (ret < 0) > > >> - ODP_ERR("rte_eth_rx_queue_setup:err=%d, port=%u\n", > > >> - ret, (unsigned) portid); > > >> - ODP_DBG("dpdk rx queue setup done\n"); > > >> - > > >> - /* init one TX queue on each port */ > > >> - fflush(stdout); > > >> - ret = rte_eth_tx_queue_setup(portid, queueid, nb_txd, > > >> - rte_eth_dev_socket_id(portid), &tx_conf); > > >> - if (ret < 0) > > >> - ODP_ERR("rte_eth_tx_queue_setup:err=%d, port=%u\n", > > >> - ret, (unsigned) portid); > > >> - ODP_DBG("dpdk tx queue setup done\n"); > > >> - > > >> - /* Start device */ > > >> - ret = rte_eth_dev_start(portid); > > >> - if (ret < 0) > > >> - ODP_ERR("rte_eth_dev_start:err=%d, port=%u\n", > > >> - ret, (unsigned) portid); > > >> - ODP_DBG("dpdk setup done\n\n"); > > >> - > > >> + nbrxq = odp_sys_core_count() / num_intf; > > >> + nbtxq = nbrxq; > > >> + if (portinit[portid] == 0) { > > >> + fflush(stdout); > > >> + ret = rte_eth_dev_configure(portid, nbrxq, nbtxq, > > >> &port_conf); > > >> + if (ret < 0) > > >> + ODP_ERR("Cannot configure device: err=%d, > > >> port=%u\n", > > >> + ret, (unsigned) portid); > > >> + > > >> + rte_eth_macaddr_get(portid, ð_addr[portid]); > > >> + ODP_DBG("Port %u, MAC address: > > >> %02X:%02X:%02X:%02X:%02X:%02X\n", > > >> + (unsigned) portid, > > >> + eth_addr[portid].addr_bytes[0], > > >> + eth_addr[portid].addr_bytes[1], > > >> + eth_addr[portid].addr_bytes[2], > > >> + eth_addr[portid].addr_bytes[3], > > >> + eth_addr[portid].addr_bytes[4], > > >> + eth_addr[portid].addr_bytes[5]); > > >> + > > >> + /* init one RX queue on each port */ > > >> + fflush(stdout); > > >> + for (i = 0; i < nbrxq; i++) { > > >> + ret = rte_eth_rx_queue_setup(portid, > i, nb_rxd, > > >> + rte_eth_dev_socket_id(portid), > > >> &rx_conf, > > >> + (struct rte_mempool *)pool); > > >> + if (ret < 0) > > >> + ODP_ERR("%s rxq:err=%d, port=%u\n", > > >> + __func__, ret, (unsigned) portid); > > >> + ODP_DBG("dpdk rx queue setup done\n"); > > >> + } > > >> + > > >> + /* init one TX queue on each port */ > > >> + fflush(stdout); > > >> + for (i = 0; i < nbtxq; i++) { > > >> + ret = rte_eth_tx_queue_setup(portid, > i, nb_txd, > > >> + rte_eth_dev_socket_id(portid), &tx_conf); > > >> + if (ret < 0) > > >> + ODP_ERR("%s txq:err=%d, port=%u\n", > > >> + __func__, ret, (unsigned) portid); > > >> + ODP_DBG("dpdk tx queue setup done\n"); > > >> + } > > >> + > > >> + /* Start device */ > > >> + ret = rte_eth_dev_start(portid); > > >> + if (ret < 0) > > >> + ODP_ERR("rte_eth_dev_start:err=%d, port=%u\n", > > >> + ret, (unsigned) portid); > > >> + ODP_DBG("dpdk setup done\n\n"); > > >> + > > >> + portinit[portid] = 1; > > >> + } > > >> + pkt_dpdk->queueid = qid[portid]++; > > >> return 0; > > >> } > > >> diff --git a/platform/linux-dpdk/odp_packet_io.c > > >> b/platform/linux-dpdk/odp_packet_io.c > > >> index d8d127f..3124175 100644 > > >> --- a/platform/linux-dpdk/odp_packet_io.c > > >> +++ b/platform/linux-dpdk/odp_packet_io.c > > >> @@ -230,6 +230,8 @@ int odp_pktio_recv(odp_pktio_t id, > odp_packet_t > > >> pkt_table[], unsigned len) > > >> if (pktio_entry == NULL) > > >> return -1; > > >> + odp_pktio_send(id, pkt_table, 0); > > >> + > > >> lock_entry(pktio_entry); > > >> pkts = recv_pkt_dpdk(&pktio_entry->s.pkt_dpdk, > pkt_table, len); > > >> unlock_entry(pktio_entry); > > >> > > > > > > > > > _______________________________________________ > > > lng-odp mailing list > > > lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org> > > > http://lists.linaro.org/mailman/listinfo/lng-odp > > > > > > > > > > > -- > > *Mike Holmes* > > Linaro Technical Manager / Lead > > LNG - ODP > > > _______________________________________________ > > lng-odp mailing list > > lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org> > > http://lists.linaro.org/mailman/listinfo/lng-odp > > > -- > Anders Roxell > anders.roxell@linaro.org <mailto:anders.roxell@linaro.org> > M: +46 709 71 42 85 | IRC: roxell > > _______________________________________________ > lng-odp mailing list > lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org> > http://lists.linaro.org/mailman/listinfo/lng-odp > > > > > _______________________________________________ > lng-odp mailing list > lng-odp@lists.linaro.org > http://lists.linaro.org/mailman/listinfo/lng-odp
Small clarification to Maxim's proposal "I think if patch came from platform maintainer, it's not new API. No comments in 1 or 2 days, than it's ok to merge it. If patch came from somebody else I would ask maintainer to review it *and wait for a day or 2 before merging"* Raj Murali On 8 August 2014 19:01, Maxim Uvarov <maxim.uvarov@linaro.org> wrote: > On 08/08/2014 05:13 PM, Venkatesh Vivekanandan wrote: > >> >> >> >> On 7 August 2014 21:10, Anders Roxell <anders.roxell@linaro.org <mailto: >> anders.roxell@linaro.org>> wrote: >> >> On 2014-08-07 10:41, Mike Holmes wrote: >> > Does this need a signoff by someone else before it is merged ? >> > >> > I think we want to enforce getting an ack, tested-by or >> reviewed-by before >> > we merge things, we have informally moved that way over the last >> couple of >> > weeks and now I think it is time we made it a formal requirement. >> >> Agree. >> >> >> If this is the case, then is it fair to say initial discussion of 24-hour >> window is void?. I guess Maxim was waiting for 2 days(for any comments) >> before he could merge this patch. Do we have any time-limit before which a >> patch /must /be reviewed or tested? I hope we can't wait indefinitely or is >> this the case?. >> > > I think if patch came from platfrom maintainer, it's not new API. No > comments in 1 or 2 days, than it's ok to merge it. If patch came from > somobody alse I would ask maintainer to review it. > > Maxim. > > Anders >> >> > >> > Mike >> > >> > >> > On 7 August 2014 09:15, Maxim Uvarov <maxim.uvarov@linaro.org >> <mailto:maxim.uvarov@linaro.org>> wrote: >> > >> > > Merged, thanks! >> > > >> > > Maxim. >> > > >> > > >> > > On 08/05/2014 06:54 PM, venkatesh.vivekanandan@linaro.org >> <mailto:venkatesh.vivekanandan@linaro.org> wrote: >> > > >> > >> From: Venkatesh Vivekanandan >> <venkatesh.vivekanandan@linaro.org >> <mailto:venkatesh.vivekanandan@linaro.org>> >> >> > >> >> > >> - Multi queue support per interface is enabled. >> > >> - odp_pktio_send with "0" packet is called in odp_pktio_recv to >> > >> give the transmitted buffers back to mempool. >> > >> - mbuf alloc failure during receive is fixed by giving more >> buffers to >> > >> mempool. >> > >> - mempool cache size is given equivalent to MAX_PKT_BURST. >> > >> >> > >> Signed-off-by: Venkatesh Vivekanandan >> <venkatesh.vivekanandan@linaro.org >> <mailto:venkatesh.vivekanandan@linaro.org>> >> >> > >> --- >> > >> platform/linux-dpdk/include/odp_packet_dpdk.h | 24 +++++ >> > >> platform/linux-dpdk/odp_buffer_pool.c | 4 +- >> > >> platform/linux-dpdk/odp_packet_dpdk.c | 136 >> > >> +++++++++++++------------- >> > >> platform/linux-dpdk/odp_packet_io.c | 2 + >> > >> 4 files changed, 94 insertions(+), 72 deletions(-) >> > >> >> > >> diff --git a/platform/linux-dpdk/include/odp_packet_dpdk.h >> > >> b/platform/linux-dpdk/include/odp_packet_dpdk.h >> > >> index bcbe9e8..bcf9aa5 100644 >> > >> --- a/platform/linux-dpdk/include/odp_packet_dpdk.h >> > >> +++ b/platform/linux-dpdk/include/odp_packet_dpdk.h >> > >> @@ -50,6 +50,30 @@ >> > >> #define DPDK_BLOCKING_IO >> > >> +/* >> > >> + * RX and TX Prefetch, Host, and Write-back threshold values >> should be >> > >> + * carefully set for optimal performance. Consult the network >> > >> + * controller's datasheet and supporting DPDK documentation >> for guidance >> > >> + * on how these parameters should be set. >> > >> + */ >> > >> +#define RX_PTHRESH 8 /**< Default values of RX prefetch >> threshold reg. */ >> > >> +#define RX_HTHRESH 8 /**< Default values of RX host >> threshold reg. */ >> > >> +#define RX_WTHRESH 4 /**< Default values of RX write-back >> threshold reg. >> > >> */ >> > >> + >> > >> +/* >> > >> + * These default values are optimized for use with the >> Intel(R) 82599 10 >> > >> GbE >> > >> + * Controller and the DPDK ixgbe PMD. Consider using other >> values for >> > >> other >> > >> + * network controllers and/or network drivers. >> > >> + */ >> > >> +#define TX_PTHRESH 36 /**< Default values of TX prefetch >> threshold reg. >> > >> */ >> > >> +#define TX_HTHRESH 0 /**< Default values of TX host >> threshold reg. */ >> > >> +#define TX_WTHRESH 0 /**< Default values of TX write-back >> threshold >> > >> reg. */ >> > >> + >> > >> +#define MAX_PKT_BURST 16 >> > >> +#define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */ >> > >> +#define RTE_TEST_RX_DESC_DEFAULT 128 >> > >> +#define RTE_TEST_TX_DESC_DEFAULT 512 >> > >> + >> > >> /** Packet socket using dpdk mmaped rings for both Rx and Tx */ >> > >> typedef struct { >> > >> odp_buffer_pool_t pool; >> > >> diff --git a/platform/linux-dpdk/odp_buffer_pool.c >> > >> b/platform/linux-dpdk/odp_buffer_pool.c >> > >> index de90275..805ce68 100644 >> > >> --- a/platform/linux-dpdk/odp_buffer_pool.c >> > >> +++ b/platform/linux-dpdk/odp_buffer_pool.c >> > >> @@ -23,7 +23,7 @@ >> > >> #include <odp_packet_dpdk.h> >> > >> #define MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + >> > >> RTE_PKTMBUF_HEADROOM) >> > >> -#define NB_MBUF 8192 >> > >> +#define NB_MBUF 32768 >> > >> #ifdef POOL_USE_TICKETLOCK >> > >> #include <odp_ticketlock.h> >> > >> @@ -112,7 +112,7 @@ odp_buffer_pool_t >> odp_buffer_pool_create(const char >> > >> *name, >> > >> pktmbuf_pool = >> > >> rte_mempool_create(name, NB_MBUF, >> > >> - MBUF_SIZE, 32, >> > >> + MBUF_SIZE, MAX_PKT_BURST, >> > >> sizeof(struct >> > >> rte_pktmbuf_pool_private), >> > >> rte_pktmbuf_pool_init, NULL, >> > >> rte_pktmbuf_init, NULL, >> > >> diff --git a/platform/linux-dpdk/odp_packet_dpdk.c >> > >> b/platform/linux-dpdk/odp_packet_dpdk.c >> > >> index 31bfa30..d5c8e80 100644 >> > >> --- a/platform/linux-dpdk/odp_packet_dpdk.c >> > >> +++ b/platform/linux-dpdk/odp_packet_dpdk.c >> > >> @@ -26,34 +26,13 @@ >> > >> #include <odp_packet_dpdk.h> >> > >> #include <net/if.h> >> > >> -/* >> > >> - * RX and TX Prefetch, Host, and Write-back threshold values >> should be >> > >> - * carefully set for optimal performance. Consult the network >> > >> - * controller's datasheet and supporting DPDK documentation >> for guidance >> > >> - * on how these parameters should be set. >> > >> - */ >> > >> -#define RX_PTHRESH 8 /**< Default values of RX prefetch >> threshold reg. */ >> > >> -#define RX_HTHRESH 8 /**< Default values of RX host >> threshold reg. */ >> > >> -#define RX_WTHRESH 4 /**< Default values of RX write-back >> threshold reg. >> > >> */ >> > >> - >> > >> -/* >> > >> - * These default values are optimized for use with the >> Intel(R) 82599 10 >> > >> GbE >> > >> - * Controller and the DPDK ixgbe PMD. Consider using other >> values for >> > >> other >> > >> - * network controllers and/or network drivers. >> > >> - */ >> > >> -#define TX_PTHRESH 36 /**< Default values of TX prefetch >> threshold reg. >> > >> */ >> > >> -#define TX_HTHRESH 0 /**< Default values of TX host >> threshold reg. */ >> > >> -#define TX_WTHRESH 0 /**< Default values of TX write-back >> threshold >> > >> reg. */ >> > >> - >> > >> -#define MAX_PKT_BURST 16 >> > >> -#define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */ >> > >> -#define RTE_TEST_RX_DESC_DEFAULT 128 >> > >> -#define RTE_TEST_TX_DESC_DEFAULT 512 >> > >> static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT; >> > >> static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT; >> > >> static const struct rte_eth_conf port_conf = { >> > >> .rxmode = { >> > >> + .mq_mode = ETH_MQ_RX_RSS, >> > >> + .max_rx_pkt_len = ETHER_MAX_LEN, >> > >> .split_hdr_size = 0, >> > >> .header_split = 0, /**< Header Split >> disabled */ >> > >> .hw_ip_checksum = 0, /**< IP checksum offload >> disabled */ >> > >> @@ -61,6 +40,12 @@ static const struct rte_eth_conf port_conf = { >> > >> .jumbo_frame = 0, /**< Jumbo Frame Support >> disabled */ >> > >> .hw_strip_crc = 0, /**< CRC stripped by >> hardware */ >> > >> }, >> > >> + .rx_adv_conf = { >> > >> + .rss_conf = { >> > >> + .rss_key = NULL, >> > >> + .rss_hf = ETH_RSS_IPV4 | ETH_RSS_IPV6, >> > >> + }, >> > >> + }, >> > >> .txmode = { >> > >> .mq_mode = ETH_MQ_TX_NONE, >> > >> }, >> > >> @@ -95,60 +80,71 @@ int setup_pkt_dpdk(pkt_dpdk_t * const >> pkt_dpdk, const >> > >> char *netdev, >> > >> ODP_DBG("setup_pkt_dpdk\n"); >> > >> static struct ether_addr eth_addr[RTE_MAX_ETHPORTS]; >> > >> - uint8_t portid = 0; >> > >> - uint16_t queueid = 0; >> > >> - int ret; >> > >> + static int portinit[RTE_MAX_ETHPORTS]; >> > >> + static int qid[RTE_MAX_ETHPORTS]; >> > >> + uint8_t portid = 0, num_intf = 2; >> > >> + uint16_t nbrxq = 0, nbtxq = 0; >> > >> + int ret, i; >> > >> + >> > >> printf("dpdk netdev: %s\n", netdev); >> > >> printf("dpdk pool: %lx\n", pool); >> > >> - >> > >> portid = atoi(netdev); >> > >> pkt_dpdk->portid = portid; >> > >> - pkt_dpdk->queueid = queueid; >> > >> pkt_dpdk->pool = pool; >> > >> printf("dpdk portid: %u\n", portid); >> > >> - fflush(stdout); >> > >> - ret = rte_eth_dev_configure(portid, 1, 1, &port_conf); >> > >> - if (ret < 0) >> > >> - ODP_ERR("Cannot configure device: err=%d, >> port=%u\n", >> > >> - ret, (unsigned) portid); >> > >> - >> > >> - rte_eth_macaddr_get(portid, ð_addr[portid]); >> > >> - ODP_DBG("Port %u, MAC address: >> %02X:%02X:%02X:%02X:%02X:%02X\ >> > >> n\n", >> > >> - (unsigned) portid, >> > >> - eth_addr[portid].addr_bytes[0], >> > >> - eth_addr[portid].addr_bytes[1], >> > >> - eth_addr[portid].addr_bytes[2], >> > >> - eth_addr[portid].addr_bytes[3], >> > >> - eth_addr[portid].addr_bytes[4], >> > >> - eth_addr[portid].addr_bytes[5]); >> > >> - >> > >> - /* init one RX queue on each port */ >> > >> - fflush(stdout); >> > >> - ret = rte_eth_rx_queue_setup(portid, queueid, nb_rxd, >> > >> - rte_eth_dev_socket_id(portid), >> > >> &rx_conf, >> > >> - (struct rte_mempool *)pool); >> > >> - if (ret < 0) >> > >> - ODP_ERR("rte_eth_rx_queue_setup:err=%d, port=%u\n", >> > >> - ret, (unsigned) portid); >> > >> - ODP_DBG("dpdk rx queue setup done\n"); >> > >> - >> > >> - /* init one TX queue on each port */ >> > >> - fflush(stdout); >> > >> - ret = rte_eth_tx_queue_setup(portid, queueid, nb_txd, >> > >> - rte_eth_dev_socket_id(portid), &tx_conf); >> > >> - if (ret < 0) >> > >> - ODP_ERR("rte_eth_tx_queue_setup:err=%d, port=%u\n", >> > >> - ret, (unsigned) portid); >> > >> - ODP_DBG("dpdk tx queue setup done\n"); >> > >> - >> > >> - /* Start device */ >> > >> - ret = rte_eth_dev_start(portid); >> > >> - if (ret < 0) >> > >> - ODP_ERR("rte_eth_dev_start:err=%d, port=%u\n", >> > >> - ret, (unsigned) portid); >> > >> - ODP_DBG("dpdk setup done\n\n"); >> > >> - >> > >> + nbrxq = odp_sys_core_count() / num_intf; >> > >> + nbtxq = nbrxq; >> > >> + if (portinit[portid] == 0) { >> > >> + fflush(stdout); >> > >> + ret = rte_eth_dev_configure(portid, nbrxq, nbtxq, >> > >> &port_conf); >> > >> + if (ret < 0) >> > >> + ODP_ERR("Cannot configure device: err=%d, >> > >> port=%u\n", >> > >> + ret, (unsigned) portid); >> > >> + >> > >> + rte_eth_macaddr_get(portid, ð_addr[portid]); >> > >> + ODP_DBG("Port %u, MAC address: >> > >> %02X:%02X:%02X:%02X:%02X:%02X\n", >> > >> + (unsigned) portid, >> > >> + eth_addr[portid].addr_bytes[0], >> > >> + eth_addr[portid].addr_bytes[1], >> > >> + eth_addr[portid].addr_bytes[2], >> > >> + eth_addr[portid].addr_bytes[3], >> > >> + eth_addr[portid].addr_bytes[4], >> > >> + eth_addr[portid].addr_bytes[5]); >> > >> + >> > >> + /* init one RX queue on each port */ >> > >> + fflush(stdout); >> > >> + for (i = 0; i < nbrxq; i++) { >> > >> + ret = rte_eth_rx_queue_setup(portid, >> i, nb_rxd, >> > >> + rte_eth_dev_socket_id(portid), >> > >> &rx_conf, >> > >> + (struct rte_mempool *)pool); >> > >> + if (ret < 0) >> > >> + ODP_ERR("%s rxq:err=%d, port=%u\n", >> > >> + __func__, ret, (unsigned) portid); >> > >> + ODP_DBG("dpdk rx queue setup done\n"); >> > >> + } >> > >> + >> > >> + /* init one TX queue on each port */ >> > >> + fflush(stdout); >> > >> + for (i = 0; i < nbtxq; i++) { >> > >> + ret = rte_eth_tx_queue_setup(portid, >> i, nb_txd, >> > >> + rte_eth_dev_socket_id(portid), &tx_conf); >> > >> + if (ret < 0) >> > >> + ODP_ERR("%s txq:err=%d, port=%u\n", >> > >> + __func__, ret, (unsigned) portid); >> > >> + ODP_DBG("dpdk tx queue setup done\n"); >> > >> + } >> > >> + >> > >> + /* Start device */ >> > >> + ret = rte_eth_dev_start(portid); >> > >> + if (ret < 0) >> > >> + ODP_ERR("rte_eth_dev_start:err=%d, port=%u\n", >> > >> + ret, (unsigned) portid); >> > >> + ODP_DBG("dpdk setup done\n\n"); >> > >> + >> > >> + portinit[portid] = 1; >> > >> + } >> > >> + pkt_dpdk->queueid = qid[portid]++; >> > >> return 0; >> > >> } >> > >> diff --git a/platform/linux-dpdk/odp_packet_io.c >> > >> b/platform/linux-dpdk/odp_packet_io.c >> > >> index d8d127f..3124175 100644 >> > >> --- a/platform/linux-dpdk/odp_packet_io.c >> > >> +++ b/platform/linux-dpdk/odp_packet_io.c >> > >> @@ -230,6 +230,8 @@ int odp_pktio_recv(odp_pktio_t id, >> odp_packet_t >> > >> pkt_table[], unsigned len) >> > >> if (pktio_entry == NULL) >> > >> return -1; >> > >> + odp_pktio_send(id, pkt_table, 0); >> > >> + >> > >> lock_entry(pktio_entry); >> > >> pkts = recv_pkt_dpdk(&pktio_entry->s.pkt_dpdk, >> pkt_table, len); >> > >> unlock_entry(pktio_entry); >> > >> >> > > >> > > >> > > _______________________________________________ >> > > lng-odp mailing list >> > > lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org> >> >> > > http://lists.linaro.org/mailman/listinfo/lng-odp >> > > >> > >> > >> > >> > -- >> > *Mike Holmes* >> > Linaro Technical Manager / Lead >> > LNG - ODP >> >> > _______________________________________________ >> > lng-odp mailing list >> > lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org> >> >> > http://lists.linaro.org/mailman/listinfo/lng-odp >> >> >> -- >> Anders Roxell >> anders.roxell@linaro.org <mailto:anders.roxell@linaro.org> >> >> M: +46 709 71 42 85 | IRC: roxell >> >> _______________________________________________ >> lng-odp mailing list >> lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org> >> http://lists.linaro.org/mailman/listinfo/lng-odp >> >> >> >> >> >> _______________________________________________ >> lng-odp mailing list >> lng-odp@lists.linaro.org >> http://lists.linaro.org/mailman/listinfo/lng-odp >> > > > _______________________________________________ > lng-odp mailing list > lng-odp@lists.linaro.org > http://lists.linaro.org/mailman/listinfo/lng-odp >
On 2014-08-08 17:31, Maxim Uvarov wrote: > On 08/08/2014 05:13 PM, Venkatesh Vivekanandan wrote: > > > > > > > >On 7 August 2014 21:10, Anders Roxell <anders.roxell@linaro.org > ><mailto:anders.roxell@linaro.org>> wrote: > > > > On 2014-08-07 10:41, Mike Holmes wrote: > > > Does this need a signoff by someone else before it is merged ? > > > > > > I think we want to enforce getting an ack, tested-by or > > reviewed-by before > > > we merge things, we have informally moved that way over the last > > couple of > > > weeks and now I think it is time we made it a formal requirement. > > > > Agree. > > > > > >If this is the case, then is it fair to say initial discussion of > >24-hour window is void?. I guess Maxim was waiting for 2 days(for > >any comments) before he could merge this patch. Do we have any > >time-limit before which a patch /must /be reviewed or tested? I > >hope we can't wait indefinitely or is this the case?. > > I think if patch came from platfrom maintainer, it's not new API. No > comments in 1 or 2 days, than it's ok to merge it. If patch came > from somobody alse I would ask maintainer to review it. I disagree with this. No matter where the patch comes from and who wrote the patch, it can be wrong and need a second pair of eyes i.e., (Reviewed|Acked|Signed-off)-by. If no one has replied to a patch after 2 days, the author of the patch should ping the list and maintainer. After the second pair of eyes, the patch should be ok to be merged. The ODP maintainer should do a smoke build test on all the supported platforms before merging though. Cheers, Anders > > Maxim. > > > Anders > > > > > > > > Mike > > > > > > > > > On 7 August 2014 09:15, Maxim Uvarov <maxim.uvarov@linaro.org > > <mailto:maxim.uvarov@linaro.org>> wrote: > > > > > > > Merged, thanks! > > > > > > > > Maxim. > > > > > > > > > > > > On 08/05/2014 06:54 PM, venkatesh.vivekanandan@linaro.org > > <mailto:venkatesh.vivekanandan@linaro.org> wrote: > > > > > > > >> From: Venkatesh Vivekanandan > > <venkatesh.vivekanandan@linaro.org > > <mailto:venkatesh.vivekanandan@linaro.org>> > > > >> > > > >> - Multi queue support per interface is enabled. > > > >> - odp_pktio_send with "0" packet is called in odp_pktio_recv to > > > >> give the transmitted buffers back to mempool. > > > >> - mbuf alloc failure during receive is fixed by giving more > > buffers to > > > >> mempool. > > > >> - mempool cache size is given equivalent to MAX_PKT_BURST. > > > >> > > > >> Signed-off-by: Venkatesh Vivekanandan > > <venkatesh.vivekanandan@linaro.org > > <mailto:venkatesh.vivekanandan@linaro.org>> > > > >> --- > > > >> platform/linux-dpdk/include/odp_packet_dpdk.h | 24 +++++ > > > >> platform/linux-dpdk/odp_buffer_pool.c | 4 +- > > > >> platform/linux-dpdk/odp_packet_dpdk.c | 136 > > > >> +++++++++++++------------- > > > >> platform/linux-dpdk/odp_packet_io.c | 2 + > > > >> 4 files changed, 94 insertions(+), 72 deletions(-) > > > >> > > > >> diff --git a/platform/linux-dpdk/include/odp_packet_dpdk.h > > > >> b/platform/linux-dpdk/include/odp_packet_dpdk.h > > > >> index bcbe9e8..bcf9aa5 100644 > > > >> --- a/platform/linux-dpdk/include/odp_packet_dpdk.h > > > >> +++ b/platform/linux-dpdk/include/odp_packet_dpdk.h > > > >> @@ -50,6 +50,30 @@ > > > >> #define DPDK_BLOCKING_IO > > > >> +/* > > > >> + * RX and TX Prefetch, Host, and Write-back threshold values > > should be > > > >> + * carefully set for optimal performance. Consult the network > > > >> + * controller's datasheet and supporting DPDK documentation > > for guidance > > > >> + * on how these parameters should be set. > > > >> + */ > > > >> +#define RX_PTHRESH 8 /**< Default values of RX prefetch > > threshold reg. */ > > > >> +#define RX_HTHRESH 8 /**< Default values of RX host > > threshold reg. */ > > > >> +#define RX_WTHRESH 4 /**< Default values of RX write-back > > threshold reg. > > > >> */ > > > >> + > > > >> +/* > > > >> + * These default values are optimized for use with the > > Intel(R) 82599 10 > > > >> GbE > > > >> + * Controller and the DPDK ixgbe PMD. Consider using other > > values for > > > >> other > > > >> + * network controllers and/or network drivers. > > > >> + */ > > > >> +#define TX_PTHRESH 36 /**< Default values of TX prefetch > > threshold reg. > > > >> */ > > > >> +#define TX_HTHRESH 0 /**< Default values of TX host > > threshold reg. */ > > > >> +#define TX_WTHRESH 0 /**< Default values of TX write-back > > threshold > > > >> reg. */ > > > >> + > > > >> +#define MAX_PKT_BURST 16 > > > >> +#define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */ > > > >> +#define RTE_TEST_RX_DESC_DEFAULT 128 > > > >> +#define RTE_TEST_TX_DESC_DEFAULT 512 > > > >> + > > > >> /** Packet socket using dpdk mmaped rings for both Rx and Tx */ > > > >> typedef struct { > > > >> odp_buffer_pool_t pool; > > > >> diff --git a/platform/linux-dpdk/odp_buffer_pool.c > > > >> b/platform/linux-dpdk/odp_buffer_pool.c > > > >> index de90275..805ce68 100644 > > > >> --- a/platform/linux-dpdk/odp_buffer_pool.c > > > >> +++ b/platform/linux-dpdk/odp_buffer_pool.c > > > >> @@ -23,7 +23,7 @@ > > > >> #include <odp_packet_dpdk.h> > > > >> #define MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + > > > >> RTE_PKTMBUF_HEADROOM) > > > >> -#define NB_MBUF 8192 > > > >> +#define NB_MBUF 32768 > > > >> #ifdef POOL_USE_TICKETLOCK > > > >> #include <odp_ticketlock.h> > > > >> @@ -112,7 +112,7 @@ odp_buffer_pool_t > > odp_buffer_pool_create(const char > > > >> *name, > > > >> pktmbuf_pool = > > > >> rte_mempool_create(name, NB_MBUF, > > > >> - MBUF_SIZE, 32, > > > >> + MBUF_SIZE, MAX_PKT_BURST, > > > >> sizeof(struct > > > >> rte_pktmbuf_pool_private), > > > >> rte_pktmbuf_pool_init, NULL, > > > >> rte_pktmbuf_init, NULL, > > > >> diff --git a/platform/linux-dpdk/odp_packet_dpdk.c > > > >> b/platform/linux-dpdk/odp_packet_dpdk.c > > > >> index 31bfa30..d5c8e80 100644 > > > >> --- a/platform/linux-dpdk/odp_packet_dpdk.c > > > >> +++ b/platform/linux-dpdk/odp_packet_dpdk.c > > > >> @@ -26,34 +26,13 @@ > > > >> #include <odp_packet_dpdk.h> > > > >> #include <net/if.h> > > > >> -/* > > > >> - * RX and TX Prefetch, Host, and Write-back threshold values > > should be > > > >> - * carefully set for optimal performance. Consult the network > > > >> - * controller's datasheet and supporting DPDK documentation > > for guidance > > > >> - * on how these parameters should be set. > > > >> - */ > > > >> -#define RX_PTHRESH 8 /**< Default values of RX prefetch > > threshold reg. */ > > > >> -#define RX_HTHRESH 8 /**< Default values of RX host > > threshold reg. */ > > > >> -#define RX_WTHRESH 4 /**< Default values of RX write-back > > threshold reg. > > > >> */ > > > >> - > > > >> -/* > > > >> - * These default values are optimized for use with the > > Intel(R) 82599 10 > > > >> GbE > > > >> - * Controller and the DPDK ixgbe PMD. Consider using other > > values for > > > >> other > > > >> - * network controllers and/or network drivers. > > > >> - */ > > > >> -#define TX_PTHRESH 36 /**< Default values of TX prefetch > > threshold reg. > > > >> */ > > > >> -#define TX_HTHRESH 0 /**< Default values of TX host > > threshold reg. */ > > > >> -#define TX_WTHRESH 0 /**< Default values of TX write-back > > threshold > > > >> reg. */ > > > >> - > > > >> -#define MAX_PKT_BURST 16 > > > >> -#define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */ > > > >> -#define RTE_TEST_RX_DESC_DEFAULT 128 > > > >> -#define RTE_TEST_TX_DESC_DEFAULT 512 > > > >> static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT; > > > >> static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT; > > > >> static const struct rte_eth_conf port_conf = { > > > >> .rxmode = { > > > >> + .mq_mode = ETH_MQ_RX_RSS, > > > >> + .max_rx_pkt_len = ETHER_MAX_LEN, > > > >> .split_hdr_size = 0, > > > >> .header_split = 0, /**< Header Split > > disabled */ > > > >> .hw_ip_checksum = 0, /**< IP checksum offload > > disabled */ > > > >> @@ -61,6 +40,12 @@ static const struct rte_eth_conf port_conf = { > > > >> .jumbo_frame = 0, /**< Jumbo Frame Support > > disabled */ > > > >> .hw_strip_crc = 0, /**< CRC stripped by > > hardware */ > > > >> }, > > > >> + .rx_adv_conf = { > > > >> + .rss_conf = { > > > >> + .rss_key = NULL, > > > >> + .rss_hf = ETH_RSS_IPV4 | ETH_RSS_IPV6, > > > >> + }, > > > >> + }, > > > >> .txmode = { > > > >> .mq_mode = ETH_MQ_TX_NONE, > > > >> }, > > > >> @@ -95,60 +80,71 @@ int setup_pkt_dpdk(pkt_dpdk_t * const > > pkt_dpdk, const > > > >> char *netdev, > > > >> ODP_DBG("setup_pkt_dpdk\n"); > > > >> static struct ether_addr eth_addr[RTE_MAX_ETHPORTS]; > > > >> - uint8_t portid = 0; > > > >> - uint16_t queueid = 0; > > > >> - int ret; > > > >> + static int portinit[RTE_MAX_ETHPORTS]; > > > >> + static int qid[RTE_MAX_ETHPORTS]; > > > >> + uint8_t portid = 0, num_intf = 2; > > > >> + uint16_t nbrxq = 0, nbtxq = 0; > > > >> + int ret, i; > > > >> + > > > >> printf("dpdk netdev: %s\n", netdev); > > > >> printf("dpdk pool: %lx\n", pool); > > > >> - > > > >> portid = atoi(netdev); > > > >> pkt_dpdk->portid = portid; > > > >> - pkt_dpdk->queueid = queueid; > > > >> pkt_dpdk->pool = pool; > > > >> printf("dpdk portid: %u\n", portid); > > > >> - fflush(stdout); > > > >> - ret = rte_eth_dev_configure(portid, 1, 1, &port_conf); > > > >> - if (ret < 0) > > > >> - ODP_ERR("Cannot configure device: err=%d, > > port=%u\n", > > > >> - ret, (unsigned) portid); > > > >> - > > > >> - rte_eth_macaddr_get(portid, ð_addr[portid]); > > > >> - ODP_DBG("Port %u, MAC address: > > %02X:%02X:%02X:%02X:%02X:%02X\ > > > >> n\n", > > > >> - (unsigned) portid, > > > >> - eth_addr[portid].addr_bytes[0], > > > >> - eth_addr[portid].addr_bytes[1], > > > >> - eth_addr[portid].addr_bytes[2], > > > >> - eth_addr[portid].addr_bytes[3], > > > >> - eth_addr[portid].addr_bytes[4], > > > >> - eth_addr[portid].addr_bytes[5]); > > > >> - > > > >> - /* init one RX queue on each port */ > > > >> - fflush(stdout); > > > >> - ret = rte_eth_rx_queue_setup(portid, queueid, nb_rxd, > > > >> - rte_eth_dev_socket_id(portid), > > > >> &rx_conf, > > > >> - (struct rte_mempool *)pool); > > > >> - if (ret < 0) > > > >> - ODP_ERR("rte_eth_rx_queue_setup:err=%d, port=%u\n", > > > >> - ret, (unsigned) portid); > > > >> - ODP_DBG("dpdk rx queue setup done\n"); > > > >> - > > > >> - /* init one TX queue on each port */ > > > >> - fflush(stdout); > > > >> - ret = rte_eth_tx_queue_setup(portid, queueid, nb_txd, > > > >> - rte_eth_dev_socket_id(portid), &tx_conf); > > > >> - if (ret < 0) > > > >> - ODP_ERR("rte_eth_tx_queue_setup:err=%d, port=%u\n", > > > >> - ret, (unsigned) portid); > > > >> - ODP_DBG("dpdk tx queue setup done\n"); > > > >> - > > > >> - /* Start device */ > > > >> - ret = rte_eth_dev_start(portid); > > > >> - if (ret < 0) > > > >> - ODP_ERR("rte_eth_dev_start:err=%d, port=%u\n", > > > >> - ret, (unsigned) portid); > > > >> - ODP_DBG("dpdk setup done\n\n"); > > > >> - > > > >> + nbrxq = odp_sys_core_count() / num_intf; > > > >> + nbtxq = nbrxq; > > > >> + if (portinit[portid] == 0) { > > > >> + fflush(stdout); > > > >> + ret = rte_eth_dev_configure(portid, nbrxq, nbtxq, > > > >> &port_conf); > > > >> + if (ret < 0) > > > >> + ODP_ERR("Cannot configure device: err=%d, > > > >> port=%u\n", > > > >> + ret, (unsigned) portid); > > > >> + > > > >> + rte_eth_macaddr_get(portid, ð_addr[portid]); > > > >> + ODP_DBG("Port %u, MAC address: > > > >> %02X:%02X:%02X:%02X:%02X:%02X\n", > > > >> + (unsigned) portid, > > > >> + eth_addr[portid].addr_bytes[0], > > > >> + eth_addr[portid].addr_bytes[1], > > > >> + eth_addr[portid].addr_bytes[2], > > > >> + eth_addr[portid].addr_bytes[3], > > > >> + eth_addr[portid].addr_bytes[4], > > > >> + eth_addr[portid].addr_bytes[5]); > > > >> + > > > >> + /* init one RX queue on each port */ > > > >> + fflush(stdout); > > > >> + for (i = 0; i < nbrxq; i++) { > > > >> + ret = rte_eth_rx_queue_setup(portid, > > i, nb_rxd, > > > >> + rte_eth_dev_socket_id(portid), > > > >> &rx_conf, > > > >> + (struct rte_mempool *)pool); > > > >> + if (ret < 0) > > > >> + ODP_ERR("%s rxq:err=%d, port=%u\n", > > > >> + __func__, ret, (unsigned) portid); > > > >> + ODP_DBG("dpdk rx queue setup done\n"); > > > >> + } > > > >> + > > > >> + /* init one TX queue on each port */ > > > >> + fflush(stdout); > > > >> + for (i = 0; i < nbtxq; i++) { > > > >> + ret = rte_eth_tx_queue_setup(portid, > > i, nb_txd, > > > >> + rte_eth_dev_socket_id(portid), &tx_conf); > > > >> + if (ret < 0) > > > >> + ODP_ERR("%s txq:err=%d, port=%u\n", > > > >> + __func__, ret, (unsigned) portid); > > > >> + ODP_DBG("dpdk tx queue setup done\n"); > > > >> + } > > > >> + > > > >> + /* Start device */ > > > >> + ret = rte_eth_dev_start(portid); > > > >> + if (ret < 0) > > > >> + ODP_ERR("rte_eth_dev_start:err=%d, port=%u\n", > > > >> + ret, (unsigned) portid); > > > >> + ODP_DBG("dpdk setup done\n\n"); > > > >> + > > > >> + portinit[portid] = 1; > > > >> + } > > > >> + pkt_dpdk->queueid = qid[portid]++; > > > >> return 0; > > > >> } > > > >> diff --git a/platform/linux-dpdk/odp_packet_io.c > > > >> b/platform/linux-dpdk/odp_packet_io.c > > > >> index d8d127f..3124175 100644 > > > >> --- a/platform/linux-dpdk/odp_packet_io.c > > > >> +++ b/platform/linux-dpdk/odp_packet_io.c > > > >> @@ -230,6 +230,8 @@ int odp_pktio_recv(odp_pktio_t id, > > odp_packet_t > > > >> pkt_table[], unsigned len) > > > >> if (pktio_entry == NULL) > > > >> return -1; > > > >> + odp_pktio_send(id, pkt_table, 0); > > > >> + > > > >> lock_entry(pktio_entry); > > > >> pkts = recv_pkt_dpdk(&pktio_entry->s.pkt_dpdk, > > pkt_table, len); > > > >> unlock_entry(pktio_entry); > > > >> > > > > > > > > > > > > _______________________________________________ > > > > lng-odp mailing list > > > > lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org> > > > > http://lists.linaro.org/mailman/listinfo/lng-odp > > > > > > > > > > > > > > > > -- > > > *Mike Holmes* > > > Linaro Technical Manager / Lead > > > LNG - ODP > > > > > _______________________________________________ > > > lng-odp mailing list > > > lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org> > > > http://lists.linaro.org/mailman/listinfo/lng-odp > > > > > > -- > > Anders Roxell > > anders.roxell@linaro.org <mailto:anders.roxell@linaro.org> > > M: +46 709 71 42 85 | IRC: roxell > > > > _______________________________________________ > > lng-odp mailing list > > lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org> > > http://lists.linaro.org/mailman/listinfo/lng-odp > > > > > > > > > >_______________________________________________ > >lng-odp mailing list > >lng-odp@lists.linaro.org > >http://lists.linaro.org/mailman/listinfo/lng-odp > > > _______________________________________________ > lng-odp mailing list > lng-odp@lists.linaro.org > http://lists.linaro.org/mailman/listinfo/lng-odp
On 8 August 2014 17:46, Anders Roxell <anders.roxell@linaro.org> wrote: > On 2014-08-08 17:31, Maxim Uvarov wrote: > > On 08/08/2014 05:13 PM, Venkatesh Vivekanandan wrote: > > > > > > > > > > > >On 7 August 2014 21:10, Anders Roxell <anders.roxell@linaro.org > > ><mailto:anders.roxell@linaro.org>> wrote: > > > > > > On 2014-08-07 10:41, Mike Holmes wrote: > > > > Does this need a signoff by someone else before it is merged ? > > > > > > > > I think we want to enforce getting an ack, tested-by or > > > reviewed-by before > > > > we merge things, we have informally moved that way over the last > > > couple of > > > > weeks and now I think it is time we made it a formal requirement. > > > > > > Agree. > > > > > > > > >If this is the case, then is it fair to say initial discussion of > > >24-hour window is void?. I guess Maxim was waiting for 2 days(for > > >any comments) before he could merge this patch. Do we have any > > >time-limit before which a patch /must /be reviewed or tested? I > > >hope we can't wait indefinitely or is this the case?. > > > > I think if patch came from platfrom maintainer, it's not new API. No > > comments in 1 or 2 days, than it's ok to merge it. If patch came > > from somobody alse I would ask maintainer to review it. > > I disagree with this. > No matter where the patch comes from and who wrote the patch, it can be > wrong and need a second pair of eyes i.e., > (Reviewed|Acked|Signed-off)-by. > If no one has replied to a patch after 2 days, the author of the patch > should ping the list and maintainer. > > After the second pair of eyes, the patch should be ok to be merged. > The ODP maintainer should do a smoke build test on all the supported > platforms before merging though. > My 2 cents We have started to develop a cohesive API, I think that is down to a lot of folks working together. I also think that peer review/team work is reflected in the increasing willingness to review each others patches which has improved quality and helped establish the guidelines on how things bolt together in ODP, may long discussions have spawned from patches. No one is beyond silly mistakes, peer review finds a lot of the dumb stuff for little cost, saving on the inevitable ugly patch up that will ensue otherwise. Maxim you could do the default reviews if no one came forward, but if a submitter finds and establishes their own network of reviewers that is one extra pair of eyes and ideas. > > Cheers, > Anders > > > > > Maxim. > > > > > Anders > > > > > > > > > > > Mike > > > > > > > > > > > > On 7 August 2014 09:15, Maxim Uvarov <maxim.uvarov@linaro.org > > > <mailto:maxim.uvarov@linaro.org>> wrote: > > > > > > > > > Merged, thanks! > > > > > > > > > > Maxim. > > > > > > > > > > > > > > > On 08/05/2014 06:54 PM, venkatesh.vivekanandan@linaro.org > > > <mailto:venkatesh.vivekanandan@linaro.org> wrote: > > > > > > > > > >> From: Venkatesh Vivekanandan > > > <venkatesh.vivekanandan@linaro.org > > > <mailto:venkatesh.vivekanandan@linaro.org>> > > > > >> > > > > >> - Multi queue support per interface is enabled. > > > > >> - odp_pktio_send with "0" packet is called in odp_pktio_recv to > > > > >> give the transmitted buffers back to mempool. > > > > >> - mbuf alloc failure during receive is fixed by giving more > > > buffers to > > > > >> mempool. > > > > >> - mempool cache size is given equivalent to MAX_PKT_BURST. > > > > >> > > > > >> Signed-off-by: Venkatesh Vivekanandan > > > <venkatesh.vivekanandan@linaro.org > > > <mailto:venkatesh.vivekanandan@linaro.org>> > > > > >> --- > > > > >> platform/linux-dpdk/include/odp_packet_dpdk.h | 24 +++++ > > > > >> platform/linux-dpdk/odp_buffer_pool.c | 4 +- > > > > >> platform/linux-dpdk/odp_packet_dpdk.c | 136 > > > > >> +++++++++++++------------- > > > > >> platform/linux-dpdk/odp_packet_io.c | 2 + > > > > >> 4 files changed, 94 insertions(+), 72 deletions(-) > > > > >> > > > > >> diff --git a/platform/linux-dpdk/include/odp_packet_dpdk.h > > > > >> b/platform/linux-dpdk/include/odp_packet_dpdk.h > > > > >> index bcbe9e8..bcf9aa5 100644 > > > > >> --- a/platform/linux-dpdk/include/odp_packet_dpdk.h > > > > >> +++ b/platform/linux-dpdk/include/odp_packet_dpdk.h > > > > >> @@ -50,6 +50,30 @@ > > > > >> #define DPDK_BLOCKING_IO > > > > >> +/* > > > > >> + * RX and TX Prefetch, Host, and Write-back threshold values > > > should be > > > > >> + * carefully set for optimal performance. Consult the network > > > > >> + * controller's datasheet and supporting DPDK documentation > > > for guidance > > > > >> + * on how these parameters should be set. > > > > >> + */ > > > > >> +#define RX_PTHRESH 8 /**< Default values of RX prefetch > > > threshold reg. */ > > > > >> +#define RX_HTHRESH 8 /**< Default values of RX host > > > threshold reg. */ > > > > >> +#define RX_WTHRESH 4 /**< Default values of RX write-back > > > threshold reg. > > > > >> */ > > > > >> + > > > > >> +/* > > > > >> + * These default values are optimized for use with the > > > Intel(R) 82599 10 > > > > >> GbE > > > > >> + * Controller and the DPDK ixgbe PMD. Consider using other > > > values for > > > > >> other > > > > >> + * network controllers and/or network drivers. > > > > >> + */ > > > > >> +#define TX_PTHRESH 36 /**< Default values of TX prefetch > > > threshold reg. > > > > >> */ > > > > >> +#define TX_HTHRESH 0 /**< Default values of TX host > > > threshold reg. */ > > > > >> +#define TX_WTHRESH 0 /**< Default values of TX write-back > > > threshold > > > > >> reg. */ > > > > >> + > > > > >> +#define MAX_PKT_BURST 16 > > > > >> +#define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */ > > > > >> +#define RTE_TEST_RX_DESC_DEFAULT 128 > > > > >> +#define RTE_TEST_TX_DESC_DEFAULT 512 > > > > >> + > > > > >> /** Packet socket using dpdk mmaped rings for both Rx and Tx > */ > > > > >> typedef struct { > > > > >> odp_buffer_pool_t pool; > > > > >> diff --git a/platform/linux-dpdk/odp_buffer_pool.c > > > > >> b/platform/linux-dpdk/odp_buffer_pool.c > > > > >> index de90275..805ce68 100644 > > > > >> --- a/platform/linux-dpdk/odp_buffer_pool.c > > > > >> +++ b/platform/linux-dpdk/odp_buffer_pool.c > > > > >> @@ -23,7 +23,7 @@ > > > > >> #include <odp_packet_dpdk.h> > > > > >> #define MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + > > > > >> RTE_PKTMBUF_HEADROOM) > > > > >> -#define NB_MBUF 8192 > > > > >> +#define NB_MBUF 32768 > > > > >> #ifdef POOL_USE_TICKETLOCK > > > > >> #include <odp_ticketlock.h> > > > > >> @@ -112,7 +112,7 @@ odp_buffer_pool_t > > > odp_buffer_pool_create(const char > > > > >> *name, > > > > >> pktmbuf_pool = > > > > >> rte_mempool_create(name, NB_MBUF, > > > > >> - MBUF_SIZE, 32, > > > > >> + MBUF_SIZE, MAX_PKT_BURST, > > > > >> sizeof(struct > > > > >> rte_pktmbuf_pool_private), > > > > >> rte_pktmbuf_pool_init, NULL, > > > > >> rte_pktmbuf_init, NULL, > > > > >> diff --git a/platform/linux-dpdk/odp_packet_dpdk.c > > > > >> b/platform/linux-dpdk/odp_packet_dpdk.c > > > > >> index 31bfa30..d5c8e80 100644 > > > > >> --- a/platform/linux-dpdk/odp_packet_dpdk.c > > > > >> +++ b/platform/linux-dpdk/odp_packet_dpdk.c > > > > >> @@ -26,34 +26,13 @@ > > > > >> #include <odp_packet_dpdk.h> > > > > >> #include <net/if.h> > > > > >> -/* > > > > >> - * RX and TX Prefetch, Host, and Write-back threshold values > > > should be > > > > >> - * carefully set for optimal performance. Consult the network > > > > >> - * controller's datasheet and supporting DPDK documentation > > > for guidance > > > > >> - * on how these parameters should be set. > > > > >> - */ > > > > >> -#define RX_PTHRESH 8 /**< Default values of RX prefetch > > > threshold reg. */ > > > > >> -#define RX_HTHRESH 8 /**< Default values of RX host > > > threshold reg. */ > > > > >> -#define RX_WTHRESH 4 /**< Default values of RX write-back > > > threshold reg. > > > > >> */ > > > > >> - > > > > >> -/* > > > > >> - * These default values are optimized for use with the > > > Intel(R) 82599 10 > > > > >> GbE > > > > >> - * Controller and the DPDK ixgbe PMD. Consider using other > > > values for > > > > >> other > > > > >> - * network controllers and/or network drivers. > > > > >> - */ > > > > >> -#define TX_PTHRESH 36 /**< Default values of TX prefetch > > > threshold reg. > > > > >> */ > > > > >> -#define TX_HTHRESH 0 /**< Default values of TX host > > > threshold reg. */ > > > > >> -#define TX_WTHRESH 0 /**< Default values of TX write-back > > > threshold > > > > >> reg. */ > > > > >> - > > > > >> -#define MAX_PKT_BURST 16 > > > > >> -#define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */ > > > > >> -#define RTE_TEST_RX_DESC_DEFAULT 128 > > > > >> -#define RTE_TEST_TX_DESC_DEFAULT 512 > > > > >> static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT; > > > > >> static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT; > > > > >> static const struct rte_eth_conf port_conf = { > > > > >> .rxmode = { > > > > >> + .mq_mode = ETH_MQ_RX_RSS, > > > > >> + .max_rx_pkt_len = ETHER_MAX_LEN, > > > > >> .split_hdr_size = 0, > > > > >> .header_split = 0, /**< Header Split > > > disabled */ > > > > >> .hw_ip_checksum = 0, /**< IP checksum offload > > > disabled */ > > > > >> @@ -61,6 +40,12 @@ static const struct rte_eth_conf port_conf > = { > > > > >> .jumbo_frame = 0, /**< Jumbo Frame Support > > > disabled */ > > > > >> .hw_strip_crc = 0, /**< CRC stripped by > > > hardware */ > > > > >> }, > > > > >> + .rx_adv_conf = { > > > > >> + .rss_conf = { > > > > >> + .rss_key = NULL, > > > > >> + .rss_hf = ETH_RSS_IPV4 | ETH_RSS_IPV6, > > > > >> + }, > > > > >> + }, > > > > >> .txmode = { > > > > >> .mq_mode = ETH_MQ_TX_NONE, > > > > >> }, > > > > >> @@ -95,60 +80,71 @@ int setup_pkt_dpdk(pkt_dpdk_t * const > > > pkt_dpdk, const > > > > >> char *netdev, > > > > >> ODP_DBG("setup_pkt_dpdk\n"); > > > > >> static struct ether_addr eth_addr[RTE_MAX_ETHPORTS]; > > > > >> - uint8_t portid = 0; > > > > >> - uint16_t queueid = 0; > > > > >> - int ret; > > > > >> + static int portinit[RTE_MAX_ETHPORTS]; > > > > >> + static int qid[RTE_MAX_ETHPORTS]; > > > > >> + uint8_t portid = 0, num_intf = 2; > > > > >> + uint16_t nbrxq = 0, nbtxq = 0; > > > > >> + int ret, i; > > > > >> + > > > > >> printf("dpdk netdev: %s\n", netdev); > > > > >> printf("dpdk pool: %lx\n", pool); > > > > >> - > > > > >> portid = atoi(netdev); > > > > >> pkt_dpdk->portid = portid; > > > > >> - pkt_dpdk->queueid = queueid; > > > > >> pkt_dpdk->pool = pool; > > > > >> printf("dpdk portid: %u\n", portid); > > > > >> - fflush(stdout); > > > > >> - ret = rte_eth_dev_configure(portid, 1, 1, &port_conf); > > > > >> - if (ret < 0) > > > > >> - ODP_ERR("Cannot configure device: err=%d, > > > port=%u\n", > > > > >> - ret, (unsigned) portid); > > > > >> - > > > > >> - rte_eth_macaddr_get(portid, ð_addr[portid]); > > > > >> - ODP_DBG("Port %u, MAC address: > > > %02X:%02X:%02X:%02X:%02X:%02X\ > > > > >> n\n", > > > > >> - (unsigned) portid, > > > > >> - eth_addr[portid].addr_bytes[0], > > > > >> - eth_addr[portid].addr_bytes[1], > > > > >> - eth_addr[portid].addr_bytes[2], > > > > >> - eth_addr[portid].addr_bytes[3], > > > > >> - eth_addr[portid].addr_bytes[4], > > > > >> - eth_addr[portid].addr_bytes[5]); > > > > >> - > > > > >> - /* init one RX queue on each port */ > > > > >> - fflush(stdout); > > > > >> - ret = rte_eth_rx_queue_setup(portid, queueid, nb_rxd, > > > > >> - rte_eth_dev_socket_id(portid), > > > > >> &rx_conf, > > > > >> - (struct rte_mempool *)pool); > > > > >> - if (ret < 0) > > > > >> - ODP_ERR("rte_eth_rx_queue_setup:err=%d, port=%u\n", > > > > >> - ret, (unsigned) portid); > > > > >> - ODP_DBG("dpdk rx queue setup done\n"); > > > > >> - > > > > >> - /* init one TX queue on each port */ > > > > >> - fflush(stdout); > > > > >> - ret = rte_eth_tx_queue_setup(portid, queueid, nb_txd, > > > > >> - rte_eth_dev_socket_id(portid), &tx_conf); > > > > >> - if (ret < 0) > > > > >> - ODP_ERR("rte_eth_tx_queue_setup:err=%d, port=%u\n", > > > > >> - ret, (unsigned) portid); > > > > >> - ODP_DBG("dpdk tx queue setup done\n"); > > > > >> - > > > > >> - /* Start device */ > > > > >> - ret = rte_eth_dev_start(portid); > > > > >> - if (ret < 0) > > > > >> - ODP_ERR("rte_eth_dev_start:err=%d, port=%u\n", > > > > >> - ret, (unsigned) portid); > > > > >> - ODP_DBG("dpdk setup done\n\n"); > > > > >> - > > > > >> + nbrxq = odp_sys_core_count() / num_intf; > > > > >> + nbtxq = nbrxq; > > > > >> + if (portinit[portid] == 0) { > > > > >> + fflush(stdout); > > > > >> + ret = rte_eth_dev_configure(portid, nbrxq, > nbtxq, > > > > >> &port_conf); > > > > >> + if (ret < 0) > > > > >> + ODP_ERR("Cannot configure device: > err=%d, > > > > >> port=%u\n", > > > > >> + ret, (unsigned) portid); > > > > >> + > > > > >> + rte_eth_macaddr_get(portid, ð_addr[portid]); > > > > >> + ODP_DBG("Port %u, MAC address: > > > > >> %02X:%02X:%02X:%02X:%02X:%02X\n", > > > > >> + (unsigned) portid, > > > > >> + eth_addr[portid].addr_bytes[0], > > > > >> + eth_addr[portid].addr_bytes[1], > > > > >> + eth_addr[portid].addr_bytes[2], > > > > >> + eth_addr[portid].addr_bytes[3], > > > > >> + eth_addr[portid].addr_bytes[4], > > > > >> + eth_addr[portid].addr_bytes[5]); > > > > >> + > > > > >> + /* init one RX queue on each port */ > > > > >> + fflush(stdout); > > > > >> + for (i = 0; i < nbrxq; i++) { > > > > >> + ret = rte_eth_rx_queue_setup(portid, > > > i, nb_rxd, > > > > >> + rte_eth_dev_socket_id(portid), > > > > >> &rx_conf, > > > > >> + (struct rte_mempool *)pool); > > > > >> + if (ret < 0) > > > > >> + ODP_ERR("%s rxq:err=%d, port=%u\n", > > > > >> + __func__, ret, (unsigned) portid); > > > > >> + ODP_DBG("dpdk rx queue setup done\n"); > > > > >> + } > > > > >> + > > > > >> + /* init one TX queue on each port */ > > > > >> + fflush(stdout); > > > > >> + for (i = 0; i < nbtxq; i++) { > > > > >> + ret = rte_eth_tx_queue_setup(portid, > > > i, nb_txd, > > > > >> + rte_eth_dev_socket_id(portid), &tx_conf); > > > > >> + if (ret < 0) > > > > >> + ODP_ERR("%s txq:err=%d, port=%u\n", > > > > >> + __func__, ret, (unsigned) portid); > > > > >> + ODP_DBG("dpdk tx queue setup done\n"); > > > > >> + } > > > > >> + > > > > >> + /* Start device */ > > > > >> + ret = rte_eth_dev_start(portid); > > > > >> + if (ret < 0) > > > > >> + ODP_ERR("rte_eth_dev_start:err=%d, port=%u\n", > > > > >> + ret, (unsigned) portid); > > > > >> + ODP_DBG("dpdk setup done\n\n"); > > > > >> + > > > > >> + portinit[portid] = 1; > > > > >> + } > > > > >> + pkt_dpdk->queueid = qid[portid]++; > > > > >> return 0; > > > > >> } > > > > >> diff --git a/platform/linux-dpdk/odp_packet_io.c > > > > >> b/platform/linux-dpdk/odp_packet_io.c > > > > >> index d8d127f..3124175 100644 > > > > >> --- a/platform/linux-dpdk/odp_packet_io.c > > > > >> +++ b/platform/linux-dpdk/odp_packet_io.c > > > > >> @@ -230,6 +230,8 @@ int odp_pktio_recv(odp_pktio_t id, > > > odp_packet_t > > > > >> pkt_table[], unsigned len) > > > > >> if (pktio_entry == NULL) > > > > >> return -1; > > > > >> + odp_pktio_send(id, pkt_table, 0); > > > > >> + > > > > >> lock_entry(pktio_entry); > > > > >> pkts = recv_pkt_dpdk(&pktio_entry->s.pkt_dpdk, > > > pkt_table, len); > > > > >> unlock_entry(pktio_entry); > > > > >> > > > > > > > > > > > > > > > _______________________________________________ > > > > > lng-odp mailing list > > > > > lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org> > > > > > http://lists.linaro.org/mailman/listinfo/lng-odp > > > > > > > > > > > > > > > > > > > > > -- > > > > *Mike Holmes* > > > > Linaro Technical Manager / Lead > > > > LNG - ODP > > > > > > > _______________________________________________ > > > > lng-odp mailing list > > > > lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org> > > > > http://lists.linaro.org/mailman/listinfo/lng-odp > > > > > > > > > -- > > > Anders Roxell > > > anders.roxell@linaro.org <mailto:anders.roxell@linaro.org> > > > M: +46 709 71 42 85 | IRC: roxell > > > > > > _______________________________________________ > > > lng-odp mailing list > > > lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org> > > > http://lists.linaro.org/mailman/listinfo/lng-odp > > > > > > > > > > > > > > >_______________________________________________ > > >lng-odp mailing list > > >lng-odp@lists.linaro.org > > >http://lists.linaro.org/mailman/listinfo/lng-odp > > > > > > _______________________________________________ > > lng-odp mailing list > > lng-odp@lists.linaro.org > > http://lists.linaro.org/mailman/listinfo/lng-odp > > -- > Anders Roxell > anders.roxell@linaro.org > M: +46 709 71 42 85 | IRC: roxell > > _______________________________________________ > lng-odp mailing list > lng-odp@lists.linaro.org > http://lists.linaro.org/mailman/listinfo/lng-odp >
On 9 August 2014 17:32, Mike Holmes <mike.holmes@linaro.org> wrote: > > > > On 8 August 2014 17:46, Anders Roxell <anders.roxell@linaro.org> wrote: > >> On 2014-08-08 17:31, Maxim Uvarov wrote: >> > On 08/08/2014 05:13 PM, Venkatesh Vivekanandan wrote: >> > > >> > > >> > > >> > >On 7 August 2014 21:10, Anders Roxell <anders.roxell@linaro.org >> > ><mailto:anders.roxell@linaro.org>> wrote: >> > > >> > > On 2014-08-07 10:41, Mike Holmes wrote: >> > > > Does this need a signoff by someone else before it is merged ? >> > > > >> > > > I think we want to enforce getting an ack, tested-by or >> > > reviewed-by before >> > > > we merge things, we have informally moved that way over the last >> > > couple of >> > > > weeks and now I think it is time we made it a formal requirement. >> > > >> > > Agree. >> > > >> > > >> > >If this is the case, then is it fair to say initial discussion of >> > >24-hour window is void?. I guess Maxim was waiting for 2 days(for >> > >any comments) before he could merge this patch. Do we have any >> > >time-limit before which a patch /must /be reviewed or tested? I >> > >hope we can't wait indefinitely or is this the case?. >> > >> > I think if patch came from platfrom maintainer, it's not new API. No >> > comments in 1 or 2 days, than it's ok to merge it. If patch came >> > from somobody alse I would ask maintainer to review it. >> >> I disagree with this. >> No matter where the patch comes from and who wrote the patch, it can be >> wrong and need a second pair of eyes i.e., >> (Reviewed|Acked|Signed-off)-by. >> If no one has replied to a patch after 2 days, the author of the patch >> should ping the list and maintainer. >> >> After the second pair of eyes, the patch should be ok to be merged. >> The ODP maintainer should do a smoke build test on all the supported >> platforms before merging though. >> > > My 2 cents > We have started to develop a cohesive API, I think that is down to a lot > of folks working together. > I also think that peer review/team work is reflected in the increasing > willingness to review each others patches which has improved quality > and helped establish the guidelines on how things bolt together in ODP, > may long discussions have spawned from patches. > > No one is beyond silly mistakes, peer review finds a lot of the dumb stuff > for little cost, saving on the inevitable ugly patch up that will ensue > otherwise. > Maxim you could do the default reviews if no one came forward, but if a > submitter finds and establishes their own network of reviewers that is one > extra pair of eyes and ideas. > Can someone please review this patch?. If there is any comments, we can request maxim to revert the patch, otherwise he can add the "Reviewed-by/Tested-by" to the applied patch. >> Cheers, >> Anders >> >> > >> > Maxim. >> > >> > > Anders >> > > >> > > > >> > > > Mike >> > > > >> > > > >> > > > On 7 August 2014 09:15, Maxim Uvarov <maxim.uvarov@linaro.org >> > > <mailto:maxim.uvarov@linaro.org>> wrote: >> > > > >> > > > > Merged, thanks! >> > > > > >> > > > > Maxim. >> > > > > >> > > > > >> > > > > On 08/05/2014 06:54 PM, venkatesh.vivekanandan@linaro.org >> > > <mailto:venkatesh.vivekanandan@linaro.org> wrote: >> > > > > >> > > > >> From: Venkatesh Vivekanandan >> > > <venkatesh.vivekanandan@linaro.org >> > > <mailto:venkatesh.vivekanandan@linaro.org>> >> > > > >> >> > > > >> - Multi queue support per interface is enabled. >> > > > >> - odp_pktio_send with "0" packet is called in odp_pktio_recv >> to >> > > > >> give the transmitted buffers back to mempool. >> > > > >> - mbuf alloc failure during receive is fixed by giving more >> > > buffers to >> > > > >> mempool. >> > > > >> - mempool cache size is given equivalent to MAX_PKT_BURST. >> > > > >> >> > > > >> Signed-off-by: Venkatesh Vivekanandan >> > > <venkatesh.vivekanandan@linaro.org >> > > <mailto:venkatesh.vivekanandan@linaro.org>> >> > > > >> --- >> > > > >> platform/linux-dpdk/include/odp_packet_dpdk.h | 24 +++++ >> > > > >> platform/linux-dpdk/odp_buffer_pool.c | 4 +- >> > > > >> platform/linux-dpdk/odp_packet_dpdk.c | 136 >> > > > >> +++++++++++++------------- >> > > > >> platform/linux-dpdk/odp_packet_io.c | 2 + >> > > > >> 4 files changed, 94 insertions(+), 72 deletions(-) >> > > > >> >> > > > >> diff --git a/platform/linux-dpdk/include/odp_packet_dpdk.h >> > > > >> b/platform/linux-dpdk/include/odp_packet_dpdk.h >> > > > >> index bcbe9e8..bcf9aa5 100644 >> > > > >> --- a/platform/linux-dpdk/include/odp_packet_dpdk.h >> > > > >> +++ b/platform/linux-dpdk/include/odp_packet_dpdk.h >> > > > >> @@ -50,6 +50,30 @@ >> > > > >> #define DPDK_BLOCKING_IO >> > > > >> +/* >> > > > >> + * RX and TX Prefetch, Host, and Write-back threshold values >> > > should be >> > > > >> + * carefully set for optimal performance. Consult the network >> > > > >> + * controller's datasheet and supporting DPDK documentation >> > > for guidance >> > > > >> + * on how these parameters should be set. >> > > > >> + */ >> > > > >> +#define RX_PTHRESH 8 /**< Default values of RX prefetch >> > > threshold reg. */ >> > > > >> +#define RX_HTHRESH 8 /**< Default values of RX host >> > > threshold reg. */ >> > > > >> +#define RX_WTHRESH 4 /**< Default values of RX write-back >> > > threshold reg. >> > > > >> */ >> > > > >> + >> > > > >> +/* >> > > > >> + * These default values are optimized for use with the >> > > Intel(R) 82599 10 >> > > > >> GbE >> > > > >> + * Controller and the DPDK ixgbe PMD. Consider using other >> > > values for >> > > > >> other >> > > > >> + * network controllers and/or network drivers. >> > > > >> + */ >> > > > >> +#define TX_PTHRESH 36 /**< Default values of TX prefetch >> > > threshold reg. >> > > > >> */ >> > > > >> +#define TX_HTHRESH 0 /**< Default values of TX host >> > > threshold reg. */ >> > > > >> +#define TX_WTHRESH 0 /**< Default values of TX write-back >> > > threshold >> > > > >> reg. */ >> > > > >> + >> > > > >> +#define MAX_PKT_BURST 16 >> > > > >> +#define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */ >> > > > >> +#define RTE_TEST_RX_DESC_DEFAULT 128 >> > > > >> +#define RTE_TEST_TX_DESC_DEFAULT 512 >> > > > >> + >> > > > >> /** Packet socket using dpdk mmaped rings for both Rx and >> Tx */ >> > > > >> typedef struct { >> > > > >> odp_buffer_pool_t pool; >> > > > >> diff --git a/platform/linux-dpdk/odp_buffer_pool.c >> > > > >> b/platform/linux-dpdk/odp_buffer_pool.c >> > > > >> index de90275..805ce68 100644 >> > > > >> --- a/platform/linux-dpdk/odp_buffer_pool.c >> > > > >> +++ b/platform/linux-dpdk/odp_buffer_pool.c >> > > > >> @@ -23,7 +23,7 @@ >> > > > >> #include <odp_packet_dpdk.h> >> > > > >> #define MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + >> > > > >> RTE_PKTMBUF_HEADROOM) >> > > > >> -#define NB_MBUF 8192 >> > > > >> +#define NB_MBUF 32768 >> > > > >> #ifdef POOL_USE_TICKETLOCK >> > > > >> #include <odp_ticketlock.h> >> > > > >> @@ -112,7 +112,7 @@ odp_buffer_pool_t >> > > odp_buffer_pool_create(const char >> > > > >> *name, >> > > > >> pktmbuf_pool = >> > > > >> rte_mempool_create(name, NB_MBUF, >> > > > >> - MBUF_SIZE, 32, >> > > > >> + MBUF_SIZE, MAX_PKT_BURST, >> > > > >> sizeof(struct >> > > > >> rte_pktmbuf_pool_private), >> > > > >> rte_pktmbuf_pool_init, NULL, >> > > > >> rte_pktmbuf_init, NULL, >> > > > >> diff --git a/platform/linux-dpdk/odp_packet_dpdk.c >> > > > >> b/platform/linux-dpdk/odp_packet_dpdk.c >> > > > >> index 31bfa30..d5c8e80 100644 >> > > > >> --- a/platform/linux-dpdk/odp_packet_dpdk.c >> > > > >> +++ b/platform/linux-dpdk/odp_packet_dpdk.c >> > > > >> @@ -26,34 +26,13 @@ >> > > > >> #include <odp_packet_dpdk.h> >> > > > >> #include <net/if.h> >> > > > >> -/* >> > > > >> - * RX and TX Prefetch, Host, and Write-back threshold values >> > > should be >> > > > >> - * carefully set for optimal performance. Consult the network >> > > > >> - * controller's datasheet and supporting DPDK documentation >> > > for guidance >> > > > >> - * on how these parameters should be set. >> > > > >> - */ >> > > > >> -#define RX_PTHRESH 8 /**< Default values of RX prefetch >> > > threshold reg. */ >> > > > >> -#define RX_HTHRESH 8 /**< Default values of RX host >> > > threshold reg. */ >> > > > >> -#define RX_WTHRESH 4 /**< Default values of RX write-back >> > > threshold reg. >> > > > >> */ >> > > > >> - >> > > > >> -/* >> > > > >> - * These default values are optimized for use with the >> > > Intel(R) 82599 10 >> > > > >> GbE >> > > > >> - * Controller and the DPDK ixgbe PMD. Consider using other >> > > values for >> > > > >> other >> > > > >> - * network controllers and/or network drivers. >> > > > >> - */ >> > > > >> -#define TX_PTHRESH 36 /**< Default values of TX prefetch >> > > threshold reg. >> > > > >> */ >> > > > >> -#define TX_HTHRESH 0 /**< Default values of TX host >> > > threshold reg. */ >> > > > >> -#define TX_WTHRESH 0 /**< Default values of TX write-back >> > > threshold >> > > > >> reg. */ >> > > > >> - >> > > > >> -#define MAX_PKT_BURST 16 >> > > > >> -#define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */ >> > > > >> -#define RTE_TEST_RX_DESC_DEFAULT 128 >> > > > >> -#define RTE_TEST_TX_DESC_DEFAULT 512 >> > > > >> static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT; >> > > > >> static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT; >> > > > >> static const struct rte_eth_conf port_conf = { >> > > > >> .rxmode = { >> > > > >> + .mq_mode = ETH_MQ_RX_RSS, >> > > > >> + .max_rx_pkt_len = ETHER_MAX_LEN, >> > > > >> .split_hdr_size = 0, >> > > > >> .header_split = 0, /**< Header Split >> > > disabled */ >> > > > >> .hw_ip_checksum = 0, /**< IP checksum offload >> > > disabled */ >> > > > >> @@ -61,6 +40,12 @@ static const struct rte_eth_conf port_conf >> = { >> > > > >> .jumbo_frame = 0, /**< Jumbo Frame Support >> > > disabled */ >> > > > >> .hw_strip_crc = 0, /**< CRC stripped by >> > > hardware */ >> > > > >> }, >> > > > >> + .rx_adv_conf = { >> > > > >> + .rss_conf = { >> > > > >> + .rss_key = NULL, >> > > > >> + .rss_hf = ETH_RSS_IPV4 | ETH_RSS_IPV6, >> > > > >> + }, >> > > > >> + }, >> > > > >> .txmode = { >> > > > >> .mq_mode = ETH_MQ_TX_NONE, >> > > > >> }, >> > > > >> @@ -95,60 +80,71 @@ int setup_pkt_dpdk(pkt_dpdk_t * const >> > > pkt_dpdk, const >> > > > >> char *netdev, >> > > > >> ODP_DBG("setup_pkt_dpdk\n"); >> > > > >> static struct ether_addr eth_addr[RTE_MAX_ETHPORTS]; >> > > > >> - uint8_t portid = 0; >> > > > >> - uint16_t queueid = 0; >> > > > >> - int ret; >> > > > >> + static int portinit[RTE_MAX_ETHPORTS]; >> > > > >> + static int qid[RTE_MAX_ETHPORTS]; >> > > > >> + uint8_t portid = 0, num_intf = 2; >> > > > >> + uint16_t nbrxq = 0, nbtxq = 0; >> > > > >> + int ret, i; >> > > > >> + >> > > > >> printf("dpdk netdev: %s\n", netdev); >> > > > >> printf("dpdk pool: %lx\n", pool); >> > > > >> - >> > > > >> portid = atoi(netdev); >> > > > >> pkt_dpdk->portid = portid; >> > > > >> - pkt_dpdk->queueid = queueid; >> > > > >> pkt_dpdk->pool = pool; >> > > > >> printf("dpdk portid: %u\n", portid); >> > > > >> - fflush(stdout); >> > > > >> - ret = rte_eth_dev_configure(portid, 1, 1, &port_conf); >> > > > >> - if (ret < 0) >> > > > >> - ODP_ERR("Cannot configure device: err=%d, >> > > port=%u\n", >> > > > >> - ret, (unsigned) portid); >> > > > >> - >> > > > >> - rte_eth_macaddr_get(portid, ð_addr[portid]); >> > > > >> - ODP_DBG("Port %u, MAC address: >> > > %02X:%02X:%02X:%02X:%02X:%02X\ >> > > > >> n\n", >> > > > >> - (unsigned) portid, >> > > > >> - eth_addr[portid].addr_bytes[0], >> > > > >> - eth_addr[portid].addr_bytes[1], >> > > > >> - eth_addr[portid].addr_bytes[2], >> > > > >> - eth_addr[portid].addr_bytes[3], >> > > > >> - eth_addr[portid].addr_bytes[4], >> > > > >> - eth_addr[portid].addr_bytes[5]); >> > > > >> - >> > > > >> - /* init one RX queue on each port */ >> > > > >> - fflush(stdout); >> > > > >> - ret = rte_eth_rx_queue_setup(portid, queueid, nb_rxd, >> > > > >> - rte_eth_dev_socket_id(portid), >> > > > >> &rx_conf, >> > > > >> - (struct rte_mempool *)pool); >> > > > >> - if (ret < 0) >> > > > >> - ODP_ERR("rte_eth_rx_queue_setup:err=%d, port=%u\n", >> > > > >> - ret, (unsigned) portid); >> > > > >> - ODP_DBG("dpdk rx queue setup done\n"); >> > > > >> - >> > > > >> - /* init one TX queue on each port */ >> > > > >> - fflush(stdout); >> > > > >> - ret = rte_eth_tx_queue_setup(portid, queueid, nb_txd, >> > > > >> - rte_eth_dev_socket_id(portid), &tx_conf); >> > > > >> - if (ret < 0) >> > > > >> - ODP_ERR("rte_eth_tx_queue_setup:err=%d, port=%u\n", >> > > > >> - ret, (unsigned) portid); >> > > > >> - ODP_DBG("dpdk tx queue setup done\n"); >> > > > >> - >> > > > >> - /* Start device */ >> > > > >> - ret = rte_eth_dev_start(portid); >> > > > >> - if (ret < 0) >> > > > >> - ODP_ERR("rte_eth_dev_start:err=%d, port=%u\n", >> > > > >> - ret, (unsigned) portid); >> > > > >> - ODP_DBG("dpdk setup done\n\n"); >> > > > >> - >> > > > >> + nbrxq = odp_sys_core_count() / num_intf; >> > > > >> + nbtxq = nbrxq; >> > > > >> + if (portinit[portid] == 0) { >> > > > >> + fflush(stdout); >> > > > >> + ret = rte_eth_dev_configure(portid, nbrxq, >> nbtxq, >> > > > >> &port_conf); >> > > > >> + if (ret < 0) >> > > > >> + ODP_ERR("Cannot configure device: >> err=%d, >> > > > >> port=%u\n", >> > > > >> + ret, (unsigned) portid); >> > > > >> + >> > > > >> + rte_eth_macaddr_get(portid, ð_addr[portid]); >> > > > >> + ODP_DBG("Port %u, MAC address: >> > > > >> %02X:%02X:%02X:%02X:%02X:%02X\n", >> > > > >> + (unsigned) portid, >> > > > >> + eth_addr[portid].addr_bytes[0], >> > > > >> + eth_addr[portid].addr_bytes[1], >> > > > >> + eth_addr[portid].addr_bytes[2], >> > > > >> + eth_addr[portid].addr_bytes[3], >> > > > >> + eth_addr[portid].addr_bytes[4], >> > > > >> + eth_addr[portid].addr_bytes[5]); >> > > > >> + >> > > > >> + /* init one RX queue on each port */ >> > > > >> + fflush(stdout); >> > > > >> + for (i = 0; i < nbrxq; i++) { >> > > > >> + ret = rte_eth_rx_queue_setup(portid, >> > > i, nb_rxd, >> > > > >> + rte_eth_dev_socket_id(portid), >> > > > >> &rx_conf, >> > > > >> + (struct rte_mempool *)pool); >> > > > >> + if (ret < 0) >> > > > >> + ODP_ERR("%s rxq:err=%d, port=%u\n", >> > > > >> + __func__, ret, (unsigned) portid); >> > > > >> + ODP_DBG("dpdk rx queue setup done\n"); >> > > > >> + } >> > > > >> + >> > > > >> + /* init one TX queue on each port */ >> > > > >> + fflush(stdout); >> > > > >> + for (i = 0; i < nbtxq; i++) { >> > > > >> + ret = rte_eth_tx_queue_setup(portid, >> > > i, nb_txd, >> > > > >> + rte_eth_dev_socket_id(portid), &tx_conf); >> > > > >> + if (ret < 0) >> > > > >> + ODP_ERR("%s txq:err=%d, port=%u\n", >> > > > >> + __func__, ret, (unsigned) portid); >> > > > >> + ODP_DBG("dpdk tx queue setup done\n"); >> > > > >> + } >> > > > >> + >> > > > >> + /* Start device */ >> > > > >> + ret = rte_eth_dev_start(portid); >> > > > >> + if (ret < 0) >> > > > >> + ODP_ERR("rte_eth_dev_start:err=%d, port=%u\n", >> > > > >> + ret, (unsigned) portid); >> > > > >> + ODP_DBG("dpdk setup done\n\n"); >> > > > >> + >> > > > >> + portinit[portid] = 1; >> > > > >> + } >> > > > >> + pkt_dpdk->queueid = qid[portid]++; >> > > > >> return 0; >> > > > >> } >> > > > >> diff --git a/platform/linux-dpdk/odp_packet_io.c >> > > > >> b/platform/linux-dpdk/odp_packet_io.c >> > > > >> index d8d127f..3124175 100644 >> > > > >> --- a/platform/linux-dpdk/odp_packet_io.c >> > > > >> +++ b/platform/linux-dpdk/odp_packet_io.c >> > > > >> @@ -230,6 +230,8 @@ int odp_pktio_recv(odp_pktio_t id, >> > > odp_packet_t >> > > > >> pkt_table[], unsigned len) >> > > > >> if (pktio_entry == NULL) >> > > > >> return -1; >> > > > >> + odp_pktio_send(id, pkt_table, 0); >> > > > >> + >> > > > >> lock_entry(pktio_entry); >> > > > >> pkts = recv_pkt_dpdk(&pktio_entry->s.pkt_dpdk, >> > > pkt_table, len); >> > > > >> unlock_entry(pktio_entry); >> > > > >> >> > > > > >> > > > > >> > > > > _______________________________________________ >> > > > > lng-odp mailing list >> > > > > lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org> >> > > > > http://lists.linaro.org/mailman/listinfo/lng-odp >> > > > > >> > > > >> > > > >> > > > >> > > > -- >> > > > *Mike Holmes* >> > > > Linaro Technical Manager / Lead >> > > > LNG - ODP >> > > >> > > > _______________________________________________ >> > > > lng-odp mailing list >> > > > lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org> >> > > > http://lists.linaro.org/mailman/listinfo/lng-odp >> > > >> > > >> > > -- >> > > Anders Roxell >> > > anders.roxell@linaro.org <mailto:anders.roxell@linaro.org> >> > > M: +46 709 71 42 85 | IRC: roxell >> > > >> > > _______________________________________________ >> > > lng-odp mailing list >> > > lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org> >> > > http://lists.linaro.org/mailman/listinfo/lng-odp >> > > >> > > >> > > >> > > >> > >_______________________________________________ >> > >lng-odp mailing list >> > >lng-odp@lists.linaro.org >> > >http://lists.linaro.org/mailman/listinfo/lng-odp >> > >> > >> > _______________________________________________ >> > lng-odp mailing list >> > lng-odp@lists.linaro.org >> > http://lists.linaro.org/mailman/listinfo/lng-odp >> >> -- >> Anders Roxell >> anders.roxell@linaro.org >> M: +46 709 71 42 85 | IRC: roxell >> >> _______________________________________________ >> lng-odp mailing list >> lng-odp@lists.linaro.org >> http://lists.linaro.org/mailman/listinfo/lng-odp >> > > > > -- > *Mike Holmes* > Linaro Technical Manager / Lead > LNG - ODP > > _______________________________________________ > lng-odp mailing list > lng-odp@lists.linaro.org > http://lists.linaro.org/mailman/listinfo/lng-odp > >
Which test case in odp/test would check this, or does it need an application like l2fwd to be run - are either in LAVA/CI ? Santosh are you able to verify this does not break anything as part of the l2fwd work you are doing ? Mike On 11 August 2014 01:43, Venkatesh Vivekanandan < venkatesh.vivekanandan@linaro.org> wrote: > > > > On 9 August 2014 17:32, Mike Holmes <mike.holmes@linaro.org> wrote: > >> >> >> >> On 8 August 2014 17:46, Anders Roxell <anders.roxell@linaro.org> wrote: >> >>> On 2014-08-08 17:31, Maxim Uvarov wrote: >>> > On 08/08/2014 05:13 PM, Venkatesh Vivekanandan wrote: >>> > > >>> > > >>> > > >>> > >On 7 August 2014 21:10, Anders Roxell <anders.roxell@linaro.org >>> > ><mailto:anders.roxell@linaro.org>> wrote: >>> > > >>> > > On 2014-08-07 10:41, Mike Holmes wrote: >>> > > > Does this need a signoff by someone else before it is merged ? >>> > > > >>> > > > I think we want to enforce getting an ack, tested-by or >>> > > reviewed-by before >>> > > > we merge things, we have informally moved that way over the last >>> > > couple of >>> > > > weeks and now I think it is time we made it a formal >>> requirement. >>> > > >>> > > Agree. >>> > > >>> > > >>> > >If this is the case, then is it fair to say initial discussion of >>> > >24-hour window is void?. I guess Maxim was waiting for 2 days(for >>> > >any comments) before he could merge this patch. Do we have any >>> > >time-limit before which a patch /must /be reviewed or tested? I >>> > >hope we can't wait indefinitely or is this the case?. >>> > >>> > I think if patch came from platfrom maintainer, it's not new API. No >>> > comments in 1 or 2 days, than it's ok to merge it. If patch came >>> > from somobody alse I would ask maintainer to review it. >>> >>> I disagree with this. >>> No matter where the patch comes from and who wrote the patch, it can be >>> wrong and need a second pair of eyes i.e., >>> (Reviewed|Acked|Signed-off)-by. >>> If no one has replied to a patch after 2 days, the author of the patch >>> should ping the list and maintainer. >>> >>> After the second pair of eyes, the patch should be ok to be merged. >>> The ODP maintainer should do a smoke build test on all the supported >>> platforms before merging though. >>> >> >> My 2 cents >> We have started to develop a cohesive API, I think that is down to a lot >> of folks working together. >> I also think that peer review/team work is reflected in the increasing >> willingness to review each others patches which has improved quality >> and helped establish the guidelines on how things bolt together in ODP, >> may long discussions have spawned from patches. >> >> No one is beyond silly mistakes, peer review finds a lot of the dumb >> stuff for little cost, saving on the inevitable ugly patch up that will >> ensue otherwise. >> Maxim you could do the default reviews if no one came forward, but if a >> submitter finds and establishes their own network of reviewers that is one >> extra pair of eyes and ideas. >> > > Can someone please review this patch?. If there is any comments, we can > request maxim to revert the patch, otherwise he can add the > "Reviewed-by/Tested-by" to the applied patch. > > >>> Cheers, >>> Anders >>> >>> > >>> > Maxim. >>> > >>> > > Anders >>> > > >>> > > > >>> > > > Mike >>> > > > >>> > > > >>> > > > On 7 August 2014 09:15, Maxim Uvarov <maxim.uvarov@linaro.org >>> > > <mailto:maxim.uvarov@linaro.org>> wrote: >>> > > > >>> > > > > Merged, thanks! >>> > > > > >>> > > > > Maxim. >>> > > > > >>> > > > > >>> > > > > On 08/05/2014 06:54 PM, venkatesh.vivekanandan@linaro.org >>> > > <mailto:venkatesh.vivekanandan@linaro.org> wrote: >>> > > > > >>> > > > >> From: Venkatesh Vivekanandan >>> > > <venkatesh.vivekanandan@linaro.org >>> > > <mailto:venkatesh.vivekanandan@linaro.org>> >>> > > > >> >>> > > > >> - Multi queue support per interface is enabled. >>> > > > >> - odp_pktio_send with "0" packet is called in odp_pktio_recv >>> to >>> > > > >> give the transmitted buffers back to mempool. >>> > > > >> - mbuf alloc failure during receive is fixed by giving more >>> > > buffers to >>> > > > >> mempool. >>> > > > >> - mempool cache size is given equivalent to MAX_PKT_BURST. >>> > > > >> >>> > > > >> Signed-off-by: Venkatesh Vivekanandan >>> > > <venkatesh.vivekanandan@linaro.org >>> > > <mailto:venkatesh.vivekanandan@linaro.org>> >>> > > > >> --- >>> > > > >> platform/linux-dpdk/include/odp_packet_dpdk.h | 24 +++++ >>> > > > >> platform/linux-dpdk/odp_buffer_pool.c | 4 +- >>> > > > >> platform/linux-dpdk/odp_packet_dpdk.c | 136 >>> > > > >> +++++++++++++------------- >>> > > > >> platform/linux-dpdk/odp_packet_io.c | 2 + >>> > > > >> 4 files changed, 94 insertions(+), 72 deletions(-) >>> > > > >> >>> > > > >> diff --git a/platform/linux-dpdk/include/odp_packet_dpdk.h >>> > > > >> b/platform/linux-dpdk/include/odp_packet_dpdk.h >>> > > > >> index bcbe9e8..bcf9aa5 100644 >>> > > > >> --- a/platform/linux-dpdk/include/odp_packet_dpdk.h >>> > > > >> +++ b/platform/linux-dpdk/include/odp_packet_dpdk.h >>> > > > >> @@ -50,6 +50,30 @@ >>> > > > >> #define DPDK_BLOCKING_IO >>> > > > >> +/* >>> > > > >> + * RX and TX Prefetch, Host, and Write-back threshold values >>> > > should be >>> > > > >> + * carefully set for optimal performance. Consult the >>> network >>> > > > >> + * controller's datasheet and supporting DPDK documentation >>> > > for guidance >>> > > > >> + * on how these parameters should be set. >>> > > > >> + */ >>> > > > >> +#define RX_PTHRESH 8 /**< Default values of RX prefetch >>> > > threshold reg. */ >>> > > > >> +#define RX_HTHRESH 8 /**< Default values of RX host >>> > > threshold reg. */ >>> > > > >> +#define RX_WTHRESH 4 /**< Default values of RX write-back >>> > > threshold reg. >>> > > > >> */ >>> > > > >> + >>> > > > >> +/* >>> > > > >> + * These default values are optimized for use with the >>> > > Intel(R) 82599 10 >>> > > > >> GbE >>> > > > >> + * Controller and the DPDK ixgbe PMD. Consider using other >>> > > values for >>> > > > >> other >>> > > > >> + * network controllers and/or network drivers. >>> > > > >> + */ >>> > > > >> +#define TX_PTHRESH 36 /**< Default values of TX prefetch >>> > > threshold reg. >>> > > > >> */ >>> > > > >> +#define TX_HTHRESH 0 /**< Default values of TX host >>> > > threshold reg. */ >>> > > > >> +#define TX_WTHRESH 0 /**< Default values of TX write-back >>> > > threshold >>> > > > >> reg. */ >>> > > > >> + >>> > > > >> +#define MAX_PKT_BURST 16 >>> > > > >> +#define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */ >>> > > > >> +#define RTE_TEST_RX_DESC_DEFAULT 128 >>> > > > >> +#define RTE_TEST_TX_DESC_DEFAULT 512 >>> > > > >> + >>> > > > >> /** Packet socket using dpdk mmaped rings for both Rx and >>> Tx */ >>> > > > >> typedef struct { >>> > > > >> odp_buffer_pool_t pool; >>> > > > >> diff --git a/platform/linux-dpdk/odp_buffer_pool.c >>> > > > >> b/platform/linux-dpdk/odp_buffer_pool.c >>> > > > >> index de90275..805ce68 100644 >>> > > > >> --- a/platform/linux-dpdk/odp_buffer_pool.c >>> > > > >> +++ b/platform/linux-dpdk/odp_buffer_pool.c >>> > > > >> @@ -23,7 +23,7 @@ >>> > > > >> #include <odp_packet_dpdk.h> >>> > > > >> #define MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + >>> > > > >> RTE_PKTMBUF_HEADROOM) >>> > > > >> -#define NB_MBUF 8192 >>> > > > >> +#define NB_MBUF 32768 >>> > > > >> #ifdef POOL_USE_TICKETLOCK >>> > > > >> #include <odp_ticketlock.h> >>> > > > >> @@ -112,7 +112,7 @@ odp_buffer_pool_t >>> > > odp_buffer_pool_create(const char >>> > > > >> *name, >>> > > > >> pktmbuf_pool = >>> > > > >> rte_mempool_create(name, NB_MBUF, >>> > > > >> - MBUF_SIZE, 32, >>> > > > >> + MBUF_SIZE, MAX_PKT_BURST, >>> > > > >> sizeof(struct >>> > > > >> rte_pktmbuf_pool_private), >>> > > > >> rte_pktmbuf_pool_init, NULL, >>> > > > >> rte_pktmbuf_init, NULL, >>> > > > >> diff --git a/platform/linux-dpdk/odp_packet_dpdk.c >>> > > > >> b/platform/linux-dpdk/odp_packet_dpdk.c >>> > > > >> index 31bfa30..d5c8e80 100644 >>> > > > >> --- a/platform/linux-dpdk/odp_packet_dpdk.c >>> > > > >> +++ b/platform/linux-dpdk/odp_packet_dpdk.c >>> > > > >> @@ -26,34 +26,13 @@ >>> > > > >> #include <odp_packet_dpdk.h> >>> > > > >> #include <net/if.h> >>> > > > >> -/* >>> > > > >> - * RX and TX Prefetch, Host, and Write-back threshold values >>> > > should be >>> > > > >> - * carefully set for optimal performance. Consult the >>> network >>> > > > >> - * controller's datasheet and supporting DPDK documentation >>> > > for guidance >>> > > > >> - * on how these parameters should be set. >>> > > > >> - */ >>> > > > >> -#define RX_PTHRESH 8 /**< Default values of RX prefetch >>> > > threshold reg. */ >>> > > > >> -#define RX_HTHRESH 8 /**< Default values of RX host >>> > > threshold reg. */ >>> > > > >> -#define RX_WTHRESH 4 /**< Default values of RX write-back >>> > > threshold reg. >>> > > > >> */ >>> > > > >> - >>> > > > >> -/* >>> > > > >> - * These default values are optimized for use with the >>> > > Intel(R) 82599 10 >>> > > > >> GbE >>> > > > >> - * Controller and the DPDK ixgbe PMD. Consider using other >>> > > values for >>> > > > >> other >>> > > > >> - * network controllers and/or network drivers. >>> > > > >> - */ >>> > > > >> -#define TX_PTHRESH 36 /**< Default values of TX prefetch >>> > > threshold reg. >>> > > > >> */ >>> > > > >> -#define TX_HTHRESH 0 /**< Default values of TX host >>> > > threshold reg. */ >>> > > > >> -#define TX_WTHRESH 0 /**< Default values of TX write-back >>> > > threshold >>> > > > >> reg. */ >>> > > > >> - >>> > > > >> -#define MAX_PKT_BURST 16 >>> > > > >> -#define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */ >>> > > > >> -#define RTE_TEST_RX_DESC_DEFAULT 128 >>> > > > >> -#define RTE_TEST_TX_DESC_DEFAULT 512 >>> > > > >> static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT; >>> > > > >> static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT; >>> > > > >> static const struct rte_eth_conf port_conf = { >>> > > > >> .rxmode = { >>> > > > >> + .mq_mode = ETH_MQ_RX_RSS, >>> > > > >> + .max_rx_pkt_len = ETHER_MAX_LEN, >>> > > > >> .split_hdr_size = 0, >>> > > > >> .header_split = 0, /**< Header Split >>> > > disabled */ >>> > > > >> .hw_ip_checksum = 0, /**< IP checksum offload >>> > > disabled */ >>> > > > >> @@ -61,6 +40,12 @@ static const struct rte_eth_conf >>> port_conf = { >>> > > > >> .jumbo_frame = 0, /**< Jumbo Frame Support >>> > > disabled */ >>> > > > >> .hw_strip_crc = 0, /**< CRC stripped by >>> > > hardware */ >>> > > > >> }, >>> > > > >> + .rx_adv_conf = { >>> > > > >> + .rss_conf = { >>> > > > >> + .rss_key = NULL, >>> > > > >> + .rss_hf = ETH_RSS_IPV4 | >>> ETH_RSS_IPV6, >>> > > > >> + }, >>> > > > >> + }, >>> > > > >> .txmode = { >>> > > > >> .mq_mode = ETH_MQ_TX_NONE, >>> > > > >> }, >>> > > > >> @@ -95,60 +80,71 @@ int setup_pkt_dpdk(pkt_dpdk_t * const >>> > > pkt_dpdk, const >>> > > > >> char *netdev, >>> > > > >> ODP_DBG("setup_pkt_dpdk\n"); >>> > > > >> static struct ether_addr eth_addr[RTE_MAX_ETHPORTS]; >>> > > > >> - uint8_t portid = 0; >>> > > > >> - uint16_t queueid = 0; >>> > > > >> - int ret; >>> > > > >> + static int portinit[RTE_MAX_ETHPORTS]; >>> > > > >> + static int qid[RTE_MAX_ETHPORTS]; >>> > > > >> + uint8_t portid = 0, num_intf = 2; >>> > > > >> + uint16_t nbrxq = 0, nbtxq = 0; >>> > > > >> + int ret, i; >>> > > > >> + >>> > > > >> printf("dpdk netdev: %s\n", netdev); >>> > > > >> printf("dpdk pool: %lx\n", pool); >>> > > > >> - >>> > > > >> portid = atoi(netdev); >>> > > > >> pkt_dpdk->portid = portid; >>> > > > >> - pkt_dpdk->queueid = queueid; >>> > > > >> pkt_dpdk->pool = pool; >>> > > > >> printf("dpdk portid: %u\n", portid); >>> > > > >> - fflush(stdout); >>> > > > >> - ret = rte_eth_dev_configure(portid, 1, 1, >>> &port_conf); >>> > > > >> - if (ret < 0) >>> > > > >> - ODP_ERR("Cannot configure device: err=%d, >>> > > port=%u\n", >>> > > > >> - ret, (unsigned) portid); >>> > > > >> - >>> > > > >> - rte_eth_macaddr_get(portid, ð_addr[portid]); >>> > > > >> - ODP_DBG("Port %u, MAC address: >>> > > %02X:%02X:%02X:%02X:%02X:%02X\ >>> > > > >> n\n", >>> > > > >> - (unsigned) portid, >>> > > > >> - eth_addr[portid].addr_bytes[0], >>> > > > >> - eth_addr[portid].addr_bytes[1], >>> > > > >> - eth_addr[portid].addr_bytes[2], >>> > > > >> - eth_addr[portid].addr_bytes[3], >>> > > > >> - eth_addr[portid].addr_bytes[4], >>> > > > >> - eth_addr[portid].addr_bytes[5]); >>> > > > >> - >>> > > > >> - /* init one RX queue on each port */ >>> > > > >> - fflush(stdout); >>> > > > >> - ret = rte_eth_rx_queue_setup(portid, queueid, nb_rxd, >>> > > > >> - rte_eth_dev_socket_id(portid), >>> > > > >> &rx_conf, >>> > > > >> - (struct rte_mempool *)pool); >>> > > > >> - if (ret < 0) >>> > > > >> - ODP_ERR("rte_eth_rx_queue_setup:err=%d, port=%u\n", >>> > > > >> - ret, (unsigned) portid); >>> > > > >> - ODP_DBG("dpdk rx queue setup done\n"); >>> > > > >> - >>> > > > >> - /* init one TX queue on each port */ >>> > > > >> - fflush(stdout); >>> > > > >> - ret = rte_eth_tx_queue_setup(portid, queueid, nb_txd, >>> > > > >> - rte_eth_dev_socket_id(portid), &tx_conf); >>> > > > >> - if (ret < 0) >>> > > > >> - ODP_ERR("rte_eth_tx_queue_setup:err=%d, port=%u\n", >>> > > > >> - ret, (unsigned) portid); >>> > > > >> - ODP_DBG("dpdk tx queue setup done\n"); >>> > > > >> - >>> > > > >> - /* Start device */ >>> > > > >> - ret = rte_eth_dev_start(portid); >>> > > > >> - if (ret < 0) >>> > > > >> - ODP_ERR("rte_eth_dev_start:err=%d, port=%u\n", >>> > > > >> - ret, (unsigned) portid); >>> > > > >> - ODP_DBG("dpdk setup done\n\n"); >>> > > > >> - >>> > > > >> + nbrxq = odp_sys_core_count() / num_intf; >>> > > > >> + nbtxq = nbrxq; >>> > > > >> + if (portinit[portid] == 0) { >>> > > > >> + fflush(stdout); >>> > > > >> + ret = rte_eth_dev_configure(portid, nbrxq, >>> nbtxq, >>> > > > >> &port_conf); >>> > > > >> + if (ret < 0) >>> > > > >> + ODP_ERR("Cannot configure device: >>> err=%d, >>> > > > >> port=%u\n", >>> > > > >> + ret, (unsigned) portid); >>> > > > >> + >>> > > > >> + rte_eth_macaddr_get(portid, ð_addr[portid]); >>> > > > >> + ODP_DBG("Port %u, MAC address: >>> > > > >> %02X:%02X:%02X:%02X:%02X:%02X\n", >>> > > > >> + (unsigned) portid, >>> > > > >> + eth_addr[portid].addr_bytes[0], >>> > > > >> + eth_addr[portid].addr_bytes[1], >>> > > > >> + eth_addr[portid].addr_bytes[2], >>> > > > >> + eth_addr[portid].addr_bytes[3], >>> > > > >> + eth_addr[portid].addr_bytes[4], >>> > > > >> + eth_addr[portid].addr_bytes[5]); >>> > > > >> + >>> > > > >> + /* init one RX queue on each port */ >>> > > > >> + fflush(stdout); >>> > > > >> + for (i = 0; i < nbrxq; i++) { >>> > > > >> + ret = rte_eth_rx_queue_setup(portid, >>> > > i, nb_rxd, >>> > > > >> + rte_eth_dev_socket_id(portid), >>> > > > >> &rx_conf, >>> > > > >> + (struct rte_mempool *)pool); >>> > > > >> + if (ret < 0) >>> > > > >> + ODP_ERR("%s rxq:err=%d, port=%u\n", >>> > > > >> + __func__, ret, (unsigned) portid); >>> > > > >> + ODP_DBG("dpdk rx queue setup >>> done\n"); >>> > > > >> + } >>> > > > >> + >>> > > > >> + /* init one TX queue on each port */ >>> > > > >> + fflush(stdout); >>> > > > >> + for (i = 0; i < nbtxq; i++) { >>> > > > >> + ret = rte_eth_tx_queue_setup(portid, >>> > > i, nb_txd, >>> > > > >> + rte_eth_dev_socket_id(portid), &tx_conf); >>> > > > >> + if (ret < 0) >>> > > > >> + ODP_ERR("%s txq:err=%d, port=%u\n", >>> > > > >> + __func__, ret, (unsigned) portid); >>> > > > >> + ODP_DBG("dpdk tx queue setup >>> done\n"); >>> > > > >> + } >>> > > > >> + >>> > > > >> + /* Start device */ >>> > > > >> + ret = rte_eth_dev_start(portid); >>> > > > >> + if (ret < 0) >>> > > > >> + ODP_ERR("rte_eth_dev_start:err=%d, port=%u\n", >>> > > > >> + ret, (unsigned) portid); >>> > > > >> + ODP_DBG("dpdk setup done\n\n"); >>> > > > >> + >>> > > > >> + portinit[portid] = 1; >>> > > > >> + } >>> > > > >> + pkt_dpdk->queueid = qid[portid]++; >>> > > > >> return 0; >>> > > > >> } >>> > > > >> diff --git a/platform/linux-dpdk/odp_packet_io.c >>> > > > >> b/platform/linux-dpdk/odp_packet_io.c >>> > > > >> index d8d127f..3124175 100644 >>> > > > >> --- a/platform/linux-dpdk/odp_packet_io.c >>> > > > >> +++ b/platform/linux-dpdk/odp_packet_io.c >>> > > > >> @@ -230,6 +230,8 @@ int odp_pktio_recv(odp_pktio_t id, >>> > > odp_packet_t >>> > > > >> pkt_table[], unsigned len) >>> > > > >> if (pktio_entry == NULL) >>> > > > >> return -1; >>> > > > >> + odp_pktio_send(id, pkt_table, 0); >>> > > > >> + >>> > > > >> lock_entry(pktio_entry); >>> > > > >> pkts = recv_pkt_dpdk(&pktio_entry->s.pkt_dpdk, >>> > > pkt_table, len); >>> > > > >> unlock_entry(pktio_entry); >>> > > > >> >>> > > > > >>> > > > > >>> > > > > _______________________________________________ >>> > > > > lng-odp mailing list >>> > > > > lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org> >>> > > > > http://lists.linaro.org/mailman/listinfo/lng-odp >>> > > > > >>> > > > >>> > > > >>> > > > >>> > > > -- >>> > > > *Mike Holmes* >>> > > > Linaro Technical Manager / Lead >>> > > > LNG - ODP >>> > > >>> > > > _______________________________________________ >>> > > > lng-odp mailing list >>> > > > lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org> >>> > > > http://lists.linaro.org/mailman/listinfo/lng-odp >>> > > >>> > > >>> > > -- >>> > > Anders Roxell >>> > > anders.roxell@linaro.org <mailto:anders.roxell@linaro.org> >>> > > M: +46 709 71 42 85 | IRC: roxell >>> > > >>> > > _______________________________________________ >>> > > lng-odp mailing list >>> > > lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org> >>> > > http://lists.linaro.org/mailman/listinfo/lng-odp >>> > > >>> > > >>> > > >>> > > >>> > >_______________________________________________ >>> > >lng-odp mailing list >>> > >lng-odp@lists.linaro.org >>> > >http://lists.linaro.org/mailman/listinfo/lng-odp >>> > >>> > >>> > _______________________________________________ >>> > lng-odp mailing list >>> > lng-odp@lists.linaro.org >>> > http://lists.linaro.org/mailman/listinfo/lng-odp >>> >>> -- >>> Anders Roxell >>> anders.roxell@linaro.org >>> M: +46 709 71 42 85 | IRC: roxell >>> >>> _______________________________________________ >>> lng-odp mailing list >>> lng-odp@lists.linaro.org >>> http://lists.linaro.org/mailman/listinfo/lng-odp >>> >> >> >> >> -- >> *Mike Holmes* >> Linaro Technical Manager / Lead >> LNG - ODP >> >> _______________________________________________ >> lng-odp mailing list >> lng-odp@lists.linaro.org >> http://lists.linaro.org/mailman/listinfo/lng-odp >> >> >
On 12 August 2014 00:25, Mike Holmes <mike.holmes@linaro.org> wrote: > Which test case in odp/test would check this, or does it need an > application like l2fwd to be run - are either in LAVA/CI ? > l2fwd should be run on a machine which has more than 2 cpus(I tested with 16 cpu machine). From Ixia, one had to generate different pkts for different queues which is eventually different cpu handling it. I am not sure how this will be achieved with odp_generator or pktgen. > > Santosh are you able to verify this does not break anything as part of the > l2fwd work you are doing ? > > Mike > > > On 11 August 2014 01:43, Venkatesh Vivekanandan < > venkatesh.vivekanandan@linaro.org> wrote: > >> >> >> >> On 9 August 2014 17:32, Mike Holmes <mike.holmes@linaro.org> wrote: >> >>> >>> >>> >>> On 8 August 2014 17:46, Anders Roxell <anders.roxell@linaro.org> wrote: >>> >>>> On 2014-08-08 17:31, Maxim Uvarov wrote: >>>> > On 08/08/2014 05:13 PM, Venkatesh Vivekanandan wrote: >>>> > > >>>> > > >>>> > > >>>> > >On 7 August 2014 21:10, Anders Roxell <anders.roxell@linaro.org >>>> > ><mailto:anders.roxell@linaro.org>> wrote: >>>> > > >>>> > > On 2014-08-07 10:41, Mike Holmes wrote: >>>> > > > Does this need a signoff by someone else before it is merged ? >>>> > > > >>>> > > > I think we want to enforce getting an ack, tested-by or >>>> > > reviewed-by before >>>> > > > we merge things, we have informally moved that way over the >>>> last >>>> > > couple of >>>> > > > weeks and now I think it is time we made it a formal >>>> requirement. >>>> > > >>>> > > Agree. >>>> > > >>>> > > >>>> > >If this is the case, then is it fair to say initial discussion of >>>> > >24-hour window is void?. I guess Maxim was waiting for 2 days(for >>>> > >any comments) before he could merge this patch. Do we have any >>>> > >time-limit before which a patch /must /be reviewed or tested? I >>>> > >hope we can't wait indefinitely or is this the case?. >>>> > >>>> > I think if patch came from platfrom maintainer, it's not new API. No >>>> > comments in 1 or 2 days, than it's ok to merge it. If patch came >>>> > from somobody alse I would ask maintainer to review it. >>>> >>>> I disagree with this. >>>> No matter where the patch comes from and who wrote the patch, it can be >>>> wrong and need a second pair of eyes i.e., >>>> (Reviewed|Acked|Signed-off)-by. >>>> If no one has replied to a patch after 2 days, the author of the patch >>>> should ping the list and maintainer. >>>> >>>> After the second pair of eyes, the patch should be ok to be merged. >>>> The ODP maintainer should do a smoke build test on all the supported >>>> platforms before merging though. >>>> >>> >>> My 2 cents >>> We have started to develop a cohesive API, I think that is down to a lot >>> of folks working together. >>> I also think that peer review/team work is reflected in the increasing >>> willingness to review each others patches which has improved quality >>> and helped establish the guidelines on how things bolt together in ODP, >>> may long discussions have spawned from patches. >>> >>> No one is beyond silly mistakes, peer review finds a lot of the dumb >>> stuff for little cost, saving on the inevitable ugly patch up that will >>> ensue otherwise. >>> Maxim you could do the default reviews if no one came forward, but if a >>> submitter finds and establishes their own network of reviewers that is one >>> extra pair of eyes and ideas. >>> >> >> Can someone please review this patch?. If there is any comments, we can >> request maxim to revert the patch, otherwise he can add the >> "Reviewed-by/Tested-by" to the applied patch. >> >> >>>> Cheers, >>>> Anders >>>> >>>> > >>>> > Maxim. >>>> > >>>> > > Anders >>>> > > >>>> > > > >>>> > > > Mike >>>> > > > >>>> > > > >>>> > > > On 7 August 2014 09:15, Maxim Uvarov <maxim.uvarov@linaro.org >>>> > > <mailto:maxim.uvarov@linaro.org>> wrote: >>>> > > > >>>> > > > > Merged, thanks! >>>> > > > > >>>> > > > > Maxim. >>>> > > > > >>>> > > > > >>>> > > > > On 08/05/2014 06:54 PM, venkatesh.vivekanandan@linaro.org >>>> > > <mailto:venkatesh.vivekanandan@linaro.org> wrote: >>>> > > > > >>>> > > > >> From: Venkatesh Vivekanandan >>>> > > <venkatesh.vivekanandan@linaro.org >>>> > > <mailto:venkatesh.vivekanandan@linaro.org>> >>>> > > > >> >>>> > > > >> - Multi queue support per interface is enabled. >>>> > > > >> - odp_pktio_send with "0" packet is called in >>>> odp_pktio_recv to >>>> > > > >> give the transmitted buffers back to mempool. >>>> > > > >> - mbuf alloc failure during receive is fixed by giving more >>>> > > buffers to >>>> > > > >> mempool. >>>> > > > >> - mempool cache size is given equivalent to MAX_PKT_BURST. >>>> > > > >> >>>> > > > >> Signed-off-by: Venkatesh Vivekanandan >>>> > > <venkatesh.vivekanandan@linaro.org >>>> > > <mailto:venkatesh.vivekanandan@linaro.org>> >>>> > > > >> --- >>>> > > > >> platform/linux-dpdk/include/odp_packet_dpdk.h | 24 +++++ >>>> > > > >> platform/linux-dpdk/odp_buffer_pool.c | 4 +- >>>> > > > >> platform/linux-dpdk/odp_packet_dpdk.c | 136 >>>> > > > >> +++++++++++++------------- >>>> > > > >> platform/linux-dpdk/odp_packet_io.c | 2 + >>>> > > > >> 4 files changed, 94 insertions(+), 72 deletions(-) >>>> > > > >> >>>> > > > >> diff --git a/platform/linux-dpdk/include/odp_packet_dpdk.h >>>> > > > >> b/platform/linux-dpdk/include/odp_packet_dpdk.h >>>> > > > >> index bcbe9e8..bcf9aa5 100644 >>>> > > > >> --- a/platform/linux-dpdk/include/odp_packet_dpdk.h >>>> > > > >> +++ b/platform/linux-dpdk/include/odp_packet_dpdk.h >>>> > > > >> @@ -50,6 +50,30 @@ >>>> > > > >> #define DPDK_BLOCKING_IO >>>> > > > >> +/* >>>> > > > >> + * RX and TX Prefetch, Host, and Write-back threshold >>>> values >>>> > > should be >>>> > > > >> + * carefully set for optimal performance. Consult the >>>> network >>>> > > > >> + * controller's datasheet and supporting DPDK documentation >>>> > > for guidance >>>> > > > >> + * on how these parameters should be set. >>>> > > > >> + */ >>>> > > > >> +#define RX_PTHRESH 8 /**< Default values of RX prefetch >>>> > > threshold reg. */ >>>> > > > >> +#define RX_HTHRESH 8 /**< Default values of RX host >>>> > > threshold reg. */ >>>> > > > >> +#define RX_WTHRESH 4 /**< Default values of RX write-back >>>> > > threshold reg. >>>> > > > >> */ >>>> > > > >> + >>>> > > > >> +/* >>>> > > > >> + * These default values are optimized for use with the >>>> > > Intel(R) 82599 10 >>>> > > > >> GbE >>>> > > > >> + * Controller and the DPDK ixgbe PMD. Consider using other >>>> > > values for >>>> > > > >> other >>>> > > > >> + * network controllers and/or network drivers. >>>> > > > >> + */ >>>> > > > >> +#define TX_PTHRESH 36 /**< Default values of TX prefetch >>>> > > threshold reg. >>>> > > > >> */ >>>> > > > >> +#define TX_HTHRESH 0 /**< Default values of TX host >>>> > > threshold reg. */ >>>> > > > >> +#define TX_WTHRESH 0 /**< Default values of TX write-back >>>> > > threshold >>>> > > > >> reg. */ >>>> > > > >> + >>>> > > > >> +#define MAX_PKT_BURST 16 >>>> > > > >> +#define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */ >>>> > > > >> +#define RTE_TEST_RX_DESC_DEFAULT 128 >>>> > > > >> +#define RTE_TEST_TX_DESC_DEFAULT 512 >>>> > > > >> + >>>> > > > >> /** Packet socket using dpdk mmaped rings for both Rx and >>>> Tx */ >>>> > > > >> typedef struct { >>>> > > > >> odp_buffer_pool_t pool; >>>> > > > >> diff --git a/platform/linux-dpdk/odp_buffer_pool.c >>>> > > > >> b/platform/linux-dpdk/odp_buffer_pool.c >>>> > > > >> index de90275..805ce68 100644 >>>> > > > >> --- a/platform/linux-dpdk/odp_buffer_pool.c >>>> > > > >> +++ b/platform/linux-dpdk/odp_buffer_pool.c >>>> > > > >> @@ -23,7 +23,7 @@ >>>> > > > >> #include <odp_packet_dpdk.h> >>>> > > > >> #define MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + >>>> > > > >> RTE_PKTMBUF_HEADROOM) >>>> > > > >> -#define NB_MBUF 8192 >>>> > > > >> +#define NB_MBUF 32768 >>>> > > > >> #ifdef POOL_USE_TICKETLOCK >>>> > > > >> #include <odp_ticketlock.h> >>>> > > > >> @@ -112,7 +112,7 @@ odp_buffer_pool_t >>>> > > odp_buffer_pool_create(const char >>>> > > > >> *name, >>>> > > > >> pktmbuf_pool = >>>> > > > >> rte_mempool_create(name, NB_MBUF, >>>> > > > >> - MBUF_SIZE, 32, >>>> > > > >> + MBUF_SIZE, MAX_PKT_BURST, >>>> > > > >> sizeof(struct >>>> > > > >> rte_pktmbuf_pool_private), >>>> > > > >> rte_pktmbuf_pool_init, NULL, >>>> > > > >> rte_pktmbuf_init, NULL, >>>> > > > >> diff --git a/platform/linux-dpdk/odp_packet_dpdk.c >>>> > > > >> b/platform/linux-dpdk/odp_packet_dpdk.c >>>> > > > >> index 31bfa30..d5c8e80 100644 >>>> > > > >> --- a/platform/linux-dpdk/odp_packet_dpdk.c >>>> > > > >> +++ b/platform/linux-dpdk/odp_packet_dpdk.c >>>> > > > >> @@ -26,34 +26,13 @@ >>>> > > > >> #include <odp_packet_dpdk.h> >>>> > > > >> #include <net/if.h> >>>> > > > >> -/* >>>> > > > >> - * RX and TX Prefetch, Host, and Write-back threshold >>>> values >>>> > > should be >>>> > > > >> - * carefully set for optimal performance. Consult the >>>> network >>>> > > > >> - * controller's datasheet and supporting DPDK documentation >>>> > > for guidance >>>> > > > >> - * on how these parameters should be set. >>>> > > > >> - */ >>>> > > > >> -#define RX_PTHRESH 8 /**< Default values of RX prefetch >>>> > > threshold reg. */ >>>> > > > >> -#define RX_HTHRESH 8 /**< Default values of RX host >>>> > > threshold reg. */ >>>> > > > >> -#define RX_WTHRESH 4 /**< Default values of RX write-back >>>> > > threshold reg. >>>> > > > >> */ >>>> > > > >> - >>>> > > > >> -/* >>>> > > > >> - * These default values are optimized for use with the >>>> > > Intel(R) 82599 10 >>>> > > > >> GbE >>>> > > > >> - * Controller and the DPDK ixgbe PMD. Consider using other >>>> > > values for >>>> > > > >> other >>>> > > > >> - * network controllers and/or network drivers. >>>> > > > >> - */ >>>> > > > >> -#define TX_PTHRESH 36 /**< Default values of TX prefetch >>>> > > threshold reg. >>>> > > > >> */ >>>> > > > >> -#define TX_HTHRESH 0 /**< Default values of TX host >>>> > > threshold reg. */ >>>> > > > >> -#define TX_WTHRESH 0 /**< Default values of TX write-back >>>> > > threshold >>>> > > > >> reg. */ >>>> > > > >> - >>>> > > > >> -#define MAX_PKT_BURST 16 >>>> > > > >> -#define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */ >>>> > > > >> -#define RTE_TEST_RX_DESC_DEFAULT 128 >>>> > > > >> -#define RTE_TEST_TX_DESC_DEFAULT 512 >>>> > > > >> static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT; >>>> > > > >> static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT; >>>> > > > >> static const struct rte_eth_conf port_conf = { >>>> > > > >> .rxmode = { >>>> > > > >> + .mq_mode = ETH_MQ_RX_RSS, >>>> > > > >> + .max_rx_pkt_len = ETHER_MAX_LEN, >>>> > > > >> .split_hdr_size = 0, >>>> > > > >> .header_split = 0, /**< Header Split >>>> > > disabled */ >>>> > > > >> .hw_ip_checksum = 0, /**< IP checksum >>>> offload >>>> > > disabled */ >>>> > > > >> @@ -61,6 +40,12 @@ static const struct rte_eth_conf >>>> port_conf = { >>>> > > > >> .jumbo_frame = 0, /**< Jumbo Frame >>>> Support >>>> > > disabled */ >>>> > > > >> .hw_strip_crc = 0, /**< CRC stripped by >>>> > > hardware */ >>>> > > > >> }, >>>> > > > >> + .rx_adv_conf = { >>>> > > > >> + .rss_conf = { >>>> > > > >> + .rss_key = NULL, >>>> > > > >> + .rss_hf = ETH_RSS_IPV4 | >>>> ETH_RSS_IPV6, >>>> > > > >> + }, >>>> > > > >> + }, >>>> > > > >> .txmode = { >>>> > > > >> .mq_mode = ETH_MQ_TX_NONE, >>>> > > > >> }, >>>> > > > >> @@ -95,60 +80,71 @@ int setup_pkt_dpdk(pkt_dpdk_t * const >>>> > > pkt_dpdk, const >>>> > > > >> char *netdev, >>>> > > > >> ODP_DBG("setup_pkt_dpdk\n"); >>>> > > > >> static struct ether_addr eth_addr[RTE_MAX_ETHPORTS]; >>>> > > > >> - uint8_t portid = 0; >>>> > > > >> - uint16_t queueid = 0; >>>> > > > >> - int ret; >>>> > > > >> + static int portinit[RTE_MAX_ETHPORTS]; >>>> > > > >> + static int qid[RTE_MAX_ETHPORTS]; >>>> > > > >> + uint8_t portid = 0, num_intf = 2; >>>> > > > >> + uint16_t nbrxq = 0, nbtxq = 0; >>>> > > > >> + int ret, i; >>>> > > > >> + >>>> > > > >> printf("dpdk netdev: %s\n", netdev); >>>> > > > >> printf("dpdk pool: %lx\n", pool); >>>> > > > >> - >>>> > > > >> portid = atoi(netdev); >>>> > > > >> pkt_dpdk->portid = portid; >>>> > > > >> - pkt_dpdk->queueid = queueid; >>>> > > > >> pkt_dpdk->pool = pool; >>>> > > > >> printf("dpdk portid: %u\n", portid); >>>> > > > >> - fflush(stdout); >>>> > > > >> - ret = rte_eth_dev_configure(portid, 1, 1, >>>> &port_conf); >>>> > > > >> - if (ret < 0) >>>> > > > >> - ODP_ERR("Cannot configure device: err=%d, >>>> > > port=%u\n", >>>> > > > >> - ret, (unsigned) portid); >>>> > > > >> - >>>> > > > >> - rte_eth_macaddr_get(portid, ð_addr[portid]); >>>> > > > >> - ODP_DBG("Port %u, MAC address: >>>> > > %02X:%02X:%02X:%02X:%02X:%02X\ >>>> > > > >> n\n", >>>> > > > >> - (unsigned) portid, >>>> > > > >> - eth_addr[portid].addr_bytes[0], >>>> > > > >> - eth_addr[portid].addr_bytes[1], >>>> > > > >> - eth_addr[portid].addr_bytes[2], >>>> > > > >> - eth_addr[portid].addr_bytes[3], >>>> > > > >> - eth_addr[portid].addr_bytes[4], >>>> > > > >> - eth_addr[portid].addr_bytes[5]); >>>> > > > >> - >>>> > > > >> - /* init one RX queue on each port */ >>>> > > > >> - fflush(stdout); >>>> > > > >> - ret = rte_eth_rx_queue_setup(portid, queueid, >>>> nb_rxd, >>>> > > > >> - rte_eth_dev_socket_id(portid), >>>> > > > >> &rx_conf, >>>> > > > >> - (struct rte_mempool *)pool); >>>> > > > >> - if (ret < 0) >>>> > > > >> - ODP_ERR("rte_eth_rx_queue_setup:err=%d, port=%u\n", >>>> > > > >> - ret, (unsigned) portid); >>>> > > > >> - ODP_DBG("dpdk rx queue setup done\n"); >>>> > > > >> - >>>> > > > >> - /* init one TX queue on each port */ >>>> > > > >> - fflush(stdout); >>>> > > > >> - ret = rte_eth_tx_queue_setup(portid, queueid, >>>> nb_txd, >>>> > > > >> - rte_eth_dev_socket_id(portid), &tx_conf); >>>> > > > >> - if (ret < 0) >>>> > > > >> - ODP_ERR("rte_eth_tx_queue_setup:err=%d, port=%u\n", >>>> > > > >> - ret, (unsigned) portid); >>>> > > > >> - ODP_DBG("dpdk tx queue setup done\n"); >>>> > > > >> - >>>> > > > >> - /* Start device */ >>>> > > > >> - ret = rte_eth_dev_start(portid); >>>> > > > >> - if (ret < 0) >>>> > > > >> - ODP_ERR("rte_eth_dev_start:err=%d, port=%u\n", >>>> > > > >> - ret, (unsigned) portid); >>>> > > > >> - ODP_DBG("dpdk setup done\n\n"); >>>> > > > >> - >>>> > > > >> + nbrxq = odp_sys_core_count() / num_intf; >>>> > > > >> + nbtxq = nbrxq; >>>> > > > >> + if (portinit[portid] == 0) { >>>> > > > >> + fflush(stdout); >>>> > > > >> + ret = rte_eth_dev_configure(portid, nbrxq, >>>> nbtxq, >>>> > > > >> &port_conf); >>>> > > > >> + if (ret < 0) >>>> > > > >> + ODP_ERR("Cannot configure device: >>>> err=%d, >>>> > > > >> port=%u\n", >>>> > > > >> + ret, (unsigned) portid); >>>> > > > >> + >>>> > > > >> + rte_eth_macaddr_get(portid, ð_addr[portid]); >>>> > > > >> + ODP_DBG("Port %u, MAC address: >>>> > > > >> %02X:%02X:%02X:%02X:%02X:%02X\n", >>>> > > > >> + (unsigned) portid, >>>> > > > >> + eth_addr[portid].addr_bytes[0], >>>> > > > >> + eth_addr[portid].addr_bytes[1], >>>> > > > >> + eth_addr[portid].addr_bytes[2], >>>> > > > >> + eth_addr[portid].addr_bytes[3], >>>> > > > >> + eth_addr[portid].addr_bytes[4], >>>> > > > >> + eth_addr[portid].addr_bytes[5]); >>>> > > > >> + >>>> > > > >> + /* init one RX queue on each port */ >>>> > > > >> + fflush(stdout); >>>> > > > >> + for (i = 0; i < nbrxq; i++) { >>>> > > > >> + ret = rte_eth_rx_queue_setup(portid, >>>> > > i, nb_rxd, >>>> > > > >> + rte_eth_dev_socket_id(portid), >>>> > > > >> &rx_conf, >>>> > > > >> + (struct rte_mempool *)pool); >>>> > > > >> + if (ret < 0) >>>> > > > >> + ODP_ERR("%s rxq:err=%d, port=%u\n", >>>> > > > >> + __func__, ret, (unsigned) portid); >>>> > > > >> + ODP_DBG("dpdk rx queue setup >>>> done\n"); >>>> > > > >> + } >>>> > > > >> + >>>> > > > >> + /* init one TX queue on each port */ >>>> > > > >> + fflush(stdout); >>>> > > > >> + for (i = 0; i < nbtxq; i++) { >>>> > > > >> + ret = rte_eth_tx_queue_setup(portid, >>>> > > i, nb_txd, >>>> > > > >> + rte_eth_dev_socket_id(portid), &tx_conf); >>>> > > > >> + if (ret < 0) >>>> > > > >> + ODP_ERR("%s txq:err=%d, port=%u\n", >>>> > > > >> + __func__, ret, (unsigned) portid); >>>> > > > >> + ODP_DBG("dpdk tx queue setup >>>> done\n"); >>>> > > > >> + } >>>> > > > >> + >>>> > > > >> + /* Start device */ >>>> > > > >> + ret = rte_eth_dev_start(portid); >>>> > > > >> + if (ret < 0) >>>> > > > >> + ODP_ERR("rte_eth_dev_start:err=%d, port=%u\n", >>>> > > > >> + ret, (unsigned) portid); >>>> > > > >> + ODP_DBG("dpdk setup done\n\n"); >>>> > > > >> + >>>> > > > >> + portinit[portid] = 1; >>>> > > > >> + } >>>> > > > >> + pkt_dpdk->queueid = qid[portid]++; >>>> > > > >> return 0; >>>> > > > >> } >>>> > > > >> diff --git a/platform/linux-dpdk/odp_packet_io.c >>>> > > > >> b/platform/linux-dpdk/odp_packet_io.c >>>> > > > >> index d8d127f..3124175 100644 >>>> > > > >> --- a/platform/linux-dpdk/odp_packet_io.c >>>> > > > >> +++ b/platform/linux-dpdk/odp_packet_io.c >>>> > > > >> @@ -230,6 +230,8 @@ int odp_pktio_recv(odp_pktio_t id, >>>> > > odp_packet_t >>>> > > > >> pkt_table[], unsigned len) >>>> > > > >> if (pktio_entry == NULL) >>>> > > > >> return -1; >>>> > > > >> + odp_pktio_send(id, pkt_table, 0); >>>> > > > >> + >>>> > > > >> lock_entry(pktio_entry); >>>> > > > >> pkts = recv_pkt_dpdk(&pktio_entry->s.pkt_dpdk, >>>> > > pkt_table, len); >>>> > > > >> unlock_entry(pktio_entry); >>>> > > > >> >>>> > > > > >>>> > > > > >>>> > > > > _______________________________________________ >>>> > > > > lng-odp mailing list >>>> > > > > lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org> >>>> > > > > http://lists.linaro.org/mailman/listinfo/lng-odp >>>> > > > > >>>> > > > >>>> > > > >>>> > > > >>>> > > > -- >>>> > > > *Mike Holmes* >>>> > > > Linaro Technical Manager / Lead >>>> > > > LNG - ODP >>>> > > >>>> > > > _______________________________________________ >>>> > > > lng-odp mailing list >>>> > > > lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org> >>>> > > > http://lists.linaro.org/mailman/listinfo/lng-odp >>>> > > >>>> > > >>>> > > -- >>>> > > Anders Roxell >>>> > > anders.roxell@linaro.org <mailto:anders.roxell@linaro.org> >>>> > > M: +46 709 71 42 85 | IRC: roxell >>>> > > >>>> > > _______________________________________________ >>>> > > lng-odp mailing list >>>> > > lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org> >>>> > > http://lists.linaro.org/mailman/listinfo/lng-odp >>>> > > >>>> > > >>>> > > >>>> > > >>>> > >_______________________________________________ >>>> > >lng-odp mailing list >>>> > >lng-odp@lists.linaro.org >>>> > >http://lists.linaro.org/mailman/listinfo/lng-odp >>>> > >>>> > >>>> > _______________________________________________ >>>> > lng-odp mailing list >>>> > lng-odp@lists.linaro.org >>>> > http://lists.linaro.org/mailman/listinfo/lng-odp >>>> >>>> -- >>>> Anders Roxell >>>> anders.roxell@linaro.org >>>> M: +46 709 71 42 85 | IRC: roxell >>>> >>>> _______________________________________________ >>>> lng-odp mailing list >>>> lng-odp@lists.linaro.org >>>> http://lists.linaro.org/mailman/listinfo/lng-odp >>>> >>> >>> >>> >>> -- >>> *Mike Holmes* >>> Linaro Technical Manager / Lead >>> LNG - ODP >>> >>> _______________________________________________ >>> lng-odp mailing list >>> lng-odp@lists.linaro.org >>> http://lists.linaro.org/mailman/listinfo/lng-odp >>> >>> >> > > > -- > *Mike Holmes* > Linaro Technical Manager / Lead > LNG - ODP >
On 12 August 2014 00:25, Mike Holmes <mike.holmes@linaro.org> wrote: > Which test case in odp/test would check this, or does it need an application > like l2fwd to be run - are either in LAVA/CI ? > > Santosh are you able to verify this does not break anything as part of the > l2fwd work you are doing ? > No, I am seeing problem with current and should persist in this multi flavour too. We have bug reported on that lines. So whole dpdk-l2fwd doesn't works for me for my requirement. Thanks. > Mike > > > On 11 August 2014 01:43, Venkatesh Vivekanandan > <venkatesh.vivekanandan@linaro.org> wrote: >> >> >> >> >> On 9 August 2014 17:32, Mike Holmes <mike.holmes@linaro.org> wrote: >>> >>> >>> >>> >>> On 8 August 2014 17:46, Anders Roxell <anders.roxell@linaro.org> wrote: >>>> >>>> On 2014-08-08 17:31, Maxim Uvarov wrote: >>>> > On 08/08/2014 05:13 PM, Venkatesh Vivekanandan wrote: >>>> > > >>>> > > >>>> > > >>>> > >On 7 August 2014 21:10, Anders Roxell <anders.roxell@linaro.org >>>> > ><mailto:anders.roxell@linaro.org>> wrote: >>>> > > >>>> > > On 2014-08-07 10:41, Mike Holmes wrote: >>>> > > > Does this need a signoff by someone else before it is merged ? >>>> > > > >>>> > > > I think we want to enforce getting an ack, tested-by or >>>> > > reviewed-by before >>>> > > > we merge things, we have informally moved that way over the >>>> > > last >>>> > > couple of >>>> > > > weeks and now I think it is time we made it a formal >>>> > > requirement. >>>> > > >>>> > > Agree. >>>> > > >>>> > > >>>> > >If this is the case, then is it fair to say initial discussion of >>>> > >24-hour window is void?. I guess Maxim was waiting for 2 days(for >>>> > >any comments) before he could merge this patch. Do we have any >>>> > >time-limit before which a patch /must /be reviewed or tested? I >>>> > >hope we can't wait indefinitely or is this the case?. >>>> > >>>> > I think if patch came from platfrom maintainer, it's not new API. No >>>> > comments in 1 or 2 days, than it's ok to merge it. If patch came >>>> > from somobody alse I would ask maintainer to review it. >>>> >>>> I disagree with this. >>>> No matter where the patch comes from and who wrote the patch, it can be >>>> wrong and need a second pair of eyes i.e., >>>> (Reviewed|Acked|Signed-off)-by. >>>> If no one has replied to a patch after 2 days, the author of the patch >>>> should ping the list and maintainer. >>>> >>>> After the second pair of eyes, the patch should be ok to be merged. >>>> The ODP maintainer should do a smoke build test on all the supported >>>> platforms before merging though. >>> >>> >>> My 2 cents >>> We have started to develop a cohesive API, I think that is down to a lot >>> of folks working together. >>> I also think that peer review/team work is reflected in the increasing >>> willingness to review each others patches which has improved quality >>> and helped establish the guidelines on how things bolt together in ODP, >>> may long discussions have spawned from patches. >>> >>> No one is beyond silly mistakes, peer review finds a lot of the dumb >>> stuff for little cost, saving on the inevitable ugly patch up that will >>> ensue otherwise. >>> Maxim you could do the default reviews if no one came forward, but if a >>> submitter finds and establishes their own network of reviewers that is one >>> extra pair of eyes and ideas. >> >> >> Can someone please review this patch?. If there is any comments, we can >> request maxim to revert the patch, otherwise he can add the >> "Reviewed-by/Tested-by" to the applied patch. >> >>>> >>>> Cheers, >>>> Anders >>>> >>>> > >>>> > Maxim. >>>> > >>>> > > Anders >>>> > > >>>> > > > >>>> > > > Mike >>>> > > > >>>> > > > >>>> > > > On 7 August 2014 09:15, Maxim Uvarov <maxim.uvarov@linaro.org >>>> > > <mailto:maxim.uvarov@linaro.org>> wrote: >>>> > > > >>>> > > > > Merged, thanks! >>>> > > > > >>>> > > > > Maxim. >>>> > > > > >>>> > > > > >>>> > > > > On 08/05/2014 06:54 PM, venkatesh.vivekanandan@linaro.org >>>> > > <mailto:venkatesh.vivekanandan@linaro.org> wrote: >>>> > > > > >>>> > > > >> From: Venkatesh Vivekanandan >>>> > > <venkatesh.vivekanandan@linaro.org >>>> > > <mailto:venkatesh.vivekanandan@linaro.org>> >>>> > > > >> >>>> > > > >> - Multi queue support per interface is enabled. >>>> > > > >> - odp_pktio_send with "0" packet is called in odp_pktio_recv >>>> > > to >>>> > > > >> give the transmitted buffers back to mempool. >>>> > > > >> - mbuf alloc failure during receive is fixed by giving more >>>> > > buffers to >>>> > > > >> mempool. >>>> > > > >> - mempool cache size is given equivalent to MAX_PKT_BURST. >>>> > > > >> >>>> > > > >> Signed-off-by: Venkatesh Vivekanandan >>>> > > <venkatesh.vivekanandan@linaro.org >>>> > > <mailto:venkatesh.vivekanandan@linaro.org>> >>>> > > > >> --- >>>> > > > >> platform/linux-dpdk/include/odp_packet_dpdk.h | 24 +++++ >>>> > > > >> platform/linux-dpdk/odp_buffer_pool.c | 4 +- >>>> > > > >> platform/linux-dpdk/odp_packet_dpdk.c | 136 >>>> > > > >> +++++++++++++------------- >>>> > > > >> platform/linux-dpdk/odp_packet_io.c | 2 + >>>> > > > >> 4 files changed, 94 insertions(+), 72 deletions(-) >>>> > > > >> >>>> > > > >> diff --git a/platform/linux-dpdk/include/odp_packet_dpdk.h >>>> > > > >> b/platform/linux-dpdk/include/odp_packet_dpdk.h >>>> > > > >> index bcbe9e8..bcf9aa5 100644 >>>> > > > >> --- a/platform/linux-dpdk/include/odp_packet_dpdk.h >>>> > > > >> +++ b/platform/linux-dpdk/include/odp_packet_dpdk.h >>>> > > > >> @@ -50,6 +50,30 @@ >>>> > > > >> #define DPDK_BLOCKING_IO >>>> > > > >> +/* >>>> > > > >> + * RX and TX Prefetch, Host, and Write-back threshold >>>> > > values >>>> > > should be >>>> > > > >> + * carefully set for optimal performance. Consult the >>>> > > network >>>> > > > >> + * controller's datasheet and supporting DPDK documentation >>>> > > for guidance >>>> > > > >> + * on how these parameters should be set. >>>> > > > >> + */ >>>> > > > >> +#define RX_PTHRESH 8 /**< Default values of RX prefetch >>>> > > threshold reg. */ >>>> > > > >> +#define RX_HTHRESH 8 /**< Default values of RX host >>>> > > threshold reg. */ >>>> > > > >> +#define RX_WTHRESH 4 /**< Default values of RX write-back >>>> > > threshold reg. >>>> > > > >> */ >>>> > > > >> + >>>> > > > >> +/* >>>> > > > >> + * These default values are optimized for use with the >>>> > > Intel(R) 82599 10 >>>> > > > >> GbE >>>> > > > >> + * Controller and the DPDK ixgbe PMD. Consider using other >>>> > > values for >>>> > > > >> other >>>> > > > >> + * network controllers and/or network drivers. >>>> > > > >> + */ >>>> > > > >> +#define TX_PTHRESH 36 /**< Default values of TX prefetch >>>> > > threshold reg. >>>> > > > >> */ >>>> > > > >> +#define TX_HTHRESH 0 /**< Default values of TX host >>>> > > threshold reg. */ >>>> > > > >> +#define TX_WTHRESH 0 /**< Default values of TX write-back >>>> > > threshold >>>> > > > >> reg. */ >>>> > > > >> + >>>> > > > >> +#define MAX_PKT_BURST 16 >>>> > > > >> +#define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */ >>>> > > > >> +#define RTE_TEST_RX_DESC_DEFAULT 128 >>>> > > > >> +#define RTE_TEST_TX_DESC_DEFAULT 512 >>>> > > > >> + >>>> > > > >> /** Packet socket using dpdk mmaped rings for both Rx and >>>> > > Tx */ >>>> > > > >> typedef struct { >>>> > > > >> odp_buffer_pool_t pool; >>>> > > > >> diff --git a/platform/linux-dpdk/odp_buffer_pool.c >>>> > > > >> b/platform/linux-dpdk/odp_buffer_pool.c >>>> > > > >> index de90275..805ce68 100644 >>>> > > > >> --- a/platform/linux-dpdk/odp_buffer_pool.c >>>> > > > >> +++ b/platform/linux-dpdk/odp_buffer_pool.c >>>> > > > >> @@ -23,7 +23,7 @@ >>>> > > > >> #include <odp_packet_dpdk.h> >>>> > > > >> #define MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + >>>> > > > >> RTE_PKTMBUF_HEADROOM) >>>> > > > >> -#define NB_MBUF 8192 >>>> > > > >> +#define NB_MBUF 32768 >>>> > > > >> #ifdef POOL_USE_TICKETLOCK >>>> > > > >> #include <odp_ticketlock.h> >>>> > > > >> @@ -112,7 +112,7 @@ odp_buffer_pool_t >>>> > > odp_buffer_pool_create(const char >>>> > > > >> *name, >>>> > > > >> pktmbuf_pool = >>>> > > > >> rte_mempool_create(name, NB_MBUF, >>>> > > > >> - MBUF_SIZE, 32, >>>> > > > >> + MBUF_SIZE, MAX_PKT_BURST, >>>> > > > >> sizeof(struct >>>> > > > >> rte_pktmbuf_pool_private), >>>> > > > >> rte_pktmbuf_pool_init, NULL, >>>> > > > >> rte_pktmbuf_init, NULL, >>>> > > > >> diff --git a/platform/linux-dpdk/odp_packet_dpdk.c >>>> > > > >> b/platform/linux-dpdk/odp_packet_dpdk.c >>>> > > > >> index 31bfa30..d5c8e80 100644 >>>> > > > >> --- a/platform/linux-dpdk/odp_packet_dpdk.c >>>> > > > >> +++ b/platform/linux-dpdk/odp_packet_dpdk.c >>>> > > > >> @@ -26,34 +26,13 @@ >>>> > > > >> #include <odp_packet_dpdk.h> >>>> > > > >> #include <net/if.h> >>>> > > > >> -/* >>>> > > > >> - * RX and TX Prefetch, Host, and Write-back threshold >>>> > > values >>>> > > should be >>>> > > > >> - * carefully set for optimal performance. Consult the >>>> > > network >>>> > > > >> - * controller's datasheet and supporting DPDK documentation >>>> > > for guidance >>>> > > > >> - * on how these parameters should be set. >>>> > > > >> - */ >>>> > > > >> -#define RX_PTHRESH 8 /**< Default values of RX prefetch >>>> > > threshold reg. */ >>>> > > > >> -#define RX_HTHRESH 8 /**< Default values of RX host >>>> > > threshold reg. */ >>>> > > > >> -#define RX_WTHRESH 4 /**< Default values of RX write-back >>>> > > threshold reg. >>>> > > > >> */ >>>> > > > >> - >>>> > > > >> -/* >>>> > > > >> - * These default values are optimized for use with the >>>> > > Intel(R) 82599 10 >>>> > > > >> GbE >>>> > > > >> - * Controller and the DPDK ixgbe PMD. Consider using other >>>> > > values for >>>> > > > >> other >>>> > > > >> - * network controllers and/or network drivers. >>>> > > > >> - */ >>>> > > > >> -#define TX_PTHRESH 36 /**< Default values of TX prefetch >>>> > > threshold reg. >>>> > > > >> */ >>>> > > > >> -#define TX_HTHRESH 0 /**< Default values of TX host >>>> > > threshold reg. */ >>>> > > > >> -#define TX_WTHRESH 0 /**< Default values of TX write-back >>>> > > threshold >>>> > > > >> reg. */ >>>> > > > >> - >>>> > > > >> -#define MAX_PKT_BURST 16 >>>> > > > >> -#define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */ >>>> > > > >> -#define RTE_TEST_RX_DESC_DEFAULT 128 >>>> > > > >> -#define RTE_TEST_TX_DESC_DEFAULT 512 >>>> > > > >> static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT; >>>> > > > >> static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT; >>>> > > > >> static const struct rte_eth_conf port_conf = { >>>> > > > >> .rxmode = { >>>> > > > >> + .mq_mode = ETH_MQ_RX_RSS, >>>> > > > >> + .max_rx_pkt_len = ETHER_MAX_LEN, >>>> > > > >> .split_hdr_size = 0, >>>> > > > >> .header_split = 0, /**< Header Split >>>> > > disabled */ >>>> > > > >> .hw_ip_checksum = 0, /**< IP checksum >>>> > > offload >>>> > > disabled */ >>>> > > > >> @@ -61,6 +40,12 @@ static const struct rte_eth_conf >>>> > > port_conf = { >>>> > > > >> .jumbo_frame = 0, /**< Jumbo Frame >>>> > > Support >>>> > > disabled */ >>>> > > > >> .hw_strip_crc = 0, /**< CRC stripped by >>>> > > hardware */ >>>> > > > >> }, >>>> > > > >> + .rx_adv_conf = { >>>> > > > >> + .rss_conf = { >>>> > > > >> + .rss_key = NULL, >>>> > > > >> + .rss_hf = ETH_RSS_IPV4 | >>>> > > ETH_RSS_IPV6, >>>> > > > >> + }, >>>> > > > >> + }, >>>> > > > >> .txmode = { >>>> > > > >> .mq_mode = ETH_MQ_TX_NONE, >>>> > > > >> }, >>>> > > > >> @@ -95,60 +80,71 @@ int setup_pkt_dpdk(pkt_dpdk_t * const >>>> > > pkt_dpdk, const >>>> > > > >> char *netdev, >>>> > > > >> ODP_DBG("setup_pkt_dpdk\n"); >>>> > > > >> static struct ether_addr eth_addr[RTE_MAX_ETHPORTS]; >>>> > > > >> - uint8_t portid = 0; >>>> > > > >> - uint16_t queueid = 0; >>>> > > > >> - int ret; >>>> > > > >> + static int portinit[RTE_MAX_ETHPORTS]; >>>> > > > >> + static int qid[RTE_MAX_ETHPORTS]; >>>> > > > >> + uint8_t portid = 0, num_intf = 2; >>>> > > > >> + uint16_t nbrxq = 0, nbtxq = 0; >>>> > > > >> + int ret, i; >>>> > > > >> + >>>> > > > >> printf("dpdk netdev: %s\n", netdev); >>>> > > > >> printf("dpdk pool: %lx\n", pool); >>>> > > > >> - >>>> > > > >> portid = atoi(netdev); >>>> > > > >> pkt_dpdk->portid = portid; >>>> > > > >> - pkt_dpdk->queueid = queueid; >>>> > > > >> pkt_dpdk->pool = pool; >>>> > > > >> printf("dpdk portid: %u\n", portid); >>>> > > > >> - fflush(stdout); >>>> > > > >> - ret = rte_eth_dev_configure(portid, 1, 1, >>>> > > &port_conf); >>>> > > > >> - if (ret < 0) >>>> > > > >> - ODP_ERR("Cannot configure device: err=%d, >>>> > > port=%u\n", >>>> > > > >> - ret, (unsigned) portid); >>>> > > > >> - >>>> > > > >> - rte_eth_macaddr_get(portid, ð_addr[portid]); >>>> > > > >> - ODP_DBG("Port %u, MAC address: >>>> > > %02X:%02X:%02X:%02X:%02X:%02X\ >>>> > > > >> n\n", >>>> > > > >> - (unsigned) portid, >>>> > > > >> - eth_addr[portid].addr_bytes[0], >>>> > > > >> - eth_addr[portid].addr_bytes[1], >>>> > > > >> - eth_addr[portid].addr_bytes[2], >>>> > > > >> - eth_addr[portid].addr_bytes[3], >>>> > > > >> - eth_addr[portid].addr_bytes[4], >>>> > > > >> - eth_addr[portid].addr_bytes[5]); >>>> > > > >> - >>>> > > > >> - /* init one RX queue on each port */ >>>> > > > >> - fflush(stdout); >>>> > > > >> - ret = rte_eth_rx_queue_setup(portid, queueid, >>>> > > nb_rxd, >>>> > > > >> - rte_eth_dev_socket_id(portid), >>>> > > > >> &rx_conf, >>>> > > > >> - (struct rte_mempool *)pool); >>>> > > > >> - if (ret < 0) >>>> > > > >> - ODP_ERR("rte_eth_rx_queue_setup:err=%d, port=%u\n", >>>> > > > >> - ret, (unsigned) portid); >>>> > > > >> - ODP_DBG("dpdk rx queue setup done\n"); >>>> > > > >> - >>>> > > > >> - /* init one TX queue on each port */ >>>> > > > >> - fflush(stdout); >>>> > > > >> - ret = rte_eth_tx_queue_setup(portid, queueid, >>>> > > nb_txd, >>>> > > > >> - rte_eth_dev_socket_id(portid), &tx_conf); >>>> > > > >> - if (ret < 0) >>>> > > > >> - ODP_ERR("rte_eth_tx_queue_setup:err=%d, port=%u\n", >>>> > > > >> - ret, (unsigned) portid); >>>> > > > >> - ODP_DBG("dpdk tx queue setup done\n"); >>>> > > > >> - >>>> > > > >> - /* Start device */ >>>> > > > >> - ret = rte_eth_dev_start(portid); >>>> > > > >> - if (ret < 0) >>>> > > > >> - ODP_ERR("rte_eth_dev_start:err=%d, port=%u\n", >>>> > > > >> - ret, (unsigned) portid); >>>> > > > >> - ODP_DBG("dpdk setup done\n\n"); >>>> > > > >> - >>>> > > > >> + nbrxq = odp_sys_core_count() / num_intf; >>>> > > > >> + nbtxq = nbrxq; >>>> > > > >> + if (portinit[portid] == 0) { >>>> > > > >> + fflush(stdout); >>>> > > > >> + ret = rte_eth_dev_configure(portid, nbrxq, >>>> > > nbtxq, >>>> > > > >> &port_conf); >>>> > > > >> + if (ret < 0) >>>> > > > >> + ODP_ERR("Cannot configure device: >>>> > > err=%d, >>>> > > > >> port=%u\n", >>>> > > > >> + ret, (unsigned) portid); >>>> > > > >> + >>>> > > > >> + rte_eth_macaddr_get(portid, ð_addr[portid]); >>>> > > > >> + ODP_DBG("Port %u, MAC address: >>>> > > > >> %02X:%02X:%02X:%02X:%02X:%02X\n", >>>> > > > >> + (unsigned) portid, >>>> > > > >> + eth_addr[portid].addr_bytes[0], >>>> > > > >> + eth_addr[portid].addr_bytes[1], >>>> > > > >> + eth_addr[portid].addr_bytes[2], >>>> > > > >> + eth_addr[portid].addr_bytes[3], >>>> > > > >> + eth_addr[portid].addr_bytes[4], >>>> > > > >> + eth_addr[portid].addr_bytes[5]); >>>> > > > >> + >>>> > > > >> + /* init one RX queue on each port */ >>>> > > > >> + fflush(stdout); >>>> > > > >> + for (i = 0; i < nbrxq; i++) { >>>> > > > >> + ret = rte_eth_rx_queue_setup(portid, >>>> > > i, nb_rxd, >>>> > > > >> + rte_eth_dev_socket_id(portid), >>>> > > > >> &rx_conf, >>>> > > > >> + (struct rte_mempool *)pool); >>>> > > > >> + if (ret < 0) >>>> > > > >> + ODP_ERR("%s rxq:err=%d, port=%u\n", >>>> > > > >> + __func__, ret, (unsigned) portid); >>>> > > > >> + ODP_DBG("dpdk rx queue setup >>>> > > done\n"); >>>> > > > >> + } >>>> > > > >> + >>>> > > > >> + /* init one TX queue on each port */ >>>> > > > >> + fflush(stdout); >>>> > > > >> + for (i = 0; i < nbtxq; i++) { >>>> > > > >> + ret = rte_eth_tx_queue_setup(portid, >>>> > > i, nb_txd, >>>> > > > >> + rte_eth_dev_socket_id(portid), &tx_conf); >>>> > > > >> + if (ret < 0) >>>> > > > >> + ODP_ERR("%s txq:err=%d, port=%u\n", >>>> > > > >> + __func__, ret, (unsigned) portid); >>>> > > > >> + ODP_DBG("dpdk tx queue setup >>>> > > done\n"); >>>> > > > >> + } >>>> > > > >> + >>>> > > > >> + /* Start device */ >>>> > > > >> + ret = rte_eth_dev_start(portid); >>>> > > > >> + if (ret < 0) >>>> > > > >> + ODP_ERR("rte_eth_dev_start:err=%d, port=%u\n", >>>> > > > >> + ret, (unsigned) portid); >>>> > > > >> + ODP_DBG("dpdk setup done\n\n"); >>>> > > > >> + >>>> > > > >> + portinit[portid] = 1; >>>> > > > >> + } >>>> > > > >> + pkt_dpdk->queueid = qid[portid]++; >>>> > > > >> return 0; >>>> > > > >> } >>>> > > > >> diff --git a/platform/linux-dpdk/odp_packet_io.c >>>> > > > >> b/platform/linux-dpdk/odp_packet_io.c >>>> > > > >> index d8d127f..3124175 100644 >>>> > > > >> --- a/platform/linux-dpdk/odp_packet_io.c >>>> > > > >> +++ b/platform/linux-dpdk/odp_packet_io.c >>>> > > > >> @@ -230,6 +230,8 @@ int odp_pktio_recv(odp_pktio_t id, >>>> > > odp_packet_t >>>> > > > >> pkt_table[], unsigned len) >>>> > > > >> if (pktio_entry == NULL) >>>> > > > >> return -1; >>>> > > > >> + odp_pktio_send(id, pkt_table, 0); >>>> > > > >> + >>>> > > > >> lock_entry(pktio_entry); >>>> > > > >> pkts = recv_pkt_dpdk(&pktio_entry->s.pkt_dpdk, >>>> > > pkt_table, len); >>>> > > > >> unlock_entry(pktio_entry); >>>> > > > >> >>>> > > > > >>>> > > > > >>>> > > > > _______________________________________________ >>>> > > > > lng-odp mailing list >>>> > > > > lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org> >>>> > > > > http://lists.linaro.org/mailman/listinfo/lng-odp >>>> > > > > >>>> > > > >>>> > > > >>>> > > > >>>> > > > -- >>>> > > > *Mike Holmes* >>>> > > > Linaro Technical Manager / Lead >>>> > > > LNG - ODP >>>> > > >>>> > > > _______________________________________________ >>>> > > > lng-odp mailing list >>>> > > > lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org> >>>> > > > http://lists.linaro.org/mailman/listinfo/lng-odp >>>> > > >>>> > > >>>> > > -- >>>> > > Anders Roxell >>>> > > anders.roxell@linaro.org <mailto:anders.roxell@linaro.org> >>>> > > M: +46 709 71 42 85 | IRC: roxell >>>> > > >>>> > > _______________________________________________ >>>> > > lng-odp mailing list >>>> > > lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org> >>>> > > http://lists.linaro.org/mailman/listinfo/lng-odp >>>> > > >>>> > > >>>> > > >>>> > > >>>> > >_______________________________________________ >>>> > >lng-odp mailing list >>>> > >lng-odp@lists.linaro.org >>>> > >http://lists.linaro.org/mailman/listinfo/lng-odp >>>> > >>>> > >>>> > _______________________________________________ >>>> > lng-odp mailing list >>>> > lng-odp@lists.linaro.org >>>> > http://lists.linaro.org/mailman/listinfo/lng-odp >>>> >>>> -- >>>> Anders Roxell >>>> anders.roxell@linaro.org >>>> M: +46 709 71 42 85 | IRC: roxell >>>> >>>> _______________________________________________ >>>> lng-odp mailing list >>>> lng-odp@lists.linaro.org >>>> http://lists.linaro.org/mailman/listinfo/lng-odp >>> >>> >>> >>> >>> -- >>> Mike Holmes >>> Linaro Technical Manager / Lead >>> LNG - ODP >>> >>> _______________________________________________ >>> lng-odp mailing list >>> lng-odp@lists.linaro.org >>> http://lists.linaro.org/mailman/listinfo/lng-odp >>> >> > > > > -- > Mike Holmes > Linaro Technical Manager / Lead > LNG - ODP > > _______________________________________________ > lng-odp mailing list > lng-odp@lists.linaro.org > http://lists.linaro.org/mailman/listinfo/lng-odp >
So it looks like we don't have any way to test this without an Ixia which is a problem given that Santosh is having trouble. Basically there is no CI job to point at that shows that excluding human error it is still working as expected. Keith, is dpdk pktgen able to generate pkts in the way Venki needs ? Mike On 12 August 2014 02:17, Santosh Shukla <santosh.shukla@linaro.org> wrote: > On 12 August 2014 00:25, Mike Holmes <mike.holmes@linaro.org> wrote: > > Which test case in odp/test would check this, or does it need an > application > > like l2fwd to be run - are either in LAVA/CI ? > > > > Santosh are you able to verify this does not break anything as part of > the > > l2fwd work you are doing ? > > > > No, I am seeing problem with current and should persist in this multi > flavour too. We have bug reported on that lines. So whole dpdk-l2fwd > doesn't works for me for my requirement. > > Thanks. > > > Mike > > > > > > On 11 August 2014 01:43, Venkatesh Vivekanandan > > <venkatesh.vivekanandan@linaro.org> wrote: > >> > >> > >> > >> > >> On 9 August 2014 17:32, Mike Holmes <mike.holmes@linaro.org> wrote: > >>> > >>> > >>> > >>> > >>> On 8 August 2014 17:46, Anders Roxell <anders.roxell@linaro.org> > wrote: > >>>> > >>>> On 2014-08-08 17:31, Maxim Uvarov wrote: > >>>> > On 08/08/2014 05:13 PM, Venkatesh Vivekanandan wrote: > >>>> > > > >>>> > > > >>>> > > > >>>> > >On 7 August 2014 21:10, Anders Roxell <anders.roxell@linaro.org > >>>> > ><mailto:anders.roxell@linaro.org>> wrote: > >>>> > > > >>>> > > On 2014-08-07 10:41, Mike Holmes wrote: > >>>> > > > Does this need a signoff by someone else before it is merged > ? > >>>> > > > > >>>> > > > I think we want to enforce getting an ack, tested-by or > >>>> > > reviewed-by before > >>>> > > > we merge things, we have informally moved that way over the > >>>> > > last > >>>> > > couple of > >>>> > > > weeks and now I think it is time we made it a formal > >>>> > > requirement. > >>>> > > > >>>> > > Agree. > >>>> > > > >>>> > > > >>>> > >If this is the case, then is it fair to say initial discussion of > >>>> > >24-hour window is void?. I guess Maxim was waiting for 2 days(for > >>>> > >any comments) before he could merge this patch. Do we have any > >>>> > >time-limit before which a patch /must /be reviewed or tested? I > >>>> > >hope we can't wait indefinitely or is this the case?. > >>>> > > >>>> > I think if patch came from platfrom maintainer, it's not new API. No > >>>> > comments in 1 or 2 days, than it's ok to merge it. If patch came > >>>> > from somobody alse I would ask maintainer to review it. > >>>> > >>>> I disagree with this. > >>>> No matter where the patch comes from and who wrote the patch, it can > be > >>>> wrong and need a second pair of eyes i.e., > >>>> (Reviewed|Acked|Signed-off)-by. > >>>> If no one has replied to a patch after 2 days, the author of the patch > >>>> should ping the list and maintainer. > >>>> > >>>> After the second pair of eyes, the patch should be ok to be merged. > >>>> The ODP maintainer should do a smoke build test on all the supported > >>>> platforms before merging though. > >>> > >>> > >>> My 2 cents > >>> We have started to develop a cohesive API, I think that is down to a > lot > >>> of folks working together. > >>> I also think that peer review/team work is reflected in the increasing > >>> willingness to review each others patches which has improved quality > >>> and helped establish the guidelines on how things bolt together in ODP, > >>> may long discussions have spawned from patches. > >>> > >>> No one is beyond silly mistakes, peer review finds a lot of the dumb > >>> stuff for little cost, saving on the inevitable ugly patch up that will > >>> ensue otherwise. > >>> Maxim you could do the default reviews if no one came forward, but if a > >>> submitter finds and establishes their own network of reviewers that is > one > >>> extra pair of eyes and ideas. > >> > >> > >> Can someone please review this patch?. If there is any comments, we can > >> request maxim to revert the patch, otherwise he can add the > >> "Reviewed-by/Tested-by" to the applied patch. > >> > >>>> > >>>> Cheers, > >>>> Anders > >>>> > >>>> > > >>>> > Maxim. > >>>> > > >>>> > > Anders > >>>> > > > >>>> > > > > >>>> > > > Mike > >>>> > > > > >>>> > > > > >>>> > > > On 7 August 2014 09:15, Maxim Uvarov < > maxim.uvarov@linaro.org > >>>> > > <mailto:maxim.uvarov@linaro.org>> wrote: > >>>> > > > > >>>> > > > > Merged, thanks! > >>>> > > > > > >>>> > > > > Maxim. > >>>> > > > > > >>>> > > > > > >>>> > > > > On 08/05/2014 06:54 PM, venkatesh.vivekanandan@linaro.org > >>>> > > <mailto:venkatesh.vivekanandan@linaro.org> wrote: > >>>> > > > > > >>>> > > > >> From: Venkatesh Vivekanandan > >>>> > > <venkatesh.vivekanandan@linaro.org > >>>> > > <mailto:venkatesh.vivekanandan@linaro.org>> > >>>> > > > >> > >>>> > > > >> - Multi queue support per interface is enabled. > >>>> > > > >> - odp_pktio_send with "0" packet is called in > odp_pktio_recv > >>>> > > to > >>>> > > > >> give the transmitted buffers back to mempool. > >>>> > > > >> - mbuf alloc failure during receive is fixed by giving > more > >>>> > > buffers to > >>>> > > > >> mempool. > >>>> > > > >> - mempool cache size is given equivalent to MAX_PKT_BURST. > >>>> > > > >> > >>>> > > > >> Signed-off-by: Venkatesh Vivekanandan > >>>> > > <venkatesh.vivekanandan@linaro.org > >>>> > > <mailto:venkatesh.vivekanandan@linaro.org>> > >>>> > > > >> --- > >>>> > > > >> platform/linux-dpdk/include/odp_packet_dpdk.h | 24 +++++ > >>>> > > > >> platform/linux-dpdk/odp_buffer_pool.c | 4 +- > >>>> > > > >> platform/linux-dpdk/odp_packet_dpdk.c | 136 > >>>> > > > >> +++++++++++++------------- > >>>> > > > >> platform/linux-dpdk/odp_packet_io.c | 2 + > >>>> > > > >> 4 files changed, 94 insertions(+), 72 deletions(-) > >>>> > > > >> > >>>> > > > >> diff --git a/platform/linux-dpdk/include/odp_packet_dpdk.h > >>>> > > > >> b/platform/linux-dpdk/include/odp_packet_dpdk.h > >>>> > > > >> index bcbe9e8..bcf9aa5 100644 > >>>> > > > >> --- a/platform/linux-dpdk/include/odp_packet_dpdk.h > >>>> > > > >> +++ b/platform/linux-dpdk/include/odp_packet_dpdk.h > >>>> > > > >> @@ -50,6 +50,30 @@ > >>>> > > > >> #define DPDK_BLOCKING_IO > >>>> > > > >> +/* > >>>> > > > >> + * RX and TX Prefetch, Host, and Write-back threshold > >>>> > > values > >>>> > > should be > >>>> > > > >> + * carefully set for optimal performance. Consult the > >>>> > > network > >>>> > > > >> + * controller's datasheet and supporting DPDK > documentation > >>>> > > for guidance > >>>> > > > >> + * on how these parameters should be set. > >>>> > > > >> + */ > >>>> > > > >> +#define RX_PTHRESH 8 /**< Default values of RX prefetch > >>>> > > threshold reg. */ > >>>> > > > >> +#define RX_HTHRESH 8 /**< Default values of RX host > >>>> > > threshold reg. */ > >>>> > > > >> +#define RX_WTHRESH 4 /**< Default values of RX write-back > >>>> > > threshold reg. > >>>> > > > >> */ > >>>> > > > >> + > >>>> > > > >> +/* > >>>> > > > >> + * These default values are optimized for use with the > >>>> > > Intel(R) 82599 10 > >>>> > > > >> GbE > >>>> > > > >> + * Controller and the DPDK ixgbe PMD. Consider using > other > >>>> > > values for > >>>> > > > >> other > >>>> > > > >> + * network controllers and/or network drivers. > >>>> > > > >> + */ > >>>> > > > >> +#define TX_PTHRESH 36 /**< Default values of TX prefetch > >>>> > > threshold reg. > >>>> > > > >> */ > >>>> > > > >> +#define TX_HTHRESH 0 /**< Default values of TX host > >>>> > > threshold reg. */ > >>>> > > > >> +#define TX_WTHRESH 0 /**< Default values of TX > write-back > >>>> > > threshold > >>>> > > > >> reg. */ > >>>> > > > >> + > >>>> > > > >> +#define MAX_PKT_BURST 16 > >>>> > > > >> +#define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */ > >>>> > > > >> +#define RTE_TEST_RX_DESC_DEFAULT 128 > >>>> > > > >> +#define RTE_TEST_TX_DESC_DEFAULT 512 > >>>> > > > >> + > >>>> > > > >> /** Packet socket using dpdk mmaped rings for both Rx > and > >>>> > > Tx */ > >>>> > > > >> typedef struct { > >>>> > > > >> odp_buffer_pool_t pool; > >>>> > > > >> diff --git a/platform/linux-dpdk/odp_buffer_pool.c > >>>> > > > >> b/platform/linux-dpdk/odp_buffer_pool.c > >>>> > > > >> index de90275..805ce68 100644 > >>>> > > > >> --- a/platform/linux-dpdk/odp_buffer_pool.c > >>>> > > > >> +++ b/platform/linux-dpdk/odp_buffer_pool.c > >>>> > > > >> @@ -23,7 +23,7 @@ > >>>> > > > >> #include <odp_packet_dpdk.h> > >>>> > > > >> #define MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + > >>>> > > > >> RTE_PKTMBUF_HEADROOM) > >>>> > > > >> -#define NB_MBUF 8192 > >>>> > > > >> +#define NB_MBUF 32768 > >>>> > > > >> #ifdef POOL_USE_TICKETLOCK > >>>> > > > >> #include <odp_ticketlock.h> > >>>> > > > >> @@ -112,7 +112,7 @@ odp_buffer_pool_t > >>>> > > odp_buffer_pool_create(const char > >>>> > > > >> *name, > >>>> > > > >> pktmbuf_pool = > >>>> > > > >> rte_mempool_create(name, NB_MBUF, > >>>> > > > >> - MBUF_SIZE, 32, > >>>> > > > >> + MBUF_SIZE, MAX_PKT_BURST, > >>>> > > > >> sizeof(struct > >>>> > > > >> rte_pktmbuf_pool_private), > >>>> > > > >> rte_pktmbuf_pool_init, NULL, > >>>> > > > >> rte_pktmbuf_init, NULL, > >>>> > > > >> diff --git a/platform/linux-dpdk/odp_packet_dpdk.c > >>>> > > > >> b/platform/linux-dpdk/odp_packet_dpdk.c > >>>> > > > >> index 31bfa30..d5c8e80 100644 > >>>> > > > >> --- a/platform/linux-dpdk/odp_packet_dpdk.c > >>>> > > > >> +++ b/platform/linux-dpdk/odp_packet_dpdk.c > >>>> > > > >> @@ -26,34 +26,13 @@ > >>>> > > > >> #include <odp_packet_dpdk.h> > >>>> > > > >> #include <net/if.h> > >>>> > > > >> -/* > >>>> > > > >> - * RX and TX Prefetch, Host, and Write-back threshold > >>>> > > values > >>>> > > should be > >>>> > > > >> - * carefully set for optimal performance. Consult the > >>>> > > network > >>>> > > > >> - * controller's datasheet and supporting DPDK > documentation > >>>> > > for guidance > >>>> > > > >> - * on how these parameters should be set. > >>>> > > > >> - */ > >>>> > > > >> -#define RX_PTHRESH 8 /**< Default values of RX prefetch > >>>> > > threshold reg. */ > >>>> > > > >> -#define RX_HTHRESH 8 /**< Default values of RX host > >>>> > > threshold reg. */ > >>>> > > > >> -#define RX_WTHRESH 4 /**< Default values of RX write-back > >>>> > > threshold reg. > >>>> > > > >> */ > >>>> > > > >> - > >>>> > > > >> -/* > >>>> > > > >> - * These default values are optimized for use with the > >>>> > > Intel(R) 82599 10 > >>>> > > > >> GbE > >>>> > > > >> - * Controller and the DPDK ixgbe PMD. Consider using > other > >>>> > > values for > >>>> > > > >> other > >>>> > > > >> - * network controllers and/or network drivers. > >>>> > > > >> - */ > >>>> > > > >> -#define TX_PTHRESH 36 /**< Default values of TX prefetch > >>>> > > threshold reg. > >>>> > > > >> */ > >>>> > > > >> -#define TX_HTHRESH 0 /**< Default values of TX host > >>>> > > threshold reg. */ > >>>> > > > >> -#define TX_WTHRESH 0 /**< Default values of TX > write-back > >>>> > > threshold > >>>> > > > >> reg. */ > >>>> > > > >> - > >>>> > > > >> -#define MAX_PKT_BURST 16 > >>>> > > > >> -#define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */ > >>>> > > > >> -#define RTE_TEST_RX_DESC_DEFAULT 128 > >>>> > > > >> -#define RTE_TEST_TX_DESC_DEFAULT 512 > >>>> > > > >> static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT; > >>>> > > > >> static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT; > >>>> > > > >> static const struct rte_eth_conf port_conf = { > >>>> > > > >> .rxmode = { > >>>> > > > >> + .mq_mode = ETH_MQ_RX_RSS, > >>>> > > > >> + .max_rx_pkt_len = ETHER_MAX_LEN, > >>>> > > > >> .split_hdr_size = 0, > >>>> > > > >> .header_split = 0, /**< Header Split > >>>> > > disabled */ > >>>> > > > >> .hw_ip_checksum = 0, /**< IP checksum > >>>> > > offload > >>>> > > disabled */ > >>>> > > > >> @@ -61,6 +40,12 @@ static const struct rte_eth_conf > >>>> > > port_conf = { > >>>> > > > >> .jumbo_frame = 0, /**< Jumbo Frame > >>>> > > Support > >>>> > > disabled */ > >>>> > > > >> .hw_strip_crc = 0, /**< CRC stripped by > >>>> > > hardware */ > >>>> > > > >> }, > >>>> > > > >> + .rx_adv_conf = { > >>>> > > > >> + .rss_conf = { > >>>> > > > >> + .rss_key = NULL, > >>>> > > > >> + .rss_hf = ETH_RSS_IPV4 | > >>>> > > ETH_RSS_IPV6, > >>>> > > > >> + }, > >>>> > > > >> + }, > >>>> > > > >> .txmode = { > >>>> > > > >> .mq_mode = ETH_MQ_TX_NONE, > >>>> > > > >> }, > >>>> > > > >> @@ -95,60 +80,71 @@ int setup_pkt_dpdk(pkt_dpdk_t * const > >>>> > > pkt_dpdk, const > >>>> > > > >> char *netdev, > >>>> > > > >> ODP_DBG("setup_pkt_dpdk\n"); > >>>> > > > >> static struct ether_addr > eth_addr[RTE_MAX_ETHPORTS]; > >>>> > > > >> - uint8_t portid = 0; > >>>> > > > >> - uint16_t queueid = 0; > >>>> > > > >> - int ret; > >>>> > > > >> + static int portinit[RTE_MAX_ETHPORTS]; > >>>> > > > >> + static int qid[RTE_MAX_ETHPORTS]; > >>>> > > > >> + uint8_t portid = 0, num_intf = 2; > >>>> > > > >> + uint16_t nbrxq = 0, nbtxq = 0; > >>>> > > > >> + int ret, i; > >>>> > > > >> + > >>>> > > > >> printf("dpdk netdev: %s\n", netdev); > >>>> > > > >> printf("dpdk pool: %lx\n", pool); > >>>> > > > >> - > >>>> > > > >> portid = atoi(netdev); > >>>> > > > >> pkt_dpdk->portid = portid; > >>>> > > > >> - pkt_dpdk->queueid = queueid; > >>>> > > > >> pkt_dpdk->pool = pool; > >>>> > > > >> printf("dpdk portid: %u\n", portid); > >>>> > > > >> - fflush(stdout); > >>>> > > > >> - ret = rte_eth_dev_configure(portid, 1, 1, > >>>> > > &port_conf); > >>>> > > > >> - if (ret < 0) > >>>> > > > >> - ODP_ERR("Cannot configure device: err=%d, > >>>> > > port=%u\n", > >>>> > > > >> - ret, (unsigned) portid); > >>>> > > > >> - > >>>> > > > >> - rte_eth_macaddr_get(portid, ð_addr[portid]); > >>>> > > > >> - ODP_DBG("Port %u, MAC address: > >>>> > > %02X:%02X:%02X:%02X:%02X:%02X\ > >>>> > > > >> n\n", > >>>> > > > >> - (unsigned) portid, > >>>> > > > >> - eth_addr[portid].addr_bytes[0], > >>>> > > > >> - eth_addr[portid].addr_bytes[1], > >>>> > > > >> - eth_addr[portid].addr_bytes[2], > >>>> > > > >> - eth_addr[portid].addr_bytes[3], > >>>> > > > >> - eth_addr[portid].addr_bytes[4], > >>>> > > > >> - eth_addr[portid].addr_bytes[5]); > >>>> > > > >> - > >>>> > > > >> - /* init one RX queue on each port */ > >>>> > > > >> - fflush(stdout); > >>>> > > > >> - ret = rte_eth_rx_queue_setup(portid, queueid, > >>>> > > nb_rxd, > >>>> > > > >> - rte_eth_dev_socket_id(portid), > >>>> > > > >> &rx_conf, > >>>> > > > >> - (struct rte_mempool *)pool); > >>>> > > > >> - if (ret < 0) > >>>> > > > >> - ODP_ERR("rte_eth_rx_queue_setup:err=%d, port=%u\n", > >>>> > > > >> - ret, (unsigned) portid); > >>>> > > > >> - ODP_DBG("dpdk rx queue setup done\n"); > >>>> > > > >> - > >>>> > > > >> - /* init one TX queue on each port */ > >>>> > > > >> - fflush(stdout); > >>>> > > > >> - ret = rte_eth_tx_queue_setup(portid, queueid, > >>>> > > nb_txd, > >>>> > > > >> - rte_eth_dev_socket_id(portid), &tx_conf); > >>>> > > > >> - if (ret < 0) > >>>> > > > >> - ODP_ERR("rte_eth_tx_queue_setup:err=%d, port=%u\n", > >>>> > > > >> - ret, (unsigned) portid); > >>>> > > > >> - ODP_DBG("dpdk tx queue setup done\n"); > >>>> > > > >> - > >>>> > > > >> - /* Start device */ > >>>> > > > >> - ret = rte_eth_dev_start(portid); > >>>> > > > >> - if (ret < 0) > >>>> > > > >> - ODP_ERR("rte_eth_dev_start:err=%d, port=%u\n", > >>>> > > > >> - ret, (unsigned) portid); > >>>> > > > >> - ODP_DBG("dpdk setup done\n\n"); > >>>> > > > >> - > >>>> > > > >> + nbrxq = odp_sys_core_count() / num_intf; > >>>> > > > >> + nbtxq = nbrxq; > >>>> > > > >> + if (portinit[portid] == 0) { > >>>> > > > >> + fflush(stdout); > >>>> > > > >> + ret = rte_eth_dev_configure(portid, nbrxq, > >>>> > > nbtxq, > >>>> > > > >> &port_conf); > >>>> > > > >> + if (ret < 0) > >>>> > > > >> + ODP_ERR("Cannot configure device: > >>>> > > err=%d, > >>>> > > > >> port=%u\n", > >>>> > > > >> + ret, (unsigned) portid); > >>>> > > > >> + > >>>> > > > >> + rte_eth_macaddr_get(portid, ð_addr[portid]); > >>>> > > > >> + ODP_DBG("Port %u, MAC address: > >>>> > > > >> %02X:%02X:%02X:%02X:%02X:%02X\n", > >>>> > > > >> + (unsigned) portid, > >>>> > > > >> + eth_addr[portid].addr_bytes[0], > >>>> > > > >> + eth_addr[portid].addr_bytes[1], > >>>> > > > >> + eth_addr[portid].addr_bytes[2], > >>>> > > > >> + eth_addr[portid].addr_bytes[3], > >>>> > > > >> + eth_addr[portid].addr_bytes[4], > >>>> > > > >> + eth_addr[portid].addr_bytes[5]); > >>>> > > > >> + > >>>> > > > >> + /* init one RX queue on each port */ > >>>> > > > >> + fflush(stdout); > >>>> > > > >> + for (i = 0; i < nbrxq; i++) { > >>>> > > > >> + ret = > rte_eth_rx_queue_setup(portid, > >>>> > > i, nb_rxd, > >>>> > > > >> + rte_eth_dev_socket_id(portid), > >>>> > > > >> &rx_conf, > >>>> > > > >> + (struct rte_mempool *)pool); > >>>> > > > >> + if (ret < 0) > >>>> > > > >> + ODP_ERR("%s rxq:err=%d, port=%u\n", > >>>> > > > >> + __func__, ret, (unsigned) portid); > >>>> > > > >> + ODP_DBG("dpdk rx queue setup > >>>> > > done\n"); > >>>> > > > >> + } > >>>> > > > >> + > >>>> > > > >> + /* init one TX queue on each port */ > >>>> > > > >> + fflush(stdout); > >>>> > > > >> + for (i = 0; i < nbtxq; i++) { > >>>> > > > >> + ret = > rte_eth_tx_queue_setup(portid, > >>>> > > i, nb_txd, > >>>> > > > >> + rte_eth_dev_socket_id(portid), &tx_conf); > >>>> > > > >> + if (ret < 0) > >>>> > > > >> + ODP_ERR("%s txq:err=%d, port=%u\n", > >>>> > > > >> + __func__, ret, (unsigned) portid); > >>>> > > > >> + ODP_DBG("dpdk tx queue setup > >>>> > > done\n"); > >>>> > > > >> + } > >>>> > > > >> + > >>>> > > > >> + /* Start device */ > >>>> > > > >> + ret = rte_eth_dev_start(portid); > >>>> > > > >> + if (ret < 0) > >>>> > > > >> + ODP_ERR("rte_eth_dev_start:err=%d, port=%u\n", > >>>> > > > >> + ret, (unsigned) portid); > >>>> > > > >> + ODP_DBG("dpdk setup done\n\n"); > >>>> > > > >> + > >>>> > > > >> + portinit[portid] = 1; > >>>> > > > >> + } > >>>> > > > >> + pkt_dpdk->queueid = qid[portid]++; > >>>> > > > >> return 0; > >>>> > > > >> } > >>>> > > > >> diff --git a/platform/linux-dpdk/odp_packet_io.c > >>>> > > > >> b/platform/linux-dpdk/odp_packet_io.c > >>>> > > > >> index d8d127f..3124175 100644 > >>>> > > > >> --- a/platform/linux-dpdk/odp_packet_io.c > >>>> > > > >> +++ b/platform/linux-dpdk/odp_packet_io.c > >>>> > > > >> @@ -230,6 +230,8 @@ int odp_pktio_recv(odp_pktio_t id, > >>>> > > odp_packet_t > >>>> > > > >> pkt_table[], unsigned len) > >>>> > > > >> if (pktio_entry == NULL) > >>>> > > > >> return -1; > >>>> > > > >> + odp_pktio_send(id, pkt_table, 0); > >>>> > > > >> + > >>>> > > > >> lock_entry(pktio_entry); > >>>> > > > >> pkts = recv_pkt_dpdk(&pktio_entry->s.pkt_dpdk, > >>>> > > pkt_table, len); > >>>> > > > >> unlock_entry(pktio_entry); > >>>> > > > >> > >>>> > > > > > >>>> > > > > > >>>> > > > > _______________________________________________ > >>>> > > > > lng-odp mailing list > >>>> > > > > lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org> > >>>> > > > > http://lists.linaro.org/mailman/listinfo/lng-odp > >>>> > > > > > >>>> > > > > >>>> > > > > >>>> > > > > >>>> > > > -- > >>>> > > > *Mike Holmes* > >>>> > > > Linaro Technical Manager / Lead > >>>> > > > LNG - ODP > >>>> > > > >>>> > > > _______________________________________________ > >>>> > > > lng-odp mailing list > >>>> > > > lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org> > >>>> > > > http://lists.linaro.org/mailman/listinfo/lng-odp > >>>> > > > >>>> > > > >>>> > > -- > >>>> > > Anders Roxell > >>>> > > anders.roxell@linaro.org <mailto:anders.roxell@linaro.org> > >>>> > > M: +46 709 71 42 85 | IRC: roxell > >>>> > > > >>>> > > _______________________________________________ > >>>> > > lng-odp mailing list > >>>> > > lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org> > >>>> > > http://lists.linaro.org/mailman/listinfo/lng-odp > >>>> > > > >>>> > > > >>>> > > > >>>> > > > >>>> > >_______________________________________________ > >>>> > >lng-odp mailing list > >>>> > >lng-odp@lists.linaro.org > >>>> > >http://lists.linaro.org/mailman/listinfo/lng-odp > >>>> > > >>>> > > >>>> > _______________________________________________ > >>>> > lng-odp mailing list > >>>> > lng-odp@lists.linaro.org > >>>> > http://lists.linaro.org/mailman/listinfo/lng-odp > >>>> > >>>> -- > >>>> Anders Roxell > >>>> anders.roxell@linaro.org > >>>> M: +46 709 71 42 85 | IRC: roxell > >>>> > >>>> _______________________________________________ > >>>> lng-odp mailing list > >>>> lng-odp@lists.linaro.org > >>>> http://lists.linaro.org/mailman/listinfo/lng-odp > >>> > >>> > >>> > >>> > >>> -- > >>> Mike Holmes > >>> Linaro Technical Manager / Lead > >>> LNG - ODP > >>> > >>> _______________________________________________ > >>> lng-odp mailing list > >>> lng-odp@lists.linaro.org > >>> http://lists.linaro.org/mailman/listinfo/lng-odp > >>> > >> > > > > > > > > -- > > Mike Holmes > > Linaro Technical Manager / Lead > > LNG - ODP > > > > _______________________________________________ > > lng-odp mailing list > > lng-odp@lists.linaro.org > > http://lists.linaro.org/mailman/listinfo/lng-odp > > >
Pktgen has a number of different ways to send packets single, range, pcap or random, sequence with parameters. One thing Pktgen does not do is act like a real stack, but you can simulate that with pcap or sequence packets. It basically depends on how complex a data flow you need. # git clone git://github.com/Pktgen/Pktgen-DPDK Let me know if I can help or change the code in some way. THanks ++keith Keith Wiles, Principal Technologist with CTO office, Wind River mobile 972-213-5533 On Aug 12, 2014, at 1:08 PM, Mike Holmes <mike.holmes@linaro.org<mailto:mike.holmes@linaro.org>> wrote: So it looks like we don't have any way to test this without an Ixia which is a problem given that Santosh is having trouble. Basically there is no CI job to point at that shows that excluding human error it is still working as expected. Keith, is dpdk pktgen able to generate pkts in the way Venki needs ? Mike On 12 August 2014 02:17, Santosh Shukla <santosh.shukla@linaro.org<mailto:santosh.shukla@linaro.org>> wrote: On 12 August 2014 00:25, Mike Holmes <mike.holmes@linaro.org<mailto:mike.holmes@linaro.org>> wrote: > Which test case in odp/test would check this, or does it need an application > like l2fwd to be run - are either in LAVA/CI ? > > Santosh are you able to verify this does not break anything as part of the > l2fwd work you are doing ? > No, I am seeing problem with current and should persist in this multi flavour too. We have bug reported on that lines. So whole dpdk-l2fwd doesn't works for me for my requirement. Thanks. > Mike > > > On 11 August 2014 01:43, Venkatesh Vivekanandan > <venkatesh.vivekanandan@linaro.org<mailto:venkatesh.vivekanandan@linaro.org>> wrote: >> >> >> >> >> On 9 August 2014 17:32, Mike Holmes <mike.holmes@linaro.org<mailto:mike.holmes@linaro.org>> wrote: >>> >>> >>> >>> >>> On 8 August 2014 17:46, Anders Roxell <anders.roxell@linaro.org<mailto:anders.roxell@linaro.org>> wrote: >>>> >>>> On 2014-08-08 17:31, Maxim Uvarov wrote: >>>> > On 08/08/2014 05:13 PM, Venkatesh Vivekanandan wrote: >>>> > > >>>> > > >>>> > > >>>> > >On 7 August 2014 21:10, Anders Roxell <anders.roxell@linaro.org<mailto:anders.roxell@linaro.org> >>>> > ><mailto:anders.roxell@linaro.org<mailto:anders.roxell@linaro.org>>> wrote: >>>> > > >>>> > > On 2014-08-07 10:41, Mike Holmes wrote: >>>> > > > Does this need a signoff by someone else before it is merged ? >>>> > > > >>>> > > > I think we want to enforce getting an ack, tested-by or >>>> > > reviewed-by before >>>> > > > we merge things, we have informally moved that way over the >>>> > > last >>>> > > couple of >>>> > > > weeks and now I think it is time we made it a formal >>>> > > requirement. >>>> > > >>>> > > Agree. >>>> > > >>>> > > >>>> > >If this is the case, then is it fair to say initial discussion of >>>> > >24-hour window is void?. I guess Maxim was waiting for 2 days(for >>>> > >any comments) before he could merge this patch. Do we have any >>>> > >time-limit before which a patch /must /be reviewed or tested? I >>>> > >hope we can't wait indefinitely or is this the case?. >>>> > >>>> > I think if patch came from platfrom maintainer, it's not new API. No >>>> > comments in 1 or 2 days, than it's ok to merge it. If patch came >>>> > from somobody alse I would ask maintainer to review it. >>>> >>>> I disagree with this. >>>> No matter where the patch comes from and who wrote the patch, it can be >>>> wrong and need a second pair of eyes i.e., >>>> (Reviewed|Acked|Signed-off)-by. >>>> If no one has replied to a patch after 2 days, the author of the patch >>>> should ping the list and maintainer. >>>> >>>> After the second pair of eyes, the patch should be ok to be merged. >>>> The ODP maintainer should do a smoke build test on all the supported >>>> platforms before merging though. >>> >>> >>> My 2 cents >>> We have started to develop a cohesive API, I think that is down to a lot >>> of folks working together. >>> I also think that peer review/team work is reflected in the increasing >>> willingness to review each others patches which has improved quality >>> and helped establish the guidelines on how things bolt together in ODP, >>> may long discussions have spawned from patches. >>> >>> No one is beyond silly mistakes, peer review finds a lot of the dumb >>> stuff for little cost, saving on the inevitable ugly patch up that will >>> ensue otherwise. >>> Maxim you could do the default reviews if no one came forward, but if a >>> submitter finds and establishes their own network of reviewers that is one >>> extra pair of eyes and ideas. >> >> >> Can someone please review this patch?. If there is any comments, we can >> request maxim to revert the patch, otherwise he can add the >> "Reviewed-by/Tested-by" to the applied patch. >> >>>> >>>> Cheers, >>>> Anders >>>> >>>> > >>>> > Maxim. >>>> > >>>> > > Anders >>>> > > >>>> > > > >>>> > > > Mike >>>> > > > >>>> > > > >>>> > > > On 7 August 2014 09:15, Maxim Uvarov <maxim.uvarov@linaro.org<mailto:maxim.uvarov@linaro.org> >>>> > > <mailto:maxim.uvarov@linaro.org<mailto:maxim.uvarov@linaro.org>>> wrote: >>>> > > > >>>> > > > > Merged, thanks! >>>> > > > > >>>> > > > > Maxim. >>>> > > > > >>>> > > > > >>>> > > > > On 08/05/2014 06:54 PM, venkatesh.vivekanandan@linaro.org<mailto:venkatesh.vivekanandan@linaro.org> >>>> > > <mailto:venkatesh.vivekanandan@linaro.org<mailto:venkatesh.vivekanandan@linaro.org>> wrote: >>>> > > > > >>>> > > > >> From: Venkatesh Vivekanandan >>>> > > <venkatesh.vivekanandan@linaro.org<mailto:venkatesh.vivekanandan@linaro.org> >>>> > > <mailto:venkatesh.vivekanandan@linaro.org<mailto:venkatesh.vivekanandan@linaro.org>>> >>>> > > > >> >>>> > > > >> - Multi queue support per interface is enabled. >>>> > > > >> - odp_pktio_send with "0" packet is called in odp_pktio_recv >>>> > > to >>>> > > > >> give the transmitted buffers back to mempool. >>>> > > > >> - mbuf alloc failure during receive is fixed by giving more >>>> > > buffers to >>>> > > > >> mempool. >>>> > > > >> - mempool cache size is given equivalent to MAX_PKT_BURST. >>>> > > > >> >>>> > > > >> Signed-off-by: Venkatesh Vivekanandan >>>> > > <venkatesh.vivekanandan@linaro.org<mailto:venkatesh.vivekanandan@linaro.org> >>>> > > <mailto:venkatesh.vivekanandan@linaro.org<mailto:venkatesh.vivekanandan@linaro.org>>> >>>> > > > >> --- >>>> > > > >> platform/linux-dpdk/include/odp_packet_dpdk.h | 24 +++++ >>>> > > > >> platform/linux-dpdk/odp_buffer_pool.c | 4 +- >>>> > > > >> platform/linux-dpdk/odp_packet_dpdk.c | 136 >>>> > > > >> +++++++++++++------------- >>>> > > > >> platform/linux-dpdk/odp_packet_io.c | 2 + >>>> > > > >> 4 files changed, 94 insertions(+), 72 deletions(-) >>>> > > > >> >>>> > > > >> diff --git a/platform/linux-dpdk/include/odp_packet_dpdk.h >>>> > > > >> b/platform/linux-dpdk/include/odp_packet_dpdk.h >>>> > > > >> index bcbe9e8..bcf9aa5 100644 >>>> > > > >> --- a/platform/linux-dpdk/include/odp_packet_dpdk.h >>>> > > > >> +++ b/platform/linux-dpdk/include/odp_packet_dpdk.h >>>> > > > >> @@ -50,6 +50,30 @@ >>>> > > > >> #define DPDK_BLOCKING_IO >>>> > > > >> +/* >>>> > > > >> + * RX and TX Prefetch, Host, and Write-back threshold >>>> > > values >>>> > > should be >>>> > > > >> + * carefully set for optimal performance. Consult the >>>> > > network >>>> > > > >> + * controller's datasheet and supporting DPDK documentation >>>> > > for guidance >>>> > > > >> + * on how these parameters should be set. >>>> > > > >> + */ >>>> > > > >> +#define RX_PTHRESH 8 /**< Default values of RX prefetch >>>> > > threshold reg. */ >>>> > > > >> +#define RX_HTHRESH 8 /**< Default values of RX host >>>> > > threshold reg. */ >>>> > > > >> +#define RX_WTHRESH 4 /**< Default values of RX write-back >>>> > > threshold reg. >>>> > > > >> */ >>>> > > > >> + >>>> > > > >> +/* >>>> > > > >> + * These default values are optimized for use with the >>>> > > Intel(R) 82599 10 >>>> > > > >> GbE >>>> > > > >> + * Controller and the DPDK ixgbe PMD. Consider using other >>>> > > values for >>>> > > > >> other >>>> > > > >> + * network controllers and/or network drivers. >>>> > > > >> + */ >>>> > > > >> +#define TX_PTHRESH 36 /**< Default values of TX prefetch >>>> > > threshold reg. >>>> > > > >> */ >>>> > > > >> +#define TX_HTHRESH 0 /**< Default values of TX host >>>> > > threshold reg. */ >>>> > > > >> +#define TX_WTHRESH 0 /**< Default values of TX write-back >>>> > > threshold >>>> > > > >> reg. */ >>>> > > > >> + >>>> > > > >> +#define MAX_PKT_BURST 16 >>>> > > > >> +#define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */ >>>> > > > >> +#define RTE_TEST_RX_DESC_DEFAULT 128 >>>> > > > >> +#define RTE_TEST_TX_DESC_DEFAULT 512 >>>> > > > >> + >>>> > > > >> /** Packet socket using dpdk mmaped rings for both Rx and >>>> > > Tx */ >>>> > > > >> typedef struct { >>>> > > > >> odp_buffer_pool_t pool; >>>> > > > >> diff --git a/platform/linux-dpdk/odp_buffer_pool.c >>>> > > > >> b/platform/linux-dpdk/odp_buffer_pool.c >>>> > > > >> index de90275..805ce68 100644 >>>> > > > >> --- a/platform/linux-dpdk/odp_buffer_pool.c >>>> > > > >> +++ b/platform/linux-dpdk/odp_buffer_pool.c >>>> > > > >> @@ -23,7 +23,7 @@ >>>> > > > >> #include <odp_packet_dpdk.h> >>>> > > > >> #define MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + >>>> > > > >> RTE_PKTMBUF_HEADROOM) >>>> > > > >> -#define NB_MBUF 8192 >>>> > > > >> +#define NB_MBUF 32768 >>>> > > > >> #ifdef POOL_USE_TICKETLOCK >>>> > > > >> #include <odp_ticketlock.h> >>>> > > > >> @@ -112,7 +112,7 @@ odp_buffer_pool_t >>>> > > odp_buffer_pool_create(const char >>>> > > > >> *name, >>>> > > > >> pktmbuf_pool = >>>> > > > >> rte_mempool_create(name, NB_MBUF, >>>> > > > >> - MBUF_SIZE, 32, >>>> > > > >> + MBUF_SIZE, MAX_PKT_BURST, >>>> > > > >> sizeof(struct >>>> > > > >> rte_pktmbuf_pool_private), >>>> > > > >> rte_pktmbuf_pool_init, NULL, >>>> > > > >> rte_pktmbuf_init, NULL, >>>> > > > >> diff --git a/platform/linux-dpdk/odp_packet_dpdk.c >>>> > > > >> b/platform/linux-dpdk/odp_packet_dpdk.c >>>> > > > >> index 31bfa30..d5c8e80 100644 >>>> > > > >> --- a/platform/linux-dpdk/odp_packet_dpdk.c >>>> > > > >> +++ b/platform/linux-dpdk/odp_packet_dpdk.c >>>> > > > >> @@ -26,34 +26,13 @@ >>>> > > > >> #include <odp_packet_dpdk.h> >>>> > > > >> #include <net/if.h> >>>> > > > >> -/* >>>> > > > >> - * RX and TX Prefetch, Host, and Write-back threshold >>>> > > values >>>> > > should be >>>> > > > >> - * carefully set for optimal performance. Consult the >>>> > > network >>>> > > > >> - * controller's datasheet and supporting DPDK documentation >>>> > > for guidance >>>> > > > >> - * on how these parameters should be set. >>>> > > > >> - */ >>>> > > > >> -#define RX_PTHRESH 8 /**< Default values of RX prefetch >>>> > > threshold reg. */ >>>> > > > >> -#define RX_HTHRESH 8 /**< Default values of RX host >>>> > > threshold reg. */ >>>> > > > >> -#define RX_WTHRESH 4 /**< Default values of RX write-back >>>> > > threshold reg. >>>> > > > >> */ >>>> > > > >> - >>>> > > > >> -/* >>>> > > > >> - * These default values are optimized for use with the >>>> > > Intel(R) 82599 10 >>>> > > > >> GbE >>>> > > > >> - * Controller and the DPDK ixgbe PMD. Consider using other >>>> > > values for >>>> > > > >> other >>>> > > > >> - * network controllers and/or network drivers. >>>> > > > >> - */ >>>> > > > >> -#define TX_PTHRESH 36 /**< Default values of TX prefetch >>>> > > threshold reg. >>>> > > > >> */ >>>> > > > >> -#define TX_HTHRESH 0 /**< Default values of TX host >>>> > > threshold reg. */ >>>> > > > >> -#define TX_WTHRESH 0 /**< Default values of TX write-back >>>> > > threshold >>>> > > > >> reg. */ >>>> > > > >> - >>>> > > > >> -#define MAX_PKT_BURST 16 >>>> > > > >> -#define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */ >>>> > > > >> -#define RTE_TEST_RX_DESC_DEFAULT 128 >>>> > > > >> -#define RTE_TEST_TX_DESC_DEFAULT 512 >>>> > > > >> static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT; >>>> > > > >> static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT; >>>> > > > >> static const struct rte_eth_conf port_conf = { >>>> > > > >> .rxmode = { >>>> > > > >> + .mq_mode = ETH_MQ_RX_RSS, >>>> > > > >> + .max_rx_pkt_len = ETHER_MAX_LEN, >>>> > > > >> .split_hdr_size = 0, >>>> > > > >> .header_split = 0, /**< Header Split >>>> > > disabled */ >>>> > > > >> .hw_ip_checksum = 0, /**< IP checksum >>>> > > offload >>>> > > disabled */ >>>> > > > >> @@ -61,6 +40,12 @@ static const struct rte_eth_conf >>>> > > port_conf = { >>>> > > > >> .jumbo_frame = 0, /**< Jumbo Frame >>>> > > Support >>>> > > disabled */ >>>> > > > >> .hw_strip_crc = 0, /**< CRC stripped by >>>> > > hardware */ >>>> > > > >> }, >>>> > > > >> + .rx_adv_conf = { >>>> > > > >> + .rss_conf = { >>>> > > > >> + .rss_key = NULL, >>>> > > > >> + .rss_hf = ETH_RSS_IPV4 | >>>> > > ETH_RSS_IPV6, >>>> > > > >> + }, >>>> > > > >> + }, >>>> > > > >> .txmode = { >>>> > > > >> .mq_mode = ETH_MQ_TX_NONE, >>>> > > > >> }, >>>> > > > >> @@ -95,60 +80,71 @@ int setup_pkt_dpdk(pkt_dpdk_t * const >>>> > > pkt_dpdk, const >>>> > > > >> char *netdev, >>>> > > > >> ODP_DBG("setup_pkt_dpdk\n"); >>>> > > > >> static struct ether_addr eth_addr[RTE_MAX_ETHPORTS]; >>>> > > > >> - uint8_t portid = 0; >>>> > > > >> - uint16_t queueid = 0; >>>> > > > >> - int ret; >>>> > > > >> + static int portinit[RTE_MAX_ETHPORTS]; >>>> > > > >> + static int qid[RTE_MAX_ETHPORTS]; >>>> > > > >> + uint8_t portid = 0, num_intf = 2; >>>> > > > >> + uint16_t nbrxq = 0, nbtxq = 0; >>>> > > > >> + int ret, i; >>>> > > > >> + >>>> > > > >> printf("dpdk netdev: %s\n", netdev); >>>> > > > >> printf("dpdk pool: %lx\n", pool); >>>> > > > >> - >>>> > > > >> portid = atoi(netdev); >>>> > > > >> pkt_dpdk->portid = portid; >>>> > > > >> - pkt_dpdk->queueid = queueid; >>>> > > > >> pkt_dpdk->pool = pool; >>>> > > > >> printf("dpdk portid: %u\n", portid); >>>> > > > >> - fflush(stdout); >>>> > > > >> - ret = rte_eth_dev_configure(portid, 1, 1, >>>> > > &port_conf); >>>> > > > >> - if (ret < 0) >>>> > > > >> - ODP_ERR("Cannot configure device: err=%d, >>>> > > port=%u\n", >>>> > > > >> - ret, (unsigned) portid); >>>> > > > >> - >>>> > > > >> - rte_eth_macaddr_get(portid, ð_addr[portid]); >>>> > > > >> - ODP_DBG("Port %u, MAC address: >>>> > > %02X:%02X:%02X:%02X:%02X:%02X\ >>>> > > > >> n\n", >>>> > > > >> - (unsigned) portid, >>>> > > > >> - eth_addr[portid].addr_bytes[0], >>>> > > > >> - eth_addr[portid].addr_bytes[1], >>>> > > > >> - eth_addr[portid].addr_bytes[2], >>>> > > > >> - eth_addr[portid].addr_bytes[3], >>>> > > > >> - eth_addr[portid].addr_bytes[4], >>>> > > > >> - eth_addr[portid].addr_bytes[5]); >>>> > > > >> - >>>> > > > >> - /* init one RX queue on each port */ >>>> > > > >> - fflush(stdout); >>>> > > > >> - ret = rte_eth_rx_queue_setup(portid, queueid, >>>> > > nb_rxd, >>>> > > > >> - rte_eth_dev_socket_id(portid), >>>> > > > >> &rx_conf, >>>> > > > >> - (struct rte_mempool *)pool); >>>> > > > >> - if (ret < 0) >>>> > > > >> - ODP_ERR("rte_eth_rx_queue_setup:err=%d, port=%u\n", >>>> > > > >> - ret, (unsigned) portid); >>>> > > > >> - ODP_DBG("dpdk rx queue setup done\n"); >>>> > > > >> - >>>> > > > >> - /* init one TX queue on each port */ >>>> > > > >> - fflush(stdout); >>>> > > > >> - ret = rte_eth_tx_queue_setup(portid, queueid, >>>> > > nb_txd, >>>> > > > >> - rte_eth_dev_socket_id(portid), &tx_conf); >>>> > > > >> - if (ret < 0) >>>> > > > >> - ODP_ERR("rte_eth_tx_queue_setup:err=%d, port=%u\n", >>>> > > > >> - ret, (unsigned) portid); >>>> > > > >> - ODP_DBG("dpdk tx queue setup done\n"); >>>> > > > >> - >>>> > > > >> - /* Start device */ >>>> > > > >> - ret = rte_eth_dev_start(portid); >>>> > > > >> - if (ret < 0) >>>> > > > >> - ODP_ERR("rte_eth_dev_start:err=%d, port=%u\n", >>>> > > > >> - ret, (unsigned) portid); >>>> > > > >> - ODP_DBG("dpdk setup done\n\n"); >>>> > > > >> - >>>> > > > >> + nbrxq = odp_sys_core_count() / num_intf; >>>> > > > >> + nbtxq = nbrxq; >>>> > > > >> + if (portinit[portid] == 0) { >>>> > > > >> + fflush(stdout); >>>> > > > >> + ret = rte_eth_dev_configure(portid, nbrxq, >>>> > > nbtxq, >>>> > > > >> &port_conf); >>>> > > > >> + if (ret < 0) >>>> > > > >> + ODP_ERR("Cannot configure device: >>>> > > err=%d, >>>> > > > >> port=%u\n", >>>> > > > >> + ret, (unsigned) portid); >>>> > > > >> + >>>> > > > >> + rte_eth_macaddr_get(portid, ð_addr[portid]); >>>> > > > >> + ODP_DBG("Port %u, MAC address: >>>> > > > >> %02X:%02X:%02X:%02X:%02X:%02X\n", >>>> > > > >> + (unsigned) portid, >>>> > > > >> + eth_addr[portid].addr_bytes[0], >>>> > > > >> + eth_addr[portid].addr_bytes[1], >>>> > > > >> + eth_addr[portid].addr_bytes[2], >>>> > > > >> + eth_addr[portid].addr_bytes[3], >>>> > > > >> + eth_addr[portid].addr_bytes[4], >>>> > > > >> + eth_addr[portid].addr_bytes[5]); >>>> > > > >> + >>>> > > > >> + /* init one RX queue on each port */ >>>> > > > >> + fflush(stdout); >>>> > > > >> + for (i = 0; i < nbrxq; i++) { >>>> > > > >> + ret = rte_eth_rx_queue_setup(portid, >>>> > > i, nb_rxd, >>>> > > > >> + rte_eth_dev_socket_id(portid), >>>> > > > >> &rx_conf, >>>> > > > >> + (struct rte_mempool *)pool); >>>> > > > >> + if (ret < 0) >>>> > > > >> + ODP_ERR("%s rxq:err=%d, port=%u\n", >>>> > > > >> + __func__, ret, (unsigned) portid); >>>> > > > >> + ODP_DBG("dpdk rx queue setup >>>> > > done\n"); >>>> > > > >> + } >>>> > > > >> + >>>> > > > >> + /* init one TX queue on each port */ >>>> > > > >> + fflush(stdout); >>>> > > > >> + for (i = 0; i < nbtxq; i++) { >>>> > > > >> + ret = rte_eth_tx_queue_setup(portid, >>>> > > i, nb_txd, >>>> > > > >> + rte_eth_dev_socket_id(portid), &tx_conf); >>>> > > > >> + if (ret < 0) >>>> > > > >> + ODP_ERR("%s txq:err=%d, port=%u\n", >>>> > > > >> + __func__, ret, (unsigned) portid); >>>> > > > >> + ODP_DBG("dpdk tx queue setup >>>> > > done\n"); >>>> > > > >> + } >>>> > > > >> + >>>> > > > >> + /* Start device */ >>>> > > > >> + ret = rte_eth_dev_start(portid); >>>> > > > >> + if (ret < 0) >>>> > > > >> + ODP_ERR("rte_eth_dev_start:err=%d, port=%u\n", >>>> > > > >> + ret, (unsigned) portid); >>>> > > > >> + ODP_DBG("dpdk setup done\n\n"); >>>> > > > >> + >>>> > > > >> + portinit[portid] = 1; >>>> > > > >> + } >>>> > > > >> + pkt_dpdk->queueid = qid[portid]++; >>>> > > > >> return 0; >>>> > > > >> } >>>> > > > >> diff --git a/platform/linux-dpdk/odp_packet_io.c >>>> > > > >> b/platform/linux-dpdk/odp_packet_io.c >>>> > > > >> index d8d127f..3124175 100644 >>>> > > > >> --- a/platform/linux-dpdk/odp_packet_io.c >>>> > > > >> +++ b/platform/linux-dpdk/odp_packet_io.c >>>> > > > >> @@ -230,6 +230,8 @@ int odp_pktio_recv(odp_pktio_t id, >>>> > > odp_packet_t >>>> > > > >> pkt_table[], unsigned len) >>>> > > > >> if (pktio_entry == NULL) >>>> > > > >> return -1; >>>> > > > >> + odp_pktio_send(id, pkt_table, 0); >>>> > > > >> + >>>> > > > >> lock_entry(pktio_entry); >>>> > > > >> pkts = recv_pkt_dpdk(&pktio_entry->s.pkt_dpdk, >>>> > > pkt_table, len); >>>> > > > >> unlock_entry(pktio_entry); >>>> > > > >> >>>> > > > > >>>> > > > > >>>> > > > > _______________________________________________ >>>> > > > > lng-odp mailing list >>>> > > > > lng-odp@lists.linaro.org<mailto:lng-odp@lists.linaro.org> <mailto:lng-odp@lists.linaro.org<mailto:lng-odp@lists.linaro.org>> >>>> > > > > http://lists.linaro.org/mailman/listinfo/lng-odp >>>> > > > > >>>> > > > >>>> > > > >>>> > > > >>>> > > > -- >>>> > > > *Mike Holmes* >>>> > > > Linaro Technical Manager / Lead >>>> > > > LNG - ODP >>>> > > >>>> > > > _______________________________________________ >>>> > > > lng-odp mailing list >>>> > > > lng-odp@lists.linaro.org<mailto:lng-odp@lists.linaro.org> <mailto:lng-odp@lists.linaro.org<mailto:lng-odp@lists.linaro.org>> >>>> > > > http://lists.linaro.org/mailman/listinfo/lng-odp >>>> > > >>>> > > >>>> > > -- >>>> > > Anders Roxell >>>> > > anders.roxell@linaro.org<mailto:anders.roxell@linaro.org> <mailto:anders.roxell@linaro.org<mailto:anders.roxell@linaro.org>> >>>> > > M: +46 709 71 42 85<tel:%2B46%20709%2071%2042%2085> | IRC: roxell >>>> > > >>>> > > _______________________________________________ >>>> > > lng-odp mailing list >>>> > > lng-odp@lists.linaro.org<mailto:lng-odp@lists.linaro.org> <mailto:lng-odp@lists.linaro.org<mailto:lng-odp@lists.linaro.org>> >>>> > > http://lists.linaro.org/mailman/listinfo/lng-odp >>>> > > >>>> > > >>>> > > >>>> > > >>>> > >_______________________________________________ >>>> > >lng-odp mailing list >>>> > >lng-odp@lists.linaro.org<mailto:lng-odp@lists.linaro.org> >>>> > >http://lists.linaro.org/mailman/listinfo/lng-odp >>>> > >>>> > >>>> > _______________________________________________ >>>> > lng-odp mailing list >>>> > lng-odp@lists.linaro.org<mailto:lng-odp@lists.linaro.org> >>>> > http://lists.linaro.org/mailman/listinfo/lng-odp >>>> >>>> -- >>>> Anders Roxell >>>> anders.roxell@linaro.org<mailto:anders.roxell@linaro.org> >>>> M: +46 709 71 42 85<tel:%2B46%20709%2071%2042%2085> | IRC: roxell >>>> >>>> _______________________________________________ >>>> lng-odp mailing list >>>> lng-odp@lists.linaro.org<mailto:lng-odp@lists.linaro.org> >>>> http://lists.linaro.org/mailman/listinfo/lng-odp >>> >>> >>> >>> >>> -- >>> Mike Holmes >>> Linaro Technical Manager / Lead >>> LNG - ODP >>> >>> _______________________________________________ >>> lng-odp mailing list >>> lng-odp@lists.linaro.org<mailto:lng-odp@lists.linaro.org> >>> http://lists.linaro.org/mailman/listinfo/lng-odp >>> >> > > > > -- > Mike Holmes > Linaro Technical Manager / Lead > LNG - ODP > > _______________________________________________ > lng-odp mailing list > lng-odp@lists.linaro.org<mailto:lng-odp@lists.linaro.org> > http://lists.linaro.org/mailman/listinfo/lng-odp > -- Mike Holmes Linaro Technical Manager / Lead LNG - ODP
why not to use tcpreplay? I.e. odp+libpcap+dpdk+tcpreplay if we have everything ready? Maxim. On 08/12/2014 11:42 PM, Wiles, Roger Keith wrote: > Pktgen has a number of different ways to send packets single, range, > pcap or random, sequence with parameters. > > One thing Pktgen does not do is act like a real stack, but you can > simulate that with pcap or sequence packets. It basically depends on > how complex a data flow you need. > > # git clone git://github.com/Pktgen/Pktgen-DPDK > > Let me know if I can help or change the code in some way. > > THanks > ++keith > > *Keith **Wiles*, Principal Technologist with CTO office, *Wind > River*mobile 972-213-5533 > > On Aug 12, 2014, at 1:08 PM, Mike Holmes <mike.holmes@linaro.org > <mailto:mike.holmes@linaro.org>> wrote: > >> So it looks like we don't have any way to test this without an Ixia >> which is a problem given that Santosh is having trouble. >> Basically there is no CI job to point at that shows that excluding >> human error it is still working as expected. >> >> Keith, is dpdk pktgen able to generate pkts in the way Venki needs ? >> >> Mike >> >> >> On 12 August 2014 02:17, Santosh Shukla <santosh.shukla@linaro.org >> <mailto:santosh.shukla@linaro.org>> wrote: >> >> On 12 August 2014 00:25, Mike Holmes <mike.holmes@linaro.org >> <mailto:mike.holmes@linaro.org>> wrote: >> > Which test case in odp/test would check this, or does it need >> an application >> > like l2fwd to be run - are either in LAVA/CI ? >> > >> > Santosh are you able to verify this does not break anything as >> part of the >> > l2fwd work you are doing ? >> > >> >> No, I am seeing problem with current and should persist in this multi >> flavour too. We have bug reported on that lines. So whole dpdk-l2fwd >> doesn't works for me for my requirement. >> >> Thanks. >> >> > Mike >> > >> > >> > On 11 August 2014 01:43, Venkatesh Vivekanandan >> > <venkatesh.vivekanandan@linaro.org >> <mailto:venkatesh.vivekanandan@linaro.org>> wrote: >> >> >> >> >> >> >> >> >> >> On 9 August 2014 17:32, Mike Holmes <mike.holmes@linaro.org >> <mailto:mike.holmes@linaro.org>> wrote: >> >>> >> >>> >> >>> >> >>> >> >>> On 8 August 2014 17:46, Anders Roxell >> <anders.roxell@linaro.org <mailto:anders.roxell@linaro.org>> wrote: >> >>>> >> >>>> On 2014-08-08 17:31, Maxim Uvarov wrote: >> >>>> > On 08/08/2014 05:13 PM, Venkatesh Vivekanandan wrote: >> >>>> > > >> >>>> > > >> >>>> > > >> >>>> > >On 7 August 2014 21:10, Anders Roxell >> <anders.roxell@linaro.org <mailto:anders.roxell@linaro.org> >> >>>> > ><mailto:anders.roxell@linaro.org >> <mailto:anders.roxell@linaro.org>>> wrote: >> >>>> > > >> >>>> > > On 2014-08-07 10:41, Mike Holmes wrote: >> >>>> > > > Does this need a signoff by someone else before it >> is merged ? >> >>>> > > > >> >>>> > > > I think we want to enforce getting an ack, tested-by or >> >>>> > > reviewed-by before >> >>>> > > > we merge things, we have informally moved that way >> over the >> >>>> > > last >> >>>> > > couple of >> >>>> > > > weeks and now I think it is time we made it a formal >> >>>> > > requirement. >> >>>> > > >> >>>> > > Agree. >> >>>> > > >> >>>> > > >> >>>> > >If this is the case, then is it fair to say initial >> discussion of >> >>>> > >24-hour window is void?. I guess Maxim was waiting for 2 >> days(for >> >>>> > >any comments) before he could merge this patch. Do we >> have any >> >>>> > >time-limit before which a patch /must /be reviewed or >> tested? I >> >>>> > >hope we can't wait indefinitely or is this the case?. >> >>>> > >> >>>> > I think if patch came from platfrom maintainer, it's not >> new API. No >> >>>> > comments in 1 or 2 days, than it's ok to merge it. If >> patch came >> >>>> > from somobody alse I would ask maintainer to review it. >> >>>> >> >>>> I disagree with this. >> >>>> No matter where the patch comes from and who wrote the >> patch, it can be >> >>>> wrong and need a second pair of eyes i.e., >> >>>> (Reviewed|Acked|Signed-off)-by. >> >>>> If no one has replied to a patch after 2 days, the author of >> the patch >> >>>> should ping the list and maintainer. >> >>>> >> >>>> After the second pair of eyes, the patch should be ok to be >> merged. >> >>>> The ODP maintainer should do a smoke build test on all the >> supported >> >>>> platforms before merging though. >> >>> >> >>> >> >>> My 2 cents >> >>> We have started to develop a cohesive API, I think that is >> down to a lot >> >>> of folks working together. >> >>> I also think that peer review/team work is reflected in the >> increasing >> >>> willingness to review each others patches which has improved >> quality >> >>> and helped establish the guidelines on how things bolt >> together in ODP, >> >>> may long discussions have spawned from patches. >> >>> >> >>> No one is beyond silly mistakes, peer review finds a lot of >> the dumb >> >>> stuff for little cost, saving on the inevitable ugly patch up >> that will >> >>> ensue otherwise. >> >>> Maxim you could do the default reviews if no one came >> forward, but if a >> >>> submitter finds and establishes their own network of >> reviewers that is one >> >>> extra pair of eyes and ideas. >> >> >> >> >> >> Can someone please review this patch?. If there is any >> comments, we can >> >> request maxim to revert the patch, otherwise he can add the >> >> "Reviewed-by/Tested-by" to the applied patch. >> >> >> >>>> >> >>>> Cheers, >> >>>> Anders >> >>>> >> >>>> > >> >>>> > Maxim. >> >>>> > >> >>>> > > Anders >> >>>> > > >> >>>> > > > >> >>>> > > > Mike >> >>>> > > > >> >>>> > > > >> >>>> > > > On 7 August 2014 09:15, Maxim Uvarov >> <maxim.uvarov@linaro.org <mailto:maxim.uvarov@linaro.org> >> >>>> > > <mailto:maxim.uvarov@linaro.org >> <mailto:maxim.uvarov@linaro.org>>> wrote: >> >>>> > > > >> >>>> > > > > Merged, thanks! >> >>>> > > > > >> >>>> > > > > Maxim. >> >>>> > > > > >> >>>> > > > > >> >>>> > > > > On 08/05/2014 06:54 PM, >> venkatesh.vivekanandan@linaro.org >> <mailto:venkatesh.vivekanandan@linaro.org> >> >>>> > > <mailto:venkatesh.vivekanandan@linaro.org >> <mailto:venkatesh.vivekanandan@linaro.org>> wrote: >> >>>> > > > > >> >>>> > > > >> From: Venkatesh Vivekanandan >> >>>> > > <venkatesh.vivekanandan@linaro.org >> <mailto:venkatesh.vivekanandan@linaro.org> >> >>>> > > <mailto:venkatesh.vivekanandan@linaro.org >> <mailto:venkatesh.vivekanandan@linaro.org>>> >> >>>> > > > >> >> >>>> > > > >> - Multi queue support per interface is enabled. >> >>>> > > > >> - odp_pktio_send with "0" packet is called in >> odp_pktio_recv >> >>>> > > to >> >>>> > > > >> give the transmitted buffers back to mempool. >> >>>> > > > >> - mbuf alloc failure during receive is fixed by >> giving more >> >>>> > > buffers to >> >>>> > > > >> mempool. >> >>>> > > > >> - mempool cache size is given equivalent to >> MAX_PKT_BURST. >> >>>> > > > >> >> >>>> > > > >> Signed-off-by: Venkatesh Vivekanandan >> >>>> > > <venkatesh.vivekanandan@linaro.org >> <mailto:venkatesh.vivekanandan@linaro.org> >> >>>> > > <mailto:venkatesh.vivekanandan@linaro.org >> <mailto:venkatesh.vivekanandan@linaro.org>>> >> >>>> > > > >> --- >> >>>> > > > >> platform/linux-dpdk/include/odp_packet_dpdk.h | >> 24 +++++ >> >>>> > > > >> platform/linux-dpdk/odp_buffer_pool.c | 4 +- >> >>>> > > > >> platform/linux-dpdk/odp_packet_dpdk.c | 136 >> >>>> > > > >> +++++++++++++------------- >> >>>> > > > >> platform/linux-dpdk/odp_packet_io.c | 2 + >> >>>> > > > >> 4 files changed, 94 insertions(+), 72 deletions(-) >> >>>> > > > >> >> >>>> > > > >> diff --git >> a/platform/linux-dpdk/include/odp_packet_dpdk.h >> >>>> > > > >> b/platform/linux-dpdk/include/odp_packet_dpdk.h >> >>>> > > > >> index bcbe9e8..bcf9aa5 100644 >> >>>> > > > >> --- a/platform/linux-dpdk/include/odp_packet_dpdk.h >> >>>> > > > >> +++ b/platform/linux-dpdk/include/odp_packet_dpdk.h >> >>>> > > > >> @@ -50,6 +50,30 @@ >> >>>> > > > >> #define DPDK_BLOCKING_IO >> >>>> > > > >> +/* >> >>>> > > > >> + * RX and TX Prefetch, Host, and Write-back >> threshold >> >>>> > > values >> >>>> > > should be >> >>>> > > > >> + * carefully set for optimal performance. >> Consult the >> >>>> > > network >> >>>> > > > >> + * controller's datasheet and supporting DPDK >> documentation >> >>>> > > for guidance >> >>>> > > > >> + * on how these parameters should be set. >> >>>> > > > >> + */ >> >>>> > > > >> +#define RX_PTHRESH 8 /**< Default values of RX >> prefetch >> >>>> > > threshold reg. */ >> >>>> > > > >> +#define RX_HTHRESH 8 /**< Default values of RX host >> >>>> > > threshold reg. */ >> >>>> > > > >> +#define RX_WTHRESH 4 /**< Default values of RX >> write-back >> >>>> > > threshold reg. >> >>>> > > > >> */ >> >>>> > > > >> + >> >>>> > > > >> +/* >> >>>> > > > >> + * These default values are optimized for use >> with the >> >>>> > > Intel(R) 82599 10 >> >>>> > > > >> GbE >> >>>> > > > >> + * Controller and the DPDK ixgbe PMD. Consider >> using other >> >>>> > > values for >> >>>> > > > >> other >> >>>> > > > >> + * network controllers and/or network drivers. >> >>>> > > > >> + */ >> >>>> > > > >> +#define TX_PTHRESH 36 /**< Default values of TX >> prefetch >> >>>> > > threshold reg. >> >>>> > > > >> */ >> >>>> > > > >> +#define TX_HTHRESH 0 /**< Default values of TX >> host >> >>>> > > threshold reg. */ >> >>>> > > > >> +#define TX_WTHRESH 0 /**< Default values of TX >> write-back >> >>>> > > threshold >> >>>> > > > >> reg. */ >> >>>> > > > >> + >> >>>> > > > >> +#define MAX_PKT_BURST 16 >> >>>> > > > >> +#define BURST_TX_DRAIN_US 100 /* TX drain every >> ~100us */ >> >>>> > > > >> +#define RTE_TEST_RX_DESC_DEFAULT 128 >> >>>> > > > >> +#define RTE_TEST_TX_DESC_DEFAULT 512 >> >>>> > > > >> + >> >>>> > > > >> /** Packet socket using dpdk mmaped rings for >> both Rx and >> >>>> > > Tx */ >> >>>> > > > >> typedef struct { >> >>>> > > > >> odp_buffer_pool_t pool; >> >>>> > > > >> diff --git a/platform/linux-dpdk/odp_buffer_pool.c >> >>>> > > > >> b/platform/linux-dpdk/odp_buffer_pool.c >> >>>> > > > >> index de90275..805ce68 100644 >> >>>> > > > >> --- a/platform/linux-dpdk/odp_buffer_pool.c >> >>>> > > > >> +++ b/platform/linux-dpdk/odp_buffer_pool.c >> >>>> > > > >> @@ -23,7 +23,7 @@ >> >>>> > > > >> #include <odp_packet_dpdk.h> >> >>>> > > > >> #define MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + >> >>>> > > > >> RTE_PKTMBUF_HEADROOM) >> >>>> > > > >> -#define NB_MBUF 8192 >> >>>> > > > >> +#define NB_MBUF 32768 >> >>>> > > > >> #ifdef POOL_USE_TICKETLOCK >> >>>> > > > >> #include <odp_ticketlock.h> >> >>>> > > > >> @@ -112,7 +112,7 @@ odp_buffer_pool_t >> >>>> > > odp_buffer_pool_create(const char >> >>>> > > > >> *name, >> >>>> > > > >> pktmbuf_pool = >> >>>> > > > >> rte_mempool_create(name, NB_MBUF, >> >>>> > > > >> - MBUF_SIZE, 32, >> >>>> > > > >> + MBUF_SIZE, MAX_PKT_BURST, >> >>>> > > > >> sizeof(struct >> >>>> > > > >> rte_pktmbuf_pool_private), >> >>>> > > > >> rte_pktmbuf_pool_init, NULL, >> >>>> > > > >> rte_pktmbuf_init, NULL, >> >>>> > > > >> diff --git a/platform/linux-dpdk/odp_packet_dpdk.c >> >>>> > > > >> b/platform/linux-dpdk/odp_packet_dpdk.c >> >>>> > > > >> index 31bfa30..d5c8e80 100644 >> >>>> > > > >> --- a/platform/linux-dpdk/odp_packet_dpdk.c >> >>>> > > > >> +++ b/platform/linux-dpdk/odp_packet_dpdk.c >> >>>> > > > >> @@ -26,34 +26,13 @@ >> >>>> > > > >> #include <odp_packet_dpdk.h> >> >>>> > > > >> #include <net/if.h> >> >>>> > > > >> -/* >> >>>> > > > >> - * RX and TX Prefetch, Host, and Write-back >> threshold >> >>>> > > values >> >>>> > > should be >> >>>> > > > >> - * carefully set for optimal performance. >> Consult the >> >>>> > > network >> >>>> > > > >> - * controller's datasheet and supporting DPDK >> documentation >> >>>> > > for guidance >> >>>> > > > >> - * on how these parameters should be set. >> >>>> > > > >> - */ >> >>>> > > > >> -#define RX_PTHRESH 8 /**< Default values of RX >> prefetch >> >>>> > > threshold reg. */ >> >>>> > > > >> -#define RX_HTHRESH 8 /**< Default values of RX host >> >>>> > > threshold reg. */ >> >>>> > > > >> -#define RX_WTHRESH 4 /**< Default values of RX >> write-back >> >>>> > > threshold reg. >> >>>> > > > >> */ >> >>>> > > > >> - >> >>>> > > > >> -/* >> >>>> > > > >> - * These default values are optimized for use >> with the >> >>>> > > Intel(R) 82599 10 >> >>>> > > > >> GbE >> >>>> > > > >> - * Controller and the DPDK ixgbe PMD. Consider >> using other >> >>>> > > values for >> >>>> > > > >> other >> >>>> > > > >> - * network controllers and/or network drivers. >> >>>> > > > >> - */ >> >>>> > > > >> -#define TX_PTHRESH 36 /**< Default values of TX >> prefetch >> >>>> > > threshold reg. >> >>>> > > > >> */ >> >>>> > > > >> -#define TX_HTHRESH 0 /**< Default values of TX >> host >> >>>> > > threshold reg. */ >> >>>> > > > >> -#define TX_WTHRESH 0 /**< Default values of TX >> write-back >> >>>> > > threshold >> >>>> > > > >> reg. */ >> >>>> > > > >> - >> >>>> > > > >> -#define MAX_PKT_BURST 16 >> >>>> > > > >> -#define BURST_TX_DRAIN_US 100 /* TX drain every >> ~100us */ >> >>>> > > > >> -#define RTE_TEST_RX_DESC_DEFAULT 128 >> >>>> > > > >> -#define RTE_TEST_TX_DESC_DEFAULT 512 >> >>>> > > > >> static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT; >> >>>> > > > >> static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT; >> >>>> > > > >> static const struct rte_eth_conf port_conf = { >> >>>> > > > >> .rxmode = { >> >>>> > > > >> + .mq_mode = ETH_MQ_RX_RSS, >> >>>> > > > >> + .max_rx_pkt_len = ETHER_MAX_LEN, >> >>>> > > > >> .split_hdr_size = 0, >> >>>> > > > >> .header_split = 0, /**< Header Split >> >>>> > > disabled */ >> >>>> > > > >> .hw_ip_checksum = 0, /**< IP checksum >> >>>> > > offload >> >>>> > > disabled */ >> >>>> > > > >> @@ -61,6 +40,12 @@ static const struct rte_eth_conf >> >>>> > > port_conf = { >> >>>> > > > >> .jumbo_frame = 0, /**< Jumbo Frame >> >>>> > > Support >> >>>> > > disabled */ >> >>>> > > > >> .hw_strip_crc = 0, /**< CRC stripped by >> >>>> > > hardware */ >> >>>> > > > >> }, >> >>>> > > > >> + .rx_adv_conf = { >> >>>> > > > >> + .rss_conf = { >> >>>> > > > >> + .rss_key = NULL, >> >>>> > > > >> + .rss_hf = ETH_RSS_IPV4 | >> >>>> > > ETH_RSS_IPV6, >> >>>> > > > >> + }, >> >>>> > > > >> + }, >> >>>> > > > >> .txmode = { >> >>>> > > > >> .mq_mode = ETH_MQ_TX_NONE, >> >>>> > > > >> }, >> >>>> > > > >> @@ -95,60 +80,71 @@ int >> setup_pkt_dpdk(pkt_dpdk_t * const >> >>>> > > pkt_dpdk, const >> >>>> > > > >> char *netdev, >> >>>> > > > >> ODP_DBG("setup_pkt_dpdk\n"); >> >>>> > > > >> static struct ether_addr >> eth_addr[RTE_MAX_ETHPORTS]; >> >>>> > > > >> - uint8_t portid = 0; >> >>>> > > > >> - uint16_t queueid = 0; >> >>>> > > > >> - int ret; >> >>>> > > > >> + static int portinit[RTE_MAX_ETHPORTS]; >> >>>> > > > >> + static int qid[RTE_MAX_ETHPORTS]; >> >>>> > > > >> + uint8_t portid = 0, num_intf = 2; >> >>>> > > > >> + uint16_t nbrxq = 0, nbtxq = 0; >> >>>> > > > >> + int ret, i; >> >>>> > > > >> + >> >>>> > > > >> printf("dpdk netdev: %s\n", netdev); >> >>>> > > > >> printf("dpdk pool: %lx\n", pool); >> >>>> > > > >> - >> >>>> > > > >> portid = atoi(netdev); >> >>>> > > > >> pkt_dpdk->portid = portid; >> >>>> > > > >> - pkt_dpdk->queueid = queueid; >> >>>> > > > >> pkt_dpdk->pool = pool; >> >>>> > > > >> printf("dpdk portid: %u\n", portid); >> >>>> > > > >> - fflush(stdout); >> >>>> > > > >> - ret = rte_eth_dev_configure(portid, 1, 1, >> >>>> > > &port_conf); >> >>>> > > > >> - if (ret < 0) >> >>>> > > > >> - ODP_ERR("Cannot configure device: >> err=%d, >> >>>> > > port=%u\n", >> >>>> > > > >> - ret, (unsigned) portid); >> >>>> > > > >> - >> >>>> > > > >> - rte_eth_macaddr_get(portid, ð_addr[portid]); >> >>>> > > > >> - ODP_DBG("Port %u, MAC address: >> >>>> > > %02X:%02X:%02X:%02X:%02X:%02X\ >> >>>> > > > >> n\n", >> >>>> > > > >> - (unsigned) portid, >> >>>> > > > >> - eth_addr[portid].addr_bytes[0], >> >>>> > > > >> - eth_addr[portid].addr_bytes[1], >> >>>> > > > >> - eth_addr[portid].addr_bytes[2], >> >>>> > > > >> - eth_addr[portid].addr_bytes[3], >> >>>> > > > >> - eth_addr[portid].addr_bytes[4], >> >>>> > > > >> - eth_addr[portid].addr_bytes[5]); >> >>>> > > > >> - >> >>>> > > > >> - /* init one RX queue on each port */ >> >>>> > > > >> - fflush(stdout); >> >>>> > > > >> - ret = rte_eth_rx_queue_setup(portid, queueid, >> >>>> > > nb_rxd, >> >>>> > > > >> - rte_eth_dev_socket_id(portid), >> >>>> > > > >> &rx_conf, >> >>>> > > > >> - (struct rte_mempool *)pool); >> >>>> > > > >> - if (ret < 0) >> >>>> > > > >> - ODP_ERR("rte_eth_rx_queue_setup:err=%d, >> port=%u\n", >> >>>> > > > >> - ret, (unsigned) portid); >> >>>> > > > >> - ODP_DBG("dpdk rx queue setup done\n"); >> >>>> > > > >> - >> >>>> > > > >> - /* init one TX queue on each port */ >> >>>> > > > >> - fflush(stdout); >> >>>> > > > >> - ret = rte_eth_tx_queue_setup(portid, queueid, >> >>>> > > nb_txd, >> >>>> > > > >> - rte_eth_dev_socket_id(portid), &tx_conf); >> >>>> > > > >> - if (ret < 0) >> >>>> > > > >> - ODP_ERR("rte_eth_tx_queue_setup:err=%d, >> port=%u\n", >> >>>> > > > >> - ret, (unsigned) portid); >> >>>> > > > >> - ODP_DBG("dpdk tx queue setup done\n"); >> >>>> > > > >> - >> >>>> > > > >> - /* Start device */ >> >>>> > > > >> - ret = rte_eth_dev_start(portid); >> >>>> > > > >> - if (ret < 0) >> >>>> > > > >> - ODP_ERR("rte_eth_dev_start:err=%d, port=%u\n", >> >>>> > > > >> - ret, (unsigned) portid); >> >>>> > > > >> - ODP_DBG("dpdk setup done\n\n"); >> >>>> > > > >> - >> >>>> > > > >> + nbrxq = odp_sys_core_count() / num_intf; >> >>>> > > > >> + nbtxq = nbrxq; >> >>>> > > > >> + if (portinit[portid] == 0) { >> >>>> > > > >> + fflush(stdout); >> >>>> > > > >> + ret = rte_eth_dev_configure(portid, >> nbrxq, >> >>>> > > nbtxq, >> >>>> > > > >> &port_conf); >> >>>> > > > >> + if (ret < 0) >> >>>> > > > >> + ODP_ERR("Cannot configure >> device: >> >>>> > > err=%d, >> >>>> > > > >> port=%u\n", >> >>>> > > > >> + ret, (unsigned) portid); >> >>>> > > > >> + >> >>>> > > > >> + rte_eth_macaddr_get(portid, ð_addr[portid]); >> >>>> > > > >> + ODP_DBG("Port %u, MAC address: >> >>>> > > > >> %02X:%02X:%02X:%02X:%02X:%02X\n", >> >>>> > > > >> + (unsigned) portid, >> >>>> > > > >> + eth_addr[portid].addr_bytes[0], >> >>>> > > > >> + eth_addr[portid].addr_bytes[1], >> >>>> > > > >> + eth_addr[portid].addr_bytes[2], >> >>>> > > > >> + eth_addr[portid].addr_bytes[3], >> >>>> > > > >> + eth_addr[portid].addr_bytes[4], >> >>>> > > > >> + eth_addr[portid].addr_bytes[5]); >> >>>> > > > >> + >> >>>> > > > >> + /* init one RX queue on each port */ >> >>>> > > > >> + fflush(stdout); >> >>>> > > > >> + for (i = 0; i < nbrxq; i++) { >> >>>> > > > >> + ret = >> rte_eth_rx_queue_setup(portid, >> >>>> > > i, nb_rxd, >> >>>> > > > >> + rte_eth_dev_socket_id(portid), >> >>>> > > > >> &rx_conf, >> >>>> > > > >> + (struct rte_mempool *)pool); >> >>>> > > > >> + if (ret < 0) >> >>>> > > > >> + ODP_ERR("%s rxq:err=%d, port=%u\n", >> >>>> > > > >> + __func__, ret, (unsigned) portid); >> >>>> > > > >> + ODP_DBG("dpdk rx queue setup >> >>>> > > done\n"); >> >>>> > > > >> + } >> >>>> > > > >> + >> >>>> > > > >> + /* init one TX queue on each port */ >> >>>> > > > >> + fflush(stdout); >> >>>> > > > >> + for (i = 0; i < nbtxq; i++) { >> >>>> > > > >> + ret = >> rte_eth_tx_queue_setup(portid, >> >>>> > > i, nb_txd, >> >>>> > > > >> + rte_eth_dev_socket_id(portid), &tx_conf); >> >>>> > > > >> + if (ret < 0) >> >>>> > > > >> + ODP_ERR("%s txq:err=%d, port=%u\n", >> >>>> > > > >> + __func__, ret, (unsigned) portid); >> >>>> > > > >> + ODP_DBG("dpdk tx queue setup >> >>>> > > done\n"); >> >>>> > > > >> + } >> >>>> > > > >> + >> >>>> > > > >> + /* Start device */ >> >>>> > > > >> + ret = rte_eth_dev_start(portid); >> >>>> > > > >> + if (ret < 0) >> >>>> > > > >> + ODP_ERR("rte_eth_dev_start:err=%d, port=%u\n", >> >>>> > > > >> + ret, (unsigned) portid); >> >>>> > > > >> + ODP_DBG("dpdk setup done\n\n"); >> >>>> > > > >> + >> >>>> > > > >> + portinit[portid] = 1; >> >>>> > > > >> + } >> >>>> > > > >> + pkt_dpdk->queueid = qid[portid]++; >> >>>> > > > >> return 0; >> >>>> > > > >> } >> >>>> > > > >> diff --git a/platform/linux-dpdk/odp_packet_io.c >> >>>> > > > >> b/platform/linux-dpdk/odp_packet_io.c >> >>>> > > > >> index d8d127f..3124175 100644 >> >>>> > > > >> --- a/platform/linux-dpdk/odp_packet_io.c >> >>>> > > > >> +++ b/platform/linux-dpdk/odp_packet_io.c >> >>>> > > > >> @@ -230,6 +230,8 @@ int >> odp_pktio_recv(odp_pktio_t id, >> >>>> > > odp_packet_t >> >>>> > > > >> pkt_table[], unsigned len) >> >>>> > > > >> if (pktio_entry == NULL) >> >>>> > > > >> return -1; >> >>>> > > > >> + odp_pktio_send(id, pkt_table, 0); >> >>>> > > > >> + >> >>>> > > > >> lock_entry(pktio_entry); >> >>>> > > > >> pkts = recv_pkt_dpdk(&pktio_entry->s.pkt_dpdk, >> >>>> > > pkt_table, len); >> >>>> > > > >> unlock_entry(pktio_entry); >> >>>> > > > >> >> >>>> > > > > >> >>>> > > > > >> >>>> > > > > _______________________________________________ >> >>>> > > > > lng-odp mailing list >> >>>> > > > > lng-odp@lists.linaro.org >> <mailto:lng-odp@lists.linaro.org> >> <mailto:lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>> >> >>>> > > > > http://lists.linaro.org/mailman/listinfo/lng-odp >> <http://lists.linaro.org/mailman/listinfo/lng-odp> >> >>>> > > > > >> >>>> > > > >> >>>> > > > >> >>>> > > > >> >>>> > > > -- >> >>>> > > > *Mike Holmes* >> >>>> > > > Linaro Technical Manager / Lead >> >>>> > > > LNG - ODP >> >>>> > > >> >>>> > > > _______________________________________________ >> >>>> > > > lng-odp mailing list >> >>>> > > > lng-odp@lists.linaro.org >> <mailto:lng-odp@lists.linaro.org> >> <mailto:lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>> >> >>>> > > > http://lists.linaro.org/mailman/listinfo/lng-odp >> <http://lists.linaro.org/mailman/listinfo/lng-odp> >> >>>> > > >> >>>> > > >> >>>> > > -- >> >>>> > > Anders Roxell >> >>>> > > anders.roxell@linaro.org >> <mailto:anders.roxell@linaro.org> >> <mailto:anders.roxell@linaro.org <mailto:anders.roxell@linaro.org>> >> >>>> > > M: +46 709 71 42 85 <tel:%2B46%20709%2071%2042%2085> >> | IRC: roxell >> >>>> > > >> >>>> > > _______________________________________________ >> >>>> > > lng-odp mailing list >> >>>> > > lng-odp@lists.linaro.org >> <mailto:lng-odp@lists.linaro.org> >> <mailto:lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>> >> >>>> > > http://lists.linaro.org/mailman/listinfo/lng-odp >> >>>> > > >> >>>> > > >> >>>> > > >> >>>> > > >> >>>> > >_______________________________________________ >> >>>> > >lng-odp mailing list >> >>>> > >lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org> >> >>>> > >http://lists.linaro.org/mailman/listinfo/lng-odp >> >>>> > >> >>>> > >> >>>> > _______________________________________________ >> >>>> > lng-odp mailing list >> >>>> > lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org> >> >>>> > http://lists.linaro.org/mailman/listinfo/lng-odp >> <http://lists.linaro.org/mailman/listinfo/lng-odp> >> >>>> >> >>>> -- >> >>>> Anders Roxell >> >>>> anders.roxell@linaro.org <mailto:anders.roxell@linaro.org> >> >>>> M: +46 709 71 42 85 <tel:%2B46%20709%2071%2042%2085> | IRC: >> roxell >> >>>> >> >>>> _______________________________________________ >> >>>> lng-odp mailing list >> >>>> lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org> >> >>>> http://lists.linaro.org/mailman/listinfo/lng-odp >> >>> >> >>> >> >>> >> >>> >> >>> -- >> >>> Mike Holmes >> >>> Linaro Technical Manager / Lead >> >>> LNG - ODP >> >>> >> >>> _______________________________________________ >> >>> lng-odp mailing list >> >>> lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org> >> >>> http://lists.linaro.org/mailman/listinfo/lng-odp >> >>> >> >> >> > >> > >> > >> > -- >> > Mike Holmes >> > Linaro Technical Manager / Lead >> > LNG - ODP >> > >> > _______________________________________________ >> > lng-odp mailing list >> > lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org> >> > http://lists.linaro.org/mailman/listinfo/lng-odp >> > >> >> >> >> >> -- >> *Mike Holmes* >> Linaro Technical Manager / Lead >> LNG - ODP > > > > _______________________________________________ > lng-odp mailing list > lng-odp@lists.linaro.org > http://lists.linaro.org/mailman/listinfo/lng-odp
On 08/13/2014 12:29 AM, Maxim Uvarov wrote: > why not to use tcpreplay? > > I.e. odp+libpcap+dpdk+tcpreplay if we have everything ready? > > Maxim. Ah, I should check that first. tcpreplay doesn't depend on libpcap. ldd /usr/bin/tcpreplay linux-vdso.so.1 => (0x00007fffa3bfe000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f3d490ba000) /lib64/ld-linux-x86-64.so.2 (0x00007f3d494a5000) > > > On 08/12/2014 11:42 PM, Wiles, Roger Keith wrote: >> Pktgen has a number of different ways to send packets single, range, >> pcap or random, sequence with parameters. >> >> One thing Pktgen does not do is act like a real stack, but you can >> simulate that with pcap or sequence packets. It basically depends on >> how complex a data flow you need. >> >> # git clone git://github.com/Pktgen/Pktgen-DPDK >> >> Let me know if I can help or change the code in some way. >> >> THanks >> ++keith >> >> *Keith **Wiles*, Principal Technologist with CTO office, *Wind >> River*mobile 972-213-5533 >> >> On Aug 12, 2014, at 1:08 PM, Mike Holmes <mike.holmes@linaro.org >> <mailto:mike.holmes@linaro.org>> wrote: >> >>> So it looks like we don't have any way to test this without an Ixia >>> which is a problem given that Santosh is having trouble. >>> Basically there is no CI job to point at that shows that excluding >>> human error it is still working as expected. >>> >>> Keith, is dpdk pktgen able to generate pkts in the way Venki needs ? >>> >>> Mike >>> >>> >>> On 12 August 2014 02:17, Santosh Shukla <santosh.shukla@linaro.org >>> <mailto:santosh.shukla@linaro.org>> wrote: >>> >>> On 12 August 2014 00:25, Mike Holmes <mike.holmes@linaro.org >>> <mailto:mike.holmes@linaro.org>> wrote: >>> > Which test case in odp/test would check this, or does it need >>> an application >>> > like l2fwd to be run - are either in LAVA/CI ? >>> > >>> > Santosh are you able to verify this does not break anything as >>> part of the >>> > l2fwd work you are doing ? >>> > >>> >>> No, I am seeing problem with current and should persist in this >>> multi >>> flavour too. We have bug reported on that lines. So whole >>> dpdk-l2fwd >>> doesn't works for me for my requirement. >>> >>> Thanks. >>> >>> > Mike >>> > >>> > >>> > On 11 August 2014 01:43, Venkatesh Vivekanandan >>> > <venkatesh.vivekanandan@linaro.org >>> <mailto:venkatesh.vivekanandan@linaro.org>> wrote: >>> >> >>> >> >>> >> >>> >> >>> >> On 9 August 2014 17:32, Mike Holmes <mike.holmes@linaro.org >>> <mailto:mike.holmes@linaro.org>> wrote: >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> On 8 August 2014 17:46, Anders Roxell >>> <anders.roxell@linaro.org <mailto:anders.roxell@linaro.org>> wrote: >>> >>>> >>> >>>> On 2014-08-08 17:31, Maxim Uvarov wrote: >>> >>>> > On 08/08/2014 05:13 PM, Venkatesh Vivekanandan wrote: >>> >>>> > > >>> >>>> > > >>> >>>> > > >>> >>>> > >On 7 August 2014 21:10, Anders Roxell >>> <anders.roxell@linaro.org <mailto:anders.roxell@linaro.org> >>> >>>> > ><mailto:anders.roxell@linaro.org >>> <mailto:anders.roxell@linaro.org>>> wrote: >>> >>>> > > >>> >>>> > > On 2014-08-07 10:41, Mike Holmes wrote: >>> >>>> > > > Does this need a signoff by someone else before it >>> is merged ? >>> >>>> > > > >>> >>>> > > > I think we want to enforce getting an ack, >>> tested-by or >>> >>>> > > reviewed-by before >>> >>>> > > > we merge things, we have informally moved that way >>> over the >>> >>>> > > last >>> >>>> > > couple of >>> >>>> > > > weeks and now I think it is time we made it a formal >>> >>>> > > requirement. >>> >>>> > > >>> >>>> > > Agree. >>> >>>> > > >>> >>>> > > >>> >>>> > >If this is the case, then is it fair to say initial >>> discussion of >>> >>>> > >24-hour window is void?. I guess Maxim was waiting for 2 >>> days(for >>> >>>> > >any comments) before he could merge this patch. Do we >>> have any >>> >>>> > >time-limit before which a patch /must /be reviewed or >>> tested? I >>> >>>> > >hope we can't wait indefinitely or is this the case?. >>> >>>> > >>> >>>> > I think if patch came from platfrom maintainer, it's not >>> new API. No >>> >>>> > comments in 1 or 2 days, than it's ok to merge it. If >>> patch came >>> >>>> > from somobody alse I would ask maintainer to review it. >>> >>>> >>> >>>> I disagree with this. >>> >>>> No matter where the patch comes from and who wrote the >>> patch, it can be >>> >>>> wrong and need a second pair of eyes i.e., >>> >>>> (Reviewed|Acked|Signed-off)-by. >>> >>>> If no one has replied to a patch after 2 days, the author of >>> the patch >>> >>>> should ping the list and maintainer. >>> >>>> >>> >>>> After the second pair of eyes, the patch should be ok to be >>> merged. >>> >>>> The ODP maintainer should do a smoke build test on all the >>> supported >>> >>>> platforms before merging though. >>> >>> >>> >>> >>> >>> My 2 cents >>> >>> We have started to develop a cohesive API, I think that is >>> down to a lot >>> >>> of folks working together. >>> >>> I also think that peer review/team work is reflected in the >>> increasing >>> >>> willingness to review each others patches which has improved >>> quality >>> >>> and helped establish the guidelines on how things bolt >>> together in ODP, >>> >>> may long discussions have spawned from patches. >>> >>> >>> >>> No one is beyond silly mistakes, peer review finds a lot of >>> the dumb >>> >>> stuff for little cost, saving on the inevitable ugly patch up >>> that will >>> >>> ensue otherwise. >>> >>> Maxim you could do the default reviews if no one came >>> forward, but if a >>> >>> submitter finds and establishes their own network of >>> reviewers that is one >>> >>> extra pair of eyes and ideas. >>> >> >>> >> >>> >> Can someone please review this patch?. If there is any >>> comments, we can >>> >> request maxim to revert the patch, otherwise he can add the >>> >> "Reviewed-by/Tested-by" to the applied patch. >>> >> >>> >>>> >>> >>>> Cheers, >>> >>>> Anders >>> >>>> >>> >>>> > >>> >>>> > Maxim. >>> >>>> > >>> >>>> > > Anders >>> >>>> > > >>> >>>> > > > >>> >>>> > > > Mike >>> >>>> > > > >>> >>>> > > > >>> >>>> > > > On 7 August 2014 09:15, Maxim Uvarov >>> <maxim.uvarov@linaro.org <mailto:maxim.uvarov@linaro.org> >>> >>>> > > <mailto:maxim.uvarov@linaro.org >>> <mailto:maxim.uvarov@linaro.org>>> wrote: >>> >>>> > > > >>> >>>> > > > > Merged, thanks! >>> >>>> > > > > >>> >>>> > > > > Maxim. >>> >>>> > > > > >>> >>>> > > > > >>> >>>> > > > > On 08/05/2014 06:54 PM, >>> venkatesh.vivekanandan@linaro.org >>> <mailto:venkatesh.vivekanandan@linaro.org> >>> >>>> > > <mailto:venkatesh.vivekanandan@linaro.org >>> <mailto:venkatesh.vivekanandan@linaro.org>> wrote: >>> >>>> > > > > >>> >>>> > > > >> From: Venkatesh Vivekanandan >>> >>>> > > <venkatesh.vivekanandan@linaro.org >>> <mailto:venkatesh.vivekanandan@linaro.org> >>> >>>> > > <mailto:venkatesh.vivekanandan@linaro.org >>> <mailto:venkatesh.vivekanandan@linaro.org>>> >>> >>>> > > > >> >>> >>>> > > > >> - Multi queue support per interface is enabled. >>> >>>> > > > >> - odp_pktio_send with "0" packet is called in >>> odp_pktio_recv >>> >>>> > > to >>> >>>> > > > >> give the transmitted buffers back to mempool. >>> >>>> > > > >> - mbuf alloc failure during receive is fixed by >>> giving more >>> >>>> > > buffers to >>> >>>> > > > >> mempool. >>> >>>> > > > >> - mempool cache size is given equivalent to >>> MAX_PKT_BURST. >>> >>>> > > > >> >>> >>>> > > > >> Signed-off-by: Venkatesh Vivekanandan >>> >>>> > > <venkatesh.vivekanandan@linaro.org >>> <mailto:venkatesh.vivekanandan@linaro.org> >>> >>>> > > <mailto:venkatesh.vivekanandan@linaro.org >>> <mailto:venkatesh.vivekanandan@linaro.org>>> >>> >>>> > > > >> --- >>> >>>> > > > >> platform/linux-dpdk/include/odp_packet_dpdk.h | >>> 24 +++++ >>> >>>> > > > >> platform/linux-dpdk/odp_buffer_pool.c | >>> 4 +- >>> >>>> > > > >> platform/linux-dpdk/odp_packet_dpdk.c | >>> 136 >>> >>>> > > > >> +++++++++++++------------- >>> >>>> > > > >> platform/linux-dpdk/odp_packet_io.c | >>> 2 + >>> >>>> > > > >> 4 files changed, 94 insertions(+), 72 >>> deletions(-) >>> >>>> > > > >> >>> >>>> > > > >> diff --git >>> a/platform/linux-dpdk/include/odp_packet_dpdk.h >>> >>>> > > > >> b/platform/linux-dpdk/include/odp_packet_dpdk.h >>> >>>> > > > >> index bcbe9e8..bcf9aa5 100644 >>> >>>> > > > >> --- >>> a/platform/linux-dpdk/include/odp_packet_dpdk.h >>> >>>> > > > >> +++ >>> b/platform/linux-dpdk/include/odp_packet_dpdk.h >>> >>>> > > > >> @@ -50,6 +50,30 @@ >>> >>>> > > > >> #define DPDK_BLOCKING_IO >>> >>>> > > > >> +/* >>> >>>> > > > >> + * RX and TX Prefetch, Host, and Write-back >>> threshold >>> >>>> > > values >>> >>>> > > should be >>> >>>> > > > >> + * carefully set for optimal performance. >>> Consult the >>> >>>> > > network >>> >>>> > > > >> + * controller's datasheet and supporting DPDK >>> documentation >>> >>>> > > for guidance >>> >>>> > > > >> + * on how these parameters should be set. >>> >>>> > > > >> + */ >>> >>>> > > > >> +#define RX_PTHRESH 8 /**< Default values of RX >>> prefetch >>> >>>> > > threshold reg. */ >>> >>>> > > > >> +#define RX_HTHRESH 8 /**< Default values of RX >>> host >>> >>>> > > threshold reg. */ >>> >>>> > > > >> +#define RX_WTHRESH 4 /**< Default values of RX >>> write-back >>> >>>> > > threshold reg. >>> >>>> > > > >> */ >>> >>>> > > > >> + >>> >>>> > > > >> +/* >>> >>>> > > > >> + * These default values are optimized for use >>> with the >>> >>>> > > Intel(R) 82599 10 >>> >>>> > > > >> GbE >>> >>>> > > > >> + * Controller and the DPDK ixgbe PMD. Consider >>> using other >>> >>>> > > values for >>> >>>> > > > >> other >>> >>>> > > > >> + * network controllers and/or network drivers. >>> >>>> > > > >> + */ >>> >>>> > > > >> +#define TX_PTHRESH 36 /**< Default values of TX >>> prefetch >>> >>>> > > threshold reg. >>> >>>> > > > >> */ >>> >>>> > > > >> +#define TX_HTHRESH 0 /**< Default values of TX >>> host >>> >>>> > > threshold reg. */ >>> >>>> > > > >> +#define TX_WTHRESH 0 /**< Default values of TX >>> write-back >>> >>>> > > threshold >>> >>>> > > > >> reg. */ >>> >>>> > > > >> + >>> >>>> > > > >> +#define MAX_PKT_BURST 16 >>> >>>> > > > >> +#define BURST_TX_DRAIN_US 100 /* TX drain every >>> ~100us */ >>> >>>> > > > >> +#define RTE_TEST_RX_DESC_DEFAULT 128 >>> >>>> > > > >> +#define RTE_TEST_TX_DESC_DEFAULT 512 >>> >>>> > > > >> + >>> >>>> > > > >> /** Packet socket using dpdk mmaped rings for >>> both Rx and >>> >>>> > > Tx */ >>> >>>> > > > >> typedef struct { >>> >>>> > > > >> odp_buffer_pool_t pool; >>> >>>> > > > >> diff --git a/platform/linux-dpdk/odp_buffer_pool.c >>> >>>> > > > >> b/platform/linux-dpdk/odp_buffer_pool.c >>> >>>> > > > >> index de90275..805ce68 100644 >>> >>>> > > > >> --- a/platform/linux-dpdk/odp_buffer_pool.c >>> >>>> > > > >> +++ b/platform/linux-dpdk/odp_buffer_pool.c >>> >>>> > > > >> @@ -23,7 +23,7 @@ >>> >>>> > > > >> #include <odp_packet_dpdk.h> >>> >>>> > > > >> #define MBUF_SIZE (2048 + sizeof(struct >>> rte_mbuf) + >>> >>>> > > > >> RTE_PKTMBUF_HEADROOM) >>> >>>> > > > >> -#define NB_MBUF 8192 >>> >>>> > > > >> +#define NB_MBUF 32768 >>> >>>> > > > >> #ifdef POOL_USE_TICKETLOCK >>> >>>> > > > >> #include <odp_ticketlock.h> >>> >>>> > > > >> @@ -112,7 +112,7 @@ odp_buffer_pool_t >>> >>>> > > odp_buffer_pool_create(const char >>> >>>> > > > >> *name, >>> >>>> > > > >> pktmbuf_pool = >>> >>>> > > > >> rte_mempool_create(name, NB_MBUF, >>> >>>> > > > >> - MBUF_SIZE, 32, >>> >>>> > > > >> + MBUF_SIZE, MAX_PKT_BURST, >>> >>>> > > > >> sizeof(struct >>> >>>> > > > >> rte_pktmbuf_pool_private), >>> >>>> > > > >> rte_pktmbuf_pool_init, NULL, >>> >>>> > > > >> rte_pktmbuf_init, NULL, >>> >>>> > > > >> diff --git a/platform/linux-dpdk/odp_packet_dpdk.c >>> >>>> > > > >> b/platform/linux-dpdk/odp_packet_dpdk.c >>> >>>> > > > >> index 31bfa30..d5c8e80 100644 >>> >>>> > > > >> --- a/platform/linux-dpdk/odp_packet_dpdk.c >>> >>>> > > > >> +++ b/platform/linux-dpdk/odp_packet_dpdk.c >>> >>>> > > > >> @@ -26,34 +26,13 @@ >>> >>>> > > > >> #include <odp_packet_dpdk.h> >>> >>>> > > > >> #include <net/if.h> >>> >>>> > > > >> -/* >>> >>>> > > > >> - * RX and TX Prefetch, Host, and Write-back >>> threshold >>> >>>> > > values >>> >>>> > > should be >>> >>>> > > > >> - * carefully set for optimal performance. >>> Consult the >>> >>>> > > network >>> >>>> > > > >> - * controller's datasheet and supporting DPDK >>> documentation >>> >>>> > > for guidance >>> >>>> > > > >> - * on how these parameters should be set. >>> >>>> > > > >> - */ >>> >>>> > > > >> -#define RX_PTHRESH 8 /**< Default values of RX >>> prefetch >>> >>>> > > threshold reg. */ >>> >>>> > > > >> -#define RX_HTHRESH 8 /**< Default values of RX >>> host >>> >>>> > > threshold reg. */ >>> >>>> > > > >> -#define RX_WTHRESH 4 /**< Default values of RX >>> write-back >>> >>>> > > threshold reg. >>> >>>> > > > >> */ >>> >>>> > > > >> - >>> >>>> > > > >> -/* >>> >>>> > > > >> - * These default values are optimized for use >>> with the >>> >>>> > > Intel(R) 82599 10 >>> >>>> > > > >> GbE >>> >>>> > > > >> - * Controller and the DPDK ixgbe PMD. Consider >>> using other >>> >>>> > > values for >>> >>>> > > > >> other >>> >>>> > > > >> - * network controllers and/or network drivers. >>> >>>> > > > >> - */ >>> >>>> > > > >> -#define TX_PTHRESH 36 /**< Default values of TX >>> prefetch >>> >>>> > > threshold reg. >>> >>>> > > > >> */ >>> >>>> > > > >> -#define TX_HTHRESH 0 /**< Default values of TX >>> host >>> >>>> > > threshold reg. */ >>> >>>> > > > >> -#define TX_WTHRESH 0 /**< Default values of TX >>> write-back >>> >>>> > > threshold >>> >>>> > > > >> reg. */ >>> >>>> > > > >> - >>> >>>> > > > >> -#define MAX_PKT_BURST 16 >>> >>>> > > > >> -#define BURST_TX_DRAIN_US 100 /* TX drain every >>> ~100us */ >>> >>>> > > > >> -#define RTE_TEST_RX_DESC_DEFAULT 128 >>> >>>> > > > >> -#define RTE_TEST_TX_DESC_DEFAULT 512 >>> >>>> > > > >> static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT; >>> >>>> > > > >> static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT; >>> >>>> > > > >> static const struct rte_eth_conf port_conf = { >>> >>>> > > > >> .rxmode = { >>> >>>> > > > >> + .mq_mode = ETH_MQ_RX_RSS, >>> >>>> > > > >> + .max_rx_pkt_len = ETHER_MAX_LEN, >>> >>>> > > > >> .split_hdr_size = 0, >>> >>>> > > > >> .header_split = 0, /**< Header Split >>> >>>> > > disabled */ >>> >>>> > > > >> .hw_ip_checksum = 0, /**< IP checksum >>> >>>> > > offload >>> >>>> > > disabled */ >>> >>>> > > > >> @@ -61,6 +40,12 @@ static const struct >>> rte_eth_conf >>> >>>> > > port_conf = { >>> >>>> > > > >> .jumbo_frame = 0, /**< Jumbo Frame >>> >>>> > > Support >>> >>>> > > disabled */ >>> >>>> > > > >> .hw_strip_crc = 0, /**< CRC stripped by >>> >>>> > > hardware */ >>> >>>> > > > >> }, >>> >>>> > > > >> + .rx_adv_conf = { >>> >>>> > > > >> + .rss_conf = { >>> >>>> > > > >> + .rss_key = NULL, >>> >>>> > > > >> + .rss_hf = ETH_RSS_IPV4 | >>> >>>> > > ETH_RSS_IPV6, >>> >>>> > > > >> + }, >>> >>>> > > > >> + }, >>> >>>> > > > >> .txmode = { >>> >>>> > > > >> .mq_mode = ETH_MQ_TX_NONE, >>> >>>> > > > >> }, >>> >>>> > > > >> @@ -95,60 +80,71 @@ int >>> setup_pkt_dpdk(pkt_dpdk_t * const >>> >>>> > > pkt_dpdk, const >>> >>>> > > > >> char *netdev, >>> >>>> > > > >> ODP_DBG("setup_pkt_dpdk\n"); >>> >>>> > > > >> static struct ether_addr >>> eth_addr[RTE_MAX_ETHPORTS]; >>> >>>> > > > >> - uint8_t portid = 0; >>> >>>> > > > >> - uint16_t queueid = 0; >>> >>>> > > > >> - int ret; >>> >>>> > > > >> + static int portinit[RTE_MAX_ETHPORTS]; >>> >>>> > > > >> + static int qid[RTE_MAX_ETHPORTS]; >>> >>>> > > > >> + uint8_t portid = 0, num_intf = 2; >>> >>>> > > > >> + uint16_t nbrxq = 0, nbtxq = 0; >>> >>>> > > > >> + int ret, i; >>> >>>> > > > >> + >>> >>>> > > > >> printf("dpdk netdev: %s\n", netdev); >>> >>>> > > > >> printf("dpdk pool: %lx\n", pool); >>> >>>> > > > >> - >>> >>>> > > > >> portid = atoi(netdev); >>> >>>> > > > >> pkt_dpdk->portid = portid; >>> >>>> > > > >> - pkt_dpdk->queueid = queueid; >>> >>>> > > > >> pkt_dpdk->pool = pool; >>> >>>> > > > >> printf("dpdk portid: %u\n", portid); >>> >>>> > > > >> - fflush(stdout); >>> >>>> > > > >> - ret = rte_eth_dev_configure(portid, 1, 1, >>> >>>> > > &port_conf); >>> >>>> > > > >> - if (ret < 0) >>> >>>> > > > >> - ODP_ERR("Cannot configure device: >>> err=%d, >>> >>>> > > port=%u\n", >>> >>>> > > > >> - ret, (unsigned) portid); >>> >>>> > > > >> - >>> >>>> > > > >> - rte_eth_macaddr_get(portid, ð_addr[portid]); >>> >>>> > > > >> - ODP_DBG("Port %u, MAC address: >>> >>>> > > %02X:%02X:%02X:%02X:%02X:%02X\ >>> >>>> > > > >> n\n", >>> >>>> > > > >> - (unsigned) portid, >>> >>>> > > > >> - eth_addr[portid].addr_bytes[0], >>> >>>> > > > >> - eth_addr[portid].addr_bytes[1], >>> >>>> > > > >> - eth_addr[portid].addr_bytes[2], >>> >>>> > > > >> - eth_addr[portid].addr_bytes[3], >>> >>>> > > > >> - eth_addr[portid].addr_bytes[4], >>> >>>> > > > >> - eth_addr[portid].addr_bytes[5]); >>> >>>> > > > >> - >>> >>>> > > > >> - /* init one RX queue on each port */ >>> >>>> > > > >> - fflush(stdout); >>> >>>> > > > >> - ret = rte_eth_rx_queue_setup(portid, queueid, >>> >>>> > > nb_rxd, >>> >>>> > > > >> - rte_eth_dev_socket_id(portid), >>> >>>> > > > >> &rx_conf, >>> >>>> > > > >> - (struct rte_mempool *)pool); >>> >>>> > > > >> - if (ret < 0) >>> >>>> > > > >> - ODP_ERR("rte_eth_rx_queue_setup:err=%d, >>> port=%u\n", >>> >>>> > > > >> - ret, (unsigned) portid); >>> >>>> > > > >> - ODP_DBG("dpdk rx queue setup done\n"); >>> >>>> > > > >> - >>> >>>> > > > >> - /* init one TX queue on each port */ >>> >>>> > > > >> - fflush(stdout); >>> >>>> > > > >> - ret = rte_eth_tx_queue_setup(portid, queueid, >>> >>>> > > nb_txd, >>> >>>> > > > >> - rte_eth_dev_socket_id(portid), &tx_conf); >>> >>>> > > > >> - if (ret < 0) >>> >>>> > > > >> - ODP_ERR("rte_eth_tx_queue_setup:err=%d, >>> port=%u\n", >>> >>>> > > > >> - ret, (unsigned) portid); >>> >>>> > > > >> - ODP_DBG("dpdk tx queue setup done\n"); >>> >>>> > > > >> - >>> >>>> > > > >> - /* Start device */ >>> >>>> > > > >> - ret = rte_eth_dev_start(portid); >>> >>>> > > > >> - if (ret < 0) >>> >>>> > > > >> - ODP_ERR("rte_eth_dev_start:err=%d, port=%u\n", >>> >>>> > > > >> - ret, (unsigned) portid); >>> >>>> > > > >> - ODP_DBG("dpdk setup done\n\n"); >>> >>>> > > > >> - >>> >>>> > > > >> + nbrxq = odp_sys_core_count() / num_intf; >>> >>>> > > > >> + nbtxq = nbrxq; >>> >>>> > > > >> + if (portinit[portid] == 0) { >>> >>>> > > > >> + fflush(stdout); >>> >>>> > > > >> + ret = rte_eth_dev_configure(portid, >>> nbrxq, >>> >>>> > > nbtxq, >>> >>>> > > > >> &port_conf); >>> >>>> > > > >> + if (ret < 0) >>> >>>> > > > >> + ODP_ERR("Cannot configure >>> device: >>> >>>> > > err=%d, >>> >>>> > > > >> port=%u\n", >>> >>>> > > > >> + ret, (unsigned) >>> portid); >>> >>>> > > > >> + >>> >>>> > > > >> + rte_eth_macaddr_get(portid, ð_addr[portid]); >>> >>>> > > > >> + ODP_DBG("Port %u, MAC address: >>> >>>> > > > >> %02X:%02X:%02X:%02X:%02X:%02X\n", >>> >>>> > > > >> + (unsigned) portid, >>> >>>> > > > >> + eth_addr[portid].addr_bytes[0], >>> >>>> > > > >> + eth_addr[portid].addr_bytes[1], >>> >>>> > > > >> + eth_addr[portid].addr_bytes[2], >>> >>>> > > > >> + eth_addr[portid].addr_bytes[3], >>> >>>> > > > >> + eth_addr[portid].addr_bytes[4], >>> >>>> > > > >> + eth_addr[portid].addr_bytes[5]); >>> >>>> > > > >> + >>> >>>> > > > >> + /* init one RX queue on each port */ >>> >>>> > > > >> + fflush(stdout); >>> >>>> > > > >> + for (i = 0; i < nbrxq; i++) { >>> >>>> > > > >> + ret = >>> rte_eth_rx_queue_setup(portid, >>> >>>> > > i, nb_rxd, >>> >>>> > > > >> + rte_eth_dev_socket_id(portid), >>> >>>> > > > >> &rx_conf, >>> >>>> > > > >> + (struct rte_mempool *)pool); >>> >>>> > > > >> + if (ret < 0) >>> >>>> > > > >> + ODP_ERR("%s rxq:err=%d, port=%u\n", >>> >>>> > > > >> + __func__, ret, (unsigned) portid); >>> >>>> > > > >> + ODP_DBG("dpdk rx queue setup >>> >>>> > > done\n"); >>> >>>> > > > >> + } >>> >>>> > > > >> + >>> >>>> > > > >> + /* init one TX queue on each port */ >>> >>>> > > > >> + fflush(stdout); >>> >>>> > > > >> + for (i = 0; i < nbtxq; i++) { >>> >>>> > > > >> + ret = >>> rte_eth_tx_queue_setup(portid, >>> >>>> > > i, nb_txd, >>> >>>> > > > >> + rte_eth_dev_socket_id(portid), &tx_conf); >>> >>>> > > > >> + if (ret < 0) >>> >>>> > > > >> + ODP_ERR("%s txq:err=%d, port=%u\n", >>> >>>> > > > >> + __func__, ret, (unsigned) portid); >>> >>>> > > > >> + ODP_DBG("dpdk tx queue setup >>> >>>> > > done\n"); >>> >>>> > > > >> + } >>> >>>> > > > >> + >>> >>>> > > > >> + /* Start device */ >>> >>>> > > > >> + ret = rte_eth_dev_start(portid); >>> >>>> > > > >> + if (ret < 0) >>> >>>> > > > >> + ODP_ERR("rte_eth_dev_start:err=%d, port=%u\n", >>> >>>> > > > >> + ret, (unsigned) >>> portid); >>> >>>> > > > >> + ODP_DBG("dpdk setup done\n\n"); >>> >>>> > > > >> + >>> >>>> > > > >> + portinit[portid] = 1; >>> >>>> > > > >> + } >>> >>>> > > > >> + pkt_dpdk->queueid = qid[portid]++; >>> >>>> > > > >> return 0; >>> >>>> > > > >> } >>> >>>> > > > >> diff --git a/platform/linux-dpdk/odp_packet_io.c >>> >>>> > > > >> b/platform/linux-dpdk/odp_packet_io.c >>> >>>> > > > >> index d8d127f..3124175 100644 >>> >>>> > > > >> --- a/platform/linux-dpdk/odp_packet_io.c >>> >>>> > > > >> +++ b/platform/linux-dpdk/odp_packet_io.c >>> >>>> > > > >> @@ -230,6 +230,8 @@ int >>> odp_pktio_recv(odp_pktio_t id, >>> >>>> > > odp_packet_t >>> >>>> > > > >> pkt_table[], unsigned len) >>> >>>> > > > >> if (pktio_entry == NULL) >>> >>>> > > > >> return -1; >>> >>>> > > > >> + odp_pktio_send(id, pkt_table, 0); >>> >>>> > > > >> + >>> >>>> > > > >> lock_entry(pktio_entry); >>> >>>> > > > >> pkts = recv_pkt_dpdk(&pktio_entry->s.pkt_dpdk, >>> >>>> > > pkt_table, len); >>> >>>> > > > >> unlock_entry(pktio_entry); >>> >>>> > > > >> >>> >>>> > > > > >>> >>>> > > > > >>> >>>> > > > > _______________________________________________ >>> >>>> > > > > lng-odp mailing list >>> >>>> > > > > lng-odp@lists.linaro.org >>> <mailto:lng-odp@lists.linaro.org> >>> <mailto:lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>> >>> >>>> > > > > http://lists.linaro.org/mailman/listinfo/lng-odp >>> <http://lists.linaro.org/mailman/listinfo/lng-odp> >>> >>>> > > > > >>> >>>> > > > >>> >>>> > > > >>> >>>> > > > >>> >>>> > > > -- >>> >>>> > > > *Mike Holmes* >>> >>>> > > > Linaro Technical Manager / Lead >>> >>>> > > > LNG - ODP >>> >>>> > > >>> >>>> > > > _______________________________________________ >>> >>>> > > > lng-odp mailing list >>> >>>> > > > lng-odp@lists.linaro.org >>> <mailto:lng-odp@lists.linaro.org> >>> <mailto:lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>> >>> >>>> > > > http://lists.linaro.org/mailman/listinfo/lng-odp >>> <http://lists.linaro.org/mailman/listinfo/lng-odp> >>> >>>> > > >>> >>>> > > >>> >>>> > > -- >>> >>>> > > Anders Roxell >>> >>>> > > anders.roxell@linaro.org >>> <mailto:anders.roxell@linaro.org> >>> <mailto:anders.roxell@linaro.org <mailto:anders.roxell@linaro.org>> >>> >>>> > > M: +46 709 71 42 85 <tel:%2B46%20709%2071%2042%2085> >>> | IRC: roxell >>> >>>> > > >>> >>>> > > _______________________________________________ >>> >>>> > > lng-odp mailing list >>> >>>> > > lng-odp@lists.linaro.org >>> <mailto:lng-odp@lists.linaro.org> >>> <mailto:lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>> >>> >>>> > > http://lists.linaro.org/mailman/listinfo/lng-odp >>> >>>> > > >>> >>>> > > >>> >>>> > > >>> >>>> > > >>> >>>> > >_______________________________________________ >>> >>>> > >lng-odp mailing list >>> >>>> > >lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org> >>> >>>> > >http://lists.linaro.org/mailman/listinfo/lng-odp >>> >>>> > >>> >>>> > >>> >>>> > _______________________________________________ >>> >>>> > lng-odp mailing list >>> >>>> > lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org> >>> >>>> > http://lists.linaro.org/mailman/listinfo/lng-odp >>> <http://lists.linaro.org/mailman/listinfo/lng-odp> >>> >>>> >>> >>>> -- >>> >>>> Anders Roxell >>> >>>> anders.roxell@linaro.org <mailto:anders.roxell@linaro.org> >>> >>>> M: +46 709 71 42 85 <tel:%2B46%20709%2071%2042%2085> | IRC: >>> roxell >>> >>>> >>> >>>> _______________________________________________ >>> >>>> lng-odp mailing list >>> >>>> lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org> >>> >>>> http://lists.linaro.org/mailman/listinfo/lng-odp >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> -- >>> >>> Mike Holmes >>> >>> Linaro Technical Manager / Lead >>> >>> LNG - ODP >>> >>> >>> >>> _______________________________________________ >>> >>> lng-odp mailing list >>> >>> lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org> >>> >>> http://lists.linaro.org/mailman/listinfo/lng-odp >>> >>> >>> >> >>> > >>> > >>> > >>> > -- >>> > Mike Holmes >>> > Linaro Technical Manager / Lead >>> > LNG - ODP >>> > >>> > _______________________________________________ >>> > lng-odp mailing list >>> > lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org> >>> > http://lists.linaro.org/mailman/listinfo/lng-odp >>> > >>> >>> >>> >>> >>> -- >>> *Mike Holmes* >>> Linaro Technical Manager / Lead >>> LNG - ODP >> >> >> >> _______________________________________________ >> lng-odp mailing list >> lng-odp@lists.linaro.org >> http://lists.linaro.org/mailman/listinfo/lng-odp >
To generate test data we don't have to use ODP, although we should try to do that down the road, but equally you still need to use external tools to be sure you did not make compatible only with yourself mistakes. I was wondering why we can't spawn several process on one machine that all send to the same port to test this ? On 12 August 2014 16:31, Maxim Uvarov <maxim.uvarov@linaro.org> wrote: > On 08/13/2014 12:29 AM, Maxim Uvarov wrote: > >> why not to use tcpreplay? >> >> I.e. odp+libpcap+dpdk+tcpreplay if we have everything ready? >> >> Maxim. >> > Ah, I should check that first. tcpreplay doesn't depend on libpcap. > > ldd /usr/bin/tcpreplay > linux-vdso.so.1 => (0x00007fffa3bfe000) > libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f3d490ba000) > /lib64/ld-linux-x86-64.so.2 (0x00007f3d494a5000) > > > >> >> On 08/12/2014 11:42 PM, Wiles, Roger Keith wrote: >> >>> Pktgen has a number of different ways to send packets single, range, >>> pcap or random, sequence with parameters. >>> >>> One thing Pktgen does not do is act like a real stack, but you can >>> simulate that with pcap or sequence packets. It basically depends on how >>> complex a data flow you need. >>> >>> # git clone git://github.com/Pktgen/Pktgen-DPDK >>> >>> Let me know if I can help or change the code in some way. >>> >>> THanks >>> ++keith >>> >>> *Keith **Wiles*, Principal Technologist with CTO office, *Wind >>> River*mobile 972-213-5533 >>> >>> On Aug 12, 2014, at 1:08 PM, Mike Holmes <mike.holmes@linaro.org >>> <mailto:mike.holmes@linaro.org>> wrote: >>> >>> So it looks like we don't have any way to test this without an Ixia >>>> which is a problem given that Santosh is having trouble. >>>> Basically there is no CI job to point at that shows that excluding >>>> human error it is still working as expected. >>>> >>>> Keith, is dpdk pktgen able to generate pkts in the way Venki needs ? >>>> >>>> Mike >>>> >>>> >>>> On 12 August 2014 02:17, Santosh Shukla <santosh.shukla@linaro.org >>>> <mailto:santosh.shukla@linaro.org>> wrote: >>>> >>>> On 12 August 2014 00:25, Mike Holmes <mike.holmes@linaro.org >>>> <mailto:mike.holmes@linaro.org>> wrote: >>>> > Which test case in odp/test would check this, or does it need >>>> an application >>>> > like l2fwd to be run - are either in LAVA/CI ? >>>> > >>>> > Santosh are you able to verify this does not break anything as >>>> part of the >>>> > l2fwd work you are doing ? >>>> > >>>> >>>> No, I am seeing problem with current and should persist in this >>>> multi >>>> flavour too. We have bug reported on that lines. So whole dpdk-l2fwd >>>> doesn't works for me for my requirement. >>>> >>>> Thanks. >>>> >>>> > Mike >>>> > >>>> > >>>> > On 11 August 2014 01:43, Venkatesh Vivekanandan >>>> > <venkatesh.vivekanandan@linaro.org >>>> <mailto:venkatesh.vivekanandan@linaro.org>> wrote: >>>> >> >>>> >> >>>> >> >>>> >> >>>> >> On 9 August 2014 17:32, Mike Holmes <mike.holmes@linaro.org >>>> <mailto:mike.holmes@linaro.org>> wrote: >>>> >>> >>>> >>> >>>> >>> >>>> >>> >>>> >>> On 8 August 2014 17:46, Anders Roxell >>>> <anders.roxell@linaro.org <mailto:anders.roxell@linaro.org>> wrote: >>>> >>>> >>>> >>>> On 2014-08-08 17:31, Maxim Uvarov wrote: >>>> >>>> > On 08/08/2014 05:13 PM, Venkatesh Vivekanandan wrote: >>>> >>>> > > >>>> >>>> > > >>>> >>>> > > >>>> >>>> > >On 7 August 2014 21:10, Anders Roxell >>>> <anders.roxell@linaro.org <mailto:anders.roxell@linaro.org> >>>> >>>> > ><mailto:anders.roxell@linaro.org >>>> <mailto:anders.roxell@linaro.org>>> wrote: >>>> >>>> > > >>>> >>>> > > On 2014-08-07 10:41, Mike Holmes wrote: >>>> >>>> > > > Does this need a signoff by someone else before it >>>> is merged ? >>>> >>>> > > > >>>> >>>> > > > I think we want to enforce getting an ack, tested-by >>>> or >>>> >>>> > > reviewed-by before >>>> >>>> > > > we merge things, we have informally moved that way >>>> over the >>>> >>>> > > last >>>> >>>> > > couple of >>>> >>>> > > > weeks and now I think it is time we made it a formal >>>> >>>> > > requirement. >>>> >>>> > > >>>> >>>> > > Agree. >>>> >>>> > > >>>> >>>> > > >>>> >>>> > >If this is the case, then is it fair to say initial >>>> discussion of >>>> >>>> > >24-hour window is void?. I guess Maxim was waiting for 2 >>>> days(for >>>> >>>> > >any comments) before he could merge this patch. Do we >>>> have any >>>> >>>> > >time-limit before which a patch /must /be reviewed or >>>> tested? I >>>> >>>> > >hope we can't wait indefinitely or is this the case?. >>>> >>>> > >>>> >>>> > I think if patch came from platfrom maintainer, it's not >>>> new API. No >>>> >>>> > comments in 1 or 2 days, than it's ok to merge it. If >>>> patch came >>>> >>>> > from somobody alse I would ask maintainer to review it. >>>> >>>> >>>> >>>> I disagree with this. >>>> >>>> No matter where the patch comes from and who wrote the >>>> patch, it can be >>>> >>>> wrong and need a second pair of eyes i.e., >>>> >>>> (Reviewed|Acked|Signed-off)-by. >>>> >>>> If no one has replied to a patch after 2 days, the author of >>>> the patch >>>> >>>> should ping the list and maintainer. >>>> >>>> >>>> >>>> After the second pair of eyes, the patch should be ok to be >>>> merged. >>>> >>>> The ODP maintainer should do a smoke build test on all the >>>> supported >>>> >>>> platforms before merging though. >>>> >>> >>>> >>> >>>> >>> My 2 cents >>>> >>> We have started to develop a cohesive API, I think that is >>>> down to a lot >>>> >>> of folks working together. >>>> >>> I also think that peer review/team work is reflected in the >>>> increasing >>>> >>> willingness to review each others patches which has improved >>>> quality >>>> >>> and helped establish the guidelines on how things bolt >>>> together in ODP, >>>> >>> may long discussions have spawned from patches. >>>> >>> >>>> >>> No one is beyond silly mistakes, peer review finds a lot of >>>> the dumb >>>> >>> stuff for little cost, saving on the inevitable ugly patch up >>>> that will >>>> >>> ensue otherwise. >>>> >>> Maxim you could do the default reviews if no one came >>>> forward, but if a >>>> >>> submitter finds and establishes their own network of >>>> reviewers that is one >>>> >>> extra pair of eyes and ideas. >>>> >> >>>> >> >>>> >> Can someone please review this patch?. If there is any >>>> comments, we can >>>> >> request maxim to revert the patch, otherwise he can add the >>>> >> "Reviewed-by/Tested-by" to the applied patch. >>>> >> >>>> >>>> >>>> >>>> Cheers, >>>> >>>> Anders >>>> >>>> >>>> >>>> > >>>> >>>> > Maxim. >>>> >>>> > >>>> >>>> > > Anders >>>> >>>> > > >>>> >>>> > > > >>>> >>>> > > > Mike >>>> >>>> > > > >>>> >>>> > > > >>>> >>>> > > > On 7 August 2014 09:15, Maxim Uvarov >>>> <maxim.uvarov@linaro.org <mailto:maxim.uvarov@linaro.org> >>>> >>>> > > <mailto:maxim.uvarov@linaro.org >>>> <mailto:maxim.uvarov@linaro.org>>> wrote: >>>> >>>> > > > >>>> >>>> > > > > Merged, thanks! >>>> >>>> > > > > >>>> >>>> > > > > Maxim. >>>> >>>> > > > > >>>> >>>> > > > > >>>> >>>> > > > > On 08/05/2014 06:54 PM, >>>> venkatesh.vivekanandan@linaro.org >>>> <mailto:venkatesh.vivekanandan@linaro.org> >>>> >>>> > > <mailto:venkatesh.vivekanandan@linaro.org >>>> <mailto:venkatesh.vivekanandan@linaro.org>> wrote: >>>> >>>> > > > > >>>> >>>> > > > >> From: Venkatesh Vivekanandan >>>> >>>> > > <venkatesh.vivekanandan@linaro.org >>>> <mailto:venkatesh.vivekanandan@linaro.org> >>>> >>>> > > <mailto:venkatesh.vivekanandan@linaro.org >>>> <mailto:venkatesh.vivekanandan@linaro.org>>> >>>> >>>> > > > >> >>>> >>>> > > > >> - Multi queue support per interface is enabled. >>>> >>>> > > > >> - odp_pktio_send with "0" packet is called in >>>> odp_pktio_recv >>>> >>>> > > to >>>> >>>> > > > >> give the transmitted buffers back to mempool. >>>> >>>> > > > >> - mbuf alloc failure during receive is fixed by >>>> giving more >>>> >>>> > > buffers to >>>> >>>> > > > >> mempool. >>>> >>>> > > > >> - mempool cache size is given equivalent to >>>> MAX_PKT_BURST. >>>> >>>> > > > >> >>>> >>>> > > > >> Signed-off-by: Venkatesh Vivekanandan >>>> >>>> > > <venkatesh.vivekanandan@linaro.org >>>> <mailto:venkatesh.vivekanandan@linaro.org> >>>> >>>> > > <mailto:venkatesh.vivekanandan@linaro.org >>>> <mailto:venkatesh.vivekanandan@linaro.org>>> >>>> >>>> > > > >> --- >>>> >>>> > > > >> platform/linux-dpdk/include/odp_packet_dpdk.h | >>>> 24 +++++ >>>> >>>> > > > >> platform/linux-dpdk/odp_buffer_pool.c | 4 >>>> +- >>>> >>>> > > > >> platform/linux-dpdk/odp_packet_dpdk.c | >>>> 136 >>>> >>>> > > > >> +++++++++++++------------- >>>> >>>> > > > >> platform/linux-dpdk/odp_packet_io.c | 2 >>>> + >>>> >>>> > > > >> 4 files changed, 94 insertions(+), 72 >>>> deletions(-) >>>> >>>> > > > >> >>>> >>>> > > > >> diff --git >>>> a/platform/linux-dpdk/include/odp_packet_dpdk.h >>>> >>>> > > > >> b/platform/linux-dpdk/include/odp_packet_dpdk.h >>>> >>>> > > > >> index bcbe9e8..bcf9aa5 100644 >>>> >>>> > > > >> --- a/platform/linux-dpdk/include/ >>>> odp_packet_dpdk.h >>>> >>>> > > > >> +++ b/platform/linux-dpdk/include/ >>>> odp_packet_dpdk.h >>>> >>>> > > > >> @@ -50,6 +50,30 @@ >>>> >>>> > > > >> #define DPDK_BLOCKING_IO >>>> >>>> > > > >> +/* >>>> >>>> > > > >> + * RX and TX Prefetch, Host, and Write-back >>>> threshold >>>> >>>> > > values >>>> >>>> > > should be >>>> >>>> > > > >> + * carefully set for optimal performance. >>>> Consult the >>>> >>>> > > network >>>> >>>> > > > >> + * controller's datasheet and supporting DPDK >>>> documentation >>>> >>>> > > for guidance >>>> >>>> > > > >> + * on how these parameters should be set. >>>> >>>> > > > >> + */ >>>> >>>> > > > >> +#define RX_PTHRESH 8 /**< Default values of RX >>>> prefetch >>>> >>>> > > threshold reg. */ >>>> >>>> > > > >> +#define RX_HTHRESH 8 /**< Default values of RX >>>> host >>>> >>>> > > threshold reg. */ >>>> >>>> > > > >> +#define RX_WTHRESH 4 /**< Default values of RX >>>> write-back >>>> >>>> > > threshold reg. >>>> >>>> > > > >> */ >>>> >>>> > > > >> + >>>> >>>> > > > >> +/* >>>> >>>> > > > >> + * These default values are optimized for use >>>> with the >>>> >>>> > > Intel(R) 82599 10 >>>> >>>> > > > >> GbE >>>> >>>> > > > >> + * Controller and the DPDK ixgbe PMD. Consider >>>> using other >>>> >>>> > > values for >>>> >>>> > > > >> other >>>> >>>> > > > >> + * network controllers and/or network drivers. >>>> >>>> > > > >> + */ >>>> >>>> > > > >> +#define TX_PTHRESH 36 /**< Default values of TX >>>> prefetch >>>> >>>> > > threshold reg. >>>> >>>> > > > >> */ >>>> >>>> > > > >> +#define TX_HTHRESH 0 /**< Default values of TX >>>> host >>>> >>>> > > threshold reg. */ >>>> >>>> > > > >> +#define TX_WTHRESH 0 /**< Default values of TX >>>> write-back >>>> >>>> > > threshold >>>> >>>> > > > >> reg. */ >>>> >>>> > > > >> + >>>> >>>> > > > >> +#define MAX_PKT_BURST 16 >>>> >>>> > > > >> +#define BURST_TX_DRAIN_US 100 /* TX drain every >>>> ~100us */ >>>> >>>> > > > >> +#define RTE_TEST_RX_DESC_DEFAULT 128 >>>> >>>> > > > >> +#define RTE_TEST_TX_DESC_DEFAULT 512 >>>> >>>> > > > >> + >>>> >>>> > > > >> /** Packet socket using dpdk mmaped rings for >>>> both Rx and >>>> >>>> > > Tx */ >>>> >>>> > > > >> typedef struct { >>>> >>>> > > > >> odp_buffer_pool_t pool; >>>> >>>> > > > >> diff --git a/platform/linux-dpdk/odp_buffer_pool.c >>>> >>>> > > > >> b/platform/linux-dpdk/odp_buffer_pool.c >>>> >>>> > > > >> index de90275..805ce68 100644 >>>> >>>> > > > >> --- a/platform/linux-dpdk/odp_buffer_pool.c >>>> >>>> > > > >> +++ b/platform/linux-dpdk/odp_buffer_pool.c >>>> >>>> > > > >> @@ -23,7 +23,7 @@ >>>> >>>> > > > >> #include <odp_packet_dpdk.h> >>>> >>>> > > > >> #define MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + >>>> >>>> > > > >> RTE_PKTMBUF_HEADROOM) >>>> >>>> > > > >> -#define NB_MBUF 8192 >>>> >>>> > > > >> +#define NB_MBUF 32768 >>>> >>>> > > > >> #ifdef POOL_USE_TICKETLOCK >>>> >>>> > > > >> #include <odp_ticketlock.h> >>>> >>>> > > > >> @@ -112,7 +112,7 @@ odp_buffer_pool_t >>>> >>>> > > odp_buffer_pool_create(const char >>>> >>>> > > > >> *name, >>>> >>>> > > > >> pktmbuf_pool = >>>> >>>> > > > >> rte_mempool_create(name, NB_MBUF, >>>> >>>> > > > >> - MBUF_SIZE, 32, >>>> >>>> > > > >> + MBUF_SIZE, MAX_PKT_BURST, >>>> >>>> > > > >> sizeof(struct >>>> >>>> > > > >> rte_pktmbuf_pool_private), >>>> >>>> > > > >> rte_pktmbuf_pool_init, NULL, >>>> >>>> > > > >> rte_pktmbuf_init, NULL, >>>> >>>> > > > >> diff --git a/platform/linux-dpdk/odp_packet_dpdk.c >>>> >>>> > > > >> b/platform/linux-dpdk/odp_packet_dpdk.c >>>> >>>> > > > >> index 31bfa30..d5c8e80 100644 >>>> >>>> > > > >> --- a/platform/linux-dpdk/odp_packet_dpdk.c >>>> >>>> > > > >> +++ b/platform/linux-dpdk/odp_packet_dpdk.c >>>> >>>> > > > >> @@ -26,34 +26,13 @@ >>>> >>>> > > > >> #include <odp_packet_dpdk.h> >>>> >>>> > > > >> #include <net/if.h> >>>> >>>> > > > >> -/* >>>> >>>> > > > >> - * RX and TX Prefetch, Host, and Write-back >>>> threshold >>>> >>>> > > values >>>> >>>> > > should be >>>> >>>> > > > >> - * carefully set for optimal performance. >>>> Consult the >>>> >>>> > > network >>>> >>>> > > > >> - * controller's datasheet and supporting DPDK >>>> documentation >>>> >>>> > > for guidance >>>> >>>> > > > >> - * on how these parameters should be set. >>>> >>>> > > > >> - */ >>>> >>>> > > > >> -#define RX_PTHRESH 8 /**< Default values of RX >>>> prefetch >>>> >>>> > > threshold reg. */ >>>> >>>> > > > >> -#define RX_HTHRESH 8 /**< Default values of RX >>>> host >>>> >>>> > > threshold reg. */ >>>> >>>> > > > >> -#define RX_WTHRESH 4 /**< Default values of RX >>>> write-back >>>> >>>> > > threshold reg. >>>> >>>> > > > >> */ >>>> >>>> > > > >> - >>>> >>>> > > > >> -/* >>>> >>>> > > > >> - * These default values are optimized for use >>>> with the >>>> >>>> > > Intel(R) 82599 10 >>>> >>>> > > > >> GbE >>>> >>>> > > > >> - * Controller and the DPDK ixgbe PMD. Consider >>>> using other >>>> >>>> > > values for >>>> >>>> > > > >> other >>>> >>>> > > > >> - * network controllers and/or network drivers. >>>> >>>> > > > >> - */ >>>> >>>> > > > >> -#define TX_PTHRESH 36 /**< Default values of TX >>>> prefetch >>>> >>>> > > threshold reg. >>>> >>>> > > > >> */ >>>> >>>> > > > >> -#define TX_HTHRESH 0 /**< Default values of TX >>>> host >>>> >>>> > > threshold reg. */ >>>> >>>> > > > >> -#define TX_WTHRESH 0 /**< Default values of TX >>>> write-back >>>> >>>> > > threshold >>>> >>>> > > > >> reg. */ >>>> >>>> > > > >> - >>>> >>>> > > > >> -#define MAX_PKT_BURST 16 >>>> >>>> > > > >> -#define BURST_TX_DRAIN_US 100 /* TX drain every >>>> ~100us */ >>>> >>>> > > > >> -#define RTE_TEST_RX_DESC_DEFAULT 128 >>>> >>>> > > > >> -#define RTE_TEST_TX_DESC_DEFAULT 512 >>>> >>>> > > > >> static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT; >>>> >>>> > > > >> static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT; >>>> >>>> > > > >> static const struct rte_eth_conf port_conf = { >>>> >>>> > > > >> .rxmode = { >>>> >>>> > > > >> + .mq_mode = ETH_MQ_RX_RSS, >>>> >>>> > > > >> + .max_rx_pkt_len = ETHER_MAX_LEN, >>>> >>>> > > > >> .split_hdr_size = 0, >>>> >>>> > > > >> .header_split = 0, /**< Header Split >>>> >>>> > > disabled */ >>>> >>>> > > > >> .hw_ip_checksum = 0, /**< IP checksum >>>> >>>> > > offload >>>> >>>> > > disabled */ >>>> >>>> > > > >> @@ -61,6 +40,12 @@ static const struct rte_eth_conf >>>> >>>> > > port_conf = { >>>> >>>> > > > >> .jumbo_frame = 0, /**< Jumbo Frame >>>> >>>> > > Support >>>> >>>> > > disabled */ >>>> >>>> > > > >> .hw_strip_crc = 0, /**< CRC stripped by >>>> >>>> > > hardware */ >>>> >>>> > > > >> }, >>>> >>>> > > > >> + .rx_adv_conf = { >>>> >>>> > > > >> + .rss_conf = { >>>> >>>> > > > >> + .rss_key = NULL, >>>> >>>> > > > >> + .rss_hf = ETH_RSS_IPV4 | >>>> >>>> > > ETH_RSS_IPV6, >>>> >>>> > > > >> + }, >>>> >>>> > > > >> + }, >>>> >>>> > > > >> .txmode = { >>>> >>>> > > > >> .mq_mode = ETH_MQ_TX_NONE, >>>> >>>> > > > >> }, >>>> >>>> > > > >> @@ -95,60 +80,71 @@ int >>>> setup_pkt_dpdk(pkt_dpdk_t * const >>>> >>>> > > pkt_dpdk, const >>>> >>>> > > > >> char *netdev, >>>> >>>> > > > >> ODP_DBG("setup_pkt_dpdk\n"); >>>> >>>> > > > >> static struct ether_addr >>>> eth_addr[RTE_MAX_ETHPORTS]; >>>> >>>> > > > >> - uint8_t portid = 0; >>>> >>>> > > > >> - uint16_t queueid = 0; >>>> >>>> > > > >> - int ret; >>>> >>>> > > > >> + static int portinit[RTE_MAX_ETHPORTS]; >>>> >>>> > > > >> + static int qid[RTE_MAX_ETHPORTS]; >>>> >>>> > > > >> + uint8_t portid = 0, num_intf = 2; >>>> >>>> > > > >> + uint16_t nbrxq = 0, nbtxq = 0; >>>> >>>> > > > >> + int ret, i; >>>> >>>> > > > >> + >>>> >>>> > > > >> printf("dpdk netdev: %s\n", netdev); >>>> >>>> > > > >> printf("dpdk pool: %lx\n", pool); >>>> >>>> > > > >> - >>>> >>>> > > > >> portid = atoi(netdev); >>>> >>>> > > > >> pkt_dpdk->portid = portid; >>>> >>>> > > > >> - pkt_dpdk->queueid = queueid; >>>> >>>> > > > >> pkt_dpdk->pool = pool; >>>> >>>> > > > >> printf("dpdk portid: %u\n", portid); >>>> >>>> > > > >> - fflush(stdout); >>>> >>>> > > > >> - ret = rte_eth_dev_configure(portid, 1, 1, >>>> >>>> > > &port_conf); >>>> >>>> > > > >> - if (ret < 0) >>>> >>>> > > > >> - ODP_ERR("Cannot configure device: >>>> err=%d, >>>> >>>> > > port=%u\n", >>>> >>>> > > > >> - ret, (unsigned) portid); >>>> >>>> > > > >> - >>>> >>>> > > > >> - rte_eth_macaddr_get(portid, ð_addr[portid]); >>>> >>>> > > > >> - ODP_DBG("Port %u, MAC address: >>>> >>>> > > %02X:%02X:%02X:%02X:%02X:%02X\ >>>> >>>> > > > >> n\n", >>>> >>>> > > > >> - (unsigned) portid, >>>> >>>> > > > >> - eth_addr[portid].addr_bytes[0], >>>> >>>> > > > >> - eth_addr[portid].addr_bytes[1], >>>> >>>> > > > >> - eth_addr[portid].addr_bytes[2], >>>> >>>> > > > >> - eth_addr[portid].addr_bytes[3], >>>> >>>> > > > >> - eth_addr[portid].addr_bytes[4], >>>> >>>> > > > >> - eth_addr[portid].addr_bytes[5]); >>>> >>>> > > > >> - >>>> >>>> > > > >> - /* init one RX queue on each port */ >>>> >>>> > > > >> - fflush(stdout); >>>> >>>> > > > >> - ret = rte_eth_rx_queue_setup(portid, queueid, >>>> >>>> > > nb_rxd, >>>> >>>> > > > >> - rte_eth_dev_socket_id(portid), >>>> >>>> > > > >> &rx_conf, >>>> >>>> > > > >> - (struct rte_mempool *)pool); >>>> >>>> > > > >> - if (ret < 0) >>>> >>>> > > > >> - ODP_ERR("rte_eth_rx_queue_setup:err=%d, >>>> port=%u\n", >>>> >>>> > > > >> - ret, (unsigned) portid); >>>> >>>> > > > >> - ODP_DBG("dpdk rx queue setup done\n"); >>>> >>>> > > > >> - >>>> >>>> > > > >> - /* init one TX queue on each port */ >>>> >>>> > > > >> - fflush(stdout); >>>> >>>> > > > >> - ret = rte_eth_tx_queue_setup(portid, queueid, >>>> >>>> > > nb_txd, >>>> >>>> > > > >> - rte_eth_dev_socket_id(portid), &tx_conf); >>>> >>>> > > > >> - if (ret < 0) >>>> >>>> > > > >> - ODP_ERR("rte_eth_tx_queue_setup:err=%d, >>>> port=%u\n", >>>> >>>> > > > >> - ret, (unsigned) portid); >>>> >>>> > > > >> - ODP_DBG("dpdk tx queue setup done\n"); >>>> >>>> > > > >> - >>>> >>>> > > > >> - /* Start device */ >>>> >>>> > > > >> - ret = rte_eth_dev_start(portid); >>>> >>>> > > > >> - if (ret < 0) >>>> >>>> > > > >> - ODP_ERR("rte_eth_dev_start:err=%d, port=%u\n", >>>> >>>> > > > >> - ret, (unsigned) portid); >>>> >>>> > > > >> - ODP_DBG("dpdk setup done\n\n"); >>>> >>>> > > > >> - >>>> >>>> > > > >> + nbrxq = odp_sys_core_count() / num_intf; >>>> >>>> > > > >> + nbtxq = nbrxq; >>>> >>>> > > > >> + if (portinit[portid] == 0) { >>>> >>>> > > > >> + fflush(stdout); >>>> >>>> > > > >> + ret = rte_eth_dev_configure(portid, >>>> nbrxq, >>>> >>>> > > nbtxq, >>>> >>>> > > > >> &port_conf); >>>> >>>> > > > >> + if (ret < 0) >>>> >>>> > > > >> + ODP_ERR("Cannot configure >>>> device: >>>> >>>> > > err=%d, >>>> >>>> > > > >> port=%u\n", >>>> >>>> > > > >> + ret, (unsigned) >>>> portid); >>>> >>>> > > > >> + >>>> >>>> > > > >> + rte_eth_macaddr_get(portid, ð_addr[portid]); >>>> >>>> > > > >> + ODP_DBG("Port %u, MAC address: >>>> >>>> > > > >> %02X:%02X:%02X:%02X:%02X:%02X\n", >>>> >>>> > > > >> + (unsigned) portid, >>>> >>>> > > > >> + eth_addr[portid].addr_bytes[0], >>>> >>>> > > > >> + eth_addr[portid].addr_bytes[1], >>>> >>>> > > > >> + eth_addr[portid].addr_bytes[2], >>>> >>>> > > > >> + eth_addr[portid].addr_bytes[3], >>>> >>>> > > > >> + eth_addr[portid].addr_bytes[4], >>>> >>>> > > > >> + eth_addr[portid].addr_bytes[5]); >>>> >>>> > > > >> + >>>> >>>> > > > >> + /* init one RX queue on each port */ >>>> >>>> > > > >> + fflush(stdout); >>>> >>>> > > > >> + for (i = 0; i < nbrxq; i++) { >>>> >>>> > > > >> + ret = >>>> rte_eth_rx_queue_setup(portid, >>>> >>>> > > i, nb_rxd, >>>> >>>> > > > >> + rte_eth_dev_socket_id(portid), >>>> >>>> > > > >> &rx_conf, >>>> >>>> > > > >> + (struct rte_mempool *)pool); >>>> >>>> > > > >> + if (ret < 0) >>>> >>>> > > > >> + ODP_ERR("%s rxq:err=%d, port=%u\n", >>>> >>>> > > > >> + __func__, ret, (unsigned) portid); >>>> >>>> > > > >> + ODP_DBG("dpdk rx queue setup >>>> >>>> > > done\n"); >>>> >>>> > > > >> + } >>>> >>>> > > > >> + >>>> >>>> > > > >> + /* init one TX queue on each port */ >>>> >>>> > > > >> + fflush(stdout); >>>> >>>> > > > >> + for (i = 0; i < nbtxq; i++) { >>>> >>>> > > > >> + ret = >>>> rte_eth_tx_queue_setup(portid, >>>> >>>> > > i, nb_txd, >>>> >>>> > > > >> + rte_eth_dev_socket_id(portid), &tx_conf); >>>> >>>> > > > >> + if (ret < 0) >>>> >>>> > > > >> + ODP_ERR("%s txq:err=%d, port=%u\n", >>>> >>>> > > > >> + __func__, ret, (unsigned) portid); >>>> >>>> > > > >> + ODP_DBG("dpdk tx queue setup >>>> >>>> > > done\n"); >>>> >>>> > > > >> + } >>>> >>>> > > > >> + >>>> >>>> > > > >> + /* Start device */ >>>> >>>> > > > >> + ret = rte_eth_dev_start(portid); >>>> >>>> > > > >> + if (ret < 0) >>>> >>>> > > > >> + ODP_ERR("rte_eth_dev_start:err=%d, port=%u\n", >>>> >>>> > > > >> + ret, (unsigned) >>>> portid); >>>> >>>> > > > >> + ODP_DBG("dpdk setup done\n\n"); >>>> >>>> > > > >> + >>>> >>>> > > > >> + portinit[portid] = 1; >>>> >>>> > > > >> + } >>>> >>>> > > > >> + pkt_dpdk->queueid = qid[portid]++; >>>> >>>> > > > >> return 0; >>>> >>>> > > > >> } >>>> >>>> > > > >> diff --git a/platform/linux-dpdk/odp_packet_io.c >>>> >>>> > > > >> b/platform/linux-dpdk/odp_packet_io.c >>>> >>>> > > > >> index d8d127f..3124175 100644 >>>> >>>> > > > >> --- a/platform/linux-dpdk/odp_packet_io.c >>>> >>>> > > > >> +++ b/platform/linux-dpdk/odp_packet_io.c >>>> >>>> > > > >> @@ -230,6 +230,8 @@ int >>>> odp_pktio_recv(odp_pktio_t id, >>>> >>>> > > odp_packet_t >>>> >>>> > > > >> pkt_table[], unsigned len) >>>> >>>> > > > >> if (pktio_entry == NULL) >>>> >>>> > > > >> return -1; >>>> >>>> > > > >> + odp_pktio_send(id, pkt_table, 0); >>>> >>>> > > > >> + >>>> >>>> > > > >> lock_entry(pktio_entry); >>>> >>>> > > > >> pkts = recv_pkt_dpdk(&pktio_entry->s.pkt_dpdk, >>>> >>>> > > pkt_table, len); >>>> >>>> > > > >> unlock_entry(pktio_entry); >>>> >>>> > > > >> >>>> >>>> > > > > >>>> >>>> > > > > >>>> >>>> > > > > _______________________________________________ >>>> >>>> > > > > lng-odp mailing list >>>> >>>> > > > > lng-odp@lists.linaro.org >>>> <mailto:lng-odp@lists.linaro.org> >>>> <mailto:lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>> >>>> >>>> > > > > http://lists.linaro.org/mailman/listinfo/lng-odp >>>> <http://lists.linaro.org/mailman/listinfo/lng-odp> >>>> >>>> > > > > >>>> >>>> > > > >>>> >>>> > > > >>>> >>>> > > > >>>> >>>> > > > -- >>>> >>>> > > > *Mike Holmes* >>>> >>>> > > > Linaro Technical Manager / Lead >>>> >>>> > > > LNG - ODP >>>> >>>> > > >>>> >>>> > > > _______________________________________________ >>>> >>>> > > > lng-odp mailing list >>>> >>>> > > > lng-odp@lists.linaro.org >>>> <mailto:lng-odp@lists.linaro.org> >>>> <mailto:lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>> >>>> >>>> > > > http://lists.linaro.org/mailman/listinfo/lng-odp >>>> <http://lists.linaro.org/mailman/listinfo/lng-odp> >>>> >>>> > > >>>> >>>> > > >>>> >>>> > > -- >>>> >>>> > > Anders Roxell >>>> >>>> > > anders.roxell@linaro.org >>>> <mailto:anders.roxell@linaro.org> >>>> <mailto:anders.roxell@linaro.org <mailto:anders.roxell@linaro.org>> >>>> >>>> > > M: +46 709 71 42 85 <tel:%2B46%20709%2071%2042%2085> >>>> | IRC: roxell >>>> >>>> > > >>>> >>>> > > _______________________________________________ >>>> >>>> > > lng-odp mailing list >>>> >>>> > > lng-odp@lists.linaro.org >>>> <mailto:lng-odp@lists.linaro.org> >>>> <mailto:lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>> >>>> >>>> > > http://lists.linaro.org/mailman/listinfo/lng-odp >>>> >>>> > > >>>> >>>> > > >>>> >>>> > > >>>> >>>> > > >>>> >>>> > >_______________________________________________ >>>> >>>> > >lng-odp mailing list >>>> >>>> > >lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org> >>>> >>>> > >http://lists.linaro.org/mailman/listinfo/lng-odp >>>> >>>> > >>>> >>>> > >>>> >>>> > _______________________________________________ >>>> >>>> > lng-odp mailing list >>>> >>>> > lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org> >>>> >>>> > http://lists.linaro.org/mailman/listinfo/lng-odp >>>> <http://lists.linaro.org/mailman/listinfo/lng-odp> >>>> >>>> >>>> >>>> -- >>>> >>>> Anders Roxell >>>> >>>> anders.roxell@linaro.org <mailto:anders.roxell@linaro.org> >>>> >>>> M: +46 709 71 42 85 <tel:%2B46%20709%2071%2042%2085> | IRC: >>>> roxell >>>> >>>> >>>> >>>> _______________________________________________ >>>> >>>> lng-odp mailing list >>>> >>>> lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org> >>>> >>>> http://lists.linaro.org/mailman/listinfo/lng-odp >>>> >>> >>>> >>> >>>> >>> >>>> >>> >>>> >>> -- >>>> >>> Mike Holmes >>>> >>> Linaro Technical Manager / Lead >>>> >>> LNG - ODP >>>> >>> >>>> >>> _______________________________________________ >>>> >>> lng-odp mailing list >>>> >>> lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org> >>>> >>> http://lists.linaro.org/mailman/listinfo/lng-odp >>>> >>> >>>> >> >>>> > >>>> > >>>> > >>>> > -- >>>> > Mike Holmes >>>> > Linaro Technical Manager / Lead >>>> > LNG - ODP >>>> > >>>> > _______________________________________________ >>>> > lng-odp mailing list >>>> > lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org> >>>> > http://lists.linaro.org/mailman/listinfo/lng-odp >>>> > >>>> >>>> >>>> >>>> >>>> -- >>>> *Mike Holmes* >>>> Linaro Technical Manager / Lead >>>> LNG - ODP >>>> >>> >>> >>> >>> _______________________________________________ >>> lng-odp mailing list >>> lng-odp@lists.linaro.org >>> http://lists.linaro.org/mailman/listinfo/lng-odp >>> >> >> > > _______________________________________________ > lng-odp mailing list > lng-odp@lists.linaro.org > http://lists.linaro.org/mailman/listinfo/lng-odp >
On 08/12/2014 09:46 AM, Venkatesh Vivekanandan wrote: > > > > On 12 August 2014 00:25, Mike Holmes <mike.holmes@linaro.org > <mailto:mike.holmes@linaro.org>> wrote: > > Which test case in odp/test would check this, or does it need an > application like l2fwd to be run - are either in LAVA/CI ? > > > l2fwd should be run on a machine which has more than 2 cpus(I tested > with 16 cpu machine). From Ixia, one had to generate different pkts > for different queues which is eventually different cpu handling it. I > am not sure how this will be achieved with odp_generator or pktgen. Venky do use udp packets? What should be difference in packets itself? odp_generator creates udp packet from stretch. It's not hard to modify it to send something needed. I guess that dpdk does some flow hashing and load balance udp packets due to dest ports? Maxim. > > Santosh are you able to verify this does not break anything as > part of the l2fwd work you are doing ? > > Mike > > > On 11 August 2014 01:43, Venkatesh Vivekanandan > <venkatesh.vivekanandan@linaro.org > <mailto:venkatesh.vivekanandan@linaro.org>> wrote: > > > > > On 9 August 2014 17:32, Mike Holmes <mike.holmes@linaro.org > <mailto:mike.holmes@linaro.org>> wrote: > > > > > On 8 August 2014 17:46, Anders Roxell > <anders.roxell@linaro.org > <mailto:anders.roxell@linaro.org>> wrote: > > On 2014-08-08 17:31, Maxim Uvarov wrote: > > On 08/08/2014 05:13 PM, Venkatesh Vivekanandan wrote: > > > > > > > > > > > >On 7 August 2014 21:10, Anders Roxell > <anders.roxell@linaro.org > <mailto:anders.roxell@linaro.org> > > ><mailto:anders.roxell@linaro.org > <mailto:anders.roxell@linaro.org>>> wrote: > > > > > > On 2014-08-07 10:41, Mike Holmes wrote: > > > > Does this need a signoff by someone else > before it is merged ? > > > > > > > > I think we want to enforce getting an ack, > tested-by or > > > reviewed-by before > > > > we merge things, we have informally moved > that way over the last > > > couple of > > > > weeks and now I think it is time we made it a > formal requirement. > > > > > > Agree. > > > > > > > > >If this is the case, then is it fair to say initial > discussion of > > >24-hour window is void?. I guess Maxim was waiting > for 2 days(for > > >any comments) before he could merge this patch. Do > we have any > > >time-limit before which a patch /must /be reviewed > or tested? I > > >hope we can't wait indefinitely or is this the case?. > > > > I think if patch came from platfrom maintainer, it's > not new API. No > > comments in 1 or 2 days, than it's ok to merge it. > If patch came > > from somobody alse I would ask maintainer to review it. > > I disagree with this. > No matter where the patch comes from and who wrote the > patch, it can be > wrong and need a second pair of eyes i.e., > (Reviewed|Acked|Signed-off)-by. > If no one has replied to a patch after 2 days, the > author of the patch > should ping the list and maintainer. > > After the second pair of eyes, the patch should be ok > to be merged. > The ODP maintainer should do a smoke build test on all > the supported > platforms before merging though. > > > My 2 cents > We have started to develop a cohesive API, I think that is > down to a lot of folks working together. > I also think that peer review/team work is reflected in > the increasing willingness to review each others patches > which has improved quality > and helped establish the guidelines on how things bolt > together in ODP, may long discussions have spawned from > patches. > > No one is beyond silly mistakes, peer review finds a lot > of the dumb stuff for little cost, saving on the > inevitable ugly patch up that will ensue otherwise. > Maxim you could do the default reviews if no one came > forward, but if a submitter finds and establishes their > own network of reviewers that is one extra pair of eyes > and ideas. > > > Can someone please review this patch?. If there is any > comments, we can request maxim to revert the patch, otherwise > he can add the "Reviewed-by/Tested-by" to the applied patch. > > > Cheers, > Anders > > > > > Maxim. > > > > > Anders > > > > > > > > > > > Mike > > > > > > > > > > > > On 7 August 2014 09:15, Maxim Uvarov > <maxim.uvarov@linaro.org <mailto:maxim.uvarov@linaro.org> > > > <mailto:maxim.uvarov@linaro.org > <mailto:maxim.uvarov@linaro.org>>> wrote: > > > > > > > > > Merged, thanks! > > > > > > > > > > Maxim. > > > > > > > > > > > > > > > On 08/05/2014 06:54 PM, > venkatesh.vivekanandan@linaro.org > <mailto:venkatesh.vivekanandan@linaro.org> > > > <mailto:venkatesh.vivekanandan@linaro.org > <mailto:venkatesh.vivekanandan@linaro.org>> wrote: > > > > > > > > > >> From: Venkatesh Vivekanandan > > > <venkatesh.vivekanandan@linaro.org > <mailto:venkatesh.vivekanandan@linaro.org> > > > <mailto:venkatesh.vivekanandan@linaro.org > <mailto:venkatesh.vivekanandan@linaro.org>>> > > > > >> > > > > >> - Multi queue support per interface is > enabled. > > > > >> - odp_pktio_send with "0" packet is called > in odp_pktio_recv to > > > > >> give the transmitted buffers back to > mempool. > > > > >> - mbuf alloc failure during receive is > fixed by giving more > > > buffers to > > > > >> mempool. > > > > >> - mempool cache size is given equivalent > to MAX_PKT_BURST. > > > > >> > > > > >> Signed-off-by: Venkatesh Vivekanandan > > > <venkatesh.vivekanandan@linaro.org > <mailto:venkatesh.vivekanandan@linaro.org> > > > <mailto:venkatesh.vivekanandan@linaro.org > <mailto:venkatesh.vivekanandan@linaro.org>>> > > > > >> --- > > > > >> > platform/linux-dpdk/include/odp_packet_dpdk.h | 24 +++++ > > > > >> platform/linux-dpdk/odp_buffer_pool.c > | 4 +- > > > > >> platform/linux-dpdk/odp_packet_dpdk.c > | 136 > > > > >> +++++++++++++------------- > > > > >> platform/linux-dpdk/odp_packet_io.c > | 2 + > > > > >> 4 files changed, 94 insertions(+), 72 > deletions(-) > > > > >> > > > > >> diff --git > a/platform/linux-dpdk/include/odp_packet_dpdk.h > > > > >> > b/platform/linux-dpdk/include/odp_packet_dpdk.h > > > > >> index bcbe9e8..bcf9aa5 100644 > > > > >> --- > a/platform/linux-dpdk/include/odp_packet_dpdk.h > > > > >> +++ > b/platform/linux-dpdk/include/odp_packet_dpdk.h > > > > >> @@ -50,6 +50,30 @@ > > > > >> #define DPDK_BLOCKING_IO > > > > >> +/* > > > > >> + * RX and TX Prefetch, Host, and > Write-back threshold values > > > should be > > > > >> + * carefully set for optimal performance. > Consult the network > > > > >> + * controller's datasheet and supporting > DPDK documentation > > > for guidance > > > > >> + * on how these parameters should be set. > > > > >> + */ > > > > >> +#define RX_PTHRESH 8 /**< Default values > of RX prefetch > > > threshold reg. */ > > > > >> +#define RX_HTHRESH 8 /**< Default values > of RX host > > > threshold reg. */ > > > > >> +#define RX_WTHRESH 4 /**< Default values > of RX write-back > > > threshold reg. > > > > >> */ > > > > >> + > > > > >> +/* > > > > >> + * These default values are optimized for > use with the > > > Intel(R) 82599 10 > > > > >> GbE > > > > >> + * Controller and the DPDK ixgbe PMD. > Consider using other > > > values for > > > > >> other > > > > >> + * network controllers and/or network > drivers. > > > > >> + */ > > > > >> +#define TX_PTHRESH 36 /**< Default values > of TX prefetch > > > threshold reg. > > > > >> */ > > > > >> +#define TX_HTHRESH 0 /**< Default values > of TX host > > > threshold reg. */ > > > > >> +#define TX_WTHRESH 0 /**< Default values > of TX write-back > > > threshold > > > > >> reg. */ > > > > >> + > > > > >> +#define MAX_PKT_BURST 16 > > > > >> +#define BURST_TX_DRAIN_US 100 /* TX drain > every ~100us */ > > > > >> +#define RTE_TEST_RX_DESC_DEFAULT 128 > > > > >> +#define RTE_TEST_TX_DESC_DEFAULT 512 > > > > >> + > > > > >> /** Packet socket using dpdk mmaped > rings for both Rx and Tx */ > > > > >> typedef struct { > > > > >> odp_buffer_pool_t pool; > > > > >> diff --git > a/platform/linux-dpdk/odp_buffer_pool.c > > > > >> b/platform/linux-dpdk/odp_buffer_pool.c > > > > >> index de90275..805ce68 100644 > > > > >> --- a/platform/linux-dpdk/odp_buffer_pool.c > > > > >> +++ b/platform/linux-dpdk/odp_buffer_pool.c > > > > >> @@ -23,7 +23,7 @@ > > > > >> #include <odp_packet_dpdk.h> > > > > >> #define MBUF_SIZE (2048 + > sizeof(struct rte_mbuf) + > > > > >> RTE_PKTMBUF_HEADROOM) > > > > >> -#define NB_MBUF 8192 > > > > >> +#define NB_MBUF 32768 > > > > >> #ifdef POOL_USE_TICKETLOCK > > > > >> #include <odp_ticketlock.h> > > > > >> @@ -112,7 +112,7 @@ odp_buffer_pool_t > > > odp_buffer_pool_create(const char > > > > >> *name, > > > > >> pktmbuf_pool = > > > > >> rte_mempool_create(name, NB_MBUF, > > > > >> - MBUF_SIZE, 32, > > > > >> + MBUF_SIZE, MAX_PKT_BURST, > > > > >> sizeof(struct > > > > >> rte_pktmbuf_pool_private), > > > > >> rte_pktmbuf_pool_init, NULL, > > > > >> rte_pktmbuf_init, NULL, > > > > >> diff --git > a/platform/linux-dpdk/odp_packet_dpdk.c > > > > >> b/platform/linux-dpdk/odp_packet_dpdk.c > > > > >> index 31bfa30..d5c8e80 100644 > > > > >> --- a/platform/linux-dpdk/odp_packet_dpdk.c > > > > >> +++ b/platform/linux-dpdk/odp_packet_dpdk.c > > > > >> @@ -26,34 +26,13 @@ > > > > >> #include <odp_packet_dpdk.h> > > > > >> #include <net/if.h> > > > > >> -/* > > > > >> - * RX and TX Prefetch, Host, and > Write-back threshold values > > > should be > > > > >> - * carefully set for optimal performance. > Consult the network > > > > >> - * controller's datasheet and supporting > DPDK documentation > > > for guidance > > > > >> - * on how these parameters should be set. > > > > >> - */ > > > > >> -#define RX_PTHRESH 8 /**< Default values > of RX prefetch > > > threshold reg. */ > > > > >> -#define RX_HTHRESH 8 /**< Default values > of RX host > > > threshold reg. */ > > > > >> -#define RX_WTHRESH 4 /**< Default values > of RX write-back > > > threshold reg. > > > > >> */ > > > > >> - > > > > >> -/* > > > > >> - * These default values are optimized for > use with the > > > Intel(R) 82599 10 > > > > >> GbE > > > > >> - * Controller and the DPDK ixgbe PMD. > Consider using other > > > values for > > > > >> other > > > > >> - * network controllers and/or network > drivers. > > > > >> - */ > > > > >> -#define TX_PTHRESH 36 /**< Default values > of TX prefetch > > > threshold reg. > > > > >> */ > > > > >> -#define TX_HTHRESH 0 /**< Default values > of TX host > > > threshold reg. */ > > > > >> -#define TX_WTHRESH 0 /**< Default values > of TX write-back > > > threshold > > > > >> reg. */ > > > > >> - > > > > >> -#define MAX_PKT_BURST 16 > > > > >> -#define BURST_TX_DRAIN_US 100 /* TX drain > every ~100us */ > > > > >> -#define RTE_TEST_RX_DESC_DEFAULT 128 > > > > >> -#define RTE_TEST_TX_DESC_DEFAULT 512 > > > > >> static uint16_t nb_rxd = > RTE_TEST_RX_DESC_DEFAULT; > > > > >> static uint16_t nb_txd = > RTE_TEST_TX_DESC_DEFAULT; > > > > >> static const struct rte_eth_conf > port_conf = { > > > > >> .rxmode = { > > > > >> + .mq_mode = ETH_MQ_RX_RSS, > > > > >> + .max_rx_pkt_len = ETHER_MAX_LEN, > > > > >> .split_hdr_size = 0, > > > > >> .header_split = 0, /**< Header Split > > > disabled */ > > > > >> .hw_ip_checksum = 0, /**< IP checksum > offload > > > disabled */ > > > > >> @@ -61,6 +40,12 @@ static const struct > rte_eth_conf port_conf = { > > > > >> .jumbo_frame = 0, /**< Jumbo Frame > Support > > > disabled */ > > > > >> .hw_strip_crc = 0, /**< CRC stripped by > > > hardware */ > > > > >> }, > > > > >> + .rx_adv_conf = { > > > > >> + .rss_conf = { > > > > >> + .rss_key = NULL, > > > > >> + .rss_hf = ETH_RSS_IPV4 | > ETH_RSS_IPV6, > > > > >> + }, > > > > >> + }, > > > > >> .txmode = { > > > > >> .mq_mode = ETH_MQ_TX_NONE, > > > > >> }, > > > > >> @@ -95,60 +80,71 @@ int > setup_pkt_dpdk(pkt_dpdk_t * const > > > pkt_dpdk, const > > > > >> char *netdev, > > > > >> ODP_DBG("setup_pkt_dpdk\n"); > > > > >> static struct ether_addr > eth_addr[RTE_MAX_ETHPORTS]; > > > > >> - uint8_t portid = 0; > > > > >> - uint16_t queueid = 0; > > > > >> - int ret; > > > > >> + static int portinit[RTE_MAX_ETHPORTS]; > > > > >> + static int qid[RTE_MAX_ETHPORTS]; > > > > >> + uint8_t portid = 0, num_intf = 2; > > > > >> + uint16_t nbrxq = 0, nbtxq = 0; > > > > >> + int ret, i; > > > > >> + > > > > >> printf("dpdk netdev: %s\n", netdev); > > > > >> printf("dpdk pool: %lx\n", pool); > > > > >> - > > > > >> portid = atoi(netdev); > > > > >> pkt_dpdk->portid = portid; > > > > >> - pkt_dpdk->queueid = queueid; > > > > >> pkt_dpdk->pool = pool; > > > > >> printf("dpdk portid: %u\n", portid); > > > > >> - fflush(stdout); > > > > >> - ret = > rte_eth_dev_configure(portid, 1, 1, &port_conf); > > > > >> - if (ret < 0) > > > > >> - ODP_ERR("Cannot configure device: > err=%d, > > > port=%u\n", > > > > >> - ret, (unsigned) portid); > > > > >> - > > > > >> - rte_eth_macaddr_get(portid, > ð_addr[portid]); > > > > >> - ODP_DBG("Port %u, MAC address: > > > %02X:%02X:%02X:%02X:%02X:%02X\ > > > > >> n\n", > > > > >> - (unsigned) portid, > > > > >> - eth_addr[portid].addr_bytes[0], > > > > >> - eth_addr[portid].addr_bytes[1], > > > > >> - eth_addr[portid].addr_bytes[2], > > > > >> - eth_addr[portid].addr_bytes[3], > > > > >> - eth_addr[portid].addr_bytes[4], > > > > >> - eth_addr[portid].addr_bytes[5]); > > > > >> - > > > > >> - /* init one RX queue on each port */ > > > > >> - fflush(stdout); > > > > >> - ret = > rte_eth_rx_queue_setup(portid, queueid, nb_rxd, > > > > >> - rte_eth_dev_socket_id(portid), > > > > >> &rx_conf, > > > > >> - (struct rte_mempool *)pool); > > > > >> - if (ret < 0) > > > > >> - ODP_ERR("rte_eth_rx_queue_setup:err=%d, > port=%u\n", > > > > >> - ret, (unsigned) portid); > > > > >> - ODP_DBG("dpdk rx queue setup done\n"); > > > > >> - > > > > >> - /* init one TX queue on each port */ > > > > >> - fflush(stdout); > > > > >> - ret = > rte_eth_tx_queue_setup(portid, queueid, nb_txd, > > > > >> - rte_eth_dev_socket_id(portid), &tx_conf); > > > > >> - if (ret < 0) > > > > >> - ODP_ERR("rte_eth_tx_queue_setup:err=%d, > port=%u\n", > > > > >> - ret, (unsigned) portid); > > > > >> - ODP_DBG("dpdk tx queue setup done\n"); > > > > >> - > > > > >> - /* Start device */ > > > > >> - ret = rte_eth_dev_start(portid); > > > > >> - if (ret < 0) > > > > >> - ODP_ERR("rte_eth_dev_start:err=%d, > port=%u\n", > > > > >> - ret, (unsigned) portid); > > > > >> - ODP_DBG("dpdk setup done\n\n"); > > > > >> - > > > > >> + nbrxq = odp_sys_core_count() / num_intf; > > > > >> + nbtxq = nbrxq; > > > > >> + if (portinit[portid] == 0) { > > > > >> + fflush(stdout); > > > > >> + ret = rte_eth_dev_configure(portid, > nbrxq, nbtxq, > > > > >> &port_conf); > > > > >> + if (ret < 0) > > > > >> + ODP_ERR("Cannot configure device: err=%d, > > > > >> port=%u\n", > > > > >> + ret, (unsigned) portid); > > > > >> + > > > > >> + rte_eth_macaddr_get(portid, > ð_addr[portid]); > > > > >> + ODP_DBG("Port %u, MAC address: > > > > >> %02X:%02X:%02X:%02X:%02X:%02X\n", > > > > >> + (unsigned) portid, > > > > >> + eth_addr[portid].addr_bytes[0], > > > > >> + eth_addr[portid].addr_bytes[1], > > > > >> + eth_addr[portid].addr_bytes[2], > > > > >> + eth_addr[portid].addr_bytes[3], > > > > >> + eth_addr[portid].addr_bytes[4], > > > > >> + eth_addr[portid].addr_bytes[5]); > > > > >> + > > > > >> + /* init one RX queue on each port */ > > > > >> + fflush(stdout); > > > > >> + for (i = 0; i < nbrxq; i++) { > > > > >> + ret = > rte_eth_rx_queue_setup(portid, > > > i, nb_rxd, > > > > >> + rte_eth_dev_socket_id(portid), > > > > >> &rx_conf, > > > > >> + (struct rte_mempool *)pool); > > > > >> + if (ret < 0) > > > > >> + ODP_ERR("%s rxq:err=%d, port=%u\n", > > > > >> + __func__, ret, (unsigned) portid); > > > > >> + ODP_DBG("dpdk rx queue setup done\n"); > > > > >> + } > > > > >> + > > > > >> + /* init one TX queue on each port */ > > > > >> + fflush(stdout); > > > > >> + for (i = 0; i < nbtxq; i++) { > > > > >> + ret = > rte_eth_tx_queue_setup(portid, > > > i, nb_txd, > > > > >> + rte_eth_dev_socket_id(portid), &tx_conf); > > > > >> + if (ret < 0) > > > > >> + ODP_ERR("%s txq:err=%d, port=%u\n", > > > > >> + __func__, ret, (unsigned) portid); > > > > >> + ODP_DBG("dpdk tx queue setup done\n"); > > > > >> + } > > > > >> + > > > > >> + /* Start device */ > > > > >> + ret = rte_eth_dev_start(portid); > > > > >> + if (ret < 0) > > > > >> + ODP_ERR("rte_eth_dev_start:err=%d, > port=%u\n", > > > > >> + ret, (unsigned) portid); > > > > >> + ODP_DBG("dpdk setup done\n\n"); > > > > >> + > > > > >> + portinit[portid] = 1; > > > > >> + } > > > > >> + pkt_dpdk->queueid = qid[portid]++; > > > > >> return 0; > > > > >> } > > > > >> diff --git > a/platform/linux-dpdk/odp_packet_io.c > > > > >> b/platform/linux-dpdk/odp_packet_io.c > > > > >> index d8d127f..3124175 100644 > > > > >> --- a/platform/linux-dpdk/odp_packet_io.c > > > > >> +++ b/platform/linux-dpdk/odp_packet_io.c > > > > >> @@ -230,6 +230,8 @@ int > odp_pktio_recv(odp_pktio_t id, > > > odp_packet_t > > > > >> pkt_table[], unsigned len) > > > > >> if (pktio_entry == NULL) > > > > >> return -1; > > > > >> + odp_pktio_send(id, pkt_table, 0); > > > > >> + > > > > >> lock_entry(pktio_entry); > > > > >> pkts = recv_pkt_dpdk(&pktio_entry->s.pkt_dpdk, > > > pkt_table, len); > > > > >> unlock_entry(pktio_entry); > > > > >> > > > > > > > > > > > > > > > _______________________________________________ > > > > > lng-odp mailing list > > > > > lng-odp@lists.linaro.org > <mailto:lng-odp@lists.linaro.org> > <mailto:lng-odp@lists.linaro.org > <mailto:lng-odp@lists.linaro.org>> > > > > > > http://lists.linaro.org/mailman/listinfo/lng-odp > > > > > > > > > > > > > > > > > > > > > -- > > > > *Mike Holmes* > > > > Linaro Technical Manager / Lead > > > > LNG - ODP > > > > > > > _______________________________________________ > > > > lng-odp mailing list > > > > lng-odp@lists.linaro.org > <mailto:lng-odp@lists.linaro.org> > <mailto:lng-odp@lists.linaro.org > <mailto:lng-odp@lists.linaro.org>> > > > > http://lists.linaro.org/mailman/listinfo/lng-odp > > > > > > > > > -- > > > Anders Roxell > > > anders.roxell@linaro.org > <mailto:anders.roxell@linaro.org> > <mailto:anders.roxell@linaro.org > <mailto:anders.roxell@linaro.org>> > > > M: +46 709 71 42 85 > <tel:%2B46%20709%2071%2042%2085> | IRC: roxell > > > > > > _______________________________________________ > > > lng-odp mailing list > > > lng-odp@lists.linaro.org > <mailto:lng-odp@lists.linaro.org> > <mailto:lng-odp@lists.linaro.org > <mailto:lng-odp@lists.linaro.org>> > > > http://lists.linaro.org/mailman/listinfo/lng-odp > > > > > > > > > > > > > > >_______________________________________________ > > >lng-odp mailing list > > >lng-odp@lists.linaro.org > <mailto:lng-odp@lists.linaro.org> > > >http://lists.linaro.org/mailman/listinfo/lng-odp > > > > > > _______________________________________________ > > lng-odp mailing list > > lng-odp@lists.linaro.org > <mailto:lng-odp@lists.linaro.org> > > http://lists.linaro.org/mailman/listinfo/lng-odp > > -- > Anders Roxell > anders.roxell@linaro.org <mailto:anders.roxell@linaro.org> > M: +46 709 71 42 85 <tel:%2B46%20709%2071%2042%2085> | > IRC: roxell > > _______________________________________________ > lng-odp mailing list > lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org> > http://lists.linaro.org/mailman/listinfo/lng-odp > > > > > -- > *Mike Holmes* > Linaro Technical Manager / Lead > LNG - ODP > > _______________________________________________ > lng-odp mailing list > lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org> > http://lists.linaro.org/mailman/listinfo/lng-odp > > > > > > -- > *Mike Holmes* > Linaro Technical Manager / Lead > LNG - ODP > > > > > _______________________________________________ > lng-odp mailing list > lng-odp@lists.linaro.org > http://lists.linaro.org/mailman/listinfo/lng-odp
On 08/13/2014 12:38 AM, Mike Holmes wrote: > To generate test data we don't have to use ODP, although we should try > to do that down the road, but equally you still need to use external > tools to be sure you did not make compatible only with yourself mistakes. > > I was wondering why we can't spawn several process on one machine that > all send to the same port to test this ? Why not to use kernel packet generator? https://www.kernel.org/doc/Documentation/networking/pktgen.txt > > > On 12 August 2014 16:31, Maxim Uvarov <maxim.uvarov@linaro.org > <mailto:maxim.uvarov@linaro.org>> wrote: > > On 08/13/2014 12:29 AM, Maxim Uvarov wrote: > > why not to use tcpreplay? > > I.e. odp+libpcap+dpdk+tcpreplay if we have everything ready? > > Maxim. > > Ah, I should check that first. tcpreplay doesn't depend on libpcap. > > ldd /usr/bin/tcpreplay > linux-vdso.so.1 => (0x00007fffa3bfe000) > libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f3d490ba000) > /lib64/ld-linux-x86-64.so.2 (0x00007f3d494a5000) > > > > > On 08/12/2014 11:42 PM, Wiles, Roger Keith wrote: > > Pktgen has a number of different ways to send packets > single, range, pcap or random, sequence with parameters. > > One thing Pktgen does not do is act like a real stack, but > you can simulate that with pcap or sequence packets. It > basically depends on how complex a data flow you need. > > # git clone git://github.com/Pktgen/Pktgen-DPDK > <http://github.com/Pktgen/Pktgen-DPDK> > > Let me know if I can help or change the code in some way. > > THanks > ++keith > > *Keith **Wiles*, Principal Technologist with CTO office, > *Wind River*mobile 972-213-5533 <tel:972-213-5533> > > On Aug 12, 2014, at 1:08 PM, Mike Holmes > <mike.holmes@linaro.org <mailto:mike.holmes@linaro.org> > <mailto:mike.holmes@linaro.org > <mailto:mike.holmes@linaro.org>>> wrote: > > So it looks like we don't have any way to test this > without an Ixia which is a problem given that Santosh > is having trouble. > Basically there is no CI job to point at that shows > that excluding human error it is still working as > expected. > > Keith, is dpdk pktgen able to generate pkts in the way > Venki needs ? > > Mike > > > On 12 August 2014 02:17, Santosh Shukla > <santosh.shukla@linaro.org > <mailto:santosh.shukla@linaro.org> > <mailto:santosh.shukla@linaro.org > <mailto:santosh.shukla@linaro.org>>> wrote: > > On 12 August 2014 00:25, Mike Holmes > <mike.holmes@linaro.org <mailto:mike.holmes@linaro.org> > <mailto:mike.holmes@linaro.org > <mailto:mike.holmes@linaro.org>>> wrote: > > Which test case in odp/test would check this, or > does it need > an application > > like l2fwd to be run - are either in LAVA/CI ? > > > > Santosh are you able to verify this does not > break anything as > part of the > > l2fwd work you are doing ? > > > > No, I am seeing problem with current and should > persist in this multi > flavour too. We have bug reported on that lines. > So whole dpdk-l2fwd > doesn't works for me for my requirement. > > Thanks. > > > Mike > > > > > > On 11 August 2014 01:43, Venkatesh Vivekanandan > > <venkatesh.vivekanandan@linaro.org > <mailto:venkatesh.vivekanandan@linaro.org> > <mailto:venkatesh.vivekanandan@linaro.org > <mailto:venkatesh.vivekanandan@linaro.org>>> wrote: > >> > >> > >> > >> > >> On 9 August 2014 17:32, Mike Holmes > <mike.holmes@linaro.org <mailto:mike.holmes@linaro.org> > <mailto:mike.holmes@linaro.org > <mailto:mike.holmes@linaro.org>>> wrote: > >>> > >>> > >>> > >>> > >>> On 8 August 2014 17:46, Anders Roxell > <anders.roxell@linaro.org > <mailto:anders.roxell@linaro.org> > <mailto:anders.roxell@linaro.org > <mailto:anders.roxell@linaro.org>>> wrote: > >>>> > >>>> On 2014-08-08 17:31, Maxim Uvarov wrote: > >>>> > On 08/08/2014 05:13 PM, Venkatesh > Vivekanandan wrote: > >>>> > > > >>>> > > > >>>> > > > >>>> > >On 7 August 2014 21:10, Anders Roxell > <anders.roxell@linaro.org > <mailto:anders.roxell@linaro.org> > <mailto:anders.roxell@linaro.org > <mailto:anders.roxell@linaro.org>> > >>>> > ><mailto:anders.roxell@linaro.org > <mailto:anders.roxell@linaro.org> > <mailto:anders.roxell@linaro.org > <mailto:anders.roxell@linaro.org>>>> wrote: > >>>> > > > >>>> > > On 2014-08-07 10:41, Mike Holmes wrote: > >>>> > > > Does this need a signoff by someone > else before it > is merged ? > >>>> > > > > >>>> > > > I think we want to enforce getting > an ack, tested-by or > >>>> > > reviewed-by before > >>>> > > > we merge things, we have informally > moved that way > over the > >>>> > > last > >>>> > > couple of > >>>> > > > weeks and now I think it is time we > made it a formal > >>>> > > requirement. > >>>> > > > >>>> > > Agree. > >>>> > > > >>>> > > > >>>> > >If this is the case, then is it fair to > say initial > discussion of > >>>> > >24-hour window is void?. I guess Maxim was > waiting for 2 > days(for > >>>> > >any comments) before he could merge this > patch. Do we > have any > >>>> > >time-limit before which a patch /must /be > reviewed or > tested? I > >>>> > >hope we can't wait indefinitely or is this > the case?. > >>>> > > >>>> > I think if patch came from platfrom > maintainer, it's not > new API. No > >>>> > comments in 1 or 2 days, than it's ok to > merge it. If > patch came > >>>> > from somobody alse I would ask maintainer > to review it. > >>>> > >>>> I disagree with this. > >>>> No matter where the patch comes from and who > wrote the > patch, it can be > >>>> wrong and need a second pair of eyes i.e., > >>>> (Reviewed|Acked|Signed-off)-by. > >>>> If no one has replied to a patch after 2 > days, the author of > the patch > >>>> should ping the list and maintainer. > >>>> > >>>> After the second pair of eyes, the patch > should be ok to be > merged. > >>>> The ODP maintainer should do a smoke build > test on all the > supported > >>>> platforms before merging though. > >>> > >>> > >>> My 2 cents > >>> We have started to develop a cohesive API, I > think that is > down to a lot > >>> of folks working together. > >>> I also think that peer review/team work is > reflected in the > increasing > >>> willingness to review each others patches > which has improved > quality > >>> and helped establish the guidelines on how > things bolt > together in ODP, > >>> may long discussions have spawned from patches. > >>> > >>> No one is beyond silly mistakes, peer review > finds a lot of > the dumb > >>> stuff for little cost, saving on the > inevitable ugly patch up > that will > >>> ensue otherwise. > >>> Maxim you could do the default reviews if no > one came > forward, but if a > >>> submitter finds and establishes their own > network of > reviewers that is one > >>> extra pair of eyes and ideas. > >> > >> > >> Can someone please review this patch?. If there > is any > comments, we can > >> request maxim to revert the patch, otherwise he > can add the > >> "Reviewed-by/Tested-by" to the applied patch. > >> > >>>> > >>>> Cheers, > >>>> Anders > >>>> > >>>> > > >>>> > Maxim. > >>>> > > >>>> > > Anders > >>>> > > > >>>> > > > > >>>> > > > Mike > >>>> > > > > >>>> > > > > >>>> > > > On 7 August 2014 09:15, Maxim Uvarov > <maxim.uvarov@linaro.org > <mailto:maxim.uvarov@linaro.org> > <mailto:maxim.uvarov@linaro.org > <mailto:maxim.uvarov@linaro.org>> > >>>> > > <mailto:maxim.uvarov@linaro.org > <mailto:maxim.uvarov@linaro.org> > <mailto:maxim.uvarov@linaro.org > <mailto:maxim.uvarov@linaro.org>>>> wrote: > >>>> > > > > >>>> > > > > Merged, thanks! > >>>> > > > > > >>>> > > > > Maxim. > >>>> > > > > > >>>> > > > > > >>>> > > > > On 08/05/2014 06:54 PM, > venkatesh.vivekanandan@linaro.org > <mailto:venkatesh.vivekanandan@linaro.org> > <mailto:venkatesh.vivekanandan@linaro.org > <mailto:venkatesh.vivekanandan@linaro.org>> > >>>> > > <mailto:venkatesh.vivekanandan@linaro.org > <mailto:venkatesh.vivekanandan@linaro.org> > <mailto:venkatesh.vivekanandan@linaro.org > <mailto:venkatesh.vivekanandan@linaro.org>>> wrote: > >>>> > > > > > >>>> > > > >> From: Venkatesh Vivekanandan > >>>> > > <venkatesh.vivekanandan@linaro.org > <mailto:venkatesh.vivekanandan@linaro.org> > <mailto:venkatesh.vivekanandan@linaro.org > <mailto:venkatesh.vivekanandan@linaro.org>> > >>>> > > <mailto:venkatesh.vivekanandan@linaro.org > <mailto:venkatesh.vivekanandan@linaro.org> > <mailto:venkatesh.vivekanandan@linaro.org > <mailto:venkatesh.vivekanandan@linaro.org>>>> > >>>> > > > >> > >>>> > > > >> - Multi queue support per > interface is enabled. > >>>> > > > >> - odp_pktio_send with "0" packet > is called in > odp_pktio_recv > >>>> > > to > >>>> > > > >> give the transmitted buffers > back to mempool. > >>>> > > > >> - mbuf alloc failure during > receive is fixed by > giving more > >>>> > > buffers to > >>>> > > > >> mempool. > >>>> > > > >> - mempool cache size is given > equivalent to > MAX_PKT_BURST. > >>>> > > > >> > >>>> > > > >> Signed-off-by: Venkatesh Vivekanandan > >>>> > > <venkatesh.vivekanandan@linaro.org > <mailto:venkatesh.vivekanandan@linaro.org> > <mailto:venkatesh.vivekanandan@linaro.org > <mailto:venkatesh.vivekanandan@linaro.org>> > >>>> > > <mailto:venkatesh.vivekanandan@linaro.org > <mailto:venkatesh.vivekanandan@linaro.org> > <mailto:venkatesh.vivekanandan@linaro.org > <mailto:venkatesh.vivekanandan@linaro.org>>>> > >>>> > > > >> --- > >>>> > > > >> > platform/linux-dpdk/include/odp_packet_dpdk.h | > 24 +++++ > >>>> > > > >> > platform/linux-dpdk/odp_buffer_pool.c | 4 +- > >>>> > > > >> > platform/linux-dpdk/odp_packet_dpdk.c | 136 > >>>> > > > >> +++++++++++++------------- > >>>> > > > >> > platform/linux-dpdk/odp_packet_io.c | 2 + > >>>> > > > >> 4 files changed, 94 > insertions(+), 72 deletions(-) > >>>> > > > >> > >>>> > > > >> diff --git > a/platform/linux-dpdk/include/odp_packet_dpdk.h > >>>> > > > >> > b/platform/linux-dpdk/include/odp_packet_dpdk.h > >>>> > > > >> index bcbe9e8..bcf9aa5 100644 > >>>> > > > >> --- > a/platform/linux-dpdk/include/odp_packet_dpdk.h > >>>> > > > >> +++ > b/platform/linux-dpdk/include/odp_packet_dpdk.h > >>>> > > > >> @@ -50,6 +50,30 @@ > >>>> > > > >> #define DPDK_BLOCKING_IO > >>>> > > > >> +/* > >>>> > > > >> + * RX and TX Prefetch, Host, and > Write-back > threshold > >>>> > > values > >>>> > > should be > >>>> > > > >> + * carefully set for optimal > performance. > Consult the > >>>> > > network > >>>> > > > >> + * controller's datasheet and > supporting DPDK > documentation > >>>> > > for guidance > >>>> > > > >> + * on how these parameters > should be set. > >>>> > > > >> + */ > >>>> > > > >> +#define RX_PTHRESH 8 /**< > Default values of RX > prefetch > >>>> > > threshold reg. */ > >>>> > > > >> +#define RX_HTHRESH 8 /**< > Default values of RX host > >>>> > > threshold reg. */ > >>>> > > > >> +#define RX_WTHRESH 4 /**< > Default values of RX > write-back > >>>> > > threshold reg. > >>>> > > > >> */ > >>>> > > > >> + > >>>> > > > >> +/* > >>>> > > > >> + * These default values are > optimized for use > with the > >>>> > > Intel(R) 82599 10 > >>>> > > > >> GbE > >>>> > > > >> + * Controller and the DPDK ixgbe > PMD. Consider > using other > >>>> > > values for > >>>> > > > >> other > >>>> > > > >> + * network controllers and/or > network drivers. > >>>> > > > >> + */ > >>>> > > > >> +#define TX_PTHRESH 36 /**< > Default values of TX > prefetch > >>>> > > threshold reg. > >>>> > > > >> */ > >>>> > > > >> +#define TX_HTHRESH 0 /**< > Default values of TX > host > >>>> > > threshold reg. */ > >>>> > > > >> +#define TX_WTHRESH 0 /**< > Default values of TX > write-back > >>>> > > threshold > >>>> > > > >> reg. */ > >>>> > > > >> + > >>>> > > > >> +#define MAX_PKT_BURST 16 > >>>> > > > >> +#define BURST_TX_DRAIN_US 100 /* > TX drain every > ~100us */ > >>>> > > > >> +#define RTE_TEST_RX_DESC_DEFAULT 128 > >>>> > > > >> +#define RTE_TEST_TX_DESC_DEFAULT 512 > >>>> > > > >> + > >>>> > > > >> /** Packet socket using dpdk > mmaped rings for > both Rx and > >>>> > > Tx */ > >>>> > > > >> typedef struct { > >>>> > > > >> odp_buffer_pool_t pool; > >>>> > > > >> diff --git > a/platform/linux-dpdk/odp_buffer_pool.c > >>>> > > > >> > b/platform/linux-dpdk/odp_buffer_pool.c > >>>> > > > >> index de90275..805ce68 100644 > >>>> > > > >> --- > a/platform/linux-dpdk/odp_buffer_pool.c > >>>> > > > >> +++ > b/platform/linux-dpdk/odp_buffer_pool.c > >>>> > > > >> @@ -23,7 +23,7 @@ > >>>> > > > >> #include <odp_packet_dpdk.h> > >>>> > > > >> #define MBUF_SIZE (2048 + > sizeof(struct rte_mbuf) + > >>>> > > > >> RTE_PKTMBUF_HEADROOM) > >>>> > > > >> -#define NB_MBUF 8192 > >>>> > > > >> +#define NB_MBUF 32768 > >>>> > > > >> #ifdef POOL_USE_TICKETLOCK > >>>> > > > >> #include <odp_ticketlock.h> > >>>> > > > >> @@ -112,7 +112,7 @@ odp_buffer_pool_t > >>>> > > odp_buffer_pool_create(const char > >>>> > > > >> *name, > >>>> > > > >> pktmbuf_pool = > >>>> > > > >> rte_mempool_create(name, NB_MBUF, > >>>> > > > >> - MBUF_SIZE, 32, > >>>> > > > >> + MBUF_SIZE, MAX_PKT_BURST, > >>>> > > > >> sizeof(struct > >>>> > > > >> rte_pktmbuf_pool_private), > >>>> > > > >> rte_pktmbuf_pool_init, NULL, > >>>> > > > >> rte_pktmbuf_init, NULL, > >>>> > > > >> diff --git > a/platform/linux-dpdk/odp_packet_dpdk.c > >>>> > > > >> > b/platform/linux-dpdk/odp_packet_dpdk.c > >>>> > > > >> index 31bfa30..d5c8e80 100644 > >>>> > > > >> --- > a/platform/linux-dpdk/odp_packet_dpdk.c > >>>> > > > >> +++ > b/platform/linux-dpdk/odp_packet_dpdk.c > >>>> > > > >> @@ -26,34 +26,13 @@ > >>>> > > > >> #include <odp_packet_dpdk.h> > >>>> > > > >> #include <net/if.h> > >>>> > > > >> -/* > >>>> > > > >> - * RX and TX Prefetch, Host, and > Write-back > threshold > >>>> > > values > >>>> > > should be > >>>> > > > >> - * carefully set for optimal > performance. > Consult the > >>>> > > network > >>>> > > > >> - * controller's datasheet and > supporting DPDK > documentation > >>>> > > for guidance > >>>> > > > >> - * on how these parameters > should be set. > >>>> > > > >> - */ > >>>> > > > >> -#define RX_PTHRESH 8 /**< > Default values of RX > prefetch > >>>> > > threshold reg. */ > >>>> > > > >> -#define RX_HTHRESH 8 /**< > Default values of RX host > >>>> > > threshold reg. */ > >>>> > > > >> -#define RX_WTHRESH 4 /**< > Default values of RX > write-back > >>>> > > threshold reg. > >>>> > > > >> */ > >>>> > > > >> - > >>>> > > > >> -/* > >>>> > > > >> - * These default values are > optimized for use > with the > >>>> > > Intel(R) 82599 10 > >>>> > > > >> GbE > >>>> > > > >> - * Controller and the DPDK ixgbe > PMD. Consider > using other > >>>> > > values for > >>>> > > > >> other > >>>> > > > >> - * network controllers and/or > network drivers. > >>>> > > > >> - */ > >>>> > > > >> -#define TX_PTHRESH 36 /**< > Default values of TX > prefetch > >>>> > > threshold reg. > >>>> > > > >> */ > >>>> > > > >> -#define TX_HTHRESH 0 /**< > Default values of TX > host > >>>> > > threshold reg. */ > >>>> > > > >> -#define TX_WTHRESH 0 /**< > Default values of TX > write-back > >>>> > > threshold > >>>> > > > >> reg. */ > >>>> > > > >> - > >>>> > > > >> -#define MAX_PKT_BURST 16 > >>>> > > > >> -#define BURST_TX_DRAIN_US 100 /* > TX drain every > ~100us */ > >>>> > > > >> -#define RTE_TEST_RX_DESC_DEFAULT 128 > >>>> > > > >> -#define RTE_TEST_TX_DESC_DEFAULT 512 > >>>> > > > >> static uint16_t nb_rxd = > RTE_TEST_RX_DESC_DEFAULT; > >>>> > > > >> static uint16_t nb_txd = > RTE_TEST_TX_DESC_DEFAULT; > >>>> > > > >> static const struct rte_eth_conf > port_conf = { > >>>> > > > >> .rxmode = { > >>>> > > > >> + .mq_mode = ETH_MQ_RX_RSS, > >>>> > > > >> + .max_rx_pkt_len = ETHER_MAX_LEN, > >>>> > > > >> .split_hdr_size = 0, > >>>> > > > >> .header_split = 0, /**< Header > Split > >>>> > > disabled */ > >>>> > > > >> .hw_ip_checksum = 0, /**< IP checksum > >>>> > > offload > >>>> > > disabled */ > >>>> > > > >> @@ -61,6 +40,12 @@ static const > struct rte_eth_conf > >>>> > > port_conf = { > >>>> > > > >> .jumbo_frame = 0, /**< Jumbo Frame > >>>> > > Support > >>>> > > disabled */ > >>>> > > > >> .hw_strip_crc = 0, /**< CRC > stripped by > >>>> > > hardware */ > >>>> > > > >> }, > >>>> > > > >> + .rx_adv_conf = { > >>>> > > > >> + .rss_conf = { > >>>> > > > >> + .rss_key = NULL, > >>>> > > > >> + .rss_hf = > ETH_RSS_IPV4 | > >>>> > > ETH_RSS_IPV6, > >>>> > > > >> + }, > >>>> > > > >> + }, > >>>> > > > >> .txmode = { > >>>> > > > >> .mq_mode = ETH_MQ_TX_NONE, > >>>> > > > >> }, > >>>> > > > >> @@ -95,60 +80,71 @@ int > setup_pkt_dpdk(pkt_dpdk_t * const > >>>> > > pkt_dpdk, const > >>>> > > > >> char *netdev, > >>>> > > > >> ODP_DBG("setup_pkt_dpdk\n"); > >>>> > > > >> static struct ether_addr > eth_addr[RTE_MAX_ETHPORTS]; > >>>> > > > >> - uint8_t portid = 0; > >>>> > > > >> - uint16_t queueid = 0; > >>>> > > > >> - int ret; > >>>> > > > >> + static int > portinit[RTE_MAX_ETHPORTS]; > >>>> > > > >> + static int qid[RTE_MAX_ETHPORTS]; > >>>> > > > >> + uint8_t portid = 0, num_intf = 2; > >>>> > > > >> + uint16_t nbrxq = 0, nbtxq = 0; > >>>> > > > >> + int ret, i; > >>>> > > > >> + > >>>> > > > >> printf("dpdk netdev: %s\n", netdev); > >>>> > > > >> printf("dpdk pool: %lx\n", pool); > >>>> > > > >> - > >>>> > > > >> portid = atoi(netdev); > >>>> > > > >> pkt_dpdk->portid = portid; > >>>> > > > >> - pkt_dpdk->queueid = queueid; > >>>> > > > >> pkt_dpdk->pool = pool; > >>>> > > > >> printf("dpdk portid: %u\n", portid); > >>>> > > > >> - fflush(stdout); > >>>> > > > >> - ret = > rte_eth_dev_configure(portid, 1, 1, > >>>> > > &port_conf); > >>>> > > > >> - if (ret < 0) > >>>> > > > >> - ODP_ERR("Cannot configure device: > err=%d, > >>>> > > port=%u\n", > >>>> > > > >> - ret, > (unsigned) portid); > >>>> > > > >> - > >>>> > > > >> - rte_eth_macaddr_get(portid, > ð_addr[portid]); > >>>> > > > >> - ODP_DBG("Port %u, MAC address: > >>>> > > %02X:%02X:%02X:%02X:%02X:%02X\ > >>>> > > > >> n\n", > >>>> > > > >> - (unsigned) portid, > >>>> > > > >> - eth_addr[portid].addr_bytes[0], > >>>> > > > >> - eth_addr[portid].addr_bytes[1], > >>>> > > > >> - eth_addr[portid].addr_bytes[2], > >>>> > > > >> - eth_addr[portid].addr_bytes[3], > >>>> > > > >> - eth_addr[portid].addr_bytes[4], > >>>> > > > >> - eth_addr[portid].addr_bytes[5]); > >>>> > > > >> - > >>>> > > > >> - /* init one RX queue on each > port */ > >>>> > > > >> - fflush(stdout); > >>>> > > > >> - ret = > rte_eth_rx_queue_setup(portid, queueid, > >>>> > > nb_rxd, > >>>> > > > >> - rte_eth_dev_socket_id(portid), > >>>> > > > >> &rx_conf, > >>>> > > > >> - (struct rte_mempool *)pool); > >>>> > > > >> - if (ret < 0) > >>>> > > > >> - > ODP_ERR("rte_eth_rx_queue_setup:err=%d, > port=%u\n", > >>>> > > > >> - ret, > (unsigned) portid); > >>>> > > > >> - ODP_DBG("dpdk rx queue setup > done\n"); > >>>> > > > >> - > >>>> > > > >> - /* init one TX queue on each > port */ > >>>> > > > >> - fflush(stdout); > >>>> > > > >> - ret = > rte_eth_tx_queue_setup(portid, queueid, > >>>> > > nb_txd, > >>>> > > > >> - rte_eth_dev_socket_id(portid), > &tx_conf); > >>>> > > > >> - if (ret < 0) > >>>> > > > >> - > ODP_ERR("rte_eth_tx_queue_setup:err=%d, > port=%u\n", > >>>> > > > >> - ret, > (unsigned) portid); > >>>> > > > >> - ODP_DBG("dpdk tx queue setup > done\n"); > >>>> > > > >> - > >>>> > > > >> - /* Start device */ > >>>> > > > >> - ret = rte_eth_dev_start(portid); > >>>> > > > >> - if (ret < 0) > >>>> > > > >> - > ODP_ERR("rte_eth_dev_start:err=%d, port=%u\n", > >>>> > > > >> - ret, > (unsigned) portid); > >>>> > > > >> - ODP_DBG("dpdk setup done\n\n"); > >>>> > > > >> - > >>>> > > > >> + nbrxq = odp_sys_core_count() > / num_intf; > >>>> > > > >> + nbtxq = nbrxq; > >>>> > > > >> + if (portinit[portid] == 0) { > >>>> > > > >> + fflush(stdout); > >>>> > > > >> + ret = rte_eth_dev_configure(portid, > nbrxq, > >>>> > > nbtxq, > >>>> > > > >> &port_conf); > >>>> > > > >> + if (ret < 0) > >>>> > > > >> + > ODP_ERR("Cannot configure > device: > >>>> > > err=%d, > >>>> > > > >> port=%u\n", > >>>> > > > >> + ret, > (unsigned) portid); > >>>> > > > >> + > >>>> > > > >> + rte_eth_macaddr_get(portid, > ð_addr[portid]); > >>>> > > > >> + ODP_DBG("Port %u, MAC address: > >>>> > > > >> %02X:%02X:%02X:%02X:%02X:%02X\n", > >>>> > > > >> + (unsigned) > portid, > >>>> > > > >> + eth_addr[portid].addr_bytes[0], > >>>> > > > >> + eth_addr[portid].addr_bytes[1], > >>>> > > > >> + eth_addr[portid].addr_bytes[2], > >>>> > > > >> + eth_addr[portid].addr_bytes[3], > >>>> > > > >> + eth_addr[portid].addr_bytes[4], > >>>> > > > >> + eth_addr[portid].addr_bytes[5]); > >>>> > > > >> + > >>>> > > > >> + /* init one RX queue > on each port */ > >>>> > > > >> + fflush(stdout); > >>>> > > > >> + for (i = 0; i < nbrxq; i++) { > >>>> > > > >> + ret = > rte_eth_rx_queue_setup(portid, > >>>> > > i, nb_rxd, > >>>> > > > >> + rte_eth_dev_socket_id(portid), > >>>> > > > >> &rx_conf, > >>>> > > > >> + (struct rte_mempool *)pool); > >>>> > > > >> + if (ret < 0) > >>>> > > > >> + ODP_ERR("%s rxq:err=%d, port=%u\n", > >>>> > > > >> + __func__, ret, (unsigned) portid); > >>>> > > > >> + ODP_DBG("dpdk > rx queue setup > >>>> > > done\n"); > >>>> > > > >> + } > >>>> > > > >> + > >>>> > > > >> + /* init one TX queue > on each port */ > >>>> > > > >> + fflush(stdout); > >>>> > > > >> + for (i = 0; i < nbtxq; i++) { > >>>> > > > >> + ret = > rte_eth_tx_queue_setup(portid, > >>>> > > i, nb_txd, > >>>> > > > >> + rte_eth_dev_socket_id(portid), > &tx_conf); > >>>> > > > >> + if (ret < 0) > >>>> > > > >> + ODP_ERR("%s txq:err=%d, port=%u\n", > >>>> > > > >> + __func__, ret, (unsigned) portid); > >>>> > > > >> + ODP_DBG("dpdk > tx queue setup > >>>> > > done\n"); > >>>> > > > >> + } > >>>> > > > >> + > >>>> > > > >> + /* Start device */ > >>>> > > > >> + ret = rte_eth_dev_start(portid); > >>>> > > > >> + if (ret < 0) > >>>> > > > >> + > ODP_ERR("rte_eth_dev_start:err=%d, port=%u\n", > >>>> > > > >> + ret, > (unsigned) portid); > >>>> > > > >> + ODP_DBG("dpdk setup done\n\n"); > >>>> > > > >> + > >>>> > > > >> + portinit[portid] = 1; > >>>> > > > >> + } > >>>> > > > >> + pkt_dpdk->queueid = qid[portid]++; > >>>> > > > >> return 0; > >>>> > > > >> } > >>>> > > > >> diff --git > a/platform/linux-dpdk/odp_packet_io.c > >>>> > > > >> b/platform/linux-dpdk/odp_packet_io.c > >>>> > > > >> index d8d127f..3124175 100644 > >>>> > > > >> --- > a/platform/linux-dpdk/odp_packet_io.c > >>>> > > > >> +++ > b/platform/linux-dpdk/odp_packet_io.c > >>>> > > > >> @@ -230,6 +230,8 @@ int > odp_pktio_recv(odp_pktio_t id, > >>>> > > odp_packet_t > >>>> > > > >> pkt_table[], unsigned len) > >>>> > > > >> if (pktio_entry == NULL) > >>>> > > > >> return -1; > >>>> > > > >> + odp_pktio_send(id, pkt_table, 0); > >>>> > > > >> + > >>>> > > > >> lock_entry(pktio_entry); > >>>> > > > >> pkts = > recv_pkt_dpdk(&pktio_entry->s.pkt_dpdk, > >>>> > > pkt_table, len); > >>>> > > > >> unlock_entry(pktio_entry); > >>>> > > > >> > >>>> > > > > > >>>> > > > > > >>>> > > > > > _______________________________________________ > >>>> > > > > lng-odp mailing list > >>>> > > > > lng-odp@lists.linaro.org > <mailto:lng-odp@lists.linaro.org> > <mailto:lng-odp@lists.linaro.org > <mailto:lng-odp@lists.linaro.org>> > <mailto:lng-odp@lists.linaro.org > <mailto:lng-odp@lists.linaro.org> > <mailto:lng-odp@lists.linaro.org > <mailto:lng-odp@lists.linaro.org>>> > >>>> > > > > > http://lists.linaro.org/mailman/listinfo/lng-odp > <http://lists.linaro.org/mailman/listinfo/lng-odp> > >>>> > > > > > >>>> > > > > >>>> > > > > >>>> > > > > >>>> > > > -- > >>>> > > > *Mike Holmes* > >>>> > > > Linaro Technical Manager / Lead > >>>> > > > LNG - ODP > >>>> > > > >>>> > > > > _______________________________________________ > >>>> > > > lng-odp mailing list > >>>> > > > lng-odp@lists.linaro.org > <mailto:lng-odp@lists.linaro.org> > <mailto:lng-odp@lists.linaro.org > <mailto:lng-odp@lists.linaro.org>> > <mailto:lng-odp@lists.linaro.org > <mailto:lng-odp@lists.linaro.org> > <mailto:lng-odp@lists.linaro.org > <mailto:lng-odp@lists.linaro.org>>> > >>>> > > > > http://lists.linaro.org/mailman/listinfo/lng-odp > <http://lists.linaro.org/mailman/listinfo/lng-odp> > >>>> > > > >>>> > > > >>>> > > -- > >>>> > > Anders Roxell > >>>> > > anders.roxell@linaro.org > <mailto:anders.roxell@linaro.org> > <mailto:anders.roxell@linaro.org > <mailto:anders.roxell@linaro.org>> > <mailto:anders.roxell@linaro.org > <mailto:anders.roxell@linaro.org> > <mailto:anders.roxell@linaro.org > <mailto:anders.roxell@linaro.org>>> > >>>> > > M: +46 709 71 42 85 > <tel:%2B46%20709%2071%2042%2085> > <tel:%2B46%20709%2071%2042%2085> > | IRC: roxell > >>>> > > > >>>> > > > _______________________________________________ > >>>> > > lng-odp mailing list > >>>> > > lng-odp@lists.linaro.org > <mailto:lng-odp@lists.linaro.org> > <mailto:lng-odp@lists.linaro.org > <mailto:lng-odp@lists.linaro.org>> > <mailto:lng-odp@lists.linaro.org > <mailto:lng-odp@lists.linaro.org> > <mailto:lng-odp@lists.linaro.org > <mailto:lng-odp@lists.linaro.org>>> > >>>> > > > http://lists.linaro.org/mailman/listinfo/lng-odp > >>>> > > > >>>> > > > >>>> > > > >>>> > > > >>>> > > >_______________________________________________ > >>>> > >lng-odp mailing list > >>>> > >lng-odp@lists.linaro.org > <mailto:lng-odp@lists.linaro.org> > <mailto:lng-odp@lists.linaro.org > <mailto:lng-odp@lists.linaro.org>> > >>>> > > >http://lists.linaro.org/mailman/listinfo/lng-odp > >>>> > > >>>> > > >>>> > _______________________________________________ > >>>> > lng-odp mailing list > >>>> > lng-odp@lists.linaro.org > <mailto:lng-odp@lists.linaro.org> > <mailto:lng-odp@lists.linaro.org > <mailto:lng-odp@lists.linaro.org>> > >>>> > > http://lists.linaro.org/mailman/listinfo/lng-odp > <http://lists.linaro.org/mailman/listinfo/lng-odp> > >>>> > >>>> -- > >>>> Anders Roxell > >>>> anders.roxell@linaro.org > <mailto:anders.roxell@linaro.org> > <mailto:anders.roxell@linaro.org > <mailto:anders.roxell@linaro.org>> > >>>> M: +46 709 71 42 85 > <tel:%2B46%20709%2071%2042%2085> > <tel:%2B46%20709%2071%2042%2085> | IRC: > roxell > >>>> > >>>> _______________________________________________ > >>>> lng-odp mailing list > >>>> lng-odp@lists.linaro.org > <mailto:lng-odp@lists.linaro.org> > <mailto:lng-odp@lists.linaro.org > <mailto:lng-odp@lists.linaro.org>> > >>>> http://lists.linaro.org/mailman/listinfo/lng-odp > >>> > >>> > >>> > >>> > >>> -- > >>> Mike Holmes > >>> Linaro Technical Manager / Lead > >>> LNG - ODP > >>> > >>> _______________________________________________ > >>> lng-odp mailing list > >>> lng-odp@lists.linaro.org > <mailto:lng-odp@lists.linaro.org> > <mailto:lng-odp@lists.linaro.org > <mailto:lng-odp@lists.linaro.org>> > >>> http://lists.linaro.org/mailman/listinfo/lng-odp > >>> > >> > > > > > > > > -- > > Mike Holmes > > Linaro Technical Manager / Lead > > LNG - ODP > > > > _______________________________________________ > > lng-odp mailing list > > lng-odp@lists.linaro.org > <mailto:lng-odp@lists.linaro.org> > <mailto:lng-odp@lists.linaro.org > <mailto:lng-odp@lists.linaro.org>> > > http://lists.linaro.org/mailman/listinfo/lng-odp > > > > > > > -- > *Mike Holmes* > Linaro Technical Manager / Lead > LNG - ODP > > > > > _______________________________________________ > lng-odp mailing list > lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org> > http://lists.linaro.org/mailman/listinfo/lng-odp > > > > > _______________________________________________ > lng-odp mailing list > lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org> > http://lists.linaro.org/mailman/listinfo/lng-odp > > > > > -- > *Mike Holmes* > Linaro Technical Manager / Lead > LNG - ODP
The DPDK version of Pktgen is a bit easy to use and configure then the kernel based version. You can also run it on the machine if you make sure you configure DPDK correctly (if you have two DPDKs running). If you build Pktgen-DPDK on another machine it should be pretty quick (within a 1/2 hour normally if not faster :-) ) to get running if all you need is to send UDP or TCP frames. I still not know your requires for the traffic. At least with Pktgen-DPDK you have a clean simple full screen ASCII (vt100) interface to use. If you have the machine setup for DPDK it will just work sending 64Byte frames as 10G wire rate. If you decide to go this direction I can help set it up for you. Keith Wiles, Principal Technologist with CTO office, Wind River mobile 972-213-5533 On Aug 12, 2014, at 3:41 PM, Maxim Uvarov <maxim.uvarov@linaro.org<mailto:maxim.uvarov@linaro.org>> wrote: On 08/13/2014 12:38 AM, Mike Holmes wrote: To generate test data we don't have to use ODP, although we should try to do that down the road, but equally you still need to use external tools to be sure you did not make compatible only with yourself mistakes. I was wondering why we can't spawn several process on one machine that all send to the same port to test this ? Why not to use kernel packet generator? https://www.kernel.org/doc/Documentation/networking/pktgen.txt On 12 August 2014 16:31, Maxim Uvarov <maxim.uvarov@linaro.org<mailto:maxim.uvarov@linaro.org><mailto:maxim.uvarov@linaro.org>> wrote: On 08/13/2014 12:29 AM, Maxim Uvarov wrote: why not to use tcpreplay? I.e. odp+libpcap+dpdk+tcpreplay if we have everything ready? Maxim. Ah, I should check that first. tcpreplay doesn't depend on libpcap. ldd /usr/bin/tcpreplay linux-vdso.so.1 => (0x00007fffa3bfe000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f3d490ba000) /lib64/ld-linux-x86-64.so.2 (0x00007f3d494a5000) On 08/12/2014 11:42 PM, Wiles, Roger Keith wrote: Pktgen has a number of different ways to send packets single, range, pcap or random, sequence with parameters. One thing Pktgen does not do is act like a real stack, but you can simulate that with pcap or sequence packets. It basically depends on how complex a data flow you need. # git clone git://github.com/Pktgen/Pktgen-DPDK <http://github.com/Pktgen/Pktgen-DPDK> Let me know if I can help or change the code in some way. THanks ++keith *Keith **Wiles*, Principal Technologist with CTO office, *Wind River*mobile 972-213-5533 <tel:972-213-5533> On Aug 12, 2014, at 1:08 PM, Mike Holmes <mike.holmes@linaro.org<mailto:mike.holmes@linaro.org> <mailto:mike.holmes@linaro.org> <mailto:mike.holmes@linaro.org <mailto:mike.holmes@linaro.org>>> wrote: So it looks like we don't have any way to test this without an Ixia which is a problem given that Santosh is having trouble. Basically there is no CI job to point at that shows that excluding human error it is still working as expected. Keith, is dpdk pktgen able to generate pkts in the way Venki needs ? Mike On 12 August 2014 02:17, Santosh Shukla <santosh.shukla@linaro.org<mailto:santosh.shukla@linaro.org> <mailto:santosh.shukla@linaro.org> <mailto:santosh.shukla@linaro.org <mailto:santosh.shukla@linaro.org>>> wrote: On 12 August 2014 00:25, Mike Holmes <mike.holmes@linaro.org<mailto:mike.holmes@linaro.org> <mailto:mike.holmes@linaro.org> <mailto:mike.holmes@linaro.org <mailto:mike.holmes@linaro.org>>> wrote: > Which test case in odp/test would check this, or does it need an application > like l2fwd to be run - are either in LAVA/CI ? > > Santosh are you able to verify this does not break anything as part of the > l2fwd work you are doing ? > No, I am seeing problem with current and should persist in this multi flavour too. We have bug reported on that lines. So whole dpdk-l2fwd doesn't works for me for my requirement. Thanks. > Mike > > > On 11 August 2014 01:43, Venkatesh Vivekanandan > <venkatesh.vivekanandan@linaro.org<mailto:venkatesh.vivekanandan@linaro.org> <mailto:venkatesh.vivekanandan@linaro.org> <mailto:venkatesh.vivekanandan@linaro.org <mailto:venkatesh.vivekanandan@linaro.org>>> wrote: >> >> >> >> >> On 9 August 2014 17:32, Mike Holmes <mike.holmes@linaro.org<mailto:mike.holmes@linaro.org> <mailto:mike.holmes@linaro.org> <mailto:mike.holmes@linaro.org <mailto:mike.holmes@linaro.org>>> wrote: >>> >>> >>> >>> >>> On 8 August 2014 17:46, Anders Roxell <anders.roxell@linaro.org<mailto:anders.roxell@linaro.org> <mailto:anders.roxell@linaro.org> <mailto:anders.roxell@linaro.org <mailto:anders.roxell@linaro.org>>> wrote: >>>> >>>> On 2014-08-08 17:31, Maxim Uvarov wrote: >>>> > On 08/08/2014 05:13 PM, Venkatesh Vivekanandan wrote: >>>> > > >>>> > > >>>> > > >>>> > >On 7 August 2014 21:10, Anders Roxell <anders.roxell@linaro.org<mailto:anders.roxell@linaro.org> <mailto:anders.roxell@linaro.org> <mailto:anders.roxell@linaro.org <mailto:anders.roxell@linaro.org>> >>>> > ><mailto:anders.roxell@linaro.org <mailto:anders.roxell@linaro.org> <mailto:anders.roxell@linaro.org <mailto:anders.roxell@linaro.org>>>> wrote: >>>> > > >>>> > > On 2014-08-07 10:41, Mike Holmes wrote: >>>> > > > Does this need a signoff by someone else before it is merged ? >>>> > > > >>>> > > > I think we want to enforce getting an ack, tested-by or >>>> > > reviewed-by before >>>> > > > we merge things, we have informally moved that way over the >>>> > > last >>>> > > couple of >>>> > > > weeks and now I think it is time we made it a formal >>>> > > requirement. >>>> > > >>>> > > Agree. >>>> > > >>>> > > >>>> > >If this is the case, then is it fair to say initial discussion of >>>> > >24-hour window is void?. I guess Maxim was waiting for 2 days(for >>>> > >any comments) before he could merge this patch. Do we have any >>>> > >time-limit before which a patch /must /be reviewed or tested? I >>>> > >hope we can't wait indefinitely or is this the case?. >>>> > >>>> > I think if patch came from platfrom maintainer, it's not new API. No >>>> > comments in 1 or 2 days, than it's ok to merge it. If patch came >>>> > from somobody alse I would ask maintainer to review it. >>>> >>>> I disagree with this. >>>> No matter where the patch comes from and who wrote the patch, it can be >>>> wrong and need a second pair of eyes i.e., >>>> (Reviewed|Acked|Signed-off)-by. >>>> If no one has replied to a patch after 2 days, the author of the patch >>>> should ping the list and maintainer. >>>> >>>> After the second pair of eyes, the patch should be ok to be merged. >>>> The ODP maintainer should do a smoke build test on all the supported >>>> platforms before merging though. >>> >>> >>> My 2 cents >>> We have started to develop a cohesive API, I think that is down to a lot >>> of folks working together. >>> I also think that peer review/team work is reflected in the increasing >>> willingness to review each others patches which has improved quality >>> and helped establish the guidelines on how things bolt together in ODP, >>> may long discussions have spawned from patches. >>> >>> No one is beyond silly mistakes, peer review finds a lot of the dumb >>> stuff for little cost, saving on the inevitable ugly patch up that will >>> ensue otherwise. >>> Maxim you could do the default reviews if no one came forward, but if a >>> submitter finds and establishes their own network of reviewers that is one >>> extra pair of eyes and ideas. >> >> >> Can someone please review this patch?. If there is any comments, we can >> request maxim to revert the patch, otherwise he can add the >> "Reviewed-by/Tested-by" to the applied patch. >> >>>> >>>> Cheers, >>>> Anders >>>> >>>> > >>>> > Maxim. >>>> > >>>> > > Anders >>>> > > >>>> > > > >>>> > > > Mike >>>> > > > >>>> > > > >>>> > > > On 7 August 2014 09:15, Maxim Uvarov <maxim.uvarov@linaro.org<mailto:maxim.uvarov@linaro.org> <mailto:maxim.uvarov@linaro.org> <mailto:maxim.uvarov@linaro.org <mailto:maxim.uvarov@linaro.org>> >>>> > > <mailto:maxim.uvarov@linaro.org <mailto:maxim.uvarov@linaro.org> <mailto:maxim.uvarov@linaro.org <mailto:maxim.uvarov@linaro.org>>>> wrote: >>>> > > > >>>> > > > > Merged, thanks! >>>> > > > > >>>> > > > > Maxim. >>>> > > > > >>>> > > > > >>>> > > > > On 08/05/2014 06:54 PM, venkatesh.vivekanandan@linaro.org<mailto:venkatesh.vivekanandan@linaro.org> <mailto:venkatesh.vivekanandan@linaro.org> <mailto:venkatesh.vivekanandan@linaro.org <mailto:venkatesh.vivekanandan@linaro.org>> >>>> > > <mailto:venkatesh.vivekanandan@linaro.org <mailto:venkatesh.vivekanandan@linaro.org> <mailto:venkatesh.vivekanandan@linaro.org <mailto:venkatesh.vivekanandan@linaro.org>>> wrote: >>>> > > > > >>>> > > > >> From: Venkatesh Vivekanandan >>>> > > <venkatesh.vivekanandan@linaro.org<mailto:venkatesh.vivekanandan@linaro.org> <mailto:venkatesh.vivekanandan@linaro.org> <mailto:venkatesh.vivekanandan@linaro.org <mailto:venkatesh.vivekanandan@linaro.org>> >>>> > > <mailto:venkatesh.vivekanandan@linaro.org <mailto:venkatesh.vivekanandan@linaro.org> <mailto:venkatesh.vivekanandan@linaro.org <mailto:venkatesh.vivekanandan@linaro.org>>>> >>>> > > > >> >>>> > > > >> - Multi queue support per interface is enabled. >>>> > > > >> - odp_pktio_send with "0" packet is called in odp_pktio_recv >>>> > > to >>>> > > > >> give the transmitted buffers back to mempool. >>>> > > > >> - mbuf alloc failure during receive is fixed by giving more >>>> > > buffers to >>>> > > > >> mempool. >>>> > > > >> - mempool cache size is given equivalent to MAX_PKT_BURST. >>>> > > > >> >>>> > > > >> Signed-off-by: Venkatesh Vivekanandan >>>> > > <venkatesh.vivekanandan@linaro.org<mailto:venkatesh.vivekanandan@linaro.org> <mailto:venkatesh.vivekanandan@linaro.org> <mailto:venkatesh.vivekanandan@linaro.org <mailto:venkatesh.vivekanandan@linaro.org>> >>>> > > <mailto:venkatesh.vivekanandan@linaro.org <mailto:venkatesh.vivekanandan@linaro.org> <mailto:venkatesh.vivekanandan@linaro.org <mailto:venkatesh.vivekanandan@linaro.org>>>> >>>> > > > >> --- >>>> > > > >> platform/linux-dpdk/include/odp_packet_dpdk.h | 24 +++++ >>>> > > > >> platform/linux-dpdk/odp_buffer_pool.c | 4 +- >>>> > > > >> platform/linux-dpdk/odp_packet_dpdk.c | 136 >>>> > > > >> +++++++++++++------------- >>>> > > > >> platform/linux-dpdk/odp_packet_io.c | 2 + >>>> > > > >> 4 files changed, 94 insertions(+), 72 deletions(-) >>>> > > > >> >>>> > > > >> diff --git a/platform/linux-dpdk/include/odp_packet_dpdk.h >>>> > > > >> b/platform/linux-dpdk/include/odp_packet_dpdk.h >>>> > > > >> index bcbe9e8..bcf9aa5 100644 >>>> > > > >> --- a/platform/linux-dpdk/include/odp_packet_dpdk.h >>>> > > > >> +++ b/platform/linux-dpdk/include/odp_packet_dpdk.h >>>> > > > >> @@ -50,6 +50,30 @@ >>>> > > > >> #define DPDK_BLOCKING_IO >>>> > > > >> +/* >>>> > > > >> + * RX and TX Prefetch, Host, and Write-back threshold >>>> > > values >>>> > > should be >>>> > > > >> + * carefully set for optimal performance. Consult the >>>> > > network >>>> > > > >> + * controller's datasheet and supporting DPDK documentation >>>> > > for guidance >>>> > > > >> + * on how these parameters should be set. >>>> > > > >> + */ >>>> > > > >> +#define RX_PTHRESH 8 /**< Default values of RX prefetch >>>> > > threshold reg. */ >>>> > > > >> +#define RX_HTHRESH 8 /**< Default values of RX host >>>> > > threshold reg. */ >>>> > > > >> +#define RX_WTHRESH 4 /**< Default values of RX write-back >>>> > > threshold reg. >>>> > > > >> */ >>>> > > > >> + >>>> > > > >> +/* >>>> > > > >> + * These default values are optimized for use with the >>>> > > Intel(R) 82599 10 >>>> > > > >> GbE >>>> > > > >> + * Controller and the DPDK ixgbe PMD. Consider using other >>>> > > values for >>>> > > > >> other >>>> > > > >> + * network controllers and/or network drivers. >>>> > > > >> + */ >>>> > > > >> +#define TX_PTHRESH 36 /**< Default values of TX prefetch >>>> > > threshold reg. >>>> > > > >> */ >>>> > > > >> +#define TX_HTHRESH 0 /**< Default values of TX host >>>> > > threshold reg. */ >>>> > > > >> +#define TX_WTHRESH 0 /**< Default values of TX write-back >>>> > > threshold >>>> > > > >> reg. */ >>>> > > > >> + >>>> > > > >> +#define MAX_PKT_BURST 16 >>>> > > > >> +#define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */ >>>> > > > >> +#define RTE_TEST_RX_DESC_DEFAULT 128 >>>> > > > >> +#define RTE_TEST_TX_DESC_DEFAULT 512 >>>> > > > >> + >>>> > > > >> /** Packet socket using dpdk mmaped rings for both Rx and >>>> > > Tx */ >>>> > > > >> typedef struct { >>>> > > > >> odp_buffer_pool_t pool; >>>> > > > >> diff --git a/platform/linux-dpdk/odp_buffer_pool.c >>>> > > > >> b/platform/linux-dpdk/odp_buffer_pool.c >>>> > > > >> index de90275..805ce68 100644 >>>> > > > >> --- a/platform/linux-dpdk/odp_buffer_pool.c >>>> > > > >> +++ b/platform/linux-dpdk/odp_buffer_pool.c >>>> > > > >> @@ -23,7 +23,7 @@ >>>> > > > >> #include <odp_packet_dpdk.h> >>>> > > > >> #define MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + >>>> > > > >> RTE_PKTMBUF_HEADROOM) >>>> > > > >> -#define NB_MBUF 8192 >>>> > > > >> +#define NB_MBUF 32768 >>>> > > > >> #ifdef POOL_USE_TICKETLOCK >>>> > > > >> #include <odp_ticketlock.h> >>>> > > > >> @@ -112,7 +112,7 @@ odp_buffer_pool_t >>>> > > odp_buffer_pool_create(const char >>>> > > > >> *name, >>>> > > > >> pktmbuf_pool = >>>> > > > >> rte_mempool_create(name, NB_MBUF, >>>> > > > >> - MBUF_SIZE, 32, >>>> > > > >> + MBUF_SIZE, MAX_PKT_BURST, >>>> > > > >> sizeof(struct >>>> > > > >> rte_pktmbuf_pool_private), >>>> > > > >> rte_pktmbuf_pool_init, NULL, >>>> > > > >> rte_pktmbuf_init, NULL, >>>> > > > >> diff --git a/platform/linux-dpdk/odp_packet_dpdk.c >>>> > > > >> b/platform/linux-dpdk/odp_packet_dpdk.c >>>> > > > >> index 31bfa30..d5c8e80 100644 >>>> > > > >> --- a/platform/linux-dpdk/odp_packet_dpdk.c >>>> > > > >> +++ b/platform/linux-dpdk/odp_packet_dpdk.c >>>> > > > >> @@ -26,34 +26,13 @@ >>>> > > > >> #include <odp_packet_dpdk.h> >>>> > > > >> #include <net/if.h> >>>> > > > >> -/* >>>> > > > >> - * RX and TX Prefetch, Host, and Write-back threshold >>>> > > values >>>> > > should be >>>> > > > >> - * carefully set for optimal performance. Consult the >>>> > > network >>>> > > > >> - * controller's datasheet and supporting DPDK documentation >>>> > > for guidance >>>> > > > >> - * on how these parameters should be set. >>>> > > > >> - */ >>>> > > > >> -#define RX_PTHRESH 8 /**< Default values of RX prefetch >>>> > > threshold reg. */ >>>> > > > >> -#define RX_HTHRESH 8 /**< Default values of RX host >>>> > > threshold reg. */ >>>> > > > >> -#define RX_WTHRESH 4 /**< Default values of RX write-back >>>> > > threshold reg. >>>> > > > >> */ >>>> > > > >> - >>>> > > > >> -/* >>>> > > > >> - * These default values are optimized for use with the >>>> > > Intel(R) 82599 10 >>>> > > > >> GbE >>>> > > > >> - * Controller and the DPDK ixgbe PMD. Consider using other >>>> > > values for >>>> > > > >> other >>>> > > > >> - * network controllers and/or network drivers. >>>> > > > >> - */ >>>> > > > >> -#define TX_PTHRESH 36 /**< Default values of TX prefetch >>>> > > threshold reg. >>>> > > > >> */ >>>> > > > >> -#define TX_HTHRESH 0 /**< Default values of TX host >>>> > > threshold reg. */ >>>> > > > >> -#define TX_WTHRESH 0 /**< Default values of TX write-back >>>> > > threshold >>>> > > > >> reg. */ >>>> > > > >> - >>>> > > > >> -#define MAX_PKT_BURST 16 >>>> > > > >> -#define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */ >>>> > > > >> -#define RTE_TEST_RX_DESC_DEFAULT 128 >>>> > > > >> -#define RTE_TEST_TX_DESC_DEFAULT 512 >>>> > > > >> static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT; >>>> > > > >> static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT; >>>> > > > >> static const struct rte_eth_conf port_conf = { >>>> > > > >> .rxmode = { >>>> > > > >> + .mq_mode = ETH_MQ_RX_RSS, >>>> > > > >> + .max_rx_pkt_len = ETHER_MAX_LEN, >>>> > > > >> .split_hdr_size = 0, >>>> > > > >> .header_split = 0, /**< Header Split >>>> > > disabled */ >>>> > > > >> .hw_ip_checksum = 0, /**< IP checksum >>>> > > offload >>>> > > disabled */ >>>> > > > >> @@ -61,6 +40,12 @@ static const struct rte_eth_conf >>>> > > port_conf = { >>>> > > > >> .jumbo_frame = 0, /**< Jumbo Frame >>>> > > Support >>>> > > disabled */ >>>> > > > >> .hw_strip_crc = 0, /**< CRC stripped by >>>> > > hardware */ >>>> > > > >> }, >>>> > > > >> + .rx_adv_conf = { >>>> > > > >> + .rss_conf = { >>>> > > > >> + .rss_key = NULL, >>>> > > > >> + .rss_hf = ETH_RSS_IPV4 | >>>> > > ETH_RSS_IPV6, >>>> > > > >> + }, >>>> > > > >> + }, >>>> > > > >> .txmode = { >>>> > > > >> .mq_mode = ETH_MQ_TX_NONE, >>>> > > > >> }, >>>> > > > >> @@ -95,60 +80,71 @@ int setup_pkt_dpdk(pkt_dpdk_t * const >>>> > > pkt_dpdk, const >>>> > > > >> char *netdev, >>>> > > > >> ODP_DBG("setup_pkt_dpdk\n"); >>>> > > > >> static struct ether_addr eth_addr[RTE_MAX_ETHPORTS]; >>>> > > > >> - uint8_t portid = 0; >>>> > > > >> - uint16_t queueid = 0; >>>> > > > >> - int ret; >>>> > > > >> + static int portinit[RTE_MAX_ETHPORTS]; >>>> > > > >> + static int qid[RTE_MAX_ETHPORTS]; >>>> > > > >> + uint8_t portid = 0, num_intf = 2; >>>> > > > >> + uint16_t nbrxq = 0, nbtxq = 0; >>>> > > > >> + int ret, i; >>>> > > > >> + >>>> > > > >> printf("dpdk netdev: %s\n", netdev); >>>> > > > >> printf("dpdk pool: %lx\n", pool); >>>> > > > >> - >>>> > > > >> portid = atoi(netdev); >>>> > > > >> pkt_dpdk->portid = portid; >>>> > > > >> - pkt_dpdk->queueid = queueid; >>>> > > > >> pkt_dpdk->pool = pool; >>>> > > > >> printf("dpdk portid: %u\n", portid); >>>> > > > >> - fflush(stdout); >>>> > > > >> - ret = rte_eth_dev_configure(portid, 1, 1, >>>> > > &port_conf); >>>> > > > >> - if (ret < 0) >>>> > > > >> - ODP_ERR("Cannot configure device: err=%d, >>>> > > port=%u\n", >>>> > > > >> - ret, (unsigned) portid); >>>> > > > >> - >>>> > > > >> - rte_eth_macaddr_get(portid, ð_addr[portid]); >>>> > > > >> - ODP_DBG("Port %u, MAC address: >>>> > > %02X:%02X:%02X:%02X:%02X:%02X\ >>>> > > > >> n\n", >>>> > > > >> - (unsigned) portid, >>>> > > > >> - eth_addr[portid].addr_bytes[0], >>>> > > > >> - eth_addr[portid].addr_bytes[1], >>>> > > > >> - eth_addr[portid].addr_bytes[2], >>>> > > > >> - eth_addr[portid].addr_bytes[3], >>>> > > > >> - eth_addr[portid].addr_bytes[4], >>>> > > > >> - eth_addr[portid].addr_bytes[5]); >>>> > > > >> - >>>> > > > >> - /* init one RX queue on each port */ >>>> > > > >> - fflush(stdout); >>>> > > > >> - ret = rte_eth_rx_queue_setup(portid, queueid, >>>> > > nb_rxd, >>>> > > > >> - rte_eth_dev_socket_id(portid), >>>> > > > >> &rx_conf, >>>> > > > >> - (struct rte_mempool *)pool); >>>> > > > >> - if (ret < 0) >>>> > > > >> - ODP_ERR("rte_eth_rx_queue_setup:err=%d, port=%u\n", >>>> > > > >> - ret, (unsigned) portid); >>>> > > > >> - ODP_DBG("dpdk rx queue setup done\n"); >>>> > > > >> - >>>> > > > >> - /* init one TX queue on each port */ >>>> > > > >> - fflush(stdout); >>>> > > > >> - ret = rte_eth_tx_queue_setup(portid, queueid, >>>> > > nb_txd, >>>> > > > >> - rte_eth_dev_socket_id(portid), &tx_conf); >>>> > > > >> - if (ret < 0) >>>> > > > >> - ODP_ERR("rte_eth_tx_queue_setup:err=%d, port=%u\n", >>>> > > > >> - ret, (unsigned) portid); >>>> > > > >> - ODP_DBG("dpdk tx queue setup done\n"); >>>> > > > >> - >>>> > > > >> - /* Start device */ >>>> > > > >> - ret = rte_eth_dev_start(portid); >>>> > > > >> - if (ret < 0) >>>> > > > >> - ODP_ERR("rte_eth_dev_start:err=%d, port=%u\n", >>>> > > > >> - ret, (unsigned) portid); >>>> > > > >> - ODP_DBG("dpdk setup done\n\n"); >>>> > > > >> - >>>> > > > >> + nbrxq = odp_sys_core_count() / num_intf; >>>> > > > >> + nbtxq = nbrxq; >>>> > > > >> + if (portinit[portid] == 0) { >>>> > > > >> + fflush(stdout); >>>> > > > >> + ret = rte_eth_dev_configure(portid, nbrxq, >>>> > > nbtxq, >>>> > > > >> &port_conf); >>>> > > > >> + if (ret < 0) >>>> > > > >> + ODP_ERR("Cannot configure device: >>>> > > err=%d, >>>> > > > >> port=%u\n", >>>> > > > >> + ret, (unsigned) portid); >>>> > > > >> + >>>> > > > >> + rte_eth_macaddr_get(portid, ð_addr[portid]); >>>> > > > >> + ODP_DBG("Port %u, MAC address: >>>> > > > >> %02X:%02X:%02X:%02X:%02X:%02X\n", >>>> > > > >> + (unsigned) portid, >>>> > > > >> + eth_addr[portid].addr_bytes[0], >>>> > > > >> + eth_addr[portid].addr_bytes[1], >>>> > > > >> + eth_addr[portid].addr_bytes[2], >>>> > > > >> + eth_addr[portid].addr_bytes[3], >>>> > > > >> + eth_addr[portid].addr_bytes[4], >>>> > > > >> + eth_addr[portid].addr_bytes[5]); >>>> > > > >> + >>>> > > > >> + /* init one RX queue on each port */ >>>> > > > >> + fflush(stdout); >>>> > > > >> + for (i = 0; i < nbrxq; i++) { >>>> > > > >> + ret = rte_eth_rx_queue_setup(portid, >>>> > > i, nb_rxd, >>>> > > > >> + rte_eth_dev_socket_id(portid), >>>> > > > >> &rx_conf, >>>> > > > >> + (struct rte_mempool *)pool); >>>> > > > >> + if (ret < 0) >>>> > > > >> + ODP_ERR("%s rxq:err=%d, port=%u\n", >>>> > > > >> + __func__, ret, (unsigned) portid); >>>> > > > >> + ODP_DBG("dpdk rx queue setup >>>> > > done\n"); >>>> > > > >> + } >>>> > > > >> + >>>> > > > >> + /* init one TX queue on each port */ >>>> > > > >> + fflush(stdout); >>>> > > > >> + for (i = 0; i < nbtxq; i++) { >>>> > > > >> + ret = rte_eth_tx_queue_setup(portid, >>>> > > i, nb_txd, >>>> > > > >> + rte_eth_dev_socket_id(portid), &tx_conf); >>>> > > > >> + if (ret < 0) >>>> > > > >> + ODP_ERR("%s txq:err=%d, port=%u\n", >>>> > > > >> + __func__, ret, (unsigned) portid); >>>> > > > >> + ODP_DBG("dpdk tx queue setup >>>> > > done\n"); >>>> > > > >> + } >>>> > > > >> + >>>> > > > >> + /* Start device */ >>>> > > > >> + ret = rte_eth_dev_start(portid); >>>> > > > >> + if (ret < 0) >>>> > > > >> + ODP_ERR("rte_eth_dev_start:err=%d, port=%u\n", >>>> > > > >> + ret, (unsigned) portid); >>>> > > > >> + ODP_DBG("dpdk setup done\n\n"); >>>> > > > >> + >>>> > > > >> + portinit[portid] = 1; >>>> > > > >> + } >>>> > > > >> + pkt_dpdk->queueid = qid[portid]++; >>>> > > > >> return 0; >>>> > > > >> } >>>> > > > >> diff --git a/platform/linux-dpdk/odp_packet_io.c >>>> > > > >> b/platform/linux-dpdk/odp_packet_io.c >>>> > > > >> index d8d127f..3124175 100644 >>>> > > > >> --- a/platform/linux-dpdk/odp_packet_io.c >>>> > > > >> +++ b/platform/linux-dpdk/odp_packet_io.c >>>> > > > >> @@ -230,6 +230,8 @@ int odp_pktio_recv(odp_pktio_t id, >>>> > > odp_packet_t >>>> > > > >> pkt_table[], unsigned len) >>>> > > > >> if (pktio_entry == NULL) >>>> > > > >> return -1; >>>> > > > >> + odp_pktio_send(id, pkt_table, 0); >>>> > > > >> + >>>> > > > >> lock_entry(pktio_entry); >>>> > > > >> pkts = recv_pkt_dpdk(&pktio_entry->s.pkt_dpdk, >>>> > > pkt_table, len); >>>> > > > >> unlock_entry(pktio_entry); >>>> > > > >> >>>> > > > > >>>> > > > > >>>> > > > > _______________________________________________ >>>> > > > > lng-odp mailing list >>>> > > > > lng-odp@lists.linaro.org<mailto:lng-odp@lists.linaro.org> <mailto:lng-odp@lists.linaro.org> <mailto:lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>> <mailto:lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org> <mailto:lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>>> >>>> > > > > http://lists.linaro.org/mailman/listinfo/lng-odp <http://lists.linaro.org/mailman/listinfo/lng-odp> >>>> > > > > >>>> > > > >>>> > > > >>>> > > > >>>> > > > -- >>>> > > > *Mike Holmes* >>>> > > > Linaro Technical Manager / Lead >>>> > > > LNG - ODP >>>> > > >>>> > > > _______________________________________________ >>>> > > > lng-odp mailing list >>>> > > > lng-odp@lists.linaro.org<mailto:lng-odp@lists.linaro.org> <mailto:lng-odp@lists.linaro.org> <mailto:lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>> <mailto:lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org> <mailto:lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>>> >>>> > > > http://lists.linaro.org/mailman/listinfo/lng-odp <http://lists.linaro.org/mailman/listinfo/lng-odp> >>>> > > >>>> > > >>>> > > -- >>>> > > Anders Roxell >>>> > > anders.roxell@linaro.org<mailto:anders.roxell@linaro.org> <mailto:anders.roxell@linaro.org> <mailto:anders.roxell@linaro.org <mailto:anders.roxell@linaro.org>> <mailto:anders.roxell@linaro.org <mailto:anders.roxell@linaro.org> <mailto:anders.roxell@linaro.org <mailto:anders.roxell@linaro.org>>> >>>> > > M: +46 709 71 42 85 <tel:%2B46%20709%2071%2042%2085> <tel:%2B46%20709%2071%2042%2085> | IRC: roxell >>>> > > >>>> > > _______________________________________________ >>>> > > lng-odp mailing list >>>> > > lng-odp@lists.linaro.org<mailto:lng-odp@lists.linaro.org> <mailto:lng-odp@lists.linaro.org> <mailto:lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>> <mailto:lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org> <mailto:lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>>> >>>> > > http://lists.linaro.org/mailman/listinfo/lng-odp >>>> > > >>>> > > >>>> > > >>>> > > >>>> > >_______________________________________________ >>>> > >lng-odp mailing list >>>> > >lng-odp@lists.linaro.org<mailto:lng-odp@lists.linaro.org> <mailto:lng-odp@lists.linaro.org> <mailto:lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>> >>>> > >http://lists.linaro.org/mailman/listinfo/lng-odp >>>> > >>>> > >>>> > _______________________________________________ >>>> > lng-odp mailing list >>>> > lng-odp@lists.linaro.org<mailto:lng-odp@lists.linaro.org> <mailto:lng-odp@lists.linaro.org> <mailto:lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>> >>>> > http://lists.linaro.org/mailman/listinfo/lng-odp <http://lists.linaro.org/mailman/listinfo/lng-odp> >>>> >>>> -- >>>> Anders Roxell >>>> anders.roxell@linaro.org<mailto:anders.roxell@linaro.org> <mailto:anders.roxell@linaro.org> <mailto:anders.roxell@linaro.org <mailto:anders.roxell@linaro.org>> >>>> M: +46 709 71 42 85 <tel:%2B46%20709%2071%2042%2085> <tel:%2B46%20709%2071%2042%2085> | IRC: roxell >>>> >>>> _______________________________________________ >>>> lng-odp mailing list >>>> lng-odp@lists.linaro.org<mailto:lng-odp@lists.linaro.org> <mailto:lng-odp@lists.linaro.org> <mailto:lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>> >>>> http://lists.linaro.org/mailman/listinfo/lng-odp >>> >>> >>> >>> >>> -- >>> Mike Holmes >>> Linaro Technical Manager / Lead >>> LNG - ODP >>> >>> _______________________________________________ >>> lng-odp mailing list >>> lng-odp@lists.linaro.org<mailto:lng-odp@lists.linaro.org> <mailto:lng-odp@lists.linaro.org> <mailto:lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>> >>> http://lists.linaro.org/mailman/listinfo/lng-odp >>> >> > > > > -- > Mike Holmes > Linaro Technical Manager / Lead > LNG - ODP > > _______________________________________________ > lng-odp mailing list > lng-odp@lists.linaro.org<mailto:lng-odp@lists.linaro.org> <mailto:lng-odp@lists.linaro.org> <mailto:lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>> > http://lists.linaro.org/mailman/listinfo/lng-odp > -- *Mike Holmes* Linaro Technical Manager / Lead LNG - ODP _______________________________________________ lng-odp mailing list lng-odp@lists.linaro.org<mailto:lng-odp@lists.linaro.org> <mailto:lng-odp@lists.linaro.org> http://lists.linaro.org/mailman/listinfo/lng-odp _______________________________________________ lng-odp mailing list lng-odp@lists.linaro.org<mailto:lng-odp@lists.linaro.org> <mailto:lng-odp@lists.linaro.org> http://lists.linaro.org/mailman/listinfo/lng-odp -- *Mike Holmes* Linaro Technical Manager / Lead LNG - ODP
On 13 August 2014 02:30, Wiles, Roger Keith <keith.wiles@windriver.com> wrote: > The DPDK version of Pktgen is a bit easy to use and configure then the > kernel based version. You can also run it on the machine if you make sure > you configure DPDK correctly (if you have two DPDKs running). > > If you build Pktgen-DPDK on another machine it should be pretty quick > (within a 1/2 hour normally if not faster :-) ) to get running if all you > need is to send UDP or TCP frames. I still not know your requires for the > traffic. At least with Pktgen-DPDK you have a clean simple full screen > ASCII (vt100) interface to use. > I am modifying the dst ip address. Say 12 different ip address(201.0.0.0 to 201.0.0.11) and again start from beginning. Can you please point me to how pktgen can do this?. > > If you have the machine setup for DPDK it will just work sending 64Byte > frames as 10G wire rate. If you decide to go this direction I can help set > it up for you. > > *Keith **Wiles*, Principal Technologist with CTO office, *Wind River *mobile > 972-213-5533 > > On Aug 12, 2014, at 3:41 PM, Maxim Uvarov <maxim.uvarov@linaro.org> > wrote: > > On 08/13/2014 12:38 AM, Mike Holmes wrote: > > To generate test data we don't have to use ODP, although we should try to > do that down the road, but equally you still need to use external tools to > be sure you did not make compatible only with yourself mistakes. > > I was wondering why we can't spawn several process on one machine that all > send to the same port to test this ? > > > Why not to use kernel packet generator? > https://www.kernel.org/doc/Documentation/networking/pktgen.txt > > > > On 12 August 2014 16:31, Maxim Uvarov <maxim.uvarov@linaro.org< > mailto:maxim.uvarov@linaro.org <maxim.uvarov@linaro.org>>> wrote: > > On 08/13/2014 12:29 AM, Maxim Uvarov wrote: > > why not to use tcpreplay? > > I.e. odp+libpcap+dpdk+tcpreplay if we have everything ready? > > Maxim. > > Ah, I should check that first. tcpreplay doesn't depend on libpcap. > > ldd /usr/bin/tcpreplay > linux-vdso.so.1 => (0x00007fffa3bfe000) > libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f3d490ba000) > /lib64/ld-linux-x86-64.so.2 (0x00007f3d494a5000) > > > > > On 08/12/2014 11:42 PM, Wiles, Roger Keith wrote: > > Pktgen has a number of different ways to send packets > single, range, pcap or random, sequence with parameters. > > One thing Pktgen does not do is act like a real stack, but > you can simulate that with pcap or sequence packets. It > basically depends on how complex a data flow you need. > > # git clone git://github.com/Pktgen/Pktgen-DPDK > <http://github.com/Pktgen/Pktgen-DPDK> > > Let me know if I can help or change the code in some way. > > THanks > ++keith > > *Keith **Wiles*, Principal Technologist with CTO office, > *Wind River*mobile 972-213-5533 <tel:972-213-5533> > > On Aug 12, 2014, at 1:08 PM, Mike Holmes > <mike.holmes@linaro.org <mailto:mike.holmes@linaro.org > <mike.holmes@linaro.org>> > <mailto:mike.holmes@linaro.org <mike.holmes@linaro.org> > <mailto:mike.holmes@linaro.org <mike.holmes@linaro.org>>>> > wrote: > > So it looks like we don't have any way to test this > without an Ixia which is a problem given that Santosh > is having trouble. > Basically there is no CI job to point at that shows > that excluding human error it is still working as > expected. > > Keith, is dpdk pktgen able to generate pkts in the way > Venki needs ? > > Mike > > > On 12 August 2014 02:17, Santosh Shukla > <santosh.shukla@linaro.org > <mailto:santosh.shukla@linaro.org > <santosh.shukla@linaro.org>> > <mailto:santosh.shukla@linaro.org > <santosh.shukla@linaro.org> > <mailto:santosh.shukla@linaro.org > <santosh.shukla@linaro.org>>>> wrote: > > On 12 August 2014 00:25, Mike Holmes > <mike.holmes@linaro.org <mailto:mike.holmes@linaro.org > <mike.holmes@linaro.org>> > <mailto:mike.holmes@linaro.org <mike.holmes@linaro.org> > <mailto:mike.holmes@linaro.org <mike.holmes@linaro.org>>>> > wrote: > > Which test case in odp/test would check this, or > does it need > an application > > like l2fwd to be run - are either in LAVA/CI ? > > > > Santosh are you able to verify this does not > break anything as > part of the > > l2fwd work you are doing ? > > > > No, I am seeing problem with current and should > persist in this multi > flavour too. We have bug reported on that lines. > So whole dpdk-l2fwd > doesn't works for me for my requirement. > > Thanks. > > > Mike > > > > > > On 11 August 2014 01:43, Venkatesh Vivekanandan > > <venkatesh.vivekanandan@linaro.org > <mailto:venkatesh.vivekanandan@linaro.org > <venkatesh.vivekanandan@linaro.org>> > <mailto:venkatesh.vivekanandan@linaro.org > <venkatesh.vivekanandan@linaro.org> > <mailto:venkatesh.vivekanandan@linaro.org > <venkatesh.vivekanandan@linaro.org>>>> wrote: > >> > >> > >> > >> > >> On 9 August 2014 17:32, Mike Holmes > <mike.holmes@linaro.org <mailto:mike.holmes@linaro.org > <mike.holmes@linaro.org>> > <mailto:mike.holmes@linaro.org <mike.holmes@linaro.org> > <mailto:mike.holmes@linaro.org <mike.holmes@linaro.org>>>> > wrote: > >>> > >>> > >>> > >>> > >>> On 8 August 2014 17:46, Anders Roxell > <anders.roxell@linaro.org > <mailto:anders.roxell@linaro.org <anders.roxell@linaro.org> > > > <mailto:anders.roxell@linaro.org <anders.roxell@linaro.org> > <mailto:anders.roxell@linaro.org <anders.roxell@linaro.org>>>> > wrote: > >>>> > >>>> On 2014-08-08 17:31, Maxim Uvarov wrote: > >>>> > On 08/08/2014 05:13 PM, Venkatesh > Vivekanandan wrote: > >>>> > > > >>>> > > > >>>> > > > >>>> > >On 7 August 2014 21:10, Anders Roxell > <anders.roxell@linaro.org > <mailto:anders.roxell@linaro.org <anders.roxell@linaro.org> > > > <mailto:anders.roxell@linaro.org <anders.roxell@linaro.org> > <mailto:anders.roxell@linaro.org <anders.roxell@linaro.org> > >> > >>>> > ><mailto:anders.roxell@linaro.org > <anders.roxell@linaro.org> > <mailto:anders.roxell@linaro.org <anders.roxell@linaro.org> > > > <mailto:anders.roxell@linaro.org > <anders.roxell@linaro.org> > <mailto:anders.roxell@linaro.org <anders.roxell@linaro.org>>>>> > wrote: > >>>> > > > >>>> > > On 2014-08-07 10:41, Mike Holmes wrote: > >>>> > > > Does this need a signoff by someone > else before it > is merged ? > >>>> > > > > >>>> > > > I think we want to enforce getting > an ack, tested-by or > >>>> > > reviewed-by before > >>>> > > > we merge things, we have informally > moved that way > over the > >>>> > > last > >>>> > > couple of > >>>> > > > weeks and now I think it is time we > made it a formal > >>>> > > requirement. > >>>> > > > >>>> > > Agree. > >>>> > > > >>>> > > > >>>> > >If this is the case, then is it fair to > say initial > discussion of > >>>> > >24-hour window is void?. I guess Maxim was > waiting for 2 > days(for > >>>> > >any comments) before he could merge this > patch. Do we > have any > >>>> > >time-limit before which a patch /must /be > reviewed or > tested? I > >>>> > >hope we can't wait indefinitely or is this > the case?. > >>>> > > >>>> > I think if patch came from platfrom > maintainer, it's not > new API. No > >>>> > comments in 1 or 2 days, than it's ok to > merge it. If > patch came > >>>> > from somobody alse I would ask maintainer > to review it. > >>>> > >>>> I disagree with this. > >>>> No matter where the patch comes from and who > wrote the > patch, it can be > >>>> wrong and need a second pair of eyes i.e., > >>>> (Reviewed|Acked|Signed-off)-by. > >>>> If no one has replied to a patch after 2 > days, the author of > the patch > >>>> should ping the list and maintainer. > >>>> > >>>> After the second pair of eyes, the patch > should be ok to be > merged. > >>>> The ODP maintainer should do a smoke build > test on all the > supported > >>>> platforms before merging though. > >>> > >>> > >>> My 2 cents > >>> We have started to develop a cohesive API, I > think that is > down to a lot > >>> of folks working together. > >>> I also think that peer review/team work is > reflected in the > increasing > >>> willingness to review each others patches > which has improved > quality > >>> and helped establish the guidelines on how > things bolt > together in ODP, > >>> may long discussions have spawned from patches. > >>> > >>> No one is beyond silly mistakes, peer review > finds a lot of > the dumb > >>> stuff for little cost, saving on the > inevitable ugly patch up > that will > >>> ensue otherwise. > >>> Maxim you could do the default reviews if no > one came > forward, but if a > >>> submitter finds and establishes their own > network of > reviewers that is one > >>> extra pair of eyes and ideas. > >> > >> > >> Can someone please review this patch?. If there > is any > comments, we can > >> request maxim to revert the patch, otherwise he > can add the > >> "Reviewed-by/Tested-by" to the applied patch. > >> > >>>> > >>>> Cheers, > >>>> Anders > >>>> > >>>> > > >>>> > Maxim. > >>>> > > >>>> > > Anders > >>>> > > > >>>> > > > > >>>> > > > Mike > >>>> > > > > >>>> > > > > >>>> > > > On 7 August 2014 09:15, Maxim Uvarov > <maxim.uvarov@linaro.org > <mailto:maxim.uvarov@linaro.org <maxim.uvarov@linaro.org>> > <mailto:maxim.uvarov@linaro.org <maxim.uvarov@linaro.org> > <mailto:maxim.uvarov@linaro.org <maxim.uvarov@linaro.org>>> > >>>> > > <mailto:maxim.uvarov@linaro.org > <maxim.uvarov@linaro.org> > <mailto:maxim.uvarov@linaro.org <maxim.uvarov@linaro.org>> > <mailto:maxim.uvarov@linaro.org > <maxim.uvarov@linaro.org> > <mailto:maxim.uvarov@linaro.org <maxim.uvarov@linaro.org>>>>> > wrote: > >>>> > > > > >>>> > > > > Merged, thanks! > >>>> > > > > > >>>> > > > > Maxim. > >>>> > > > > > >>>> > > > > > >>>> > > > > On 08/05/2014 06:54 PM, > venkatesh.vivekanandan@linaro.org > <mailto:venkatesh.vivekanandan@linaro.org > <venkatesh.vivekanandan@linaro.org>> > <mailto:venkatesh.vivekanandan@linaro.org > <venkatesh.vivekanandan@linaro.org> > <mailto:venkatesh.vivekanandan@linaro.org > <venkatesh.vivekanandan@linaro.org>>> > >>>> > > <mailto:venkatesh.vivekanandan@linaro.org > <venkatesh.vivekanandan@linaro.org> > <mailto:venkatesh.vivekanandan@linaro.org > <venkatesh.vivekanandan@linaro.org>> > <mailto:venkatesh.vivekanandan@linaro.org > <venkatesh.vivekanandan@linaro.org> > <mailto:venkatesh.vivekanandan@linaro.org > <venkatesh.vivekanandan@linaro.org>>>> wrote: > >>>> > > > > > >>>> > > > >> From: Venkatesh Vivekanandan > >>>> > > <venkatesh.vivekanandan@linaro.org > <mailto:venkatesh.vivekanandan@linaro.org > <venkatesh.vivekanandan@linaro.org>> > <mailto:venkatesh.vivekanandan@linaro.org > <venkatesh.vivekanandan@linaro.org> > <mailto:venkatesh.vivekanandan@linaro.org > <venkatesh.vivekanandan@linaro.org>>> > >>>> > > <mailto:venkatesh.vivekanandan@linaro.org > <venkatesh.vivekanandan@linaro.org> > <mailto:venkatesh.vivekanandan@linaro.org > <venkatesh.vivekanandan@linaro.org>> > <mailto:venkatesh.vivekanandan@linaro.org > <venkatesh.vivekanandan@linaro.org> > <mailto:venkatesh.vivekanandan@linaro.org > <venkatesh.vivekanandan@linaro.org>>>>> > >>>> > > > >> > >>>> > > > >> - Multi queue support per > interface is enabled. > >>>> > > > >> - odp_pktio_send with "0" packet > is called in > odp_pktio_recv > >>>> > > to > >>>> > > > >> give the transmitted buffers > back to mempool. > >>>> > > > >> - mbuf alloc failure during > receive is fixed by > giving more > >>>> > > buffers to > >>>> > > > >> mempool. > >>>> > > > >> - mempool cache size is given > equivalent to > MAX_PKT_BURST. > >>>> > > > >> > >>>> > > > >> Signed-off-by: Venkatesh Vivekanandan > >>>> > > <venkatesh.vivekanandan@linaro.org > <mailto:venkatesh.vivekanandan@linaro.org > <venkatesh.vivekanandan@linaro.org>> > <mailto:venkatesh.vivekanandan@linaro.org > <venkatesh.vivekanandan@linaro.org> > <mailto:venkatesh.vivekanandan@linaro.org > <venkatesh.vivekanandan@linaro.org>>> > >>>> > > <mailto:venkatesh.vivekanandan@linaro.org > <venkatesh.vivekanandan@linaro.org> > <mailto:venkatesh.vivekanandan@linaro.org > <venkatesh.vivekanandan@linaro.org>> > <mailto:venkatesh.vivekanandan@linaro.org > <venkatesh.vivekanandan@linaro.org> > <mailto:venkatesh.vivekanandan@linaro.org > <venkatesh.vivekanandan@linaro.org>>>>> > >>>> > > > >> --- > >>>> > > > >> > platform/linux-dpdk/include/odp_packet_dpdk.h | > 24 +++++ > >>>> > > > >> > platform/linux-dpdk/odp_buffer_pool.c | 4 +- > >>>> > > > >> > platform/linux-dpdk/odp_packet_dpdk.c | 136 > >>>> > > > >> +++++++++++++------------- > >>>> > > > >> > platform/linux-dpdk/odp_packet_io.c | 2 + > >>>> > > > >> 4 files changed, 94 > insertions(+), 72 deletions(-) > >>>> > > > >> > >>>> > > > >> diff --git > a/platform/linux-dpdk/include/odp_packet_dpdk.h > >>>> > > > >> > b/platform/linux-dpdk/include/odp_packet_dpdk.h > >>>> > > > >> index bcbe9e8..bcf9aa5 100644 > >>>> > > > >> --- > a/platform/linux-dpdk/include/odp_packet_dpdk.h > >>>> > > > >> +++ > b/platform/linux-dpdk/include/odp_packet_dpdk.h > >>>> > > > >> @@ -50,6 +50,30 @@ > >>>> > > > >> #define DPDK_BLOCKING_IO > >>>> > > > >> +/* > >>>> > > > >> + * RX and TX Prefetch, Host, and > Write-back > threshold > >>>> > > values > >>>> > > should be > >>>> > > > >> + * carefully set for optimal > performance. > Consult the > >>>> > > network > >>>> > > > >> + * controller's datasheet and > supporting DPDK > documentation > >>>> > > for guidance > >>>> > > > >> + * on how these parameters > should be set. > >>>> > > > >> + */ > >>>> > > > >> +#define RX_PTHRESH 8 /**< > Default values of RX > prefetch > >>>> > > threshold reg. */ > >>>> > > > >> +#define RX_HTHRESH 8 /**< > Default values of RX host > >>>> > > threshold reg. */ > >>>> > > > >> +#define RX_WTHRESH 4 /**< > Default values of RX > write-back > >>>> > > threshold reg. > >>>> > > > >> */ > >>>> > > > >> + > >>>> > > > >> +/* > >>>> > > > >> + * These default values are > optimized for use > with the > >>>> > > Intel(R) 82599 10 > >>>> > > > >> GbE > >>>> > > > >> + * Controller and the DPDK ixgbe > PMD. Consider > using other > >>>> > > values for > >>>> > > > >> other > >>>> > > > >> + * network controllers and/or > network drivers. > >>>> > > > >> + */ > >>>> > > > >> +#define TX_PTHRESH 36 /**< > Default values of TX > prefetch > >>>> > > threshold reg. > >>>> > > > >> */ > >>>> > > > >> +#define TX_HTHRESH 0 /**< > Default values of TX > host > >>>> > > threshold reg. */ > >>>> > > > >> +#define TX_WTHRESH 0 /**< > Default values of TX > write-back > >>>> > > threshold > >>>> > > > >> reg. */ > >>>> > > > >> + > >>>> > > > >> +#define MAX_PKT_BURST 16 > >>>> > > > >> +#define BURST_TX_DRAIN_US 100 /* > TX drain every > ~100us */ > >>>> > > > >> +#define RTE_TEST_RX_DESC_DEFAULT 128 > >>>> > > > >> +#define RTE_TEST_TX_DESC_DEFAULT 512 > >>>> > > > >> + > >>>> > > > >> /** Packet socket using dpdk > mmaped rings for > both Rx and > >>>> > > Tx */ > >>>> > > > >> typedef struct { > >>>> > > > >> odp_buffer_pool_t pool; > >>>> > > > >> diff --git > a/platform/linux-dpdk/odp_buffer_pool.c > >>>> > > > >> > b/platform/linux-dpdk/odp_buffer_pool.c > >>>> > > > >> index de90275..805ce68 100644 > >>>> > > > >> --- > a/platform/linux-dpdk/odp_buffer_pool.c > >>>> > > > >> +++ > b/platform/linux-dpdk/odp_buffer_pool.c > >>>> > > > >> @@ -23,7 +23,7 @@ > >>>> > > > >> #include <odp_packet_dpdk.h> > >>>> > > > >> #define MBUF_SIZE (2048 + > sizeof(struct rte_mbuf) + > >>>> > > > >> RTE_PKTMBUF_HEADROOM) > >>>> > > > >> -#define NB_MBUF 8192 > >>>> > > > >> +#define NB_MBUF 32768 > >>>> > > > >> #ifdef POOL_USE_TICKETLOCK > >>>> > > > >> #include <odp_ticketlock.h> > >>>> > > > >> @@ -112,7 +112,7 @@ odp_buffer_pool_t > >>>> > > odp_buffer_pool_create(const char > >>>> > > > >> *name, > >>>> > > > >> pktmbuf_pool = > >>>> > > > >> rte_mempool_create(name, NB_MBUF, > >>>> > > > >> - MBUF_SIZE, 32, > >>>> > > > >> + MBUF_SIZE, MAX_PKT_BURST, > >>>> > > > >> sizeof(struct > >>>> > > > >> rte_pktmbuf_pool_private), > >>>> > > > >> rte_pktmbuf_pool_init, NULL, > >>>> > > > >> rte_pktmbuf_init, NULL, > >>>> > > > >> diff --git > a/platform/linux-dpdk/odp_packet_dpdk.c > >>>> > > > >> > b/platform/linux-dpdk/odp_packet_dpdk.c > >>>> > > > >> index 31bfa30..d5c8e80 100644 > >>>> > > > >> --- > a/platform/linux-dpdk/odp_packet_dpdk.c > >>>> > > > >> +++ > b/platform/linux-dpdk/odp_packet_dpdk.c > >>>> > > > >> @@ -26,34 +26,13 @@ > >>>> > > > >> #include <odp_packet_dpdk.h> > >>>> > > > >> #include <net/if.h> > >>>> > > > >> -/* > >>>> > > > >> - * RX and TX Prefetch, Host, and > Write-back > threshold > >>>> > > values > >>>> > > should be > >>>> > > > >> - * carefully set for optimal > performance. > Consult the > >>>> > > network > >>>> > > > >> - * controller's datasheet and > supporting DPDK > documentation > >>>> > > for guidance > >>>> > > > >> - * on how these parameters > should be set. > >>>> > > > >> - */ > >>>> > > > >> -#define RX_PTHRESH 8 /**< > Default values of RX > prefetch > >>>> > > threshold reg. */ > >>>> > > > >> -#define RX_HTHRESH 8 /**< > Default values of RX host > >>>> > > threshold reg. */ > >>>> > > > >> -#define RX_WTHRESH 4 /**< > Default values of RX > write-back > >>>> > > threshold reg. > >>>> > > > >> */ > >>>> > > > >> - > >>>> > > > >> -/* > >>>> > > > >> - * These default values are > optimized for use > with the > >>>> > > Intel(R) 82599 10 > >>>> > > > >> GbE > >>>> > > > >> - * Controller and the DPDK ixgbe > PMD. Consider > using other > >>>> > > values for > >>>> > > > >> other > >>>> > > > >> - * network controllers and/or > network drivers. > >>>> > > > >> - */ > >>>> > > > >> -#define TX_PTHRESH 36 /**< > Default values of TX > prefetch > >>>> > > threshold reg. > >>>> > > > >> */ > >>>> > > > >> -#define TX_HTHRESH 0 /**< > Default values of TX > host > >>>> > > threshold reg. */ > >>>> > > > >> -#define TX_WTHRESH 0 /**< > Default values of TX > write-back > >>>> > > threshold > >>>> > > > >> reg. */ > >>>> > > > >> - > >>>> > > > >> -#define MAX_PKT_BURST 16 > >>>> > > > >> -#define BURST_TX_DRAIN_US 100 /* > TX drain every > ~100us */ > >>>> > > > >> -#define RTE_TEST_RX_DESC_DEFAULT 128 > >>>> > > > >> -#define RTE_TEST_TX_DESC_DEFAULT 512 > >>>> > > > >> static uint16_t nb_rxd = > RTE_TEST_RX_DESC_DEFAULT; > >>>> > > > >> static uint16_t nb_txd = > RTE_TEST_TX_DESC_DEFAULT; > >>>> > > > >> static const struct rte_eth_conf > port_conf = { > >>>> > > > >> .rxmode = { > >>>> > > > >> + .mq_mode = ETH_MQ_RX_RSS, > >>>> > > > >> + .max_rx_pkt_len = ETHER_MAX_LEN, > >>>> > > > >> .split_hdr_size = 0, > >>>> > > > >> .header_split = 0, /**< Header > Split > >>>> > > disabled */ > >>>> > > > >> .hw_ip_checksum = 0, /**< IP checksum > >>>> > > offload > >>>> > > disabled */ > >>>> > > > >> @@ -61,6 +40,12 @@ static const > struct rte_eth_conf > >>>> > > port_conf = { > >>>> > > > >> .jumbo_frame = 0, /**< Jumbo Frame > >>>> > > Support > >>>> > > disabled */ > >>>> > > > >> .hw_strip_crc = 0, /**< CRC > stripped by > >>>> > > hardware */ > >>>> > > > >> }, > >>>> > > > >> + .rx_adv_conf = { > >>>> > > > >> + .rss_conf = { > >>>> > > > >> + .rss_key = NULL, > >>>> > > > >> + .rss_hf = > ETH_RSS_IPV4 | > >>>> > > ETH_RSS_IPV6, > >>>> > > > >> + }, > >>>> > > > >> + }, > >>>> > > > >> .txmode = { > >>>> > > > >> .mq_mode = ETH_MQ_TX_NONE, > >>>> > > > >> }, > >>>> > > > >> @@ -95,60 +80,71 @@ int > setup_pkt_dpdk(pkt_dpdk_t * const > >>>> > > pkt_dpdk, const > >>>> > > > >> char *netdev, > >>>> > > > >> ODP_DBG("setup_pkt_dpdk\n"); > >>>> > > > >> static struct ether_addr > eth_addr[RTE_MAX_ETHPORTS]; > >>>> > > > >> - uint8_t portid = 0; > >>>> > > > >> - uint16_t queueid = 0; > >>>> > > > >> - int ret; > >>>> > > > >> + static int > portinit[RTE_MAX_ETHPORTS]; > >>>> > > > >> + static int qid[RTE_MAX_ETHPORTS]; > >>>> > > > >> + uint8_t portid = 0, num_intf = 2; > >>>> > > > >> + uint16_t nbrxq = 0, nbtxq = 0; > >>>> > > > >> + int ret, i; > >>>> > > > >> + > >>>> > > > >> printf("dpdk netdev: %s\n", netdev); > >>>> > > > >> printf("dpdk pool: %lx\n", pool); > >>>> > > > >> - > >>>> > > > >> portid = atoi(netdev); > >>>> > > > >> pkt_dpdk->portid = portid; > >>>> > > > >> - pkt_dpdk->queueid = queueid; > >>>> > > > >> pkt_dpdk->pool = pool; > >>>> > > > >> printf("dpdk portid: %u\n", portid); > >>>> > > > >> - fflush(stdout); > >>>> > > > >> - ret = > rte_eth_dev_configure(portid, 1, 1, > >>>> > > &port_conf); > >>>> > > > >> - if (ret < 0) > >>>> > > > >> - ODP_ERR("Cannot configure device: > err=%d, > >>>> > > port=%u\n", > >>>> > > > >> - ret, > (unsigned) portid); > >>>> > > > >> - > >>>> > > > >> - rte_eth_macaddr_get(portid, > ð_addr[portid]); > >>>> > > > >> - ODP_DBG("Port %u, MAC address: > >>>> > > %02X:%02X:%02X:%02X:%02X:%02X\ > >>>> > > > >> n\n", > >>>> > > > >> - (unsigned) portid, > >>>> > > > >> - eth_addr[portid].addr_bytes[0], > >>>> > > > >> - eth_addr[portid].addr_bytes[1], > >>>> > > > >> - eth_addr[portid].addr_bytes[2], > >>>> > > > >> - eth_addr[portid].addr_bytes[3], > >>>> > > > >> - eth_addr[portid].addr_bytes[4], > >>>> > > > >> - eth_addr[portid].addr_bytes[5]); > >>>> > > > >> - > >>>> > > > >> - /* init one RX queue on each > port */ > >>>> > > > >> - fflush(stdout); > >>>> > > > >> - ret = > rte_eth_rx_queue_setup(portid, queueid, > >>>> > > nb_rxd, > >>>> > > > >> - rte_eth_dev_socket_id(portid), > >>>> > > > >> &rx_conf, > >>>> > > > >> - (struct rte_mempool *)pool); > >>>> > > > >> - if (ret < 0) > >>>> > > > >> - > ODP_ERR("rte_eth_rx_queue_setup:err=%d, > port=%u\n", > >>>> > > > >> - ret, > (unsigned) portid); > >>>> > > > >> - ODP_DBG("dpdk rx queue setup > done\n"); > >>>> > > > >> - > >>>> > > > >> - /* init one TX queue on each > port */ > >>>> > > > >> - fflush(stdout); > >>>> > > > >> - ret = > rte_eth_tx_queue_setup(portid, queueid, > >>>> > > nb_txd, > >>>> > > > >> - rte_eth_dev_socket_id(portid), > &tx_conf); > >>>> > > > >> - if (ret < 0) > >>>> > > > >> - > ODP_ERR("rte_eth_tx_queue_setup:err=%d, > port=%u\n", > >>>> > > > >> - ret, > (unsigned) portid); > >>>> > > > >> - ODP_DBG("dpdk tx queue setup > done\n"); > >>>> > > > >> - > >>>> > > > >> - /* Start device */ > >>>> > > > >> - ret = rte_eth_dev_start(portid); > >>>> > > > >> - if (ret < 0) > >>>> > > > >> - > ODP_ERR("rte_eth_dev_start:err=%d, port=%u\n", > >>>> > > > >> - ret, > (unsigned) portid); > >>>> > > > >> - ODP_DBG("dpdk setup done\n\n"); > >>>> > > > >> - > >>>> > > > >> + nbrxq = odp_sys_core_count() > / num_intf; > >>>> > > > >> + nbtxq = nbrxq; > >>>> > > > >> + if (portinit[portid] == 0) { > >>>> > > > >> + fflush(stdout); > >>>> > > > >> + ret = rte_eth_dev_configure(portid, > nbrxq, > >>>> > > nbtxq, > >>>> > > > >> &port_conf); > >>>> > > > >> + if (ret < 0) > >>>> > > > >> + > ODP_ERR("Cannot configure > device: > >>>> > > err=%d, > >>>> > > > >> port=%u\n", > >>>> > > > >> + ret, > (unsigned) portid); > >>>> > > > >> + > >>>> > > > >> + rte_eth_macaddr_get(portid, > ð_addr[portid]); > >>>> > > > >> + ODP_DBG("Port %u, MAC address: > >>>> > > > >> %02X:%02X:%02X:%02X:%02X:%02X\n", > >>>> > > > >> + (unsigned) > portid, > >>>> > > > >> + eth_addr[portid].addr_bytes[0], > >>>> > > > >> + eth_addr[portid].addr_bytes[1], > >>>> > > > >> + eth_addr[portid].addr_bytes[2], > >>>> > > > >> + eth_addr[portid].addr_bytes[3], > >>>> > > > >> + eth_addr[portid].addr_bytes[4], > >>>> > > > >> + eth_addr[portid].addr_bytes[5]); > >>>> > > > >> + > >>>> > > > >> + /* init one RX queue > on each port */ > >>>> > > > >> + fflush(stdout); > >>>> > > > >> + for (i = 0; i < nbrxq; i++) { > >>>> > > > >> + ret = > rte_eth_rx_queue_setup(portid, > >>>> > > i, nb_rxd, > >>>> > > > >> + rte_eth_dev_socket_id(portid), > >>>> > > > >> &rx_conf, > >>>> > > > >> + (struct rte_mempool *)pool); > >>>> > > > >> + if (ret < 0) > >>>> > > > >> + ODP_ERR("%s rxq:err=%d, port=%u\n", > >>>> > > > >> + __func__, ret, (unsigned) portid); > >>>> > > > >> + ODP_DBG("dpdk > rx queue setup > >>>> > > done\n"); > >>>> > > > >> + } > >>>> > > > >> + > >>>> > > > >> + /* init one TX queue > on each port */ > >>>> > > > >> + fflush(stdout); > >>>> > > > >> + for (i = 0; i < nbtxq; i++) { > >>>> > > > >> + ret = > rte_eth_tx_queue_setup(portid, > >>>> > > i, nb_txd, > >>>> > > > >> + rte_eth_dev_socket_id(portid), > &tx_conf); > >>>> > > > >> + if (ret < 0) > >>>> > > > >> + ODP_ERR("%s txq:err=%d, port=%u\n", > >>>> > > > >> + __func__, ret, (unsigned) portid); > >>>> > > > >> + ODP_DBG("dpdk > tx queue setup > >>>> > > done\n"); > >>>> > > > >> + } > >>>> > > > >> + > >>>> > > > >> + /* Start device */ > >>>> > > > >> + ret = rte_eth_dev_start(portid); > >>>> > > > >> + if (ret < 0) > >>>> > > > >> + > ODP_ERR("rte_eth_dev_start:err=%d, port=%u\n", > >>>> > > > >> + ret, > (unsigned) portid); > >>>> > > > >> + ODP_DBG("dpdk setup done\n\n"); > >>>> > > > >> + > >>>> > > > >> + portinit[portid] = 1; > >>>> > > > >> + } > >>>> > > > >> + pkt_dpdk->queueid = qid[portid]++; > >>>> > > > >> return 0; > >>>> > > > >> } > >>>> > > > >> diff --git > a/platform/linux-dpdk/odp_packet_io.c > >>>> > > > >> b/platform/linux-dpdk/odp_packet_io.c > >>>> > > > >> index d8d127f..3124175 100644 > >>>> > > > >> --- > a/platform/linux-dpdk/odp_packet_io.c > >>>> > > > >> +++ > b/platform/linux-dpdk/odp_packet_io.c > >>>> > > > >> @@ -230,6 +230,8 @@ int > odp_pktio_recv(odp_pktio_t id, > >>>> > > odp_packet_t > >>>> > > > >> pkt_table[], unsigned len) > >>>> > > > >> if (pktio_entry == NULL) > >>>> > > > >> return -1; > >>>> > > > >> + odp_pktio_send(id, pkt_table, 0); > >>>> > > > >> + > >>>> > > > >> lock_entry(pktio_entry); > >>>> > > > >> pkts = > recv_pkt_dpdk(&pktio_entry->s.pkt_dpdk, > >>>> > > pkt_table, len); > >>>> > > > >> unlock_entry(pktio_entry); > >>>> > > > >> > >>>> > > > > > >>>> > > > > > >>>> > > > > > _______________________________________________ > >>>> > > > > lng-odp mailing list > >>>> > > > > lng-odp@lists.linaro.org > <mailto:lng-odp@lists.linaro.org <lng-odp@lists.linaro.org> > > > <mailto:lng-odp@lists.linaro.org > <lng-odp@lists.linaro.org> > <mailto:lng-odp@lists.linaro.org <lng-odp@lists.linaro.org> > >> > <mailto:lng-odp@lists.linaro.org > <lng-odp@lists.linaro.org> > <mailto:lng-odp@lists.linaro.org <lng-odp@lists.linaro.org> > > > <mailto:lng-odp@lists.linaro.org <lng-odp@lists.linaro.org> > <mailto:lng-odp@lists.linaro.org <lng-odp@lists.linaro.org> > >>> > >>>> > > > > > http://lists.linaro.org/mailman/listinfo/lng-odp > <http://lists.linaro.org/mailman/listinfo/lng-odp> > >>>> > > > > > >>>> > > > > >>>> > > > > >>>> > > > > >>>> > > > -- > >>>> > > > *Mike Holmes* > >>>> > > > Linaro Technical Manager / Lead > >>>> > > > LNG - ODP > >>>> > > > >>>> > > > > _______________________________________________ > >>>> > > > lng-odp mailing list > >>>> > > > lng-odp@lists.linaro.org > <mailto:lng-odp@lists.linaro.org <lng-odp@lists.linaro.org> > > > <mailto:lng-odp@lists.linaro.org > <lng-odp@lists.linaro.org> > <mailto:lng-odp@lists.linaro.org <lng-odp@lists.linaro.org> > >> > <mailto:lng-odp@lists.linaro.org > <lng-odp@lists.linaro.org> > <mailto:lng-odp@lists.linaro.org <lng-odp@lists.linaro.org> > > > <mailto:lng-odp@lists.linaro.org <lng-odp@lists.linaro.org> > <mailto:lng-odp@lists.linaro.org <lng-odp@lists.linaro.org> > >>> > >>>> > > > > http://lists.linaro.org/mailman/listinfo/lng-odp > <http://lists.linaro.org/mailman/listinfo/lng-odp> > >>>> > > > >>>> > > > >>>> > > -- > >>>> > > Anders Roxell > >>>> > > anders.roxell@linaro.org > <mailto:anders.roxell@linaro.org <anders.roxell@linaro.org> > > > <mailto:anders.roxell@linaro.org > <anders.roxell@linaro.org> > <mailto:anders.roxell@linaro.org <anders.roxell@linaro.org> > >> > <mailto:anders.roxell@linaro.org > <anders.roxell@linaro.org> > <mailto:anders.roxell@linaro.org <anders.roxell@linaro.org> > > > <mailto:anders.roxell@linaro.org <anders.roxell@linaro.org> > <mailto:anders.roxell@linaro.org <anders.roxell@linaro.org> > >>> > >>>> > > M: +46 709 71 42 85 > <tel:%2B46%20709%2071%2042%2085> > <tel:%2B46%20709%2071%2042%2085> > | IRC: roxell > >>>> > > > >>>> > > > _______________________________________________ > >>>> > > lng-odp mailing list > >>>> > > lng-odp@lists.linaro.org > <mailto:lng-odp@lists.linaro.org <lng-odp@lists.linaro.org> > > > <mailto:lng-odp@lists.linaro.org > <lng-odp@lists.linaro.org> > <mailto:lng-odp@lists.linaro.org <lng-odp@lists.linaro.org> > >> > <mailto:lng-odp@lists.linaro.org > <lng-odp@lists.linaro.org> > <mailto:lng-odp@lists.linaro.org <lng-odp@lists.linaro.org> > > > <mailto:lng-odp@lists.linaro.org <lng-odp@lists.linaro.org> > <mailto:lng-odp@lists.linaro.org <lng-odp@lists.linaro.org> > >>> > >>>> > > > http://lists.linaro.org/mailman/listinfo/lng-odp > >>>> > > > >>>> > > > >>>> > > > >>>> > > > >>>> > > >_______________________________________________ > >>>> > >lng-odp mailing list > >>>> > >lng-odp@lists.linaro.org > <mailto:lng-odp@lists.linaro.org <lng-odp@lists.linaro.org> > > > <mailto:lng-odp@lists.linaro.org <lng-odp@lists.linaro.org> > <mailto:lng-odp@lists.linaro.org <lng-odp@lists.linaro.org> > >> > >>>> > > >http://lists.linaro.org/mailman/listinfo/lng-odp > >>>> > > >>>> > > >>>> > _______________________________________________ > >>>> > lng-odp mailing list > >>>> > lng-odp@lists.linaro.org > <mailto:lng-odp@lists.linaro.org <lng-odp@lists.linaro.org> > > > <mailto:lng-odp@lists.linaro.org <lng-odp@lists.linaro.org> > <mailto:lng-odp@lists.linaro.org <lng-odp@lists.linaro.org> > >> > >>>> > > http://lists.linaro.org/mailman/listinfo/lng-odp > <http://lists.linaro.org/mailman/listinfo/lng-odp> > >>>> > >>>> -- > >>>> Anders Roxell > >>>> anders.roxell@linaro.org > <mailto:anders.roxell@linaro.org <anders.roxell@linaro.org> > > > <mailto:anders.roxell@linaro.org <anders.roxell@linaro.org> > <mailto:anders.roxell@linaro.org <anders.roxell@linaro.org> > >> > >>>> M: +46 709 71 42 85 > <tel:%2B46%20709%2071%2042%2085> > <tel:%2B46%20709%2071%2042%2085> | IRC: > roxell > >>>> > >>>> _______________________________________________ > >>>> lng-odp mailing list > >>>> lng-odp@lists.linaro.org > <mailto:lng-odp@lists.linaro.org <lng-odp@lists.linaro.org> > > > <mailto:lng-odp@lists.linaro.org <lng-odp@lists.linaro.org> > <mailto:lng-odp@lists.linaro.org <lng-odp@lists.linaro.org> > >> > >>>> http://lists.linaro.org/mailman/listinfo/lng-odp > >>> > >>> > >>> > >>> > >>> -- > >>> Mike Holmes > >>> Linaro Technical Manager / Lead > >>> LNG - ODP > >>> > >>> _______________________________________________ > >>> lng-odp mailing list > >>> lng-odp@lists.linaro.org > <mailto:lng-odp@lists.linaro.org <lng-odp@lists.linaro.org> > > > <mailto:lng-odp@lists.linaro.org <lng-odp@lists.linaro.org> > <mailto:lng-odp@lists.linaro.org <lng-odp@lists.linaro.org> > >> > >>> http://lists.linaro.org/mailman/listinfo/lng-odp > >>> > >> > > > > > > > > -- > > Mike Holmes > > Linaro Technical Manager / Lead > > LNG - ODP > > > > _______________________________________________ > > lng-odp mailing list > > lng-odp@lists.linaro.org > <mailto:lng-odp@lists.linaro.org <lng-odp@lists.linaro.org> > > > <mailto:lng-odp@lists.linaro.org <lng-odp@lists.linaro.org> > <mailto:lng-odp@lists.linaro.org <lng-odp@lists.linaro.org> > >> > > http://lists.linaro.org/mailman/listinfo/lng-odp > > > > > > > -- *Mike Holmes* > Linaro Technical Manager / Lead > LNG - ODP > > > > > _______________________________________________ > lng-odp mailing list > lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org > <lng-odp@lists.linaro.org>> > http://lists.linaro.org/mailman/listinfo/lng-odp > > > > > _______________________________________________ > lng-odp mailing list > lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org > <lng-odp@lists.linaro.org>> > http://lists.linaro.org/mailman/listinfo/lng-odp > > > > > -- > *Mike Holmes* > Linaro Technical Manager / Lead > LNG - ODP > > > > _______________________________________________ > lng-odp mailing list > lng-odp@lists.linaro.org > http://lists.linaro.org/mailman/listinfo/lng-odp > > > > _______________________________________________ > lng-odp mailing list > lng-odp@lists.linaro.org > http://lists.linaro.org/mailman/listinfo/lng-odp > >
On 08/13/2014 12:36 PM, Venkatesh Vivekanandan wrote: > > > > On 13 August 2014 02:30, Wiles, Roger Keith <keith.wiles@windriver.com > <mailto:keith.wiles@windriver.com>> wrote: > > The DPDK version of Pktgen is a bit easy to use and configure then > the kernel based version. You can also run it on the machine if > you make sure you configure DPDK correctly (if you have two DPDKs > running). > > If you build Pktgen-DPDK on another machine it should be pretty > quick (within a 1/2 hour normally if not faster :-) ) to get > running if all you need is to send UDP or TCP frames. I still not > know your requires for the traffic. At least with Pktgen-DPDK you > have a clean simple full screen ASCII (vt100) interface to use. > > > I am modifying the dst ip address. Say 12 different ip > address(201.0.0.0 to 201.0.0.11) and again start from beginning. Can > you please point me to how pktgen can do this?. with odp generator it has to be easy: example/generator/odp_generator.c static void pack_udp_pkt(odp_buffer_t obuf) { change this: ip->dst_addr = odp_cpu_to_be_32(args->appl.dstip); to something like this: ip->dst_addr = odp_cpu_to_be_32(0xc9000000 + (i++ % 12)) Maxim. > > > If you have the machine setup for DPDK it will just work sending > 64Byte frames as 10G wire rate. If you decide to go this direction > I can help set it up for you. > > *Keith **Wiles*, Principal Technologist with CTO office, *Wind > River*mobile 972-213-5533 > > On Aug 12, 2014, at 3:41 PM, Maxim Uvarov <maxim.uvarov@linaro.org > <mailto:maxim.uvarov@linaro.org>> wrote: > >> On 08/13/2014 12:38 AM, Mike Holmes wrote: >>> To generate test data we don't have to use ODP, although we >>> should try to do that down the road, but equally you still need >>> to use external tools to be sure you did not make compatible >>> only with yourself mistakes. >>> >>> I was wondering why we can't spawn several process on one >>> machine that all send to the same port to test this ? >> >> Why not to use kernel packet generator? >> https://www.kernel.org/doc/Documentation/networking/pktgen.txt >> >>> >>> >>> On 12 August 2014 16:31, Maxim Uvarov <maxim.uvarov@linaro.org >>> <mailto:maxim.uvarov@linaro.org><mailto:maxim.uvarov@linaro.org>> wrote: >>> >>> On 08/13/2014 12:29 AM, Maxim Uvarov wrote: >>> >>> why not to use tcpreplay? >>> >>> I.e. odp+libpcap+dpdk+tcpreplay if we have everything ready? >>> >>> Maxim. >>> >>> Ah, I should check that first. tcpreplay doesn't depend on >>> libpcap. >>> >>> ldd /usr/bin/tcpreplay >>> linux-vdso.so.1 => (0x00007fffa3bfe000) >>> libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 >>> (0x00007f3d490ba000) >>> /lib64/ld-linux-x86-64.so.2 (0x00007f3d494a5000) >>> >>> >>> >>> >>> On 08/12/2014 11:42 PM, Wiles, Roger Keith wrote: >>> >>> Pktgen has a number of different ways to send packets >>> single, range, pcap or random, sequence with parameters. >>> >>> One thing Pktgen does not do is act like a real >>> stack, but >>> you can simulate that with pcap or sequence packets. It >>> basically depends on how complex a data flow you need. >>> >>> # git clonegit://github.com/Pktgen/Pktgen-DPDK >>> <http://github.com/Pktgen/Pktgen-DPDK> >>> >>> Let me know if I can help or change the code in some way. >>> >>> THanks >>> ++keith >>> >>> *Keith **Wiles*, Principal Technologist with CTO office, >>> *Wind River*mobile 972-213-5533 <tel:972-213-5533> >>> >>> On Aug 12, 2014, at 1:08 PM, Mike Holmes >>> <mike.holmes@linaro.org >>> <mailto:mike.holmes@linaro.org><mailto:mike.holmes@linaro.org> >>> <mailto:mike.holmes@linaro.org >>> <mailto:mike.holmes@linaro.org>>> wrote: >>> >>> So it looks like we don't have any way to test this >>> without an Ixia which is a problem given that Santosh >>> is having trouble. >>> Basically there is no CI job to point at that shows >>> that excluding human error it is still working as >>> expected. >>> >>> Keith, is dpdk pktgen able to generate pkts in >>> the way >>> Venki needs ? >>> >>> Mike >>> >>> >>> On 12 August 2014 02:17, Santosh Shukla >>> <santosh.shukla@linaro.org >>> <mailto:santosh.shukla@linaro.org> >>> <mailto:santosh.shukla@linaro.org> >>> <mailto:santosh.shukla@linaro.org >>> <mailto:santosh.shukla@linaro.org>>> wrote: >>> >>> On 12 August 2014 00:25, Mike Holmes >>> <mike.holmes@linaro.org >>> <mailto:mike.holmes@linaro.org><mailto:mike.holmes@linaro.org> >>> <mailto:mike.holmes@linaro.org >>> <mailto:mike.holmes@linaro.org>>> wrote: >>> > Which test case in odp/test would check >>> this, or >>> does it need >>> an application >>> > like l2fwd to be run - are either in LAVA/CI ? >>> > >>> > Santosh are you able to verify this does not >>> break anything as >>> part of the >>> > l2fwd work you are doing ? >>> > >>> >>> No, I am seeing problem with current and should >>> persist in this multi >>> flavour too. We have bug reported on that lines. >>> So whole dpdk-l2fwd >>> doesn't works for me for my requirement. >>> >>> Thanks. >>> >>> > Mike >>> > >>> > >>> > On 11 August 2014 01:43, Venkatesh Vivekanandan >>> > <venkatesh.vivekanandan@linaro.org >>> <mailto:venkatesh.vivekanandan@linaro.org> >>> <mailto:venkatesh.vivekanandan@linaro.org> >>> <mailto:venkatesh.vivekanandan@linaro.org >>> <mailto:venkatesh.vivekanandan@linaro.org>>> wrote: >>> >> >>> >> >>> >> >>> >> >>> >> On 9 August 2014 17:32, Mike Holmes >>> <mike.holmes@linaro.org >>> <mailto:mike.holmes@linaro.org><mailto:mike.holmes@linaro.org> >>> <mailto:mike.holmes@linaro.org >>> <mailto:mike.holmes@linaro.org>>> wrote: >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> On 8 August 2014 17:46, Anders Roxell >>> <anders.roxell@linaro.org >>> <mailto:anders.roxell@linaro.org> >>> <mailto:anders.roxell@linaro.org> >>> <mailto:anders.roxell@linaro.org >>> <mailto:anders.roxell@linaro.org>>> wrote: >>> >>>> >>> >>>> On 2014-08-08 17:31, Maxim Uvarov wrote: >>> >>>> > On 08/08/2014 05:13 PM, Venkatesh >>> Vivekanandan wrote: >>> >>>> > > >>> >>>> > > >>> >>>> > > >>> >>>> > >On 7 August 2014 21:10, Anders Roxell >>> <anders.roxell@linaro.org >>> <mailto:anders.roxell@linaro.org> >>> <mailto:anders.roxell@linaro.org> >>> <mailto:anders.roxell@linaro.org >>> <mailto:anders.roxell@linaro.org>> >>> >>>> > ><mailto:anders.roxell@linaro.org >>> <mailto:anders.roxell@linaro.org> >>> <mailto:anders.roxell@linaro.org >>> <mailto:anders.roxell@linaro.org>>>> wrote: >>> >>>> > > >>> >>>> > > On 2014-08-07 10:41, Mike Holmes >>> wrote: >>> >>>> > > > Does this need a signoff by someone >>> else before it >>> is merged ? >>> >>>> > > > >>> >>>> > > > I think we want to enforce getting >>> an ack, tested-by or >>> >>>> > > reviewed-by before >>> >>>> > > > we merge things, we have informally >>> moved that way >>> over the >>> >>>> > > last >>> >>>> > > couple of >>> >>>> > > > weeks and now I think it is time we >>> made it a formal >>> >>>> > > requirement. >>> >>>> > > >>> >>>> > > Agree. >>> >>>> > > >>> >>>> > > >>> >>>> > >If this is the case, then is it fair to >>> say initial >>> discussion of >>> >>>> > >24-hour window is void?. I guess >>> Maxim was >>> waiting for 2 >>> days(for >>> >>>> > >any comments) before he could merge this >>> patch. Do we >>> have any >>> >>>> > >time-limit before which a patch /must /be >>> reviewed or >>> tested? I >>> >>>> > >hope we can't wait indefinitely or is >>> this >>> the case?. >>> >>>> > >>> >>>> > I think if patch came from platfrom >>> maintainer, it's not >>> new API. No >>> >>>> > comments in 1 or 2 days, than it's ok to >>> merge it. If >>> patch came >>> >>>> > from somobody alse I would ask maintainer >>> to review it. >>> >>>> >>> >>>> I disagree with this. >>> >>>> No matter where the patch comes from and who >>> wrote the >>> patch, it can be >>> >>>> wrong and need a second pair of eyes i.e., >>> >>>> (Reviewed|Acked|Signed-off)-by. >>> >>>> If no one has replied to a patch after 2 >>> days, the author of >>> the patch >>> >>>> should ping the list and maintainer. >>> >>>> >>> >>>> After the second pair of eyes, the patch >>> should be ok to be >>> merged. >>> >>>> The ODP maintainer should do a smoke build >>> test on all the >>> supported >>> >>>> platforms before merging though. >>> >>> >>> >>> >>> >>> My 2 cents >>> >>> We have started to develop a cohesive API, I >>> think that is >>> down to a lot >>> >>> of folks working together. >>> >>> I also think that peer review/team work is >>> reflected in the >>> increasing >>> >>> willingness to review each others patches >>> which has improved >>> quality >>> >>> and helped establish the guidelines on how >>> things bolt >>> together in ODP, >>> >>> may long discussions have spawned from >>> patches. >>> >>> >>> >>> No one is beyond silly mistakes, peer review >>> finds a lot of >>> the dumb >>> >>> stuff for little cost, saving on the >>> inevitable ugly patch up >>> that will >>> >>> ensue otherwise. >>> >>> Maxim you could do the default reviews if no >>> one came >>> forward, but if a >>> >>> submitter finds and establishes their own >>> network of >>> reviewers that is one >>> >>> extra pair of eyes and ideas. >>> >> >>> >> >>> >> Can someone please review this patch?. If >>> there >>> is any >>> comments, we can >>> >> request maxim to revert the patch, >>> otherwise he >>> can add the >>> >> "Reviewed-by/Tested-by" to the applied patch. >>> >> >>> >>>> >>> >>>> Cheers, >>> >>>> Anders >>> >>>> >>> >>>> > >>> >>>> > Maxim. >>> >>>> > >>> >>>> > > Anders >>> >>>> > > >>> >>>> > > > >>> >>>> > > > Mike >>> >>>> > > > >>> >>>> > > > >>> >>>> > > > On 7 August 2014 09:15, Maxim >>> Uvarov >>> <maxim.uvarov@linaro.org >>> <mailto:maxim.uvarov@linaro.org> >>> <mailto:maxim.uvarov@linaro.org> >>> <mailto:maxim.uvarov@linaro.org >>> <mailto:maxim.uvarov@linaro.org>> >>> >>>> > > <mailto:maxim.uvarov@linaro.org >>> <mailto:maxim.uvarov@linaro.org> >>> <mailto:maxim.uvarov@linaro.org >>> <mailto:maxim.uvarov@linaro.org>>>> wrote: >>> >>>> > > > >>> >>>> > > > > Merged, thanks! >>> >>>> > > > > >>> >>>> > > > > Maxim. >>> >>>> > > > > >>> >>>> > > > > >>> >>>> > > > > On 08/05/2014 06:54 PM, >>> venkatesh.vivekanandan@linaro.org >>> <mailto:venkatesh.vivekanandan@linaro.org> >>> <mailto:venkatesh.vivekanandan@linaro.org> >>> <mailto:venkatesh.vivekanandan@linaro.org >>> <mailto:venkatesh.vivekanandan@linaro.org>> >>> >>>> > > >>> <mailto:venkatesh.vivekanandan@linaro.org >>> <mailto:venkatesh.vivekanandan@linaro.org> >>> <mailto:venkatesh.vivekanandan@linaro.org >>> <mailto:venkatesh.vivekanandan@linaro.org>>> wrote: >>> >>>> > > > > >>> >>>> > > > >> From: Venkatesh Vivekanandan >>> >>>> > > <venkatesh.vivekanandan@linaro.org >>> <mailto:venkatesh.vivekanandan@linaro.org> >>> <mailto:venkatesh.vivekanandan@linaro.org> >>> <mailto:venkatesh.vivekanandan@linaro.org >>> <mailto:venkatesh.vivekanandan@linaro.org>> >>> >>>> > > >>> <mailto:venkatesh.vivekanandan@linaro.org >>> <mailto:venkatesh.vivekanandan@linaro.org> >>> <mailto:venkatesh.vivekanandan@linaro.org >>> <mailto:venkatesh.vivekanandan@linaro.org>>>> >>> >>>> > > > >> >>> >>>> > > > >> - Multi queue support per >>> interface is enabled. >>> >>>> > > > >> - odp_pktio_send with "0" packet >>> is called in >>> odp_pktio_recv >>> >>>> > > to >>> >>>> > > > >> give the transmitted buffers >>> back to mempool. >>> >>>> > > > >> - mbuf alloc failure during >>> receive is fixed by >>> giving more >>> >>>> > > buffers to >>> >>>> > > > >> mempool. >>> >>>> > > > >> - mempool cache size is given >>> equivalent to >>> MAX_PKT_BURST. >>> >>>> > > > >> >>> >>>> > > > >> Signed-off-by: Venkatesh >>> Vivekanandan >>> >>>> > > <venkatesh.vivekanandan@linaro.org >>> <mailto:venkatesh.vivekanandan@linaro.org> >>> <mailto:venkatesh.vivekanandan@linaro.org> >>> <mailto:venkatesh.vivekanandan@linaro.org >>> <mailto:venkatesh.vivekanandan@linaro.org>> >>> >>>> > > >>> <mailto:venkatesh.vivekanandan@linaro.org >>> <mailto:venkatesh.vivekanandan@linaro.org> >>> <mailto:venkatesh.vivekanandan@linaro.org >>> <mailto:venkatesh.vivekanandan@linaro.org>>>> >>> >>>> > > > >> --- >>> >>>> > > > >> >>> platform/linux-dpdk/include/odp_packet_dpdk.h | >>> 24 +++++ >>> >>>> > > > >> >>> platform/linux-dpdk/odp_buffer_pool.c | 4 +- >>> >>>> > > > >> >>> platform/linux-dpdk/odp_packet_dpdk.c | 136 >>> >>>> > > > >> +++++++++++++------------- >>> >>>> > > > >> >>> platform/linux-dpdk/odp_packet_io.c | 2 + >>> >>>> > > > >> 4 files changed, 94 >>> insertions(+), 72 deletions(-) >>> >>>> > > > >> >>> >>>> > > > >> diff --git >>> a/platform/linux-dpdk/include/odp_packet_dpdk.h >>> >>>> > > > >> >>> b/platform/linux-dpdk/include/odp_packet_dpdk.h >>> >>>> > > > >> index bcbe9e8..bcf9aa5 100644 >>> >>>> > > > >> --- >>> a/platform/linux-dpdk/include/odp_packet_dpdk.h >>> >>>> > > > >> +++ >>> b/platform/linux-dpdk/include/odp_packet_dpdk.h >>> >>>> > > > >> @@ -50,6 +50,30 @@ >>> >>>> > > > >> #define DPDK_BLOCKING_IO >>> >>>> > > > >> +/* >>> >>>> > > > >> + * RX and TX Prefetch, >>> Host, and >>> Write-back >>> threshold >>> >>>> > > values >>> >>>> > > should be >>> >>>> > > > >> + * carefully set for optimal >>> performance. >>> Consult the >>> >>>> > > network >>> >>>> > > > >> + * controller's datasheet and >>> supporting DPDK >>> documentation >>> >>>> > > for guidance >>> >>>> > > > >> + * on how these parameters >>> should be set. >>> >>>> > > > >> + */ >>> >>>> > > > >> +#define RX_PTHRESH 8 /**< >>> Default values of RX >>> prefetch >>> >>>> > > threshold reg. */ >>> >>>> > > > >> +#define RX_HTHRESH 8 /**< >>> Default values of RX host >>> >>>> > > threshold reg. */ >>> >>>> > > > >> +#define RX_WTHRESH 4 /**< >>> Default values of RX >>> write-back >>> >>>> > > threshold reg. >>> >>>> > > > >> */ >>> >>>> > > > >> + >>> >>>> > > > >> +/* >>> >>>> > > > >> + * These default values are >>> optimized for use >>> with the >>> >>>> > > Intel(R) 82599 10 >>> >>>> > > > >> GbE >>> >>>> > > > >> + * Controller and the DPDK >>> ixgbe >>> PMD. Consider >>> using other >>> >>>> > > values for >>> >>>> > > > >> other >>> >>>> > > > >> + * network controllers and/or >>> network drivers. >>> >>>> > > > >> + */ >>> >>>> > > > >> +#define TX_PTHRESH 36 /**< >>> Default values of TX >>> prefetch >>> >>>> > > threshold reg. >>> >>>> > > > >> */ >>> >>>> > > > >> +#define TX_HTHRESH 0 /**< >>> Default values of TX >>> host >>> >>>> > > threshold reg. */ >>> >>>> > > > >> +#define TX_WTHRESH 0 /**< >>> Default values of TX >>> write-back >>> >>>> > > threshold >>> >>>> > > > >> reg. */ >>> >>>> > > > >> + >>> >>>> > > > >> +#define MAX_PKT_BURST 16 >>> >>>> > > > >> +#define BURST_TX_DRAIN_US >>> 100 /* >>> TX drain every >>> ~100us */ >>> >>>> > > > >> +#define >>> RTE_TEST_RX_DESC_DEFAULT 128 >>> >>>> > > > >> +#define >>> RTE_TEST_TX_DESC_DEFAULT 512 >>> >>>> > > > >> + >>> >>>> > > > >> /** Packet socket using dpdk >>> mmaped rings for >>> both Rx and >>> >>>> > > Tx */ >>> >>>> > > > >> typedef struct { >>> >>>> > > > >> odp_buffer_pool_t pool; >>> >>>> > > > >> diff --git >>> a/platform/linux-dpdk/odp_buffer_pool.c >>> >>>> > > > >> >>> b/platform/linux-dpdk/odp_buffer_pool.c >>> >>>> > > > >> index de90275..805ce68 100644 >>> >>>> > > > >> --- >>> a/platform/linux-dpdk/odp_buffer_pool.c >>> >>>> > > > >> +++ >>> b/platform/linux-dpdk/odp_buffer_pool.c >>> >>>> > > > >> @@ -23,7 +23,7 @@ >>> >>>> > > > >> #include <odp_packet_dpdk.h> >>> >>>> > > > >> #define MBUF_SIZE (2048 + >>> sizeof(struct rte_mbuf) + >>> >>>> > > > >> RTE_PKTMBUF_HEADROOM) >>> >>>> > > > >> -#define NB_MBUF 8192 >>> >>>> > > > >> +#define NB_MBUF 32768 >>> >>>> > > > >> #ifdef POOL_USE_TICKETLOCK >>> >>>> > > > >> #include <odp_ticketlock.h> >>> >>>> > > > >> @@ -112,7 +112,7 @@ >>> odp_buffer_pool_t >>> >>>> > > odp_buffer_pool_create(const char >>> >>>> > > > >> *name, >>> >>>> > > > >> pktmbuf_pool = >>> >>>> > > > >> rte_mempool_create(name, >>> NB_MBUF, >>> >>>> > > > >> - MBUF_SIZE, 32, >>> >>>> > > > >> + MBUF_SIZE, MAX_PKT_BURST, >>> >>>> > > > >> sizeof(struct >>> >>>> > > > >> rte_pktmbuf_pool_private), >>> >>>> > > > >> rte_pktmbuf_pool_init, NULL, >>> >>>> > > > >> rte_pktmbuf_init, NULL, >>> >>>> > > > >> diff --git >>> a/platform/linux-dpdk/odp_packet_dpdk.c >>> >>>> > > > >> >>> b/platform/linux-dpdk/odp_packet_dpdk.c >>> >>>> > > > >> index 31bfa30..d5c8e80 100644 >>> >>>> > > > >> --- >>> a/platform/linux-dpdk/odp_packet_dpdk.c >>> >>>> > > > >> +++ >>> b/platform/linux-dpdk/odp_packet_dpdk.c >>> >>>> > > > >> @@ -26,34 +26,13 @@ >>> >>>> > > > >> #include <odp_packet_dpdk.h> >>> >>>> > > > >> #include <net/if.h> >>> >>>> > > > >> -/* >>> >>>> > > > >> - * RX and TX Prefetch, >>> Host, and >>> Write-back >>> threshold >>> >>>> > > values >>> >>>> > > should be >>> >>>> > > > >> - * carefully set for optimal >>> performance. >>> Consult the >>> >>>> > > network >>> >>>> > > > >> - * controller's datasheet and >>> supporting DPDK >>> documentation >>> >>>> > > for guidance >>> >>>> > > > >> - * on how these parameters >>> should be set. >>> >>>> > > > >> - */ >>> >>>> > > > >> -#define RX_PTHRESH 8 /**< >>> Default values of RX >>> prefetch >>> >>>> > > threshold reg. */ >>> >>>> > > > >> -#define RX_HTHRESH 8 /**< >>> Default values of RX host >>> >>>> > > threshold reg. */ >>> >>>> > > > >> -#define RX_WTHRESH 4 /**< >>> Default values of RX >>> write-back >>> >>>> > > threshold reg. >>> >>>> > > > >> */ >>> >>>> > > > >> - >>> >>>> > > > >> -/* >>> >>>> > > > >> - * These default values are >>> optimized for use >>> with the >>> >>>> > > Intel(R) 82599 10 >>> >>>> > > > >> GbE >>> >>>> > > > >> - * Controller and the DPDK >>> ixgbe >>> PMD. Consider >>> using other >>> >>>> > > values for >>> >>>> > > > >> other >>> >>>> > > > >> - * network controllers and/or >>> network drivers. >>> >>>> > > > >> - */ >>> >>>> > > > >> -#define TX_PTHRESH 36 /**< >>> Default values of TX >>> prefetch >>> >>>> > > threshold reg. >>> >>>> > > > >> */ >>> >>>> > > > >> -#define TX_HTHRESH 0 /**< >>> Default values of TX >>> host >>> >>>> > > threshold reg. */ >>> >>>> > > > >> -#define TX_WTHRESH 0 /**< >>> Default values of TX >>> write-back >>> >>>> > > threshold >>> >>>> > > > >> reg. */ >>> >>>> > > > >> - >>> >>>> > > > >> -#define MAX_PKT_BURST 16 >>> >>>> > > > >> -#define BURST_TX_DRAIN_US >>> 100 /* >>> TX drain every >>> ~100us */ >>> >>>> > > > >> -#define >>> RTE_TEST_RX_DESC_DEFAULT 128 >>> >>>> > > > >> -#define >>> RTE_TEST_TX_DESC_DEFAULT 512 >>> >>>> > > > >> static uint16_t nb_rxd = >>> RTE_TEST_RX_DESC_DEFAULT; >>> >>>> > > > >> static uint16_t nb_txd = >>> RTE_TEST_TX_DESC_DEFAULT; >>> >>>> > > > >> static const struct rte_eth_conf >>> port_conf = { >>> >>>> > > > >> .rxmode = { >>> >>>> > > > >> + .mq_mode = ETH_MQ_RX_RSS, >>> >>>> > > > >> + .max_rx_pkt_len = >>> ETHER_MAX_LEN, >>> >>>> > > > >> .split_hdr_size = 0, >>> >>>> > > > >> .header_split = 0, /**< Header >>> Split >>> >>>> > > disabled */ >>> >>>> > > > >> .hw_ip_checksum = 0, /**< IP >>> checksum >>> >>>> > > offload >>> >>>> > > disabled */ >>> >>>> > > > >> @@ -61,6 +40,12 @@ static const >>> struct rte_eth_conf >>> >>>> > > port_conf = { >>> >>>> > > > >> .jumbo_frame = 0, /**< >>> Jumbo Frame >>> >>>> > > Support >>> >>>> > > disabled */ >>> >>>> > > > >> .hw_strip_crc = 0, /**< CRC >>> stripped by >>> >>>> > > hardware */ >>> >>>> > > > >> }, >>> >>>> > > > >> + .rx_adv_conf = { >>> >>>> > > > >> + .rss_conf = { >>> >>>> > > > >> + .rss_key >>> = NULL, >>> >>>> > > > >> + .rss_hf = >>> ETH_RSS_IPV4 | >>> >>>> > > ETH_RSS_IPV6, >>> >>>> > > > >> + }, >>> >>>> > > > >> + }, >>> >>>> > > > >> .txmode = { >>> >>>> > > > >> .mq_mode = ETH_MQ_TX_NONE, >>> >>>> > > > >> }, >>> >>>> > > > >> @@ -95,60 +80,71 @@ int >>> setup_pkt_dpdk(pkt_dpdk_t * const >>> >>>> > > pkt_dpdk, const >>> >>>> > > > >> char *netdev, >>> >>>> > > > >> ODP_DBG("setup_pkt_dpdk\n"); >>> >>>> > > > >> static struct ether_addr >>> eth_addr[RTE_MAX_ETHPORTS]; >>> >>>> > > > >> - uint8_t portid = 0; >>> >>>> > > > >> - uint16_t queueid = 0; >>> >>>> > > > >> - int ret; >>> >>>> > > > >> + static int >>> portinit[RTE_MAX_ETHPORTS]; >>> >>>> > > > >> + static int >>> qid[RTE_MAX_ETHPORTS]; >>> >>>> > > > >> + uint8_t portid = 0, >>> num_intf = 2; >>> >>>> > > > >> + uint16_t nbrxq = 0, >>> nbtxq = 0; >>> >>>> > > > >> + int ret, i; >>> >>>> > > > >> + >>> >>>> > > > >> printf("dpdk netdev: %s\n", >>> netdev); >>> >>>> > > > >> printf("dpdk pool: %lx\n", >>> pool); >>> >>>> > > > >> - >>> >>>> > > > >> portid = atoi(netdev); >>> >>>> > > > >> pkt_dpdk->portid = portid; >>> >>>> > > > >> - pkt_dpdk->queueid = queueid; >>> >>>> > > > >> pkt_dpdk->pool = pool; >>> >>>> > > > >> printf("dpdk portid: %u\n", >>> portid); >>> >>>> > > > >> - fflush(stdout); >>> >>>> > > > >> - ret = >>> rte_eth_dev_configure(portid, 1, 1, >>> >>>> > > &port_conf); >>> >>>> > > > >> - if (ret < 0) >>> >>>> > > > >> - ODP_ERR("Cannot configure >>> device: >>> err=%d, >>> >>>> > > port=%u\n", >>> >>>> > > > >> - ret, >>> (unsigned) portid); >>> >>>> > > > >> - >>> >>>> > > > >> - rte_eth_macaddr_get(portid, >>> ð_addr[portid]); >>> >>>> > > > >> - ODP_DBG("Port %u, MAC address: >>> >>>> > > %02X:%02X:%02X:%02X:%02X:%02X\ >>> >>>> > > > >> n\n", >>> >>>> > > > >> - (unsigned) portid, >>> >>>> > > > >> - >>> eth_addr[portid].addr_bytes[0], >>> >>>> > > > >> - >>> eth_addr[portid].addr_bytes[1], >>> >>>> > > > >> - >>> eth_addr[portid].addr_bytes[2], >>> >>>> > > > >> - >>> eth_addr[portid].addr_bytes[3], >>> >>>> > > > >> - >>> eth_addr[portid].addr_bytes[4], >>> >>>> > > > >> - >>> eth_addr[portid].addr_bytes[5]); >>> >>>> > > > >> - >>> >>>> > > > >> - /* init one RX queue on each >>> port */ >>> >>>> > > > >> - fflush(stdout); >>> >>>> > > > >> - ret = >>> rte_eth_rx_queue_setup(portid, queueid, >>> >>>> > > nb_rxd, >>> >>>> > > > >> - rte_eth_dev_socket_id(portid), >>> >>>> > > > >> &rx_conf, >>> >>>> > > > >> - (struct rte_mempool *)pool); >>> >>>> > > > >> - if (ret < 0) >>> >>>> > > > >> - >>> ODP_ERR("rte_eth_rx_queue_setup:err=%d, >>> port=%u\n", >>> >>>> > > > >> - ret, >>> (unsigned) portid); >>> >>>> > > > >> - ODP_DBG("dpdk rx queue setup >>> done\n"); >>> >>>> > > > >> - >>> >>>> > > > >> - /* init one TX queue on each >>> port */ >>> >>>> > > > >> - fflush(stdout); >>> >>>> > > > >> - ret = >>> rte_eth_tx_queue_setup(portid, queueid, >>> >>>> > > nb_txd, >>> >>>> > > > >> - rte_eth_dev_socket_id(portid), >>> &tx_conf); >>> >>>> > > > >> - if (ret < 0) >>> >>>> > > > >> - >>> ODP_ERR("rte_eth_tx_queue_setup:err=%d, >>> port=%u\n", >>> >>>> > > > >> - ret, >>> (unsigned) portid); >>> >>>> > > > >> - ODP_DBG("dpdk tx queue setup >>> done\n"); >>> >>>> > > > >> - >>> >>>> > > > >> - /* Start device */ >>> >>>> > > > >> - ret = >>> rte_eth_dev_start(portid); >>> >>>> > > > >> - if (ret < 0) >>> >>>> > > > >> - >>> ODP_ERR("rte_eth_dev_start:err=%d, port=%u\n", >>> >>>> > > > >> - ret, >>> (unsigned) portid); >>> >>>> > > > >> - ODP_DBG("dpdk setup >>> done\n\n"); >>> >>>> > > > >> - >>> >>>> > > > >> + nbrxq = odp_sys_core_count() >>> / num_intf; >>> >>>> > > > >> + nbtxq = nbrxq; >>> >>>> > > > >> + if (portinit[portid] == 0) { >>> >>>> > > > >> + fflush(stdout); >>> >>>> > > > >> + ret = >>> rte_eth_dev_configure(portid, >>> nbrxq, >>> >>>> > > nbtxq, >>> >>>> > > > >> &port_conf); >>> >>>> > > > >> + if (ret < 0) >>> >>>> > > > >> + >>> ODP_ERR("Cannot configure >>> device: >>> >>>> > > err=%d, >>> >>>> > > > >> port=%u\n", >>> >>>> > > > >> + ret, >>> (unsigned) portid); >>> >>>> > > > >> + >>> >>>> > > > >> + rte_eth_macaddr_get(portid, >>> ð_addr[portid]); >>> >>>> > > > >> + ODP_DBG("Port %u, MAC address: >>> >>>> > > > >> >>> %02X:%02X:%02X:%02X:%02X:%02X\n", >>> >>>> > > > >> + (unsigned) >>> portid, >>> >>>> > > > >> + >>> eth_addr[portid].addr_bytes[0], >>> >>>> > > > >> + >>> eth_addr[portid].addr_bytes[1], >>> >>>> > > > >> + >>> eth_addr[portid].addr_bytes[2], >>> >>>> > > > >> + >>> eth_addr[portid].addr_bytes[3], >>> >>>> > > > >> + >>> eth_addr[portid].addr_bytes[4], >>> >>>> > > > >> + >>> eth_addr[portid].addr_bytes[5]); >>> >>>> > > > >> + >>> >>>> > > > >> + /* init one RX queue >>> on each port */ >>> >>>> > > > >> + fflush(stdout); >>> >>>> > > > >> + for (i = 0; i < nbrxq; i++) { >>> >>>> > > > >> + ret = >>> rte_eth_rx_queue_setup(portid, >>> >>>> > > i, nb_rxd, >>> >>>> > > > >> + rte_eth_dev_socket_id(portid), >>> >>>> > > > >> &rx_conf, >>> >>>> > > > >> + (struct rte_mempool *)pool); >>> >>>> > > > >> + if (ret < 0) >>> >>>> > > > >> + ODP_ERR("%s rxq:err=%d, >>> port=%u\n", >>> >>>> > > > >> + __func__, ret, (unsigned) >>> portid); >>> >>>> > > > >> + >>> ODP_DBG("dpdk >>> rx queue setup >>> >>>> > > done\n"); >>> >>>> > > > >> + } >>> >>>> > > > >> + >>> >>>> > > > >> + /* init one TX queue >>> on each port */ >>> >>>> > > > >> + fflush(stdout); >>> >>>> > > > >> + for (i = 0; i < nbtxq; i++) { >>> >>>> > > > >> + ret = >>> rte_eth_tx_queue_setup(portid, >>> >>>> > > i, nb_txd, >>> >>>> > > > >> + rte_eth_dev_socket_id(portid), >>> &tx_conf); >>> >>>> > > > >> + if (ret < 0) >>> >>>> > > > >> + ODP_ERR("%s txq:err=%d, >>> port=%u\n", >>> >>>> > > > >> + __func__, ret, (unsigned) >>> portid); >>> >>>> > > > >> + >>> ODP_DBG("dpdk >>> tx queue setup >>> >>>> > > done\n"); >>> >>>> > > > >> + } >>> >>>> > > > >> + >>> >>>> > > > >> + /* Start device */ >>> >>>> > > > >> + ret = >>> rte_eth_dev_start(portid); >>> >>>> > > > >> + if (ret < 0) >>> >>>> > > > >> + >>> ODP_ERR("rte_eth_dev_start:err=%d, port=%u\n", >>> >>>> > > > >> + ret, >>> (unsigned) portid); >>> >>>> > > > >> + ODP_DBG("dpdk setup >>> done\n\n"); >>> >>>> > > > >> + >>> >>>> > > > >> + portinit[portid] = 1; >>> >>>> > > > >> + } >>> >>>> > > > >> + pkt_dpdk->queueid = >>> qid[portid]++; >>> >>>> > > > >> return 0; >>> >>>> > > > >> } >>> >>>> > > > >> diff --git >>> a/platform/linux-dpdk/odp_packet_io.c >>> >>>> > > > >> >>> b/platform/linux-dpdk/odp_packet_io.c >>> >>>> > > > >> index d8d127f..3124175 100644 >>> >>>> > > > >> --- >>> a/platform/linux-dpdk/odp_packet_io.c >>> >>>> > > > >> +++ >>> b/platform/linux-dpdk/odp_packet_io.c >>> >>>> > > > >> @@ -230,6 +230,8 @@ int >>> odp_pktio_recv(odp_pktio_t id, >>> >>>> > > odp_packet_t >>> >>>> > > > >> pkt_table[], unsigned len) >>> >>>> > > > >> if (pktio_entry == NULL) >>> >>>> > > > >> return -1; >>> >>>> > > > >> + odp_pktio_send(id, >>> pkt_table, 0); >>> >>>> > > > >> + >>> >>>> > > > >> lock_entry(pktio_entry); >>> >>>> > > > >> pkts = >>> recv_pkt_dpdk(&pktio_entry->s.pkt_dpdk, >>> >>>> > > pkt_table, len); >>> >>>> > > > >> unlock_entry(pktio_entry); >>> >>>> > > > >> >>> >>>> > > > > >>> >>>> > > > > >>> >>>> > > > > >>> _______________________________________________ >>> >>>> > > > > lng-odp mailing list >>> >>>> > > > >lng-odp@lists.linaro.org >>> <mailto:lng-odp@lists.linaro.org> >>> <mailto:lng-odp@lists.linaro.org> >>> <mailto:lng-odp@lists.linaro.org >>> <mailto:lng-odp@lists.linaro.org>> >>> <mailto:lng-odp@lists.linaro.org >>> <mailto:lng-odp@lists.linaro.org> >>> <mailto:lng-odp@lists.linaro.org >>> <mailto:lng-odp@lists.linaro.org>>> >>> >>>> > > > > >>> http://lists.linaro.org/mailman/listinfo/lng-odp >>> <http://lists.linaro.org/mailman/listinfo/lng-odp> >>> >>>> > > > > >>> >>>> > > > >>> >>>> > > > >>> >>>> > > > >>> >>>> > > > -- >>> >>>> > > > *Mike Holmes* >>> >>>> > > > Linaro Technical Manager / Lead >>> >>>> > > > LNG - ODP >>> >>>> > > >>> >>>> > > > >>> _______________________________________________ >>> >>>> > > > lng-odp mailing list >>> >>>> > > >lng-odp@lists.linaro.org >>> <mailto:lng-odp@lists.linaro.org> >>> <mailto:lng-odp@lists.linaro.org> >>> <mailto:lng-odp@lists.linaro.org >>> <mailto:lng-odp@lists.linaro.org>> >>> <mailto:lng-odp@lists.linaro.org >>> <mailto:lng-odp@lists.linaro.org> >>> <mailto:lng-odp@lists.linaro.org >>> <mailto:lng-odp@lists.linaro.org>>> >>> >>>> > > > >>> http://lists.linaro.org/mailman/listinfo/lng-odp >>> <http://lists.linaro.org/mailman/listinfo/lng-odp> >>> >>>> > > >>> >>>> > > >>> >>>> > > -- >>> >>>> > > Anders Roxell >>> >>>> > >anders.roxell@linaro.org >>> <mailto:anders.roxell@linaro.org> >>> <mailto:anders.roxell@linaro.org> >>> <mailto:anders.roxell@linaro.org >>> <mailto:anders.roxell@linaro.org>> >>> <mailto:anders.roxell@linaro.org >>> <mailto:anders.roxell@linaro.org> >>> <mailto:anders.roxell@linaro.org >>> <mailto:anders.roxell@linaro.org>>> >>> >>>> > > M: +46 709 71 42 85 >>> <tel:%2B46%20709%2071%2042%2085> >>> <tel:%2B46%20709%2071%2042%2085> >>> | IRC: roxell >>> >>>> > > >>> >>>> > > >>> _______________________________________________ >>> >>>> > > lng-odp mailing list >>> >>>> > >lng-odp@lists.linaro.org >>> <mailto:lng-odp@lists.linaro.org> >>> <mailto:lng-odp@lists.linaro.org> >>> <mailto:lng-odp@lists.linaro.org >>> <mailto:lng-odp@lists.linaro.org>> >>> <mailto:lng-odp@lists.linaro.org >>> <mailto:lng-odp@lists.linaro.org> >>> <mailto:lng-odp@lists.linaro.org >>> <mailto:lng-odp@lists.linaro.org>>> >>> >>>> > > >>> http://lists.linaro.org/mailman/listinfo/lng-odp >>> >>>> > > >>> >>>> > > >>> >>>> > > >>> >>>> > > >>> >>>> > >>> >_______________________________________________ >>> >>>> > >lng-odp mailing list >>> >>>> > >lng-odp@lists.linaro.org >>> <mailto:lng-odp@lists.linaro.org> >>> <mailto:lng-odp@lists.linaro.org> >>> <mailto:lng-odp@lists.linaro.org >>> <mailto:lng-odp@lists.linaro.org>> >>> >>>> > >>> >http://lists.linaro.org/mailman/listinfo/lng-odp >>> >>>> > >>> >>>> > >>> >>>> > >>> _______________________________________________ >>> >>>> > lng-odp mailing list >>> >>>> >lng-odp@lists.linaro.org >>> <mailto:lng-odp@lists.linaro.org> >>> <mailto:lng-odp@lists.linaro.org> >>> <mailto:lng-odp@lists.linaro.org >>> <mailto:lng-odp@lists.linaro.org>> >>> >>>> > >>> http://lists.linaro.org/mailman/listinfo/lng-odp >>> <http://lists.linaro.org/mailman/listinfo/lng-odp> >>> >>>> >>> >>>> -- >>> >>>> Anders Roxell >>> >>>>anders.roxell@linaro.org >>> <mailto:anders.roxell@linaro.org> >>> <mailto:anders.roxell@linaro.org> >>> <mailto:anders.roxell@linaro.org >>> <mailto:anders.roxell@linaro.org>> >>> >>>> M: +46 709 71 42 85 >>> <tel:%2B46%20709%2071%2042%2085> >>> <tel:%2B46%20709%2071%2042%2085> | IRC: >>> roxell >>> >>>> >>> >>>> >>> _______________________________________________ >>> >>>> lng-odp mailing list >>> >>>>lng-odp@lists.linaro.org >>> <mailto:lng-odp@lists.linaro.org> >>> <mailto:lng-odp@lists.linaro.org> >>> <mailto:lng-odp@lists.linaro.org >>> <mailto:lng-odp@lists.linaro.org>> >>> >>>> >>> http://lists.linaro.org/mailman/listinfo/lng-odp >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> -- >>> >>> Mike Holmes >>> >>> Linaro Technical Manager / Lead >>> >>> LNG - ODP >>> >>> >>> >>> >>> _______________________________________________ >>> >>> lng-odp mailing list >>> >>>lng-odp@lists.linaro.org >>> <mailto:lng-odp@lists.linaro.org> >>> <mailto:lng-odp@lists.linaro.org> >>> <mailto:lng-odp@lists.linaro.org >>> <mailto:lng-odp@lists.linaro.org>> >>> >>>http://lists.linaro.org/mailman/listinfo/lng-odp >>> >>> >>> >> >>> > >>> > >>> > >>> > -- >>> > Mike Holmes >>> > Linaro Technical Manager / Lead >>> > LNG - ODP >>> > >>> > _______________________________________________ >>> > lng-odp mailing list >>> >lng-odp@lists.linaro.org >>> <mailto:lng-odp@lists.linaro.org> >>> <mailto:lng-odp@lists.linaro.org> >>> <mailto:lng-odp@lists.linaro.org >>> <mailto:lng-odp@lists.linaro.org>> >>> >http://lists.linaro.org/mailman/listinfo/lng-odp >>> > >>> >>> >>> >>> >>> -- *Mike Holmes* >>> Linaro Technical Manager / Lead >>> LNG - ODP >>> >>> >>> >>> >>> _______________________________________________ >>> lng-odp mailing list >>> lng-odp@lists.linaro.org >>> <mailto:lng-odp@lists.linaro.org><mailto:lng-odp@lists.linaro.org> >>> http://lists.linaro.org/mailman/listinfo/lng-odp >>> >>> >>> >>> >>> _______________________________________________ >>> lng-odp mailing list >>> lng-odp@lists.linaro.org >>> <mailto:lng-odp@lists.linaro.org><mailto:lng-odp@lists.linaro.org> >>> http://lists.linaro.org/mailman/listinfo/lng-odp >>> >>> >>> >>> >>> -- >>> *Mike Holmes* >>> Linaro Technical Manager / Lead >>> LNG - ODP >> >> >> _______________________________________________ >> lng-odp mailing list >> lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org> >> http://lists.linaro.org/mailman/listinfo/lng-odp > > > _______________________________________________ > lng-odp mailing list > lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org> > http://lists.linaro.org/mailman/listinfo/lng-odp > >
On 12 August 2014 23:38, Mike Holmes <mike.holmes@linaro.org> wrote: > So it looks like we don't have any way to test this without an Ixia which is > a problem given that Santosh is having trouble. > Basically there is no CI job to point at that shows that excluding human > error it is still working as expected. > Status : Yesterday with Venky's help I managed to get dpdk-pktgen working with odp l2fwd applivation for single queue patch. I have not tested multi patch yet. Refer bug [1] for details, I could see no_hz_full isolated odp's-dpdk-l2fwd recieving/sending packet for more than 2000 secs. In-kernel pktgen has problem with odp's-dpdk-l2fwd. [1] https://bugs.linaro.org/show_bug.cgi?id=320 > Keith, is dpdk pktgen able to generate pkts in the way Venki needs ? > > Mike > > > On 12 August 2014 02:17, Santosh Shukla <santosh.shukla@linaro.org> wrote: >> >> On 12 August 2014 00:25, Mike Holmes <mike.holmes@linaro.org> wrote: >> > Which test case in odp/test would check this, or does it need an >> > application >> > like l2fwd to be run - are either in LAVA/CI ? >> > >> > Santosh are you able to verify this does not break anything as part of >> > the >> > l2fwd work you are doing ? >> > >> >> No, I am seeing problem with current and should persist in this multi >> flavour too. We have bug reported on that lines. So whole dpdk-l2fwd >> doesn't works for me for my requirement. >> >> Thanks. >> >> > Mike >> > >> > >> > On 11 August 2014 01:43, Venkatesh Vivekanandan >> > <venkatesh.vivekanandan@linaro.org> wrote: >> >> >> >> >> >> >> >> >> >> On 9 August 2014 17:32, Mike Holmes <mike.holmes@linaro.org> wrote: >> >>> >> >>> >> >>> >> >>> >> >>> On 8 August 2014 17:46, Anders Roxell <anders.roxell@linaro.org> >> >>> wrote: >> >>>> >> >>>> On 2014-08-08 17:31, Maxim Uvarov wrote: >> >>>> > On 08/08/2014 05:13 PM, Venkatesh Vivekanandan wrote: >> >>>> > > >> >>>> > > >> >>>> > > >> >>>> > >On 7 August 2014 21:10, Anders Roxell <anders.roxell@linaro.org >> >>>> > ><mailto:anders.roxell@linaro.org>> wrote: >> >>>> > > >> >>>> > > On 2014-08-07 10:41, Mike Holmes wrote: >> >>>> > > > Does this need a signoff by someone else before it is merged >> >>>> > > ? >> >>>> > > > >> >>>> > > > I think we want to enforce getting an ack, tested-by or >> >>>> > > reviewed-by before >> >>>> > > > we merge things, we have informally moved that way over the >> >>>> > > last >> >>>> > > couple of >> >>>> > > > weeks and now I think it is time we made it a formal >> >>>> > > requirement. >> >>>> > > >> >>>> > > Agree. >> >>>> > > >> >>>> > > >> >>>> > >If this is the case, then is it fair to say initial discussion of >> >>>> > >24-hour window is void?. I guess Maxim was waiting for 2 days(for >> >>>> > >any comments) before he could merge this patch. Do we have any >> >>>> > >time-limit before which a patch /must /be reviewed or tested? I >> >>>> > >hope we can't wait indefinitely or is this the case?. >> >>>> > >> >>>> > I think if patch came from platfrom maintainer, it's not new API. >> >>>> > No >> >>>> > comments in 1 or 2 days, than it's ok to merge it. If patch came >> >>>> > from somobody alse I would ask maintainer to review it. >> >>>> >> >>>> I disagree with this. >> >>>> No matter where the patch comes from and who wrote the patch, it can >> >>>> be >> >>>> wrong and need a second pair of eyes i.e., >> >>>> (Reviewed|Acked|Signed-off)-by. >> >>>> If no one has replied to a patch after 2 days, the author of the >> >>>> patch >> >>>> should ping the list and maintainer. >> >>>> >> >>>> After the second pair of eyes, the patch should be ok to be merged. >> >>>> The ODP maintainer should do a smoke build test on all the supported >> >>>> platforms before merging though. >> >>> >> >>> >> >>> My 2 cents >> >>> We have started to develop a cohesive API, I think that is down to a >> >>> lot >> >>> of folks working together. >> >>> I also think that peer review/team work is reflected in the increasing >> >>> willingness to review each others patches which has improved quality >> >>> and helped establish the guidelines on how things bolt together in >> >>> ODP, >> >>> may long discussions have spawned from patches. >> >>> >> >>> No one is beyond silly mistakes, peer review finds a lot of the dumb >> >>> stuff for little cost, saving on the inevitable ugly patch up that >> >>> will >> >>> ensue otherwise. >> >>> Maxim you could do the default reviews if no one came forward, but if >> >>> a >> >>> submitter finds and establishes their own network of reviewers that is >> >>> one >> >>> extra pair of eyes and ideas. >> >> >> >> >> >> Can someone please review this patch?. If there is any comments, we can >> >> request maxim to revert the patch, otherwise he can add the >> >> "Reviewed-by/Tested-by" to the applied patch. >> >> >> >>>> >> >>>> Cheers, >> >>>> Anders >> >>>> >> >>>> > >> >>>> > Maxim. >> >>>> > >> >>>> > > Anders >> >>>> > > >> >>>> > > > >> >>>> > > > Mike >> >>>> > > > >> >>>> > > > >> >>>> > > > On 7 August 2014 09:15, Maxim Uvarov >> >>>> > > <maxim.uvarov@linaro.org >> >>>> > > <mailto:maxim.uvarov@linaro.org>> wrote: >> >>>> > > > >> >>>> > > > > Merged, thanks! >> >>>> > > > > >> >>>> > > > > Maxim. >> >>>> > > > > >> >>>> > > > > >> >>>> > > > > On 08/05/2014 06:54 PM, venkatesh.vivekanandan@linaro.org >> >>>> > > <mailto:venkatesh.vivekanandan@linaro.org> wrote: >> >>>> > > > > >> >>>> > > > >> From: Venkatesh Vivekanandan >> >>>> > > <venkatesh.vivekanandan@linaro.org >> >>>> > > <mailto:venkatesh.vivekanandan@linaro.org>> >> >>>> > > > >> >> >>>> > > > >> - Multi queue support per interface is enabled. >> >>>> > > > >> - odp_pktio_send with "0" packet is called in >> >>>> > > odp_pktio_recv >> >>>> > > to >> >>>> > > > >> give the transmitted buffers back to mempool. >> >>>> > > > >> - mbuf alloc failure during receive is fixed by giving >> >>>> > > more >> >>>> > > buffers to >> >>>> > > > >> mempool. >> >>>> > > > >> - mempool cache size is given equivalent to >> >>>> > > MAX_PKT_BURST. >> >>>> > > > >> >> >>>> > > > >> Signed-off-by: Venkatesh Vivekanandan >> >>>> > > <venkatesh.vivekanandan@linaro.org >> >>>> > > <mailto:venkatesh.vivekanandan@linaro.org>> >> >>>> > > > >> --- >> >>>> > > > >> platform/linux-dpdk/include/odp_packet_dpdk.h | 24 +++++ >> >>>> > > > >> platform/linux-dpdk/odp_buffer_pool.c | 4 +- >> >>>> > > > >> platform/linux-dpdk/odp_packet_dpdk.c | 136 >> >>>> > > > >> +++++++++++++------------- >> >>>> > > > >> platform/linux-dpdk/odp_packet_io.c | 2 + >> >>>> > > > >> 4 files changed, 94 insertions(+), 72 deletions(-) >> >>>> > > > >> >> >>>> > > > >> diff --git >> >>>> > > a/platform/linux-dpdk/include/odp_packet_dpdk.h >> >>>> > > > >> b/platform/linux-dpdk/include/odp_packet_dpdk.h >> >>>> > > > >> index bcbe9e8..bcf9aa5 100644 >> >>>> > > > >> --- a/platform/linux-dpdk/include/odp_packet_dpdk.h >> >>>> > > > >> +++ b/platform/linux-dpdk/include/odp_packet_dpdk.h >> >>>> > > > >> @@ -50,6 +50,30 @@ >> >>>> > > > >> #define DPDK_BLOCKING_IO >> >>>> > > > >> +/* >> >>>> > > > >> + * RX and TX Prefetch, Host, and Write-back threshold >> >>>> > > values >> >>>> > > should be >> >>>> > > > >> + * carefully set for optimal performance. Consult the >> >>>> > > network >> >>>> > > > >> + * controller's datasheet and supporting DPDK >> >>>> > > documentation >> >>>> > > for guidance >> >>>> > > > >> + * on how these parameters should be set. >> >>>> > > > >> + */ >> >>>> > > > >> +#define RX_PTHRESH 8 /**< Default values of RX prefetch >> >>>> > > threshold reg. */ >> >>>> > > > >> +#define RX_HTHRESH 8 /**< Default values of RX host >> >>>> > > threshold reg. */ >> >>>> > > > >> +#define RX_WTHRESH 4 /**< Default values of RX >> >>>> > > write-back >> >>>> > > threshold reg. >> >>>> > > > >> */ >> >>>> > > > >> + >> >>>> > > > >> +/* >> >>>> > > > >> + * These default values are optimized for use with the >> >>>> > > Intel(R) 82599 10 >> >>>> > > > >> GbE >> >>>> > > > >> + * Controller and the DPDK ixgbe PMD. Consider using >> >>>> > > other >> >>>> > > values for >> >>>> > > > >> other >> >>>> > > > >> + * network controllers and/or network drivers. >> >>>> > > > >> + */ >> >>>> > > > >> +#define TX_PTHRESH 36 /**< Default values of TX prefetch >> >>>> > > threshold reg. >> >>>> > > > >> */ >> >>>> > > > >> +#define TX_HTHRESH 0 /**< Default values of TX host >> >>>> > > threshold reg. */ >> >>>> > > > >> +#define TX_WTHRESH 0 /**< Default values of TX >> >>>> > > write-back >> >>>> > > threshold >> >>>> > > > >> reg. */ >> >>>> > > > >> + >> >>>> > > > >> +#define MAX_PKT_BURST 16 >> >>>> > > > >> +#define BURST_TX_DRAIN_US 100 /* TX drain every ~100us >> >>>> > > */ >> >>>> > > > >> +#define RTE_TEST_RX_DESC_DEFAULT 128 >> >>>> > > > >> +#define RTE_TEST_TX_DESC_DEFAULT 512 >> >>>> > > > >> + >> >>>> > > > >> /** Packet socket using dpdk mmaped rings for both Rx >> >>>> > > and >> >>>> > > Tx */ >> >>>> > > > >> typedef struct { >> >>>> > > > >> odp_buffer_pool_t pool; >> >>>> > > > >> diff --git a/platform/linux-dpdk/odp_buffer_pool.c >> >>>> > > > >> b/platform/linux-dpdk/odp_buffer_pool.c >> >>>> > > > >> index de90275..805ce68 100644 >> >>>> > > > >> --- a/platform/linux-dpdk/odp_buffer_pool.c >> >>>> > > > >> +++ b/platform/linux-dpdk/odp_buffer_pool.c >> >>>> > > > >> @@ -23,7 +23,7 @@ >> >>>> > > > >> #include <odp_packet_dpdk.h> >> >>>> > > > >> #define MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + >> >>>> > > > >> RTE_PKTMBUF_HEADROOM) >> >>>> > > > >> -#define NB_MBUF 8192 >> >>>> > > > >> +#define NB_MBUF 32768 >> >>>> > > > >> #ifdef POOL_USE_TICKETLOCK >> >>>> > > > >> #include <odp_ticketlock.h> >> >>>> > > > >> @@ -112,7 +112,7 @@ odp_buffer_pool_t >> >>>> > > odp_buffer_pool_create(const char >> >>>> > > > >> *name, >> >>>> > > > >> pktmbuf_pool = >> >>>> > > > >> rte_mempool_create(name, NB_MBUF, >> >>>> > > > >> - MBUF_SIZE, 32, >> >>>> > > > >> + MBUF_SIZE, MAX_PKT_BURST, >> >>>> > > > >> sizeof(struct >> >>>> > > > >> rte_pktmbuf_pool_private), >> >>>> > > > >> rte_pktmbuf_pool_init, NULL, >> >>>> > > > >> rte_pktmbuf_init, NULL, >> >>>> > > > >> diff --git a/platform/linux-dpdk/odp_packet_dpdk.c >> >>>> > > > >> b/platform/linux-dpdk/odp_packet_dpdk.c >> >>>> > > > >> index 31bfa30..d5c8e80 100644 >> >>>> > > > >> --- a/platform/linux-dpdk/odp_packet_dpdk.c >> >>>> > > > >> +++ b/platform/linux-dpdk/odp_packet_dpdk.c >> >>>> > > > >> @@ -26,34 +26,13 @@ >> >>>> > > > >> #include <odp_packet_dpdk.h> >> >>>> > > > >> #include <net/if.h> >> >>>> > > > >> -/* >> >>>> > > > >> - * RX and TX Prefetch, Host, and Write-back threshold >> >>>> > > values >> >>>> > > should be >> >>>> > > > >> - * carefully set for optimal performance. Consult the >> >>>> > > network >> >>>> > > > >> - * controller's datasheet and supporting DPDK >> >>>> > > documentation >> >>>> > > for guidance >> >>>> > > > >> - * on how these parameters should be set. >> >>>> > > > >> - */ >> >>>> > > > >> -#define RX_PTHRESH 8 /**< Default values of RX prefetch >> >>>> > > threshold reg. */ >> >>>> > > > >> -#define RX_HTHRESH 8 /**< Default values of RX host >> >>>> > > threshold reg. */ >> >>>> > > > >> -#define RX_WTHRESH 4 /**< Default values of RX >> >>>> > > write-back >> >>>> > > threshold reg. >> >>>> > > > >> */ >> >>>> > > > >> - >> >>>> > > > >> -/* >> >>>> > > > >> - * These default values are optimized for use with the >> >>>> > > Intel(R) 82599 10 >> >>>> > > > >> GbE >> >>>> > > > >> - * Controller and the DPDK ixgbe PMD. Consider using >> >>>> > > other >> >>>> > > values for >> >>>> > > > >> other >> >>>> > > > >> - * network controllers and/or network drivers. >> >>>> > > > >> - */ >> >>>> > > > >> -#define TX_PTHRESH 36 /**< Default values of TX prefetch >> >>>> > > threshold reg. >> >>>> > > > >> */ >> >>>> > > > >> -#define TX_HTHRESH 0 /**< Default values of TX host >> >>>> > > threshold reg. */ >> >>>> > > > >> -#define TX_WTHRESH 0 /**< Default values of TX >> >>>> > > write-back >> >>>> > > threshold >> >>>> > > > >> reg. */ >> >>>> > > > >> - >> >>>> > > > >> -#define MAX_PKT_BURST 16 >> >>>> > > > >> -#define BURST_TX_DRAIN_US 100 /* TX drain every ~100us >> >>>> > > */ >> >>>> > > > >> -#define RTE_TEST_RX_DESC_DEFAULT 128 >> >>>> > > > >> -#define RTE_TEST_TX_DESC_DEFAULT 512 >> >>>> > > > >> static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT; >> >>>> > > > >> static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT; >> >>>> > > > >> static const struct rte_eth_conf port_conf = { >> >>>> > > > >> .rxmode = { >> >>>> > > > >> + .mq_mode = ETH_MQ_RX_RSS, >> >>>> > > > >> + .max_rx_pkt_len = ETHER_MAX_LEN, >> >>>> > > > >> .split_hdr_size = 0, >> >>>> > > > >> .header_split = 0, /**< Header Split >> >>>> > > disabled */ >> >>>> > > > >> .hw_ip_checksum = 0, /**< IP checksum >> >>>> > > offload >> >>>> > > disabled */ >> >>>> > > > >> @@ -61,6 +40,12 @@ static const struct rte_eth_conf >> >>>> > > port_conf = { >> >>>> > > > >> .jumbo_frame = 0, /**< Jumbo Frame >> >>>> > > Support >> >>>> > > disabled */ >> >>>> > > > >> .hw_strip_crc = 0, /**< CRC stripped by >> >>>> > > hardware */ >> >>>> > > > >> }, >> >>>> > > > >> + .rx_adv_conf = { >> >>>> > > > >> + .rss_conf = { >> >>>> > > > >> + .rss_key = NULL, >> >>>> > > > >> + .rss_hf = ETH_RSS_IPV4 | >> >>>> > > ETH_RSS_IPV6, >> >>>> > > > >> + }, >> >>>> > > > >> + }, >> >>>> > > > >> .txmode = { >> >>>> > > > >> .mq_mode = ETH_MQ_TX_NONE, >> >>>> > > > >> }, >> >>>> > > > >> @@ -95,60 +80,71 @@ int setup_pkt_dpdk(pkt_dpdk_t * const >> >>>> > > pkt_dpdk, const >> >>>> > > > >> char *netdev, >> >>>> > > > >> ODP_DBG("setup_pkt_dpdk\n"); >> >>>> > > > >> static struct ether_addr >> >>>> > > eth_addr[RTE_MAX_ETHPORTS]; >> >>>> > > > >> - uint8_t portid = 0; >> >>>> > > > >> - uint16_t queueid = 0; >> >>>> > > > >> - int ret; >> >>>> > > > >> + static int portinit[RTE_MAX_ETHPORTS]; >> >>>> > > > >> + static int qid[RTE_MAX_ETHPORTS]; >> >>>> > > > >> + uint8_t portid = 0, num_intf = 2; >> >>>> > > > >> + uint16_t nbrxq = 0, nbtxq = 0; >> >>>> > > > >> + int ret, i; >> >>>> > > > >> + >> >>>> > > > >> printf("dpdk netdev: %s\n", netdev); >> >>>> > > > >> printf("dpdk pool: %lx\n", pool); >> >>>> > > > >> - >> >>>> > > > >> portid = atoi(netdev); >> >>>> > > > >> pkt_dpdk->portid = portid; >> >>>> > > > >> - pkt_dpdk->queueid = queueid; >> >>>> > > > >> pkt_dpdk->pool = pool; >> >>>> > > > >> printf("dpdk portid: %u\n", portid); >> >>>> > > > >> - fflush(stdout); >> >>>> > > > >> - ret = rte_eth_dev_configure(portid, 1, 1, >> >>>> > > &port_conf); >> >>>> > > > >> - if (ret < 0) >> >>>> > > > >> - ODP_ERR("Cannot configure device: err=%d, >> >>>> > > port=%u\n", >> >>>> > > > >> - ret, (unsigned) portid); >> >>>> > > > >> - >> >>>> > > > >> - rte_eth_macaddr_get(portid, ð_addr[portid]); >> >>>> > > > >> - ODP_DBG("Port %u, MAC address: >> >>>> > > %02X:%02X:%02X:%02X:%02X:%02X\ >> >>>> > > > >> n\n", >> >>>> > > > >> - (unsigned) portid, >> >>>> > > > >> - eth_addr[portid].addr_bytes[0], >> >>>> > > > >> - eth_addr[portid].addr_bytes[1], >> >>>> > > > >> - eth_addr[portid].addr_bytes[2], >> >>>> > > > >> - eth_addr[portid].addr_bytes[3], >> >>>> > > > >> - eth_addr[portid].addr_bytes[4], >> >>>> > > > >> - eth_addr[portid].addr_bytes[5]); >> >>>> > > > >> - >> >>>> > > > >> - /* init one RX queue on each port */ >> >>>> > > > >> - fflush(stdout); >> >>>> > > > >> - ret = rte_eth_rx_queue_setup(portid, queueid, >> >>>> > > nb_rxd, >> >>>> > > > >> - rte_eth_dev_socket_id(portid), >> >>>> > > > >> &rx_conf, >> >>>> > > > >> - (struct rte_mempool *)pool); >> >>>> > > > >> - if (ret < 0) >> >>>> > > > >> - ODP_ERR("rte_eth_rx_queue_setup:err=%d, port=%u\n", >> >>>> > > > >> - ret, (unsigned) portid); >> >>>> > > > >> - ODP_DBG("dpdk rx queue setup done\n"); >> >>>> > > > >> - >> >>>> > > > >> - /* init one TX queue on each port */ >> >>>> > > > >> - fflush(stdout); >> >>>> > > > >> - ret = rte_eth_tx_queue_setup(portid, queueid, >> >>>> > > nb_txd, >> >>>> > > > >> - rte_eth_dev_socket_id(portid), &tx_conf); >> >>>> > > > >> - if (ret < 0) >> >>>> > > > >> - ODP_ERR("rte_eth_tx_queue_setup:err=%d, port=%u\n", >> >>>> > > > >> - ret, (unsigned) portid); >> >>>> > > > >> - ODP_DBG("dpdk tx queue setup done\n"); >> >>>> > > > >> - >> >>>> > > > >> - /* Start device */ >> >>>> > > > >> - ret = rte_eth_dev_start(portid); >> >>>> > > > >> - if (ret < 0) >> >>>> > > > >> - ODP_ERR("rte_eth_dev_start:err=%d, port=%u\n", >> >>>> > > > >> - ret, (unsigned) portid); >> >>>> > > > >> - ODP_DBG("dpdk setup done\n\n"); >> >>>> > > > >> - >> >>>> > > > >> + nbrxq = odp_sys_core_count() / num_intf; >> >>>> > > > >> + nbtxq = nbrxq; >> >>>> > > > >> + if (portinit[portid] == 0) { >> >>>> > > > >> + fflush(stdout); >> >>>> > > > >> + ret = rte_eth_dev_configure(portid, >> >>>> > > nbrxq, >> >>>> > > nbtxq, >> >>>> > > > >> &port_conf); >> >>>> > > > >> + if (ret < 0) >> >>>> > > > >> + ODP_ERR("Cannot configure device: >> >>>> > > err=%d, >> >>>> > > > >> port=%u\n", >> >>>> > > > >> + ret, (unsigned) portid); >> >>>> > > > >> + >> >>>> > > > >> + rte_eth_macaddr_get(portid, ð_addr[portid]); >> >>>> > > > >> + ODP_DBG("Port %u, MAC address: >> >>>> > > > >> %02X:%02X:%02X:%02X:%02X:%02X\n", >> >>>> > > > >> + (unsigned) portid, >> >>>> > > > >> + eth_addr[portid].addr_bytes[0], >> >>>> > > > >> + eth_addr[portid].addr_bytes[1], >> >>>> > > > >> + eth_addr[portid].addr_bytes[2], >> >>>> > > > >> + eth_addr[portid].addr_bytes[3], >> >>>> > > > >> + eth_addr[portid].addr_bytes[4], >> >>>> > > > >> + eth_addr[portid].addr_bytes[5]); >> >>>> > > > >> + >> >>>> > > > >> + /* init one RX queue on each port */ >> >>>> > > > >> + fflush(stdout); >> >>>> > > > >> + for (i = 0; i < nbrxq; i++) { >> >>>> > > > >> + ret = >> >>>> > > rte_eth_rx_queue_setup(portid, >> >>>> > > i, nb_rxd, >> >>>> > > > >> + rte_eth_dev_socket_id(portid), >> >>>> > > > >> &rx_conf, >> >>>> > > > >> + (struct rte_mempool *)pool); >> >>>> > > > >> + if (ret < 0) >> >>>> > > > >> + ODP_ERR("%s rxq:err=%d, port=%u\n", >> >>>> > > > >> + __func__, ret, (unsigned) portid); >> >>>> > > > >> + ODP_DBG("dpdk rx queue setup >> >>>> > > done\n"); >> >>>> > > > >> + } >> >>>> > > > >> + >> >>>> > > > >> + /* init one TX queue on each port */ >> >>>> > > > >> + fflush(stdout); >> >>>> > > > >> + for (i = 0; i < nbtxq; i++) { >> >>>> > > > >> + ret = >> >>>> > > rte_eth_tx_queue_setup(portid, >> >>>> > > i, nb_txd, >> >>>> > > > >> + rte_eth_dev_socket_id(portid), &tx_conf); >> >>>> > > > >> + if (ret < 0) >> >>>> > > > >> + ODP_ERR("%s txq:err=%d, port=%u\n", >> >>>> > > > >> + __func__, ret, (unsigned) portid); >> >>>> > > > >> + ODP_DBG("dpdk tx queue setup >> >>>> > > done\n"); >> >>>> > > > >> + } >> >>>> > > > >> + >> >>>> > > > >> + /* Start device */ >> >>>> > > > >> + ret = rte_eth_dev_start(portid); >> >>>> > > > >> + if (ret < 0) >> >>>> > > > >> + ODP_ERR("rte_eth_dev_start:err=%d, port=%u\n", >> >>>> > > > >> + ret, (unsigned) portid); >> >>>> > > > >> + ODP_DBG("dpdk setup done\n\n"); >> >>>> > > > >> + >> >>>> > > > >> + portinit[portid] = 1; >> >>>> > > > >> + } >> >>>> > > > >> + pkt_dpdk->queueid = qid[portid]++; >> >>>> > > > >> return 0; >> >>>> > > > >> } >> >>>> > > > >> diff --git a/platform/linux-dpdk/odp_packet_io.c >> >>>> > > > >> b/platform/linux-dpdk/odp_packet_io.c >> >>>> > > > >> index d8d127f..3124175 100644 >> >>>> > > > >> --- a/platform/linux-dpdk/odp_packet_io.c >> >>>> > > > >> +++ b/platform/linux-dpdk/odp_packet_io.c >> >>>> > > > >> @@ -230,6 +230,8 @@ int odp_pktio_recv(odp_pktio_t id, >> >>>> > > odp_packet_t >> >>>> > > > >> pkt_table[], unsigned len) >> >>>> > > > >> if (pktio_entry == NULL) >> >>>> > > > >> return -1; >> >>>> > > > >> + odp_pktio_send(id, pkt_table, 0); >> >>>> > > > >> + >> >>>> > > > >> lock_entry(pktio_entry); >> >>>> > > > >> pkts = recv_pkt_dpdk(&pktio_entry->s.pkt_dpdk, >> >>>> > > pkt_table, len); >> >>>> > > > >> unlock_entry(pktio_entry); >> >>>> > > > >> >> >>>> > > > > >> >>>> > > > > >> >>>> > > > > _______________________________________________ >> >>>> > > > > lng-odp mailing list >> >>>> > > > > lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org> >> >>>> > > > > http://lists.linaro.org/mailman/listinfo/lng-odp >> >>>> > > > > >> >>>> > > > >> >>>> > > > >> >>>> > > > >> >>>> > > > -- >> >>>> > > > *Mike Holmes* >> >>>> > > > Linaro Technical Manager / Lead >> >>>> > > > LNG - ODP >> >>>> > > >> >>>> > > > _______________________________________________ >> >>>> > > > lng-odp mailing list >> >>>> > > > lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org> >> >>>> > > > http://lists.linaro.org/mailman/listinfo/lng-odp >> >>>> > > >> >>>> > > >> >>>> > > -- >> >>>> > > Anders Roxell >> >>>> > > anders.roxell@linaro.org <mailto:anders.roxell@linaro.org> >> >>>> > > M: +46 709 71 42 85 | IRC: roxell >> >>>> > > >> >>>> > > _______________________________________________ >> >>>> > > lng-odp mailing list >> >>>> > > lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org> >> >>>> > > http://lists.linaro.org/mailman/listinfo/lng-odp >> >>>> > > >> >>>> > > >> >>>> > > >> >>>> > > >> >>>> > >_______________________________________________ >> >>>> > >lng-odp mailing list >> >>>> > >lng-odp@lists.linaro.org >> >>>> > >http://lists.linaro.org/mailman/listinfo/lng-odp >> >>>> > >> >>>> > >> >>>> > _______________________________________________ >> >>>> > lng-odp mailing list >> >>>> > lng-odp@lists.linaro.org >> >>>> > http://lists.linaro.org/mailman/listinfo/lng-odp >> >>>> >> >>>> -- >> >>>> Anders Roxell >> >>>> anders.roxell@linaro.org >> >>>> M: +46 709 71 42 85 | IRC: roxell >> >>>> >> >>>> _______________________________________________ >> >>>> lng-odp mailing list >> >>>> lng-odp@lists.linaro.org >> >>>> http://lists.linaro.org/mailman/listinfo/lng-odp >> >>> >> >>> >> >>> >> >>> >> >>> -- >> >>> Mike Holmes >> >>> Linaro Technical Manager / Lead >> >>> LNG - ODP >> >>> >> >>> _______________________________________________ >> >>> lng-odp mailing list >> >>> lng-odp@lists.linaro.org >> >>> http://lists.linaro.org/mailman/listinfo/lng-odp >> >>> >> >> >> > >> > >> > >> > -- >> > Mike Holmes >> > Linaro Technical Manager / Lead >> > LNG - ODP >> > >> > _______________________________________________ >> > lng-odp mailing list >> > lng-odp@lists.linaro.org >> > http://lists.linaro.org/mailman/listinfo/lng-odp >> > > > > > > -- > Mike Holmes > Linaro Technical Manager / Lead > LNG - ODP
On 13 August 2014 15:26, Maxim Uvarov <maxim.uvarov@linaro.org> wrote: > On 08/13/2014 12:36 PM, Venkatesh Vivekanandan wrote: >> >> >> >> >> On 13 August 2014 02:30, Wiles, Roger Keith <keith.wiles@windriver.com >> <mailto:keith.wiles@windriver.com>> wrote: >> >> The DPDK version of Pktgen is a bit easy to use and configure then >> the kernel based version. You can also run it on the machine if >> you make sure you configure DPDK correctly (if you have two DPDKs >> running). >> >> If you build Pktgen-DPDK on another machine it should be pretty >> quick (within a 1/2 hour normally if not faster :-) ) to get >> running if all you need is to send UDP or TCP frames. I still not >> know your requires for the traffic. At least with Pktgen-DPDK you >> have a clean simple full screen ASCII (vt100) interface to use. >> >> >> I am modifying the dst ip address. Say 12 different ip address(201.0.0.0 >> to 201.0.0.11) and again start from beginning. Can you please point me to >> how pktgen can do this?. > > > with odp generator it has to be easy: (:- I think, we should stop using odp_generator, It simply doesn't work for case basis. Sticking with in-kernel pktgen or dpdk-pktgen better option for testing/regression. > example/generator/odp_generator.c > static void pack_udp_pkt(odp_buffer_t obuf) > { > > change this: > ip->dst_addr = odp_cpu_to_be_32(args->appl.dstip); > > to something like this: > ip->dst_addr = odp_cpu_to_be_32(0xc9000000 + (i++ % 12)) > > > Maxim. >> >> >> >> If you have the machine setup for DPDK it will just work sending >> 64Byte frames as 10G wire rate. If you decide to go this direction >> I can help set it up for you. >> >> *Keith **Wiles*, Principal Technologist with CTO office, *Wind >> River*mobile 972-213-5533 >> >> On Aug 12, 2014, at 3:41 PM, Maxim Uvarov <maxim.uvarov@linaro.org >> <mailto:maxim.uvarov@linaro.org>> wrote: >> >>> On 08/13/2014 12:38 AM, Mike Holmes wrote: >>>> >>>> To generate test data we don't have to use ODP, although we >>>> should try to do that down the road, but equally you still need >>>> to use external tools to be sure you did not make compatible >>>> only with yourself mistakes. >>>> >>>> I was wondering why we can't spawn several process on one >>>> machine that all send to the same port to test this ? >>> >>> >>> Why not to use kernel packet generator? >>> https://www.kernel.org/doc/Documentation/networking/pktgen.txt >>> >>>> >>>> >>>> On 12 August 2014 16:31, Maxim Uvarov <maxim.uvarov@linaro.org >>>> <mailto:maxim.uvarov@linaro.org><mailto:maxim.uvarov@linaro.org>> >>>> wrote: >>>> >>>> On 08/13/2014 12:29 AM, Maxim Uvarov wrote: >>>> >>>> why not to use tcpreplay? >>>> >>>> I.e. odp+libpcap+dpdk+tcpreplay if we have everything ready? >>>> >>>> Maxim. >>>> >>>> Ah, I should check that first. tcpreplay doesn't depend on >>>> libpcap. >>>> >>>> ldd /usr/bin/tcpreplay >>>> linux-vdso.so.1 => (0x00007fffa3bfe000) >>>> libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 >>>> (0x00007f3d490ba000) >>>> /lib64/ld-linux-x86-64.so.2 (0x00007f3d494a5000) >>>> >>>> >>>> >>>> >>>> On 08/12/2014 11:42 PM, Wiles, Roger Keith wrote: >>>> >>>> Pktgen has a number of different ways to send packets >>>> single, range, pcap or random, sequence with parameters. >>>> >>>> One thing Pktgen does not do is act like a real >>>> stack, but >>>> you can simulate that with pcap or sequence packets. It >>>> basically depends on how complex a data flow you need. >>>> >>>> # git clonegit://github.com/Pktgen/Pktgen-DPDK >>>> <http://github.com/Pktgen/Pktgen-DPDK> >>>> >>>> Let me know if I can help or change the code in some way. >>>> >>>> THanks >>>> ++keith >>>> >>>> *Keith **Wiles*, Principal Technologist with CTO office, >>>> *Wind River*mobile 972-213-5533 <tel:972-213-5533> >>>> >>>> On Aug 12, 2014, at 1:08 PM, Mike Holmes >>>> <mike.holmes@linaro.org >>>> <mailto:mike.holmes@linaro.org><mailto:mike.holmes@linaro.org> >>>> <mailto:mike.holmes@linaro.org >>>> <mailto:mike.holmes@linaro.org>>> wrote: >>>> >>>> So it looks like we don't have any way to test this >>>> without an Ixia which is a problem given that Santosh >>>> is having trouble. >>>> Basically there is no CI job to point at that shows >>>> that excluding human error it is still working as >>>> expected. >>>> >>>> Keith, is dpdk pktgen able to generate pkts in >>>> the way >>>> Venki needs ? >>>> >>>> Mike >>>> >>>> >>>> On 12 August 2014 02:17, Santosh Shukla >>>> <santosh.shukla@linaro.org >>>> <mailto:santosh.shukla@linaro.org> >>>> <mailto:santosh.shukla@linaro.org> >>>> <mailto:santosh.shukla@linaro.org >>>> <mailto:santosh.shukla@linaro.org>>> wrote: >>>> >>>> On 12 August 2014 00:25, Mike Holmes >>>> <mike.holmes@linaro.org >>>> <mailto:mike.holmes@linaro.org><mailto:mike.holmes@linaro.org> >>>> <mailto:mike.holmes@linaro.org >>>> <mailto:mike.holmes@linaro.org>>> wrote: >>>> > Which test case in odp/test would check >>>> this, or >>>> does it need >>>> an application >>>> > like l2fwd to be run - are either in LAVA/CI ? >>>> > >>>> > Santosh are you able to verify this does not >>>> break anything as >>>> part of the >>>> > l2fwd work you are doing ? >>>> > >>>> >>>> No, I am seeing problem with current and should >>>> persist in this multi >>>> flavour too. We have bug reported on that lines. >>>> So whole dpdk-l2fwd >>>> doesn't works for me for my requirement. >>>> >>>> Thanks. >>>> >>>> > Mike >>>> > >>>> > >>>> > On 11 August 2014 01:43, Venkatesh Vivekanandan >>>> > <venkatesh.vivekanandan@linaro.org >>>> <mailto:venkatesh.vivekanandan@linaro.org> >>>> <mailto:venkatesh.vivekanandan@linaro.org> >>>> <mailto:venkatesh.vivekanandan@linaro.org >>>> <mailto:venkatesh.vivekanandan@linaro.org>>> wrote: >>>> >> >>>> >> >>>> >> >>>> >> >>>> >> On 9 August 2014 17:32, Mike Holmes >>>> <mike.holmes@linaro.org >>>> <mailto:mike.holmes@linaro.org><mailto:mike.holmes@linaro.org> >>>> <mailto:mike.holmes@linaro.org >>>> <mailto:mike.holmes@linaro.org>>> wrote: >>>> >>> >>>> >>> >>>> >>> >>>> >>> >>>> >>> On 8 August 2014 17:46, Anders Roxell >>>> <anders.roxell@linaro.org >>>> <mailto:anders.roxell@linaro.org> >>>> <mailto:anders.roxell@linaro.org> >>>> <mailto:anders.roxell@linaro.org >>>> <mailto:anders.roxell@linaro.org>>> wrote: >>>> >>>> >>>> >>>> On 2014-08-08 17:31, Maxim Uvarov wrote: >>>> >>>> > On 08/08/2014 05:13 PM, Venkatesh >>>> Vivekanandan wrote: >>>> >>>> > > >>>> >>>> > > >>>> >>>> > > >>>> >>>> > >On 7 August 2014 21:10, Anders Roxell >>>> <anders.roxell@linaro.org >>>> <mailto:anders.roxell@linaro.org> >>>> <mailto:anders.roxell@linaro.org> >>>> <mailto:anders.roxell@linaro.org >>>> <mailto:anders.roxell@linaro.org>> >>>> >>>> > ><mailto:anders.roxell@linaro.org >>>> <mailto:anders.roxell@linaro.org> >>>> <mailto:anders.roxell@linaro.org >>>> <mailto:anders.roxell@linaro.org>>>> wrote: >>>> >>>> > > >>>> >>>> > > On 2014-08-07 10:41, Mike Holmes >>>> wrote: >>>> >>>> > > > Does this need a signoff by someone >>>> else before it >>>> is merged ? >>>> >>>> > > > >>>> >>>> > > > I think we want to enforce getting >>>> an ack, tested-by or >>>> >>>> > > reviewed-by before >>>> >>>> > > > we merge things, we have informally >>>> moved that way >>>> over the >>>> >>>> > > last >>>> >>>> > > couple of >>>> >>>> > > > weeks and now I think it is time we >>>> made it a formal >>>> >>>> > > requirement. >>>> >>>> > > >>>> >>>> > > Agree. >>>> >>>> > > >>>> >>>> > > >>>> >>>> > >If this is the case, then is it fair to >>>> say initial >>>> discussion of >>>> >>>> > >24-hour window is void?. I guess >>>> Maxim was >>>> waiting for 2 >>>> days(for >>>> >>>> > >any comments) before he could merge this >>>> patch. Do we >>>> have any >>>> >>>> > >time-limit before which a patch /must /be >>>> reviewed or >>>> tested? I >>>> >>>> > >hope we can't wait indefinitely or is >>>> this >>>> the case?. >>>> >>>> > >>>> >>>> > I think if patch came from platfrom >>>> maintainer, it's not >>>> new API. No >>>> >>>> > comments in 1 or 2 days, than it's ok to >>>> merge it. If >>>> patch came >>>> >>>> > from somobody alse I would ask maintainer >>>> to review it. >>>> >>>> >>>> >>>> I disagree with this. >>>> >>>> No matter where the patch comes from and who >>>> wrote the >>>> patch, it can be >>>> >>>> wrong and need a second pair of eyes i.e., >>>> >>>> (Reviewed|Acked|Signed-off)-by. >>>> >>>> If no one has replied to a patch after 2 >>>> days, the author of >>>> the patch >>>> >>>> should ping the list and maintainer. >>>> >>>> >>>> >>>> After the second pair of eyes, the patch >>>> should be ok to be >>>> merged. >>>> >>>> The ODP maintainer should do a smoke build >>>> test on all the >>>> supported >>>> >>>> platforms before merging though. >>>> >>> >>>> >>> >>>> >>> My 2 cents >>>> >>> We have started to develop a cohesive API, I >>>> think that is >>>> down to a lot >>>> >>> of folks working together. >>>> >>> I also think that peer review/team work is >>>> reflected in the >>>> increasing >>>> >>> willingness to review each others patches >>>> which has improved >>>> quality >>>> >>> and helped establish the guidelines on how >>>> things bolt >>>> together in ODP, >>>> >>> may long discussions have spawned from >>>> patches. >>>> >>> >>>> >>> No one is beyond silly mistakes, peer review >>>> finds a lot of >>>> the dumb >>>> >>> stuff for little cost, saving on the >>>> inevitable ugly patch up >>>> that will >>>> >>> ensue otherwise. >>>> >>> Maxim you could do the default reviews if no >>>> one came >>>> forward, but if a >>>> >>> submitter finds and establishes their own >>>> network of >>>> reviewers that is one >>>> >>> extra pair of eyes and ideas. >>>> >> >>>> >> >>>> >> Can someone please review this patch?. If >>>> there >>>> is any >>>> comments, we can >>>> >> request maxim to revert the patch, >>>> otherwise he >>>> can add the >>>> >> "Reviewed-by/Tested-by" to the applied patch. >>>> >> >>>> >>>> >>>> >>>> Cheers, >>>> >>>> Anders >>>> >>>> >>>> >>>> > >>>> >>>> > Maxim. >>>> >>>> > >>>> >>>> > > Anders >>>> >>>> > > >>>> >>>> > > > >>>> >>>> > > > Mike >>>> >>>> > > > >>>> >>>> > > > >>>> >>>> > > > On 7 August 2014 09:15, Maxim >>>> Uvarov >>>> <maxim.uvarov@linaro.org >>>> <mailto:maxim.uvarov@linaro.org> >>>> <mailto:maxim.uvarov@linaro.org> >>>> <mailto:maxim.uvarov@linaro.org >>>> <mailto:maxim.uvarov@linaro.org>> >>>> >>>> > > <mailto:maxim.uvarov@linaro.org >>>> <mailto:maxim.uvarov@linaro.org> >>>> <mailto:maxim.uvarov@linaro.org >>>> <mailto:maxim.uvarov@linaro.org>>>> wrote: >>>> >>>> > > > >>>> >>>> > > > > Merged, thanks! >>>> >>>> > > > > >>>> >>>> > > > > Maxim. >>>> >>>> > > > > >>>> >>>> > > > > >>>> >>>> > > > > On 08/05/2014 06:54 PM, >>>> venkatesh.vivekanandan@linaro.org >>>> <mailto:venkatesh.vivekanandan@linaro.org> >>>> <mailto:venkatesh.vivekanandan@linaro.org> >>>> <mailto:venkatesh.vivekanandan@linaro.org >>>> <mailto:venkatesh.vivekanandan@linaro.org>> >>>> >>>> > > >>>> <mailto:venkatesh.vivekanandan@linaro.org >>>> <mailto:venkatesh.vivekanandan@linaro.org> >>>> <mailto:venkatesh.vivekanandan@linaro.org >>>> <mailto:venkatesh.vivekanandan@linaro.org>>> wrote: >>>> >>>> > > > > >>>> >>>> > > > >> From: Venkatesh Vivekanandan >>>> >>>> > > <venkatesh.vivekanandan@linaro.org >>>> <mailto:venkatesh.vivekanandan@linaro.org> >>>> <mailto:venkatesh.vivekanandan@linaro.org> >>>> <mailto:venkatesh.vivekanandan@linaro.org >>>> <mailto:venkatesh.vivekanandan@linaro.org>> >>>> >>>> > > >>>> <mailto:venkatesh.vivekanandan@linaro.org >>>> <mailto:venkatesh.vivekanandan@linaro.org> >>>> <mailto:venkatesh.vivekanandan@linaro.org >>>> <mailto:venkatesh.vivekanandan@linaro.org>>>> >>>> >>>> > > > >> >>>> >>>> > > > >> - Multi queue support per >>>> interface is enabled. >>>> >>>> > > > >> - odp_pktio_send with "0" packet >>>> is called in >>>> odp_pktio_recv >>>> >>>> > > to >>>> >>>> > > > >> give the transmitted buffers >>>> back to mempool. >>>> >>>> > > > >> - mbuf alloc failure during >>>> receive is fixed by >>>> giving more >>>> >>>> > > buffers to >>>> >>>> > > > >> mempool. >>>> >>>> > > > >> - mempool cache size is given >>>> equivalent to >>>> MAX_PKT_BURST. >>>> >>>> > > > >> >>>> >>>> > > > >> Signed-off-by: Venkatesh >>>> Vivekanandan >>>> >>>> > > <venkatesh.vivekanandan@linaro.org >>>> <mailto:venkatesh.vivekanandan@linaro.org> >>>> <mailto:venkatesh.vivekanandan@linaro.org> >>>> <mailto:venkatesh.vivekanandan@linaro.org >>>> <mailto:venkatesh.vivekanandan@linaro.org>> >>>> >>>> > > >>>> <mailto:venkatesh.vivekanandan@linaro.org >>>> <mailto:venkatesh.vivekanandan@linaro.org> >>>> <mailto:venkatesh.vivekanandan@linaro.org >>>> <mailto:venkatesh.vivekanandan@linaro.org>>>> >>>> >>>> > > > >> --- >>>> >>>> > > > >> >>>> platform/linux-dpdk/include/odp_packet_dpdk.h | >>>> 24 +++++ >>>> >>>> > > > >> >>>> platform/linux-dpdk/odp_buffer_pool.c | 4 +- >>>> >>>> > > > >> >>>> platform/linux-dpdk/odp_packet_dpdk.c | 136 >>>> >>>> > > > >> +++++++++++++------------- >>>> >>>> > > > >> >>>> platform/linux-dpdk/odp_packet_io.c | 2 + >>>> >>>> > > > >> 4 files changed, 94 >>>> insertions(+), 72 deletions(-) >>>> >>>> > > > >> >>>> >>>> > > > >> diff --git >>>> a/platform/linux-dpdk/include/odp_packet_dpdk.h >>>> >>>> > > > >> >>>> b/platform/linux-dpdk/include/odp_packet_dpdk.h >>>> >>>> > > > >> index bcbe9e8..bcf9aa5 100644 >>>> >>>> > > > >> --- >>>> a/platform/linux-dpdk/include/odp_packet_dpdk.h >>>> >>>> > > > >> +++ >>>> b/platform/linux-dpdk/include/odp_packet_dpdk.h >>>> >>>> > > > >> @@ -50,6 +50,30 @@ >>>> >>>> > > > >> #define DPDK_BLOCKING_IO >>>> >>>> > > > >> +/* >>>> >>>> > > > >> + * RX and TX Prefetch, >>>> Host, and >>>> Write-back >>>> threshold >>>> >>>> > > values >>>> >>>> > > should be >>>> >>>> > > > >> + * carefully set for optimal >>>> performance. >>>> Consult the >>>> >>>> > > network >>>> >>>> > > > >> + * controller's datasheet and >>>> supporting DPDK >>>> documentation >>>> >>>> > > for guidance >>>> >>>> > > > >> + * on how these parameters >>>> should be set. >>>> >>>> > > > >> + */ >>>> >>>> > > > >> +#define RX_PTHRESH 8 /**< >>>> Default values of RX >>>> prefetch >>>> >>>> > > threshold reg. */ >>>> >>>> > > > >> +#define RX_HTHRESH 8 /**< >>>> Default values of RX host >>>> >>>> > > threshold reg. */ >>>> >>>> > > > >> +#define RX_WTHRESH 4 /**< >>>> Default values of RX >>>> write-back >>>> >>>> > > threshold reg. >>>> >>>> > > > >> */ >>>> >>>> > > > >> + >>>> >>>> > > > >> +/* >>>> >>>> > > > >> + * These default values are >>>> optimized for use >>>> with the >>>> >>>> > > Intel(R) 82599 10 >>>> >>>> > > > >> GbE >>>> >>>> > > > >> + * Controller and the DPDK >>>> ixgbe >>>> PMD. Consider >>>> using other >>>> >>>> > > values for >>>> >>>> > > > >> other >>>> >>>> > > > >> + * network controllers and/or >>>> network drivers. >>>> >>>> > > > >> + */ >>>> >>>> > > > >> +#define TX_PTHRESH 36 /**< >>>> Default values of TX >>>> prefetch >>>> >>>> > > threshold reg. >>>> >>>> > > > >> */ >>>> >>>> > > > >> +#define TX_HTHRESH 0 /**< >>>> Default values of TX >>>> host >>>> >>>> > > threshold reg. */ >>>> >>>> > > > >> +#define TX_WTHRESH 0 /**< >>>> Default values of TX >>>> write-back >>>> >>>> > > threshold >>>> >>>> > > > >> reg. */ >>>> >>>> > > > >> + >>>> >>>> > > > >> +#define MAX_PKT_BURST 16 >>>> >>>> > > > >> +#define BURST_TX_DRAIN_US >>>> 100 /* >>>> TX drain every >>>> ~100us */ >>>> >>>> > > > >> +#define >>>> RTE_TEST_RX_DESC_DEFAULT 128 >>>> >>>> > > > >> +#define >>>> RTE_TEST_TX_DESC_DEFAULT 512 >>>> >>>> > > > >> + >>>> >>>> > > > >> /** Packet socket using dpdk >>>> mmaped rings for >>>> both Rx and >>>> >>>> > > Tx */ >>>> >>>> > > > >> typedef struct { >>>> >>>> > > > >> odp_buffer_pool_t pool; >>>> >>>> > > > >> diff --git >>>> a/platform/linux-dpdk/odp_buffer_pool.c >>>> >>>> > > > >> >>>> b/platform/linux-dpdk/odp_buffer_pool.c >>>> >>>> > > > >> index de90275..805ce68 100644 >>>> >>>> > > > >> --- >>>> a/platform/linux-dpdk/odp_buffer_pool.c >>>> >>>> > > > >> +++ >>>> b/platform/linux-dpdk/odp_buffer_pool.c >>>> >>>> > > > >> @@ -23,7 +23,7 @@ >>>> >>>> > > > >> #include <odp_packet_dpdk.h> >>>> >>>> > > > >> #define MBUF_SIZE (2048 + >>>> sizeof(struct rte_mbuf) + >>>> >>>> > > > >> RTE_PKTMBUF_HEADROOM) >>>> >>>> > > > >> -#define NB_MBUF 8192 >>>> >>>> > > > >> +#define NB_MBUF 32768 >>>> >>>> > > > >> #ifdef POOL_USE_TICKETLOCK >>>> >>>> > > > >> #include <odp_ticketlock.h> >>>> >>>> > > > >> @@ -112,7 +112,7 @@ >>>> odp_buffer_pool_t >>>> >>>> > > odp_buffer_pool_create(const char >>>> >>>> > > > >> *name, >>>> >>>> > > > >> pktmbuf_pool = >>>> >>>> > > > >> rte_mempool_create(name, >>>> NB_MBUF, >>>> >>>> > > > >> - MBUF_SIZE, 32, >>>> >>>> > > > >> + MBUF_SIZE, MAX_PKT_BURST, >>>> >>>> > > > >> sizeof(struct >>>> >>>> > > > >> rte_pktmbuf_pool_private), >>>> >>>> > > > >> rte_pktmbuf_pool_init, NULL, >>>> >>>> > > > >> rte_pktmbuf_init, NULL, >>>> >>>> > > > >> diff --git >>>> a/platform/linux-dpdk/odp_packet_dpdk.c >>>> >>>> > > > >> >>>> b/platform/linux-dpdk/odp_packet_dpdk.c >>>> >>>> > > > >> index 31bfa30..d5c8e80 100644 >>>> >>>> > > > >> --- >>>> a/platform/linux-dpdk/odp_packet_dpdk.c >>>> >>>> > > > >> +++ >>>> b/platform/linux-dpdk/odp_packet_dpdk.c >>>> >>>> > > > >> @@ -26,34 +26,13 @@ >>>> >>>> > > > >> #include <odp_packet_dpdk.h> >>>> >>>> > > > >> #include <net/if.h> >>>> >>>> > > > >> -/* >>>> >>>> > > > >> - * RX and TX Prefetch, >>>> Host, and >>>> Write-back >>>> threshold >>>> >>>> > > values >>>> >>>> > > should be >>>> >>>> > > > >> - * carefully set for optimal >>>> performance. >>>> Consult the >>>> >>>> > > network >>>> >>>> > > > >> - * controller's datasheet and >>>> supporting DPDK >>>> documentation >>>> >>>> > > for guidance >>>> >>>> > > > >> - * on how these parameters >>>> should be set. >>>> >>>> > > > >> - */ >>>> >>>> > > > >> -#define RX_PTHRESH 8 /**< >>>> Default values of RX >>>> prefetch >>>> >>>> > > threshold reg. */ >>>> >>>> > > > >> -#define RX_HTHRESH 8 /**< >>>> Default values of RX host >>>> >>>> > > threshold reg. */ >>>> >>>> > > > >> -#define RX_WTHRESH 4 /**< >>>> Default values of RX >>>> write-back >>>> >>>> > > threshold reg. >>>> >>>> > > > >> */ >>>> >>>> > > > >> - >>>> >>>> > > > >> -/* >>>> >>>> > > > >> - * These default values are >>>> optimized for use >>>> with the >>>> >>>> > > Intel(R) 82599 10 >>>> >>>> > > > >> GbE >>>> >>>> > > > >> - * Controller and the DPDK >>>> ixgbe >>>> PMD. Consider >>>> using other >>>> >>>> > > values for >>>> >>>> > > > >> other >>>> >>>> > > > >> - * network controllers and/or >>>> network drivers. >>>> >>>> > > > >> - */ >>>> >>>> > > > >> -#define TX_PTHRESH 36 /**< >>>> Default values of TX >>>> prefetch >>>> >>>> > > threshold reg. >>>> >>>> > > > >> */ >>>> >>>> > > > >> -#define TX_HTHRESH 0 /**< >>>> Default values of TX >>>> host >>>> >>>> > > threshold reg. */ >>>> >>>> > > > >> -#define TX_WTHRESH 0 /**< >>>> Default values of TX >>>> write-back >>>> >>>> > > threshold >>>> >>>> > > > >> reg. */ >>>> >>>> > > > >> - >>>> >>>> > > > >> -#define MAX_PKT_BURST 16 >>>> >>>> > > > >> -#define BURST_TX_DRAIN_US >>>> 100 /* >>>> TX drain every >>>> ~100us */ >>>> >>>> > > > >> -#define >>>> RTE_TEST_RX_DESC_DEFAULT 128 >>>> >>>> > > > >> -#define >>>> RTE_TEST_TX_DESC_DEFAULT 512 >>>> >>>> > > > >> static uint16_t nb_rxd = >>>> RTE_TEST_RX_DESC_DEFAULT; >>>> >>>> > > > >> static uint16_t nb_txd = >>>> RTE_TEST_TX_DESC_DEFAULT; >>>> >>>> > > > >> static const struct rte_eth_conf >>>> port_conf = { >>>> >>>> > > > >> .rxmode = { >>>> >>>> > > > >> + .mq_mode = ETH_MQ_RX_RSS, >>>> >>>> > > > >> + .max_rx_pkt_len = >>>> ETHER_MAX_LEN, >>>> >>>> > > > >> .split_hdr_size = 0, >>>> >>>> > > > >> .header_split = 0, /**< Header >>>> Split >>>> >>>> > > disabled */ >>>> >>>> > > > >> .hw_ip_checksum = 0, /**< IP >>>> checksum >>>> >>>> > > offload >>>> >>>> > > disabled */ >>>> >>>> > > > >> @@ -61,6 +40,12 @@ static const >>>> struct rte_eth_conf >>>> >>>> > > port_conf = { >>>> >>>> > > > >> .jumbo_frame = 0, /**< >>>> Jumbo Frame >>>> >>>> > > Support >>>> >>>> > > disabled */ >>>> >>>> > > > >> .hw_strip_crc = 0, /**< CRC >>>> stripped by >>>> >>>> > > hardware */ >>>> >>>> > > > >> }, >>>> >>>> > > > >> + .rx_adv_conf = { >>>> >>>> > > > >> + .rss_conf = { >>>> >>>> > > > >> + .rss_key >>>> = NULL, >>>> >>>> > > > >> + .rss_hf = >>>> ETH_RSS_IPV4 | >>>> >>>> > > ETH_RSS_IPV6, >>>> >>>> > > > >> + }, >>>> >>>> > > > >> + }, >>>> >>>> > > > >> .txmode = { >>>> >>>> > > > >> .mq_mode = ETH_MQ_TX_NONE, >>>> >>>> > > > >> }, >>>> >>>> > > > >> @@ -95,60 +80,71 @@ int >>>> setup_pkt_dpdk(pkt_dpdk_t * const >>>> >>>> > > pkt_dpdk, const >>>> >>>> > > > >> char *netdev, >>>> >>>> > > > >> ODP_DBG("setup_pkt_dpdk\n"); >>>> >>>> > > > >> static struct ether_addr >>>> eth_addr[RTE_MAX_ETHPORTS]; >>>> >>>> > > > >> - uint8_t portid = 0; >>>> >>>> > > > >> - uint16_t queueid = 0; >>>> >>>> > > > >> - int ret; >>>> >>>> > > > >> + static int >>>> portinit[RTE_MAX_ETHPORTS]; >>>> >>>> > > > >> + static int >>>> qid[RTE_MAX_ETHPORTS]; >>>> >>>> > > > >> + uint8_t portid = 0, >>>> num_intf = 2; >>>> >>>> > > > >> + uint16_t nbrxq = 0, >>>> nbtxq = 0; >>>> >>>> > > > >> + int ret, i; >>>> >>>> > > > >> + >>>> >>>> > > > >> printf("dpdk netdev: %s\n", >>>> netdev); >>>> >>>> > > > >> printf("dpdk pool: %lx\n", >>>> pool); >>>> >>>> > > > >> - >>>> >>>> > > > >> portid = atoi(netdev); >>>> >>>> > > > >> pkt_dpdk->portid = portid; >>>> >>>> > > > >> - pkt_dpdk->queueid = queueid; >>>> >>>> > > > >> pkt_dpdk->pool = pool; >>>> >>>> > > > >> printf("dpdk portid: %u\n", >>>> portid); >>>> >>>> > > > >> - fflush(stdout); >>>> >>>> > > > >> - ret = >>>> rte_eth_dev_configure(portid, 1, 1, >>>> >>>> > > &port_conf); >>>> >>>> > > > >> - if (ret < 0) >>>> >>>> > > > >> - ODP_ERR("Cannot configure >>>> device: >>>> err=%d, >>>> >>>> > > port=%u\n", >>>> >>>> > > > >> - ret, >>>> (unsigned) portid); >>>> >>>> > > > >> - >>>> >>>> > > > >> - rte_eth_macaddr_get(portid, >>>> ð_addr[portid]); >>>> >>>> > > > >> - ODP_DBG("Port %u, MAC address: >>>> >>>> > > %02X:%02X:%02X:%02X:%02X:%02X\ >>>> >>>> > > > >> n\n", >>>> >>>> > > > >> - (unsigned) portid, >>>> >>>> > > > >> - >>>> eth_addr[portid].addr_bytes[0], >>>> >>>> > > > >> - >>>> eth_addr[portid].addr_bytes[1], >>>> >>>> > > > >> - >>>> eth_addr[portid].addr_bytes[2], >>>> >>>> > > > >> - >>>> eth_addr[portid].addr_bytes[3], >>>> >>>> > > > >> - >>>> eth_addr[portid].addr_bytes[4], >>>> >>>> > > > >> - >>>> eth_addr[portid].addr_bytes[5]); >>>> >>>> > > > >> - >>>> >>>> > > > >> - /* init one RX queue on each >>>> port */ >>>> >>>> > > > >> - fflush(stdout); >>>> >>>> > > > >> - ret = >>>> rte_eth_rx_queue_setup(portid, queueid, >>>> >>>> > > nb_rxd, >>>> >>>> > > > >> - rte_eth_dev_socket_id(portid), >>>> >>>> > > > >> &rx_conf, >>>> >>>> > > > >> - (struct rte_mempool *)pool); >>>> >>>> > > > >> - if (ret < 0) >>>> >>>> > > > >> - >>>> ODP_ERR("rte_eth_rx_queue_setup:err=%d, >>>> port=%u\n", >>>> >>>> > > > >> - ret, >>>> (unsigned) portid); >>>> >>>> > > > >> - ODP_DBG("dpdk rx queue setup >>>> done\n"); >>>> >>>> > > > >> - >>>> >>>> > > > >> - /* init one TX queue on each >>>> port */ >>>> >>>> > > > >> - fflush(stdout); >>>> >>>> > > > >> - ret = >>>> rte_eth_tx_queue_setup(portid, queueid, >>>> >>>> > > nb_txd, >>>> >>>> > > > >> - rte_eth_dev_socket_id(portid), >>>> &tx_conf); >>>> >>>> > > > >> - if (ret < 0) >>>> >>>> > > > >> - >>>> ODP_ERR("rte_eth_tx_queue_setup:err=%d, >>>> port=%u\n", >>>> >>>> > > > >> - ret, >>>> (unsigned) portid); >>>> >>>> > > > >> - ODP_DBG("dpdk tx queue setup >>>> done\n"); >>>> >>>> > > > >> - >>>> >>>> > > > >> - /* Start device */ >>>> >>>> > > > >> - ret = >>>> rte_eth_dev_start(portid); >>>> >>>> > > > >> - if (ret < 0) >>>> >>>> > > > >> - >>>> ODP_ERR("rte_eth_dev_start:err=%d, port=%u\n", >>>> >>>> > > > >> - ret, >>>> (unsigned) portid); >>>> >>>> > > > >> - ODP_DBG("dpdk setup >>>> done\n\n"); >>>> >>>> > > > >> - >>>> >>>> > > > >> + nbrxq = odp_sys_core_count() >>>> / num_intf; >>>> >>>> > > > >> + nbtxq = nbrxq; >>>> >>>> > > > >> + if (portinit[portid] == 0) { >>>> >>>> > > > >> + fflush(stdout); >>>> >>>> > > > >> + ret = >>>> rte_eth_dev_configure(portid, >>>> nbrxq, >>>> >>>> > > nbtxq, >>>> >>>> > > > >> &port_conf); >>>> >>>> > > > >> + if (ret < 0) >>>> >>>> > > > >> + >>>> ODP_ERR("Cannot configure >>>> device: >>>> >>>> > > err=%d, >>>> >>>> > > > >> port=%u\n", >>>> >>>> > > > >> + ret, >>>> (unsigned) portid); >>>> >>>> > > > >> + >>>> >>>> > > > >> + rte_eth_macaddr_get(portid, >>>> ð_addr[portid]); >>>> >>>> > > > >> + ODP_DBG("Port %u, MAC address: >>>> >>>> > > > >> >>>> %02X:%02X:%02X:%02X:%02X:%02X\n", >>>> >>>> > > > >> + (unsigned) >>>> portid, >>>> >>>> > > > >> + >>>> eth_addr[portid].addr_bytes[0], >>>> >>>> > > > >> + >>>> eth_addr[portid].addr_bytes[1], >>>> >>>> > > > >> + >>>> eth_addr[portid].addr_bytes[2], >>>> >>>> > > > >> + >>>> eth_addr[portid].addr_bytes[3], >>>> >>>> > > > >> + >>>> eth_addr[portid].addr_bytes[4], >>>> >>>> > > > >> + >>>> eth_addr[portid].addr_bytes[5]); >>>> >>>> > > > >> + >>>> >>>> > > > >> + /* init one RX queue >>>> on each port */ >>>> >>>> > > > >> + fflush(stdout); >>>> >>>> > > > >> + for (i = 0; i < nbrxq; i++) { >>>> >>>> > > > >> + ret = >>>> rte_eth_rx_queue_setup(portid, >>>> >>>> > > i, nb_rxd, >>>> >>>> > > > >> + rte_eth_dev_socket_id(portid), >>>> >>>> > > > >> &rx_conf, >>>> >>>> > > > >> + (struct rte_mempool *)pool); >>>> >>>> > > > >> + if (ret < 0) >>>> >>>> > > > >> + ODP_ERR("%s rxq:err=%d, >>>> port=%u\n", >>>> >>>> > > > >> + __func__, ret, (unsigned) >>>> portid); >>>> >>>> > > > >> + >>>> ODP_DBG("dpdk >>>> rx queue setup >>>> >>>> > > done\n"); >>>> >>>> > > > >> + } >>>> >>>> > > > >> + >>>> >>>> > > > >> + /* init one TX queue >>>> on each port */ >>>> >>>> > > > >> + fflush(stdout); >>>> >>>> > > > >> + for (i = 0; i < nbtxq; i++) { >>>> >>>> > > > >> + ret = >>>> rte_eth_tx_queue_setup(portid, >>>> >>>> > > i, nb_txd, >>>> >>>> > > > >> + rte_eth_dev_socket_id(portid), >>>> &tx_conf); >>>> >>>> > > > >> + if (ret < 0) >>>> >>>> > > > >> + ODP_ERR("%s txq:err=%d, >>>> port=%u\n", >>>> >>>> > > > >> + __func__, ret, (unsigned) >>>> portid); >>>> >>>> > > > >> + >>>> ODP_DBG("dpdk >>>> tx queue setup >>>> >>>> > > done\n"); >>>> >>>> > > > >> + } >>>> >>>> > > > >> + >>>> >>>> > > > >> + /* Start device */ >>>> >>>> > > > >> + ret = >>>> rte_eth_dev_start(portid); >>>> >>>> > > > >> + if (ret < 0) >>>> >>>> > > > >> + >>>> ODP_ERR("rte_eth_dev_start:err=%d, port=%u\n", >>>> >>>> > > > >> + ret, >>>> (unsigned) portid); >>>> >>>> > > > >> + ODP_DBG("dpdk setup >>>> done\n\n"); >>>> >>>> > > > >> + >>>> >>>> > > > >> + portinit[portid] = 1; >>>> >>>> > > > >> + }
diff --git a/platform/linux-dpdk/include/odp_packet_dpdk.h b/platform/linux-dpdk/include/odp_packet_dpdk.h index bcbe9e8..bcf9aa5 100644 --- a/platform/linux-dpdk/include/odp_packet_dpdk.h +++ b/platform/linux-dpdk/include/odp_packet_dpdk.h @@ -50,6 +50,30 @@ #define DPDK_BLOCKING_IO +/* + * RX and TX Prefetch, Host, and Write-back threshold values should be + * carefully set for optimal performance. Consult the network + * controller's datasheet and supporting DPDK documentation for guidance + * on how these parameters should be set. + */ +#define RX_PTHRESH 8 /**< Default values of RX prefetch threshold reg. */ +#define RX_HTHRESH 8 /**< Default values of RX host threshold reg. */ +#define RX_WTHRESH 4 /**< Default values of RX write-back threshold reg. */ + +/* + * These default values are optimized for use with the Intel(R) 82599 10 GbE + * Controller and the DPDK ixgbe PMD. Consider using other values for other + * network controllers and/or network drivers. + */ +#define TX_PTHRESH 36 /**< Default values of TX prefetch threshold reg. */ +#define TX_HTHRESH 0 /**< Default values of TX host threshold reg. */ +#define TX_WTHRESH 0 /**< Default values of TX write-back threshold reg. */ + +#define MAX_PKT_BURST 16 +#define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */ +#define RTE_TEST_RX_DESC_DEFAULT 128 +#define RTE_TEST_TX_DESC_DEFAULT 512 + /** Packet socket using dpdk mmaped rings for both Rx and Tx */ typedef struct { odp_buffer_pool_t pool; diff --git a/platform/linux-dpdk/odp_buffer_pool.c b/platform/linux-dpdk/odp_buffer_pool.c index de90275..805ce68 100644 --- a/platform/linux-dpdk/odp_buffer_pool.c +++ b/platform/linux-dpdk/odp_buffer_pool.c @@ -23,7 +23,7 @@ #include <odp_packet_dpdk.h> #define MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM) -#define NB_MBUF 8192 +#define NB_MBUF 32768 #ifdef POOL_USE_TICKETLOCK #include <odp_ticketlock.h> @@ -112,7 +112,7 @@ odp_buffer_pool_t odp_buffer_pool_create(const char *name, pktmbuf_pool = rte_mempool_create(name, NB_MBUF, - MBUF_SIZE, 32, + MBUF_SIZE, MAX_PKT_BURST, sizeof(struct rte_pktmbuf_pool_private), rte_pktmbuf_pool_init, NULL, rte_pktmbuf_init, NULL, diff --git a/platform/linux-dpdk/odp_packet_dpdk.c b/platform/linux-dpdk/odp_packet_dpdk.c index 31bfa30..d5c8e80 100644 --- a/platform/linux-dpdk/odp_packet_dpdk.c +++ b/platform/linux-dpdk/odp_packet_dpdk.c @@ -26,34 +26,13 @@ #include <odp_packet_dpdk.h> #include <net/if.h> -/* - * RX and TX Prefetch, Host, and Write-back threshold values should be - * carefully set for optimal performance. Consult the network - * controller's datasheet and supporting DPDK documentation for guidance - * on how these parameters should be set. - */ -#define RX_PTHRESH 8 /**< Default values of RX prefetch threshold reg. */ -#define RX_HTHRESH 8 /**< Default values of RX host threshold reg. */ -#define RX_WTHRESH 4 /**< Default values of RX write-back threshold reg. */ - -/* - * These default values are optimized for use with the Intel(R) 82599 10 GbE - * Controller and the DPDK ixgbe PMD. Consider using other values for other - * network controllers and/or network drivers. - */ -#define TX_PTHRESH 36 /**< Default values of TX prefetch threshold reg. */ -#define TX_HTHRESH 0 /**< Default values of TX host threshold reg. */ -#define TX_WTHRESH 0 /**< Default values of TX write-back threshold reg. */ - -#define MAX_PKT_BURST 16 -#define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */ -#define RTE_TEST_RX_DESC_DEFAULT 128 -#define RTE_TEST_TX_DESC_DEFAULT 512 static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT; static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT; static const struct rte_eth_conf port_conf = { .rxmode = { + .mq_mode = ETH_MQ_RX_RSS, + .max_rx_pkt_len = ETHER_MAX_LEN, .split_hdr_size = 0, .header_split = 0, /**< Header Split disabled */ .hw_ip_checksum = 0, /**< IP checksum offload disabled */ @@ -61,6 +40,12 @@ static const struct rte_eth_conf port_conf = { .jumbo_frame = 0, /**< Jumbo Frame Support disabled */ .hw_strip_crc = 0, /**< CRC stripped by hardware */ }, + .rx_adv_conf = { + .rss_conf = { + .rss_key = NULL, + .rss_hf = ETH_RSS_IPV4 | ETH_RSS_IPV6, + }, + }, .txmode = { .mq_mode = ETH_MQ_TX_NONE, }, @@ -95,60 +80,71 @@ int setup_pkt_dpdk(pkt_dpdk_t * const pkt_dpdk, const char *netdev, ODP_DBG("setup_pkt_dpdk\n"); static struct ether_addr eth_addr[RTE_MAX_ETHPORTS]; - uint8_t portid = 0; - uint16_t queueid = 0; - int ret; + static int portinit[RTE_MAX_ETHPORTS]; + static int qid[RTE_MAX_ETHPORTS]; + uint8_t portid = 0, num_intf = 2; + uint16_t nbrxq = 0, nbtxq = 0; + int ret, i; + printf("dpdk netdev: %s\n", netdev); printf("dpdk pool: %lx\n", pool); - portid = atoi(netdev); pkt_dpdk->portid = portid; - pkt_dpdk->queueid = queueid; pkt_dpdk->pool = pool; printf("dpdk portid: %u\n", portid); - fflush(stdout); - ret = rte_eth_dev_configure(portid, 1, 1, &port_conf); - if (ret < 0) - ODP_ERR("Cannot configure device: err=%d, port=%u\n", - ret, (unsigned) portid); - - rte_eth_macaddr_get(portid, ð_addr[portid]); - ODP_DBG("Port %u, MAC address: %02X:%02X:%02X:%02X:%02X:%02X\n\n", - (unsigned) portid, - eth_addr[portid].addr_bytes[0], - eth_addr[portid].addr_bytes[1], - eth_addr[portid].addr_bytes[2], - eth_addr[portid].addr_bytes[3], - eth_addr[portid].addr_bytes[4], - eth_addr[portid].addr_bytes[5]); - - /* init one RX queue on each port */ - fflush(stdout); - ret = rte_eth_rx_queue_setup(portid, queueid, nb_rxd, - rte_eth_dev_socket_id(portid), &rx_conf, - (struct rte_mempool *)pool); - if (ret < 0) - ODP_ERR("rte_eth_rx_queue_setup:err=%d, port=%u\n", - ret, (unsigned) portid); - ODP_DBG("dpdk rx queue setup done\n"); - - /* init one TX queue on each port */ - fflush(stdout); - ret = rte_eth_tx_queue_setup(portid, queueid, nb_txd, - rte_eth_dev_socket_id(portid), &tx_conf); - if (ret < 0) - ODP_ERR("rte_eth_tx_queue_setup:err=%d, port=%u\n", - ret, (unsigned) portid); - ODP_DBG("dpdk tx queue setup done\n"); - - /* Start device */ - ret = rte_eth_dev_start(portid); - if (ret < 0) - ODP_ERR("rte_eth_dev_start:err=%d, port=%u\n", - ret, (unsigned) portid); - ODP_DBG("dpdk setup done\n\n"); - + nbrxq = odp_sys_core_count() / num_intf; + nbtxq = nbrxq; + if (portinit[portid] == 0) { + fflush(stdout); + ret = rte_eth_dev_configure(portid, nbrxq, nbtxq, &port_conf); + if (ret < 0) + ODP_ERR("Cannot configure device: err=%d, port=%u\n", + ret, (unsigned) portid); + + rte_eth_macaddr_get(portid, ð_addr[portid]); + ODP_DBG("Port %u, MAC address: %02X:%02X:%02X:%02X:%02X:%02X\n", + (unsigned) portid, + eth_addr[portid].addr_bytes[0], + eth_addr[portid].addr_bytes[1], + eth_addr[portid].addr_bytes[2], + eth_addr[portid].addr_bytes[3], + eth_addr[portid].addr_bytes[4], + eth_addr[portid].addr_bytes[5]); + + /* init one RX queue on each port */ + fflush(stdout); + for (i = 0; i < nbrxq; i++) { + ret = rte_eth_rx_queue_setup(portid, i, nb_rxd, + rte_eth_dev_socket_id(portid), &rx_conf, + (struct rte_mempool *)pool); + if (ret < 0) + ODP_ERR("%s rxq:err=%d, port=%u\n", + __func__, ret, (unsigned) portid); + ODP_DBG("dpdk rx queue setup done\n"); + } + + /* init one TX queue on each port */ + fflush(stdout); + for (i = 0; i < nbtxq; i++) { + ret = rte_eth_tx_queue_setup(portid, i, nb_txd, + rte_eth_dev_socket_id(portid), &tx_conf); + if (ret < 0) + ODP_ERR("%s txq:err=%d, port=%u\n", + __func__, ret, (unsigned) portid); + ODP_DBG("dpdk tx queue setup done\n"); + } + + /* Start device */ + ret = rte_eth_dev_start(portid); + if (ret < 0) + ODP_ERR("rte_eth_dev_start:err=%d, port=%u\n", + ret, (unsigned) portid); + ODP_DBG("dpdk setup done\n\n"); + + portinit[portid] = 1; + } + pkt_dpdk->queueid = qid[portid]++; return 0; } diff --git a/platform/linux-dpdk/odp_packet_io.c b/platform/linux-dpdk/odp_packet_io.c index d8d127f..3124175 100644 --- a/platform/linux-dpdk/odp_packet_io.c +++ b/platform/linux-dpdk/odp_packet_io.c @@ -230,6 +230,8 @@ int odp_pktio_recv(odp_pktio_t id, odp_packet_t pkt_table[], unsigned len) if (pktio_entry == NULL) return -1; + odp_pktio_send(id, pkt_table, 0); + lock_entry(pktio_entry); pkts = recv_pkt_dpdk(&pktio_entry->s.pkt_dpdk, pkt_table, len); unlock_entry(pktio_entry);