Skip to content

Commit 26e7228

Browse files
committed
Disable aligning consecutive assignments
1 parent 0cf973f commit 26e7228

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+379
-379
lines changed

.clang-format

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ BasedOnStyle: Google
44
AccessModifierOffset: -4
55
AlignAfterOpenBracket: Align
66
AlignArrayOfStructures: Left
7-
AlignConsecutiveAssignments: Consecutive
7+
AlignConsecutiveAssignments: None
88
AlignConsecutiveBitFields: Consecutive
99
AlignConsecutiveDeclarations: None
1010
AlignConsecutiveMacros: AcrossEmptyLines

src/configparser.cpp

Lines changed: 77 additions & 77 deletions
Large diffs are not rendered by default.

src/configparser.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,11 @@ class ConfigParser {
9999
void parse_conn_spec(ConnSpec &, const toml::table &, const Network &);
100100

101101
public:
102-
ConfigParser() = default;
103-
ConfigParser(const ConfigParser &) = delete;
104-
ConfigParser(ConfigParser &&) = delete;
102+
ConfigParser() = default;
103+
ConfigParser(const ConfigParser &) = delete;
104+
ConfigParser(ConfigParser &&) = delete;
105105
ConfigParser &operator=(const ConfigParser &) = delete;
106-
ConfigParser &operator=(ConfigParser &&) = delete;
106+
ConfigParser &operator=(ConfigParser &&) = delete;
107107

108108
void parse(const std::string &filename, Plankton &plankton);
109109
void estimate_pkt_lat(int num_injections);

src/conn.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class Connection {
3333
uint16_t dst_port);
3434
Connection(const Packet &, Node *src_node);
3535
Connection(const Connection &) = default;
36-
Connection(Connection &&) = default;
36+
Connection(Connection &&) = default;
3737

3838
std::string to_string() const;
3939
void init(size_t conn_idx) const;

src/dockerapi.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ DockerAPI_GLOBAL::~DockerAPI_GLOBAL() {
1717
curl_global_cleanup();
1818
}
1919

20-
const string DockerAPI::_api_version = "v1.42";
20+
const string DockerAPI::_api_version = "v1.42";
2121
const Document DockerAPI::_empty_json = {};
2222
const DockerAPI_GLOBAL DockerAPI::_global_raii;
2323

@@ -26,7 +26,7 @@ Document DockerAPI::send_curl_request(method method,
2626
const Document &request_body) {
2727

2828
// curl: set request URL and method
29-
string url = this->_uri_prefix + path;
29+
string url = this->_uri_prefix + path;
3030
string method_str = method_to_str(method);
3131
curl_easy_setopt(_curl, CURLOPT_URL, url.c_str());
3232
curl_easy_setopt(_curl, CURLOPT_CUSTOMREQUEST, method_str.c_str());

src/driver/docker.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ void Docker::wait_for_dpdk_interfaces() const {
113113
// Abort if some interfaces are not created after some time.
114114
if (!if_names.empty()) {
115115
string remaining_intfs = *if_names.begin();
116-
auto it = if_names.begin();
116+
auto it = if_names.begin();
117117
++it;
118118
for (; it != if_names.end(); ++it) {
119119
remaining_intfs += ", " + *it;
@@ -152,10 +152,10 @@ int Docker::tap_open_dpdk(const string &if_name) const {
152152

153153
struct sockaddr_ll saddr;
154154
memset(&saddr, 0, sizeof(saddr));
155-
saddr.sll_family = AF_PACKET;
155+
saddr.sll_family = AF_PACKET;
156156
saddr.sll_protocol = htons(ETH_P_IP);
157-
saddr.sll_ifindex = ifr.ifr_ifindex;
158-
saddr.sll_pkttype = PACKET_HOST;
157+
saddr.sll_ifindex = ifr.ifr_ifindex;
158+
saddr.sll_pkttype = PACKET_HOST;
159159

160160
if (bind(sock, (struct sockaddr *)&saddr, sizeof(saddr)) == -1) {
161161
close(sock);
@@ -343,10 +343,10 @@ void Docker::set_arp_cache() {
343343

344344
// Set permanent arp cache entries
345345
struct arpreq arp;
346-
arp.arp_pa = {AF_INET, {0}};
347-
arp.arp_ha = {ARPHRD_ETHER, {0}};
348-
arp.arp_flags = ATF_COM | ATF_PERM;
349-
arp.arp_netmask = {AF_UNSPEC, {0}};
346+
arp.arp_pa = {AF_INET, {0}};
347+
arp.arp_ha = {ARPHRD_ETHER, {0}};
348+
arp.arp_flags = ATF_COM | ATF_PERM;
349+
arp.arp_netmask = {AF_UNSPEC, {0}};
350350
uint8_t id_mac[6] = ID_ETH_ADDR;
351351
memcpy(arp.arp_ha.sa_data, id_mac, 6);
352352

@@ -376,7 +376,7 @@ void Docker::set_epoll_events() {
376376
struct epoll_event event;
377377

378378
for (const auto &[intf, tapfd] : this->_tapfds) {
379-
event.events = EPOLLIN;
379+
event.events = EPOLLIN;
380380
event.data.ptr = intf;
381381
if (epoll_ctl(_epollfd, EPOLL_CTL_ADD, tapfd, &event) < 0) {
382382
logger.error("epoll_ctl", errno);
@@ -563,7 +563,7 @@ void Docker::init() {
563563
make_unique<pcpp::PcapFileWriterDevice>(
564564
pcapFn, pcpp::LINKTYPE_ETHERNET));
565565
auto &pcapLogger = this->_pcap_loggers.at(intf);
566-
bool appendMode = fs::exists(pcapFn);
566+
bool appendMode = fs::exists(pcapFn);
567567
if (!pcapLogger->open(appendMode)) {
568568
logger.error("Failed to open " + pcapFn);
569569
}
@@ -641,7 +641,7 @@ size_t Docker::inject_packet(const Packet &pkt) {
641641
Net::get().serialize(&buf, &len, pkt, src_mac, dst_mac);
642642

643643
// Write to the tap device fd
644-
int fd = this->_tapfds.at(pkt.get_intf());
644+
int fd = this->_tapfds.at(pkt.get_intf());
645645
ssize_t nwrite = write(fd, buf, len);
646646
if (nwrite < 0) {
647647
logger.error("Packet injection failed", errno);
@@ -681,7 +681,7 @@ list<Packet> Docker::read_packets() const {
681681
// Read from available tap fds
682682
for (int i = 0; i < nfds; ++i) {
683683
Interface *interface = static_cast<Interface *>(_events[i].data.ptr);
684-
int tapfd = this->_tapfds.at(interface);
684+
int tapfd = this->_tapfds.at(interface);
685685
PktBuffer pktbuff(interface);
686686
ssize_t nread;
687687
if ((nread = read(tapfd, pktbuff.get_buffer(), pktbuff.get_len())) <

src/driver/driver.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ class Driver {
1010
public:
1111
virtual ~Driver() = default;
1212

13-
virtual void init() = 0;
14-
virtual void reset() = 0;
15-
virtual void pause() = 0;
16-
virtual void unpause() = 0;
17-
virtual size_t inject_packet(const Packet &) = 0;
13+
virtual void init() = 0;
14+
virtual void reset() = 0;
15+
virtual void pause() = 0;
16+
virtual void unpause() = 0;
17+
virtual size_t inject_packet(const Packet &) = 0;
1818
virtual std::list<Packet> read_packets() const = 0;
1919
};

src/dropmon.cpp

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,28 +19,28 @@ DropMon::DropMon() :
1919
_dm_sock(nullptr),
2020
_stop_dm_thread(false),
2121
_drop_ts(0) {
22-
_net_dm_policy[NET_DM_ATTR_UNSPEC] = {NLA_UNSPEC, 0, 0};
23-
_net_dm_policy[NET_DM_ATTR_ALERT_MODE] = {NLA_U8, 0, 0};
24-
_net_dm_policy[NET_DM_ATTR_PC] = {NLA_U64, 0, 0};
25-
_net_dm_policy[NET_DM_ATTR_SYMBOL] = {NLA_STRING, 0, 0};
26-
_net_dm_policy[NET_DM_ATTR_IN_PORT] = {NLA_NESTED, 0, 0};
27-
_net_dm_policy[NET_DM_ATTR_TIMESTAMP] = {NLA_U64, 0, 0};
28-
_net_dm_policy[NET_DM_ATTR_PROTO] = {NLA_U16, 0, 0};
29-
_net_dm_policy[NET_DM_ATTR_PAYLOAD] = {NLA_UNSPEC, 0, 0};
30-
_net_dm_policy[NET_DM_ATTR_PAD] = {NLA_UNSPEC, 0, 0};
31-
_net_dm_policy[NET_DM_ATTR_TRUNC_LEN] = {NLA_U32, 0, 0};
32-
_net_dm_policy[NET_DM_ATTR_ORIG_LEN] = {NLA_U32, 0, 0};
33-
_net_dm_policy[NET_DM_ATTR_QUEUE_LEN] = {NLA_U32, 0, 0};
34-
_net_dm_policy[NET_DM_ATTR_STATS] = {NLA_NESTED, 0, 0};
35-
_net_dm_policy[NET_DM_ATTR_HW_STATS] = {NLA_NESTED, 0, 0};
36-
_net_dm_policy[NET_DM_ATTR_ORIGIN] = {NLA_U16, 0, 0};
22+
_net_dm_policy[NET_DM_ATTR_UNSPEC] = {NLA_UNSPEC, 0, 0};
23+
_net_dm_policy[NET_DM_ATTR_ALERT_MODE] = {NLA_U8, 0, 0};
24+
_net_dm_policy[NET_DM_ATTR_PC] = {NLA_U64, 0, 0};
25+
_net_dm_policy[NET_DM_ATTR_SYMBOL] = {NLA_STRING, 0, 0};
26+
_net_dm_policy[NET_DM_ATTR_IN_PORT] = {NLA_NESTED, 0, 0};
27+
_net_dm_policy[NET_DM_ATTR_TIMESTAMP] = {NLA_U64, 0, 0};
28+
_net_dm_policy[NET_DM_ATTR_PROTO] = {NLA_U16, 0, 0};
29+
_net_dm_policy[NET_DM_ATTR_PAYLOAD] = {NLA_UNSPEC, 0, 0};
30+
_net_dm_policy[NET_DM_ATTR_PAD] = {NLA_UNSPEC, 0, 0};
31+
_net_dm_policy[NET_DM_ATTR_TRUNC_LEN] = {NLA_U32, 0, 0};
32+
_net_dm_policy[NET_DM_ATTR_ORIG_LEN] = {NLA_U32, 0, 0};
33+
_net_dm_policy[NET_DM_ATTR_QUEUE_LEN] = {NLA_U32, 0, 0};
34+
_net_dm_policy[NET_DM_ATTR_STATS] = {NLA_NESTED, 0, 0};
35+
_net_dm_policy[NET_DM_ATTR_HW_STATS] = {NLA_NESTED, 0, 0};
36+
_net_dm_policy[NET_DM_ATTR_ORIGIN] = {NLA_U16, 0, 0};
3737
_net_dm_policy[NET_DM_ATTR_HW_TRAP_GROUP_NAME] = {NLA_STRING, 0, 0};
38-
_net_dm_policy[NET_DM_ATTR_HW_TRAP_NAME] = {NLA_STRING, 0, 0};
39-
_net_dm_policy[NET_DM_ATTR_HW_ENTRIES] = {NLA_NESTED, 0, 0};
40-
_net_dm_policy[NET_DM_ATTR_HW_ENTRY] = {NLA_NESTED, 0, 0};
41-
_net_dm_policy[NET_DM_ATTR_HW_TRAP_COUNT] = {NLA_U32, 0, 0};
42-
_net_dm_policy[NET_DM_ATTR_SW_DROPS] = {NLA_FLAG, 0, 0};
43-
_net_dm_policy[NET_DM_ATTR_HW_DROPS] = {NLA_FLAG, 0, 0};
38+
_net_dm_policy[NET_DM_ATTR_HW_TRAP_NAME] = {NLA_STRING, 0, 0};
39+
_net_dm_policy[NET_DM_ATTR_HW_ENTRIES] = {NLA_NESTED, 0, 0};
40+
_net_dm_policy[NET_DM_ATTR_HW_ENTRY] = {NLA_NESTED, 0, 0};
41+
_net_dm_policy[NET_DM_ATTR_HW_TRAP_COUNT] = {NLA_U32, 0, 0};
42+
_net_dm_policy[NET_DM_ATTR_SW_DROPS] = {NLA_FLAG, 0, 0};
43+
_net_dm_policy[NET_DM_ATTR_HW_DROPS] = {NLA_FLAG, 0, 0};
4444
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 7, 0)
4545
_net_dm_policy[NET_DM_ATTR_FLOW_ACTION_COOKIE] = {NLA_UNSPEC, 0, 0};
4646
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)
@@ -158,7 +158,7 @@ void DropMon::start_listening_for(const Packet &pkt,
158158
// Reset dropmon variables
159159
unique_lock<mutex> lck(_mtx);
160160
_target_pkt = pkt;
161-
_drop_ts = 0;
161+
_drop_ts = 0;
162162
lck.unlock();
163163

164164
// Set up the drop listener thread (block all signals)
@@ -337,7 +337,7 @@ Packet DropMon::recv_msg(struct nl_sock *sock, uint64_t &ts) const {
337337
goto out_free;
338338
}
339339
// deserialize packet
340-
payload = nla_data(attrs[NET_DM_ATTR_PAYLOAD]);
340+
payload = nla_data(attrs[NET_DM_ATTR_PAYLOAD]);
341341
payloadlen = nla_len(attrs[NET_DM_ATTR_PAYLOAD]);
342342
Net::get().deserialize(pkt, (const uint8_t *)payload, payloadlen);
343343

src/dropmon.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ class DropMon : public DropDetection {
4242

4343
public:
4444
// Disable the copy/move constructors and the assignment operators
45-
DropMon(const DropMon &) = delete;
46-
DropMon(DropMon &&) = delete;
45+
DropMon(const DropMon &) = delete;
46+
DropMon(DropMon &&) = delete;
4747
DropMon &operator=(const DropMon &) = delete;
48-
DropMon &operator=(DropMon &&) = delete;
48+
DropMon &operator=(DropMon &&) = delete;
4949
~DropMon() override;
5050

5151
static DropMon &get();

src/droptimeout.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ void DropTimeout::init() {
5252
}
5353

5454
void DropTimeout::reset() {
55-
_lat_avg = chrono::microseconds();
56-
_lat_mdev = chrono::microseconds();
57-
_timeout = chrono::microseconds();
55+
_lat_avg = chrono::microseconds();
56+
_lat_mdev = chrono::microseconds();
57+
_timeout = chrono::microseconds();
5858
_has_initial_estimate = false;
59-
_nprocs = 0;
60-
_mdev_scalar = 0;
59+
_nprocs = 0;
60+
_mdev_scalar = 0;
6161
}
6262

6363
/**
@@ -67,11 +67,11 @@ void DropTimeout::reset() {
6767
* @param nprocs the number of parallel processes for the current invariant
6868
*/
6969
void DropTimeout::adjust_latency_estimate_by_nprocs(int nprocs) {
70-
_nprocs = nprocs;
70+
_nprocs = nprocs;
7171
static const int total_cores = thread::hardware_concurrency();
72-
double load = double(_nprocs) / total_cores;
73-
_mdev_scalar = max(5.0, ceil(sqrt(_nprocs) * 2 * load));
74-
_timeout = _lat_avg + _lat_mdev * _mdev_scalar;
72+
double load = double(_nprocs) / total_cores;
73+
_mdev_scalar = max(5.0, ceil(sqrt(_nprocs) * 2 * load));
74+
_timeout = _lat_avg + _lat_mdev * _mdev_scalar;
7575
}
7676

7777
/**

0 commit comments

Comments
 (0)