From 4f187114c5520750d885f8e9db7d620ae698ce9e Mon Sep 17 00:00:00 2001 From: Sangjin Han Date: Mon, 18 Nov 2019 08:19:35 +0000 Subject: [PATCH] support net_ens --- core/drivers/pmd.cc | 6 +++++- core/gate_hooks/track.cc | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/core/drivers/pmd.cc b/core/drivers/pmd.cc index 3ed683156..9714a322e 100644 --- a/core/drivers/pmd.cc +++ b/core/drivers/pmd.cc @@ -367,6 +367,10 @@ int PMDPort::UpdateConf(const Conf &conf) { void PMDPort::DeInit() { rte_eth_dev_stop(dpdk_port_id_); + if (driver_ == "net_ena") { + rte_eth_dev_reset(dpdk_port_id_); + } + if (hot_plugged_) { char name[RTE_ETH_NAME_MAX_LEN]; int ret; @@ -412,7 +416,7 @@ void PMDPort::CollectStats(bool reset) { // per-queue stats if (driver_ == "net_i40e" || driver_ == "net_i40e_vf" || driver_ == "net_ixgbe_vf" || driver_ == "net_bonding" || - driver_ == "net_e1000_igb") { + driver_ == "net_e1000_igb" || driver_ == "net_ena") { // NOTE: // - if link is down, tx bytes won't increase // - if destination MAC address is incorrect, rx pkts won't increase diff --git a/core/gate_hooks/track.cc b/core/gate_hooks/track.cc index 65a45046e..833541afb 100644 --- a/core/gate_hooks/track.cc +++ b/core/gate_hooks/track.cc @@ -47,7 +47,7 @@ Track::Track() worker_stats_() {} CommandResponse Track::Init(const bess::Gate *, const bess::pb::TrackArg &arg) { - track_bytes_ = arg.bits(); + track_bytes_ = arg.bits() || true; return CommandSuccess(); }