Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 7 additions & 13 deletions src/common/net/Listener.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,12 @@

namespace hf3fs::net {

static bool checkNicType(std::string_view nic, Address::Type type) {

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inetworkType_ is not get from load (), this fun post "RDMA" to networkType_, this case , NIC only filter by name

switch (type) {
case Address::TCP:
return nic.starts_with("en") || nic.starts_with("eth") || nic.starts_with("bond") || nic.starts_with("xgbe");
case Address::IPoIB:
return nic.starts_with("ib");
case Address::RDMA:
return nic.starts_with("en") || nic.starts_with("eth") || nic.starts_with("bond") || nic.starts_with("xgbe");
case Address::LOCAL:
return nic.starts_with("lo");
default:
return false;
static bool checkNicType(Address::Type type) {
// listen to all ip address type for some NIC not start with en eth,bond, except for the Unix type
if (type == Address::UNIX){
return false;
} else {
return true;
}
}

Expand All @@ -65,7 +59,7 @@ Result<Void> Listener::setup() {

auto &filters = config_.filter_list();
for (auto [name, addr] : nics.value()) {
if (addr.up && (filters.empty() || filters.count(name) != 0) && checkNicType(name, networkType_)) {
if (addr.up && (filters.empty() || filters.count(name) != 0) && checkNicType(networkType_)) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider deleting the checkNicType function and replacing checkNicType(networkType_) with networkType_ != Address::UNIX

@qiuxinyidian qiuxinyidian Apr 28, 2025

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

networkType_ is not get from IfAddrs::load(), funny

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in this case ,this fun post "RDMA" to networkType_, NIC only filter by name

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SF-Zhou any suggestion?

addressList_.push_back(Address{addr.ip.toLong(),
config_.listen_port(),
networkType_ == Address::LOCAL ? Address::TCP : networkType_});
Expand Down