Skip to content

Commit

Permalink
Merge conflict fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dylan-eustice committed Feb 21, 2025
1 parent 8ec5598 commit 6f01b69
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
12 changes: 7 additions & 5 deletions operators/advanced_network/adv_network_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ uint16_t adv_net_get_pkt_len(AdvNetBurstParams* burst, int idx);

/**
* @brief Get flow ID of a packet
*
*
* Retrieves the flow ID of a packet, or 0 if no flow was matched. The flow ID should match
* the flow ID in the flow rule for the ANO config.
*
Expand Down Expand Up @@ -502,11 +502,13 @@ struct YAML::convert<holoscan::ops::AdvNetConfigYaml> {
input_spec.common_.manager_type = holoscan::ops::AnoMgrType::DEFAULT;
}

input_spec.common_.loopback_ = holoscan::ops::LoopbackType::DISABLED;
try {
input_spec.common_.loopback_ = node["loopback"].as<bool>();
} catch (const std::exception& e) {
input_spec.common_.loopback_ = false;
}
const auto lbstr = node["loopback"].as<std::string>();
if (lbstr == "sw") {
input_spec.common_.loopback_ = holoscan::ops::LoopbackType::LOOPBACK_TYPE_SW;
}
} catch (const std::exception& e) {}

try {
input_spec.debug_ = node["debug"].as<bool>(false);
Expand Down
2 changes: 1 addition & 1 deletion operators/advanced_network/adv_network_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ struct CommonConfig {
int master_core_;
AdvNetDirection dir;
AnoMgrType manager_type;
bool loopback_;
LoopbackType loopback_;
};

struct AdvNetRxConfig {
Expand Down
18 changes: 8 additions & 10 deletions operators/advanced_network/managers/dpdk/adv_network_dpdk_mgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ void DpdkMgr::initialize() {
},
};

loopback_ = cfg_.common_.loopback_ ? LoopbackType::LOOPBACK_TYPE_SW : LoopbackType::DISABLED;
loopback_ = cfg_.common_.loopback_;
if (loopback_ == LoopbackType::LOOPBACK_TYPE_SW) {
if (cfg_.ifs_.size() > 1) {
HOLOSCAN_LOG_CRITICAL("Only a single interface allowed for loopback mode currently");
Expand Down Expand Up @@ -463,8 +463,7 @@ void DpdkMgr::initialize() {

if (loopback_ == LoopbackType::LOOPBACK_TYPE_SW) {
intf.port_id_ = 0;
}
else {
} else {
ret = rte_eth_dev_get_port_by_name(intf.address_.c_str(), &intf.port_id_);
if (ret < 0) {
HOLOSCAN_LOG_CRITICAL("Failed to get port number for {}", intf.name_.c_str());
Expand Down Expand Up @@ -825,8 +824,7 @@ void DpdkMgr::initialize() {
}

apply_tx_offloads(intf.port_id_);
}
else {
} else {
HOLOSCAN_LOG_INFO("Loopback mode configured");
}
}
Expand Down Expand Up @@ -984,12 +982,12 @@ struct rte_flow* DpdkMgr::add_flow(int port, const FlowConfig& cfg) {
struct rte_flow_action action[MAX_ACTION_NUM];
struct rte_flow* flow = NULL;
struct rte_flow_action_queue queue = {.index = cfg.action_.id_};
struct rte_flow_action_mark mark = {.id = cfg.id_};
struct rte_flow_action_mark mark = {.id = cfg.id_};
struct rte_flow_error error;
struct rte_flow_item_udp udp_spec;
struct rte_flow_item_udp udp_mask;
struct rte_flow_item_ipv4 ip_spec;
struct rte_flow_item_ipv4 ip_mask;
struct rte_flow_item_ipv4 ip_spec;
struct rte_flow_item_ipv4 ip_mask;
struct rte_flow_item udp_item;
int res;

Expand Down Expand Up @@ -1252,8 +1250,7 @@ void DpdkMgr::run() {
if (loopback_ != LoopbackType::LOOPBACK_TYPE_SW) {
rx_worker = rx_core_worker;
tx_worker = tx_core_worker;
}
else {
} else {
rx_worker = rx_lb_worker;
tx_worker = tx_lb_worker;
}
Expand Down Expand Up @@ -1319,6 +1316,7 @@ void DpdkMgr::run() {
// params->hds = q.common_.hds_ > 0;
params->port = intf.port_id_;
params->ring = tx_rings[key];
params->lb_ring = loopback_ring;
params->queue = q.common_.id_;
params->burst_pool = tx_burst_buffers[key];
params->meta_pool = tx_meta;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ class DpdkMgr : public ANOMgr {
static int rx_core_multi_q_worker(void* arg);
static int tx_core_worker(void* arg);
static int rx_lb_worker(void* arg);
static int tx_lb_worker(void* arg);
static int tx_lb_worker(void* arg);
static void flush_packets(int port);
void setup_accurate_send_scheduling_mask();
int setup_pools_and_rings(int max_rx_batch, int max_tx_batch);
Expand Down

0 comments on commit 6f01b69

Please sign in to comment.