Merge pull request from yuyuyu101/wip-dpdk-fix

msg/async/dpdk: fix compile errors

Reviewed-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
Kefu Chai 2016-12-29 14:06:00 +08:00 committed by GitHub
commit 27d9cf8fd9
2 changed files with 9 additions and 9 deletions
src
msg/async/dpdk
test/msgr

View File

@ -543,13 +543,13 @@ class tcp {
}
void do_syn_sent() {
_state = SYN_SENT;
_snd.syn_tx_time = clock_type::now(_tcp.cct);
_snd.syn_tx_time = clock_type::now();
// Send <SYN> to remote
output();
}
void do_syn_received() {
_state = SYN_RECEIVED;
_snd.syn_tx_time = clock_type::now(_tcp.cct);
_snd.syn_tx_time = clock_type::now();
// Send <SYN,ACK> to remote
output();
}
@ -1198,7 +1198,7 @@ void tcp<InetTraits>::tcb::output_one(bool data_retransmit) {
p.set_offload_info(oi);
if (!data_retransmit && (len || syn_on || fin_on)) {
auto now = clock_type::now(_tcp.cct);
auto now = clock_type::now();
if (len) {
unsigned nr_transmits = 0;
_snd.data.emplace_back(unacked_segment{std::move(clone),
@ -1380,7 +1380,7 @@ void tcp<InetTraits>::tcb::fast_retransmit() {
template <typename InetTraits>
void tcp<InetTraits>::tcb::update_rto(clock_type::time_point tx_time) {
// Update RTO according to RFC6298
auto R = std::chrono::duration_cast<std::chrono::microseconds>(clock_type::now(_tcp.cct) - tx_time);
auto R = std::chrono::duration_cast<std::chrono::microseconds>(clock_type::now() - tx_time);
if (_snd.first_rto_sample) {
_snd.first_rto_sample = false;
// RTTVAR <- R/2
@ -1445,7 +1445,7 @@ tcp_sequence tcp<InetTraits>::tcb::get_isn() {
hash[3] = _isn_secret.key[15];
CryptoPP::Weak::MD5::Transform(hash, _isn_secret.key);
auto seq = hash[0];
auto m = duration_cast<microseconds>(clock_type::now(_tcp.cct).time_since_epoch());
auto m = duration_cast<microseconds>(clock_type::now().time_since_epoch());
seq += m.count() / 4;
return make_seq(seq);
}

View File

@ -76,11 +76,11 @@ TEST_F(UserspaceManagerTest, StressTest) {
std::uniform_int_distribution<> dist(0, 100);
mappings.resize(1001);
mappings[0] = make_pair(-1, -1);
mappings[0] = std::make_pair(-1, -1);
for (int i = 0; i < 1000; ++i) {
int fd = manager->get_eventfd();
ASSERT_TRUE(fd > 0);
mappings[fd] = make_pair(0, 0);
mappings[fd] = std::make_pair(0, 0);
}
int r = 0;
int fd = manager->get_eventfd();
@ -155,11 +155,11 @@ TEST_F(UserspaceManagerTest, StressTest) {
ASSERT_TRUE(r > 0);
if ((size_t)r >= mappings.size())
mappings.resize(r+1);
mappings[r] = make_pair(0, 0);
mappings[r] = std::make_pair(0, 0);
} else {
manager->close(fd);
std::cerr << " close fd " << fd << std::endl;
mappings[fd] = make_pair(-1, -1);
mappings[fd] = std::make_pair(-1, -1);
}
ASSERT_TRUE(manager->check());
}