diff options
author | 2016-07-17 12:48:05 +0300 | |
---|---|---|
committer | 2016-07-24 14:01:10 +0300 | |
commit | 3c106ce73a4a54863ed1c3df47c09eb1e63fadaf (patch) | |
tree | 4c8fb1c16c2bac869019b276dcec94444d1c79a0 | |
parent | a551c94a6069f30617825f9046d36099846ab7ec (diff) |
dpdk0716 move: changes to our files
-rw-r--r-- | src/debug.cpp | 4 | ||||
-rw-r--r-- | src/dpdk/drivers/net/e1000/base/e1000_api.c | 5 | ||||
-rw-r--r-- | src/dpdk/lib/librte_eal/linuxapp/eal/eal_interrupts.c | 20 | ||||
-rw-r--r-- | src/main_dpdk.cpp | 63 |
4 files changed, 41 insertions, 51 deletions
diff --git a/src/debug.cpp b/src/debug.cpp index 656549dc..14e7002a 100644 --- a/src/debug.cpp +++ b/src/debug.cpp @@ -334,10 +334,6 @@ static void rte_stats_dump(const struct rte_eth_stats &stats) { rte_stat_dump_array(stats.q_ibytes, "queue rx bytes", RTE_ETHDEV_QUEUE_STAT_CNTRS); rte_stat_dump_array(stats.q_obytes, "queue tx bytes", RTE_ETHDEV_QUEUE_STAT_CNTRS); rte_stat_dump_array(stats.q_errors, "queue dropped", RTE_ETHDEV_QUEUE_STAT_CNTRS); - rte_stat_dump_one(stats.ilbpackets, "rx loopback"); - rte_stat_dump_one(stats.olbpackets, "tx loopback"); - rte_stat_dump_one(stats.ilbbytes, "rx bytes loopback"); - rte_stat_dump_one(stats.olbbytes, "tx bytes loopback"); } int CTrexDebug::test_send(uint pkt_type) { diff --git a/src/dpdk/drivers/net/e1000/base/e1000_api.c b/src/dpdk/drivers/net/e1000/base/e1000_api.c index bbfcae88..22b96fd1 100644 --- a/src/dpdk/drivers/net/e1000/base/e1000_api.c +++ b/src/dpdk/drivers/net/e1000/base/e1000_api.c @@ -632,6 +632,8 @@ s32 e1000_reset_hw(struct e1000_hw *hw) return -E1000_ERR_CONFIG; } +//TREX_PATCH +extern int eal_err_read_from_file_is_error; /** * e1000_init_hw - Initialize hardware * @hw: pointer to the HW structure @@ -641,6 +643,9 @@ s32 e1000_reset_hw(struct e1000_hw *hw) **/ s32 e1000_init_hw(struct e1000_hw *hw) { + //TREX_PATCH + eal_err_read_from_file_is_error = 0; + if (hw->mac.ops.init_hw) return hw->mac.ops.init_hw(hw); diff --git a/src/dpdk/lib/librte_eal/linuxapp/eal/eal_interrupts.c b/src/dpdk/lib/librte_eal/linuxapp/eal/eal_interrupts.c index 47a3b20a..54ab6253 100644 --- a/src/dpdk/lib/librte_eal/linuxapp/eal/eal_interrupts.c +++ b/src/dpdk/lib/librte_eal/linuxapp/eal/eal_interrupts.c @@ -73,6 +73,9 @@ static RTE_DEFINE_PER_LCORE(int, _epfd) = -1; /**< epoll fd per thread */ +// TREX_PATCH +int eal_err_read_from_file_is_error = 1; + /** * union for pipe fds. */ @@ -709,10 +712,19 @@ eal_intr_process_interrupts(struct epoll_event *events, int nfds) if (errno == EINTR || errno == EWOULDBLOCK) continue; - RTE_LOG(ERR, EAL, "Error reading from file " - "descriptor %d: %s\n", - events[n].data.fd, - strerror(errno)); + // TREX_PATCH. Because of issues with e1000, we want this message to + // have lower priority only if running on e1000 card + if (eal_err_read_from_file_is_error) { + RTE_LOG(ERR, EAL, "Error reading from file " + "descriptor %d: %s\n", + events[n].data.fd, + strerror(errno)); + } else { + RTE_LOG(INFO, EAL, "Error reading from file " + "descriptor %d: %s\n", + events[n].data.fd, + strerror(errno)); + } } else if (bytes_read == 0) RTE_LOG(ERR, EAL, "Read nothing from file " "descriptor %d\n", events[n].data.fd); diff --git a/src/main_dpdk.cpp b/src/main_dpdk.cpp index 7bff8253..7a6f972a 100644 --- a/src/main_dpdk.cpp +++ b/src/main_dpdk.cpp @@ -64,9 +64,9 @@ #include "publisher/trex_publisher.h" #include "../linux_dpdk/version.h" extern "C" { -#include "dpdk22/drivers/net/ixgbe/base/ixgbe_type.h" +#include "dpdk/drivers/net/ixgbe/base/ixgbe_type.h" } -#include "dpdk22/drivers/net/e1000/base/e1000_regs.h" +#include "dpdk/drivers/net/e1000/base/e1000_regs.h" #include "global_io_mode.h" #include "utl_term_io.h" #include "msg_manager.h" @@ -306,17 +306,7 @@ public: m_if_per_card = 4; } - TrexPlatformApi::driver_speed_e get_driver_speed(uint8_t port_id) { - int speed; - - rte_eth_get_speed(port_id, &speed); - if (speed == 10) { - return TrexPlatformApi::SPEED_10G; - } else { - return TrexPlatformApi::SPEED_40G; - } - } - + TrexPlatformApi::driver_speed_e get_driver_speed(uint8_t port_id); static CTRexExtendedDriverBase * create(){ return ( new CTRexExtendedDriverBase40G() ); } @@ -3282,7 +3272,6 @@ int CGlobalTRex::ixgbe_start(void){ return (0); } - bool CGlobalTRex::Create(){ CFlowsYamlInfo pre_yaml_info; @@ -5351,6 +5340,16 @@ CFlowStatParser *CTRexExtendedDriverBase10G::get_flow_stat_parser() { } //////////////////////////////////////////////////////////////////////////////// +TrexPlatformApi::driver_speed_e CTRexExtendedDriverBase40G::get_driver_speed(uint8_t port_id) { + CPhyEthIF *phy_if = &g_trex.m_ports[port_id]; + + if (phy_if->m_dev_info.speed_capa & ETH_LINK_SPEED_40G) { + return TrexPlatformApi::SPEED_40G; + } else { + return TrexPlatformApi::SPEED_10G; + } + } + void CTRexExtendedDriverBase40G::clear_extended_stats(CPhyEthIF * _if){ rte_eth_stats_reset(_if->get_port_id()); } @@ -5409,7 +5408,7 @@ void CTRexExtendedDriverBase40G::add_del_rules(enum rte_filter_op op, uint8_t po case RTE_ETH_FLOW_NONFRAG_IPV4_OTHER: filter.input.flow.ip4_flow.ttl=ttl; filter.input.flow.ip4_flow.ip_id = ip_id; - filter.input.flow.ip4_flow.l4_protocol = IPPROTO_ICMP; // In this case we want filter for icmp packets + filter.input.flow.ip4_flow.proto = IPPROTO_ICMP; // In this case we want filter for icmp packets break; case RTE_ETH_FLOW_NONFRAG_IPV4_UDP: case RTE_ETH_FLOW_NONFRAG_IPV4_TCP: @@ -5419,11 +5418,11 @@ void CTRexExtendedDriverBase40G::add_del_rules(enum rte_filter_op op, uint8_t po break; case RTE_ETH_FLOW_NONFRAG_IPV6_UDP: case RTE_ETH_FLOW_NONFRAG_IPV6_TCP: - filter.input.flow.ipv6_flow.hop_limit=ttl; + filter.input.flow.ipv6_flow.hop_limits=ttl; break; case RTE_ETH_FLOW_NONFRAG_IPV6_OTHER: - filter.input.flow.ipv6_flow.hop_limit=ttl; - filter.input.flow.ipv6_flow.l4_protocol = IPPROTO_ICMP; // In the future we want to support this + filter.input.flow.ipv6_flow.hop_limits=ttl; + filter.input.flow.ipv6_flow.proto = IPPROTO_ICMP; // In the future we want to support this break; } @@ -5579,36 +5578,19 @@ int CTRexExtendedDriverBase40G::dump_fdir_global_stats(CPhyEthIF * _if, FILE *fd } void CTRexExtendedDriverBase40G::get_extended_stats(CPhyEthIF * _if,CPhyEthIFStats *stats){ - struct rte_eth_stats stats1; rte_eth_stats_get(_if->get_port_id(), &stats1); - stats->ipackets = stats1.ipackets; stats->ibytes = stats1.ibytes ; - stats->opackets = stats1.opackets; stats->obytes = stats1.obytes + (stats1.opackets<<2); - stats->f_ipackets = 0; stats->f_ibytes = 0; - - - stats->ierrors = stats1.imissed + stats1.ibadcrc + - stats1.ibadlen + - stats1.ierrors + - stats1.oerrors + - stats1.rx_nombuf + - stats1.tx_pause_xon + - stats1.rx_pause_xon + - stats1.tx_pause_xoff+ - stats1.rx_pause_xoff ; - - + stats->ierrors = stats1.imissed + stats1.ierrors + stats1.rx_nombuf; stats->oerrors = stats1.oerrors;; stats->imcasts = 0; stats->rx_nombuf = stats1.rx_nombuf; - } int CTRexExtendedDriverBase40G::wait_for_stable_link(){ @@ -5667,15 +5649,10 @@ void CTRexExtendedDriverBase1GVm::get_extended_stats(CPhyEthIF * _if,CPhyEthIFSt stats->f_ibytes = 0; - stats->ierrors = stats1.imissed + stats1.ibadcrc + - stats1.ibadlen + + stats->ierrors = stats1.imissed + stats1.ierrors + stats1.oerrors + - stats1.rx_nombuf + - stats1.tx_pause_xon + - stats1.rx_pause_xon + - stats1.tx_pause_xoff+ - stats1.rx_pause_xoff ; + stats1.rx_nombuf; stats->oerrors = stats1.oerrors;; |