summaryrefslogtreecommitdiffstats
path: root/src/msg/async/dpdk
diff options
context:
space:
mode:
authorKefu Chai <tchaikov@gmail.com>2018-05-06 05:34:52 +0200
committerGitHub <noreply@github.com>2018-05-06 05:34:52 +0200
commitc17e3d834615f3dae0aaf2bfbece5965d7a94887 (patch)
treeb63894ec3d80086ecc37f2671a6c1bb099c382fa /src/msg/async/dpdk
parentMerge pull request #19041 from dragonylffly/wip-list-objects-in-a-pg (diff)
parentmisc: mark constructors as explicit (diff)
downloadceph-c17e3d834615f3dae0aaf2bfbece5965d7a94887.tar.xz
ceph-c17e3d834615f3dae0aaf2bfbece5965d7a94887.zip
Merge pull request #21637 from ceph/wip-da-SCA-20180423
misc: mark constructors as explicit Reviewed-by: Jason Dillaman <dillaman@redhat.com> Reviewed-by: Kefu Chai <kchai@redhat.com>
Diffstat (limited to 'src/msg/async/dpdk')
-rw-r--r--src/msg/async/dpdk/EventDPDK.h2
-rw-r--r--src/msg/async/dpdk/Packet.h8
-rw-r--r--src/msg/async/dpdk/UserspaceEvent.h2
-rw-r--r--src/msg/async/dpdk/ethernet.h4
-rw-r--r--src/msg/async/dpdk/net.h2
5 files changed, 9 insertions, 9 deletions
diff --git a/src/msg/async/dpdk/EventDPDK.h b/src/msg/async/dpdk/EventDPDK.h
index db47b893b94..541c2210e01 100644
--- a/src/msg/async/dpdk/EventDPDK.h
+++ b/src/msg/async/dpdk/EventDPDK.h
@@ -26,7 +26,7 @@ class DPDKDriver : public EventDriver {
public:
UserspaceEventManager manager;
- DPDKDriver(CephContext *c): cct(c), manager(c) {}
+ explicit DPDKDriver(CephContext *c): cct(c), manager(c) {}
virtual ~DPDKDriver() { }
int init(EventCenter *c, int nevent) override;
diff --git a/src/msg/async/dpdk/Packet.h b/src/msg/async/dpdk/Packet.h
index 3daab3172d0..b22492db865 100644
--- a/src/msg/async/dpdk/Packet.h
+++ b/src/msg/async/dpdk/Packet.h
@@ -104,7 +104,7 @@ class Packet {
fragment frags[];
- impl(size_t nr_frags = default_nr_frags);
+ explicit impl(size_t nr_frags = default_nr_frags);
impl(const impl&) = delete;
impl(fragment frag, size_t nr_frags = default_nr_frags);
@@ -180,7 +180,7 @@ class Packet {
to->frags[0].base);
}
};
- Packet(std::unique_ptr<impl>&& impl) : _impl(std::move(impl)) {}
+ explicit Packet(std::unique_ptr<impl>&& impl) : _impl(std::move(impl)) {}
std::unique_ptr<impl> _impl;
public:
static Packet from_static_data(const char* data, size_t len) {
@@ -190,13 +190,13 @@ public:
// build empty Packet
Packet();
// build empty Packet with nr_frags allocated
- Packet(size_t nr_frags);
+ explicit Packet(size_t nr_frags);
// move existing Packet
Packet(Packet&& x) noexcept;
// copy data into Packet
Packet(const char* data, size_t len);
// copy data into Packet
- Packet(fragment frag);
+ explicit Packet(fragment frag);
// zero-copy single fragment
Packet(fragment frag, deleter del);
// zero-copy multiple fragments
diff --git a/src/msg/async/dpdk/UserspaceEvent.h b/src/msg/async/dpdk/UserspaceEvent.h
index 1a725a667d8..75f3abf78ab 100644
--- a/src/msg/async/dpdk/UserspaceEvent.h
+++ b/src/msg/async/dpdk/UserspaceEvent.h
@@ -46,7 +46,7 @@ class UserspaceEventManager {
std::list<uint32_t> unused_fds;
public:
- UserspaceEventManager(CephContext *c): cct(c) {
+ explicit UserspaceEventManager(CephContext *c): cct(c) {
waiting_fds.resize(1024);
}
diff --git a/src/msg/async/dpdk/ethernet.h b/src/msg/async/dpdk/ethernet.h
index 17546d73a10..4efd9416cf2 100644
--- a/src/msg/async/dpdk/ethernet.h
+++ b/src/msg/async/dpdk/ethernet.h
@@ -32,11 +32,11 @@
struct ethernet_address {
ethernet_address() {}
- ethernet_address(const uint8_t *eaddr) {
+ explicit ethernet_address(const uint8_t *eaddr) {
std::copy(eaddr, eaddr + 6, mac.begin());
}
- ethernet_address(std::initializer_list<uint8_t> eaddr) {
+ explicit ethernet_address(std::initializer_list<uint8_t> eaddr) {
assert(eaddr.size() == mac.size());
std::copy(eaddr.begin(), eaddr.end(), mac.begin());
}
diff --git a/src/msg/async/dpdk/net.h b/src/msg/async/dpdk/net.h
index c48815b8d33..53ef473cf95 100644
--- a/src/msg/async/dpdk/net.h
+++ b/src/msg/async/dpdk/net.h
@@ -105,7 +105,7 @@ class interface {
stream<Packet, ethernet_address> packet_stream;
std::function<bool (forward_hash&, Packet&, size_t)> forward;
bool ready() { return packet_stream.started(); }
- l3_rx_stream(std::function<bool (forward_hash&, Packet&, size_t)>&& fw) : forward(fw) {}
+ explicit l3_rx_stream(std::function<bool (forward_hash&, Packet&, size_t)>&& fw) : forward(fw) {}
};
std::unordered_map<uint16_t, l3_rx_stream> _proto_map;
std::shared_ptr<DPDKDevice> _dev;