mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-19 16:15:07 +00:00
net: return reference to hw_feature instead of copying the structure
I noticed that tcp::hw_features() is not inlined and copies the structure to a caller. The function takes ~1.5% in httpd profiling.
This commit is contained in:
@@ -368,7 +368,7 @@ public:
|
||||
tcp<ipv4_traits>& get_tcp() { return *_tcp._tcp; }
|
||||
ipv4_udp& get_udp() { return _udp; }
|
||||
void register_l4(proto_type id, ip_protocol* handler);
|
||||
net::hw_features hw_features() { return _netif->hw_features(); }
|
||||
const net::hw_features& hw_features() const { return _netif->hw_features(); }
|
||||
static bool needs_frag(packet& p, ip_protocol_num proto_num, net::hw_features hw_features);
|
||||
void learn(ethernet_address l2, ipv4_address l3) {
|
||||
_arp.learn(l2, l3);
|
||||
|
||||
@@ -119,7 +119,7 @@ private:
|
||||
public:
|
||||
explicit interface(std::shared_ptr<device> dev);
|
||||
ethernet_address hw_address() { return _hw_address; }
|
||||
net::hw_features hw_features() { return _hw_features; }
|
||||
const net::hw_features& hw_features() const { return _hw_features; }
|
||||
subscription<packet, ethernet_address> register_l3(eth_protocol_num proto_num,
|
||||
std::function<future<> (packet p, ethernet_address from)> next,
|
||||
std::function<bool (forward_hash&, packet&, size_t)> forward);
|
||||
|
||||
@@ -591,7 +591,7 @@ public:
|
||||
bool forward(forward_hash& out_hash_data, packet& p, size_t off);
|
||||
listener listen(uint16_t port, size_t queue_length = 100);
|
||||
future<connection> connect(socket_address sa);
|
||||
net::hw_features hw_features() { return _inet._inet.hw_features(); }
|
||||
const net::hw_features& hw_features() const { return _inet._inet.hw_features(); }
|
||||
future<> poll_tcb(ipaddr to, lw_shared_ptr<tcb> tcb);
|
||||
private:
|
||||
void send_packet_without_tcb(ipaddr from, ipaddr to, packet p);
|
||||
|
||||
Reference in New Issue
Block a user