#include "net.h"
#include "toeplitz.h"
-
struct free_deleter {
void operator()(void* p) { ::free(p); }
};
if (ret != 0) {
rte_exit(EXIT_FAILURE, "Cannot initialise port %u\n", _port_idx);
}
- string name(std::string("port") + std::to_string(port_idx));
+ std::string name(std::string("port") + std::to_string(port_idx));
PerfCountersBuilder plb(cct, name, l_dpdk_dev_first, l_dpdk_dev_last);
plb.add_u64_counter(l_dpdk_dev_rx_mcast, "dpdk_device_receive_multicast_packets", "DPDK received multicast packets");
}
const rss_key_type& rss_key() const { return _rss_key; }
uint16_t hw_queues_count() { return _num_queues; }
- std::unique_ptr<DPDKQueuePair> init_local_queue(CephContext *c, EventCenter *center, string hugepages, uint16_t qid) {
+ std::unique_ptr<DPDKQueuePair> init_local_queue(CephContext *c,
+ EventCenter *center, std::string hugepages, uint16_t qid) {
std::unique_ptr<DPDKQueuePair> qp;
qp = std::unique_ptr<DPDKQueuePair>(new DPDKQueuePair(c, center, this, qid));
return qp;
}
}
-using AvailableIPAddress = std::tuple<string, string, string>;
+using AvailableIPAddress = std::tuple<std::string, std::string, std::string>;
static bool parse_available_address(
- const string &ips, const string &gates, const string &masks, vector<AvailableIPAddress> &res)
+ const std::string &ips, const std::string &gates,
+ const std::string &masks, std::vector<AvailableIPAddress> &res)
{
- vector<string> ip_vec, gate_vec, mask_vec;
+ std::vector<std::string> ip_vec, gate_vec, mask_vec;
string_to_vec(ip_vec, ips);
string_to_vec(gate_vec, gates);
string_to_vec(mask_vec, masks);
return true;
}
-static bool match_available_address(const vector<AvailableIPAddress> &avails,
+static bool match_available_address(const std::vector<AvailableIPAddress> &avails,
const entity_addr_t &ip, int &res)
{
for (size_t i = 0; i < avails.size(); ++i) {
DPDKWorker::Impl::Impl(CephContext *cct, unsigned i, EventCenter *c, std::shared_ptr<DPDKDevice> dev)
: id(i), _netif(cct, dev, c), _dev(dev), _inet(cct, c, &_netif)
{
- vector<AvailableIPAddress> tuples;
+ std::vector<AvailableIPAddress> tuples;
bool parsed = parse_available_address(cct->_conf.get_val<std::string>("ms_dpdk_host_ipv4_addr"),
cct->_conf.get_val<std::string>("ms_dpdk_gateway_ipv4_addr"),
cct->_conf.get_val<std::string>("ms_dpdk_netmask_ipv4_addr"), tuples);
break;
}
}
- void *adapted_func = static_cast<void*>(funcs.back());
+ void *adapted_func = static_cast<void*>(&funcs.back());
dpdk::eal::execute_on_master([adapted_func, core_id, this]() {
int r = rte_eal_remote_launch(dpdk_thread_adaptor, adapted_func, core_id);
if (r < 0) {
};
class DPDKStack : public NetworkStack {
- vector<std::function<void()> > funcs;
+ std::vector<std::function<void()> > funcs;
virtual Worker* create_worker(CephContext *c, unsigned worker_id) override {
return new DPDKWorker(c, worker_id);
return 0;
}
-int DPDKDriver::event_wait(vector<FiredFileEvent> &fired_events, struct timeval *tvp)
+int DPDKDriver::event_wait(std::vector<FiredFileEvent> &fired_events, struct timeval *tvp)
{
int num_events = 512;
int events[num_events];
int add_event(int fd, int cur_mask, int add_mask) override;
int del_event(int fd, int cur_mask, int del_mask) override;
int resize_events(int newsize) override;
- int event_wait(vector<FiredFileEvent> &fired_events, struct timeval *tp) override;
+ int event_wait(std::vector<FiredFileEvent> &fired_events, struct timeval *tp) override;
bool need_wakeup() override { return false; }
};
#undef dout_prefix
#define dout_prefix _prefix(_dout)
template<typename InetTraits>
-ostream& tcp<InetTraits>::tcb::_prefix(std::ostream *_dout) {
+std::ostream& tcp<InetTraits>::tcb::_prefix(std::ostream *_dout) {
return *_dout << "tcp " << _local_ip << ":" << _local_port << " -> " << _foreign_ip << ":" << _foreign_port
<< " tcb(" << this << " fd=" << fd << " s=" << _state << ").";
}
public:
// callback
void close_final_cleanup();
- ostream& _prefix(std::ostream *_dout);
+ std::ostream& _prefix(std::ostream *_dout);
public:
tcb(tcp& t, connid id);
uint16_t _port;
int _fd = -1;
int16_t _errno;
- queue<connection> _q;
+ std::queue<connection> _q;
size_t _q_max_length;
private:
t = std::thread([&]() {
// TODO: Inherit these from the app parameters - "opts"
std::vector<std::vector<char>> args {
- string2vector(string("ceph")),
+ string2vector("ceph"),
string2vector("-c"), string2vector(c->_conf.get_val<std::string>("ms_dpdk_coremask")),
string2vector("-n"), string2vector(c->_conf->ms_dpdk_memory_channel),
};