Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove port's attached flag #430

Merged
merged 1 commit into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
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
3 changes: 0 additions & 3 deletions include/dp_port.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ struct dp_port {
char dev_name[RTE_ETH_NAME_MAX_LEN];
uint8_t peer_pf_hairpin_tx_rx_queue_offset;
uint16_t peer_pf_port_id;
bool attached;
struct vm_entry vm;
struct rte_flow *default_jump_flow;
struct rte_flow *default_capture_flow;
Expand All @@ -74,8 +73,6 @@ extern struct dp_ports _dp_ports;

struct dp_port *dp_get_port_by_name(const char *pci_name);

int dp_attach_vf(struct dp_port *port);

int dp_ports_init(void);
void dp_ports_free(void);

Expand Down
11 changes: 0 additions & 11 deletions src/dp_port.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,6 @@ struct dp_port *dp_get_port_by_name(const char *pci_name)
return _dp_port_table[port_id];
}

int dp_attach_vf(struct dp_port *port)
{
if (port->port_type != DP_PORT_VF) {
DPS_LOG_ERR("VF port not registered in dpservice", DP_LOG_PORT(port));
return DP_ERROR;
}

port->attached = true;
return DP_OK;
}

static int dp_port_init_ethdev(struct dp_port *port, struct rte_eth_dev_info *dev_info, enum dp_port_type port_type)
{
struct dp_dpdk_layer *dp_layer = get_dpdk_layer();
Expand Down
7 changes: 1 addition & 6 deletions src/nodes/arp_node.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,11 @@ static __rte_always_inline bool arp_handled(struct rte_mbuf *m)
return true;
}

static __rte_always_inline rte_edge_t get_next_index(struct rte_node *node, struct rte_mbuf *m)
static __rte_always_inline rte_edge_t get_next_index(__rte_unused struct rte_node *node, struct rte_mbuf *m)
{
if (!arp_handled(m))
return ARP_NEXT_DROP;

if (DP_FAILED(dp_attach_vf(dp_get_port(m)))) {
DPNODE_LOG_ERR(node, "Cannot attach port", DP_LOG_PORTID(m->port));
return ARP_NEXT_DROP;
}

return next_tx_index[m->port];
}

Expand Down
5 changes: 0 additions & 5 deletions src/nodes/dhcp_node.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,11 +276,6 @@ static __rte_always_inline rte_edge_t get_next_index(struct rte_node *node, stru
+ header_size;
m->data_len = m->pkt_len;

if (DP_FAILED(dp_attach_vf(port))) {
DPNODE_LOG_ERR(node, "Cannot attach port", DP_LOG_PORT(port));
return DHCP_NEXT_DROP;
}

return next_tx_index[m->port];
}

Expand Down
5 changes: 0 additions & 5 deletions src/nodes/ipv4_lookup_node.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,6 @@ static __rte_always_inline rte_edge_t get_next_index(__rte_unused struct rte_nod
if (!df->flags.flow_type)
df->flags.flow_type = DP_FLOW_TYPE_LOCAL;

if (df->flags.flow_type == DP_FLOW_TYPE_LOCAL || df->flags.flow_type == DP_FLOW_TYPE_INCOMING) {
if (dst_port->port_type == DP_PORT_VF && !dst_port->attached)
return IPV4_LOOKUP_NEXT_DROP;
}

if (df->flags.flow_type == DP_FLOW_TYPE_OUTGOING)
dst_port = dp_multipath_get_pf(df->dp_flow_hash);

Expand Down