-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes updated slow worker mixing up packets between interfaces #255
Fixes updated slow worker mixing up packets between interfaces #255
Conversation
ada7a85
to
bbb06b6
Compare
dataplane/dataplane.cpp
Outdated
const auto name = std::get<0>(config.ports.at(iface.data())).c_str(); | ||
if (rte_eth_dev_get_port_by_name(name, &port)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mb add a method analogous to std::string InterfaceNameFromPort(tPortId id) { return std::get<0>(ports[id]); };
from cDataPlane
class, this looks very similar
|
||
PortMapper(const PortMapper& other) | ||
{ | ||
*this = other; | ||
} | ||
|
||
PortMapper& operator=(const PortMapper& other) | ||
{ | ||
ports_count_ = other.ports_count_; | ||
std::copy(std::begin(other.dpdk_ports_), | ||
std::end(other.dpdk_ports_), | ||
std::begin(dpdk_ports_)); | ||
std::copy(std::begin(other.logical_ports_), | ||
std::end(other.logical_ports_), | ||
std::begin(logical_ports_)); | ||
return *this; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should just use std::array
instead of c-style arrays.
std::array<tPortId, std::numeric_limits<tPortId>::max() + 1> dpdk_ports_{INVALID_PORT_ID};
std::array<tPortId, std::numeric_limits<tPortId>::max() + 1> logical_ports_{INVALID_PORT_ID};
std::array
has default =
operator, your code will become
PortMapper(const PortMapper& other) = default;
PortMapper& operator=(const PortMapper& other) = default;
Plus the default constructor could be implemented with .fill
method:
PortMapper()
{
dpdk_ports_.fill(INVALID_PORT_ID);
logical_ports_.fill(INVALID_PORT_ID);
}
9ed6a59
to
af3c971
Compare
char cname[256]; | ||
if (int res = rte_eth_dev_get_name_by_port(pid, cname); res) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
char cname[256]; | |
if (int res = rte_eth_dev_get_name_by_port(pid, cname); res) | |
std::array<char, 256> cname; | |
if (int res = rte_eth_dev_get_name_by_port(pid, cname.data()); res) |
Wow, found new github feature, didn't know about that
6d03837
to
518e396
Compare
for each controlplane worker one needs to provide only the core used for the worker and list of fast worker cores serviced. "controlPlaneWorkers": [ { "core": 42, "serviced_cores": [4, 2] } ]
518e396
to
831f80e
Compare
No description provided.