/** * fm10k_open - Called when a network interface is made active * @netdev: network interface device structure * * Returns 0 on success, negative value on failure * * The open entry point is called when a network interface is made * active by the system (IFF_UP). At this point all resources needed * for transmit and receive operations are allocated, the interrupt * handler is registered with the OS, the watchdog timer is started, * and the stack is notified that the interface is ready. **/ int fm10k_open(struct net_device *netdev) { struct fm10k_intfc *interface = netdev_priv(netdev); int err; /* allocate transmit descriptors */ err = fm10k_setup_all_tx_resources(interface); if (err) goto err_setup_tx; /* allocate receive descriptors */ err = fm10k_setup_all_rx_resources(interface); if (err) goto err_setup_rx; /* allocate interrupt resources */ err = fm10k_qv_request_irq(interface); if (err) goto err_req_irq; /* setup GLORT assignment for this port */ fm10k_request_glort_range(interface); /* Notify the stack of the actual queue counts */ err = netif_set_real_num_tx_queues(netdev, interface->num_tx_queues); if (err) goto err_set_queues; err = netif_set_real_num_rx_queues(netdev, interface->num_rx_queues); if (err) goto err_set_queues; #if IS_ENABLED(CONFIG_VXLAN) /* update VXLAN port configuration */ vxlan_get_rx_port(netdev); #endif fm10k_up(interface); return 0; err_set_queues: fm10k_qv_free_irq(interface); err_req_irq: fm10k_free_all_rx_resources(interface); err_setup_rx: fm10k_free_all_tx_resources(interface); err_setup_tx: return err; }
/** * fm10k_open - Called when a network interface is made active * @netdev: network interface device structure * * Returns 0 on success, negative value on failure * * The open entry point is called when a network interface is made * active by the system (IFF_UP). At this point all resources needed * for transmit and receive operations are allocated, the interrupt * handler is registered with the OS, the watchdog timer is started, * and the stack is notified that the interface is ready. **/ int fm10k_open(struct net_device *netdev) { struct fm10k_intfc *interface = netdev_priv(netdev); int err; /* allocate transmit descriptors */ err = fm10k_setup_all_tx_resources(interface); if (err) goto err_setup_tx; /* allocate receive descriptors */ err = fm10k_setup_all_rx_resources(interface); if (err) goto err_setup_rx; /* allocate interrupt resources */ err = fm10k_qv_request_irq(interface); if (err) goto err_req_irq; /* setup GLORT assignment for this port */ fm10k_request_glort_range(interface); /* Notify the stack of the actual queue counts */ err = netif_set_real_num_tx_queues(netdev, interface->num_tx_queues); if (err) goto err_set_queues; err = netif_set_real_num_rx_queues(netdev, interface->num_rx_queues); if (err) goto err_set_queues; udp_tunnel_get_rx_info(netdev); fm10k_up(interface); return 0; err_set_queues: fm10k_qv_free_irq(interface); err_req_irq: fm10k_free_all_rx_resources(interface); err_setup_rx: fm10k_free_all_tx_resources(interface); err_setup_tx: return err; }