if (rc != 0)
goto fail_intr_configure;
- rc = sfc_port_init(sa);
+ rc = sfc_port_configure(sa);
if (rc != 0)
- goto fail_port_init;
+ goto fail_port_configure;
rc = sfc_rx_init(sa);
if (rc != 0)
sfc_rx_fini(sa);
fail_rx_init:
- sfc_port_fini(sa);
+ sfc_port_close(sa);
-fail_port_init:
+fail_port_configure:
sfc_intr_close(sa);
fail_intr_configure:
sfc_tx_fini(sa);
sfc_rx_fini(sa);
- sfc_port_fini(sa);
+ sfc_port_close(sa);
sfc_intr_close(sa);
sa->state = SFC_ADAPTER_INITIALIZED;
if (rc != 0)
goto fail_ev_attach;
- efx_phy_adv_cap_get(sa->nic, EFX_PHY_CAP_PERM,
- &sa->port.phy_adv_cap_mask);
+ rc = sfc_port_attach(sa);
+ if (rc != 0)
+ goto fail_port_attach;
rc = sfc_set_rss_defaults(sa);
if (rc != 0)
fail_filter_attach:
fail_set_rss_defaults:
+ sfc_port_detach(sa);
+
+fail_port_attach:
sfc_ev_detach(sa);
fail_ev_attach:
sfc_flow_fini(sa);
sfc_filter_detach(sa);
+ sfc_port_detach(sa);
sfc_ev_detach(sa);
sfc_intr_detach(sa);
int sfc_intr_start(struct sfc_adapter *sa);
void sfc_intr_stop(struct sfc_adapter *sa);
-int sfc_port_init(struct sfc_adapter *sa);
-void sfc_port_fini(struct sfc_adapter *sa);
+int sfc_port_attach(struct sfc_adapter *sa);
+void sfc_port_detach(struct sfc_adapter *sa);
+int sfc_port_configure(struct sfc_adapter *sa);
+void sfc_port_close(struct sfc_adapter *sa);
int sfc_port_start(struct sfc_adapter *sa);
void sfc_port_stop(struct sfc_adapter *sa);
void sfc_port_link_mode_to_info(efx_link_mode_t link_mode,
}
int
-sfc_port_init(struct sfc_adapter *sa)
+sfc_port_configure(struct sfc_adapter *sa)
{
const struct rte_eth_dev_data *dev_data = sa->eth_dev->data;
struct sfc_port *port = &sa->port;
+
+ sfc_log_init(sa, "entry");
+
+ if (dev_data->dev_conf.rxmode.jumbo_frame)
+ port->pdu = dev_data->dev_conf.rxmode.max_rx_pkt_len;
+ else
+ port->pdu = EFX_MAC_PDU(dev_data->mtu);
+
+ return 0;
+}
+
+void
+sfc_port_close(struct sfc_adapter *sa)
+{
+ sfc_log_init(sa, "entry");
+}
+
+int
+sfc_port_attach(struct sfc_adapter *sa)
+{
+ struct sfc_port *port = &sa->port;
long kvarg_stats_update_period_ms;
int rc;
sfc_log_init(sa, "entry");
+ efx_phy_adv_cap_get(sa->nic, EFX_PHY_CAP_PERM, &port->phy_adv_cap_mask);
+
/* Enable flow control by default */
port->flow_ctrl = EFX_FCNTL_RESPOND | EFX_FCNTL_GENERATE;
port->flow_ctrl_autoneg = B_TRUE;
- if (dev_data->dev_conf.rxmode.jumbo_frame)
- port->pdu = dev_data->dev_conf.rxmode.max_rx_pkt_len;
- else
- port->pdu = EFX_MAC_PDU(dev_data->mtu);
-
port->max_mcast_addrs = EFX_MAC_MULTICAST_LIST_MAX;
port->nb_mcast_addrs = 0;
port->mcast_addrs = rte_calloc_socket("mcast_addr_list_buf",
}
void
-sfc_port_fini(struct sfc_adapter *sa)
+sfc_port_detach(struct sfc_adapter *sa)
{
struct sfc_port *port = &sa->port;