Lines Matching refs:netdev

621 	idpf_add_del_mac_filters(vport, netdev_priv(vport->netdev),
645 idpf_add_del_mac_filters(vport, netdev_priv(vport->netdev),
674 * @netdev: pointer to netdev struct associated with this vport
677 struct net_device *netdev)
679 struct idpf_netdev_priv *np = netdev_priv(netdev);
684 eth_hw_addr_set(netdev, vport->default_mac_addr);
685 ether_addr_copy(netdev->perm_addr, vport->default_mac_addr);
699 eth_hw_addr_random(netdev);
700 err = idpf_add_mac_filter(vport, np, netdev->dev_addr, false);
705 vport->default_mac_addr, netdev->dev_addr);
706 ether_addr_copy(vport->default_mac_addr, netdev->dev_addr);
712 * idpf_cfg_netdev - Allocate, configure and register a netdev
724 struct net_device *netdev;
730 /* It's possible we already have a netdev allocated and registered for
734 netdev = adapter->netdevs[idx];
735 np = netdev_priv(netdev);
739 vport->netdev = netdev;
741 return idpf_init_mac_addr(vport, netdev);
744 netdev = alloc_etherdev_mqs(sizeof(struct idpf_netdev_priv),
747 if (!netdev)
750 vport->netdev = netdev;
751 np = netdev_priv(netdev);
759 err = idpf_init_mac_addr(vport, netdev);
761 free_netdev(vport->netdev);
762 vport->netdev = NULL;
769 netdev->netdev_ops = &idpf_netdev_ops_splitq;
771 netdev->netdev_ops = &idpf_netdev_ops_singleq;
774 netdev->watchdog_timeo = 5 * HZ;
776 netdev->dev_port = idx;
779 netdev->min_mtu = ETH_MIN_MTU;
780 netdev->max_mtu = vport->max_mtu;
822 netdev->gso_partial_features |=
825 netdev->gso_partial_features |= NETIF_F_GSO_GRE_CSUM;
831 netdev->features |= dflt_features;
832 netdev->hw_features |= dflt_features | offloads;
833 netdev->hw_enc_features |= dflt_features | offloads;
834 idpf_set_ethtool_ops(netdev);
835 SET_NETDEV_DEV(netdev, &adapter->pdev->dev);
838 netif_carrier_off(netdev);
841 netif_tx_stop_all_queues(netdev);
846 adapter->netdevs[idx] = netdev;
885 struct idpf_netdev_priv *np = netdev_priv(vport->netdev);
890 netif_carrier_off(vport->netdev);
891 netif_tx_disable(vport->netdev);
915 * @netdev: network interface device structure
919 * driver's control, but the netdev interface is disabled.
923 static int idpf_stop(struct net_device *netdev)
925 struct idpf_netdev_priv *np = netdev_priv(netdev);
931 idpf_vport_ctrl_lock(netdev);
932 vport = idpf_netdev_to_vport(netdev);
936 idpf_vport_ctrl_unlock(netdev);
942 * idpf_decfg_netdev - Unregister the netdev
943 * @vport: vport for which netdev to be unregistered
949 unregister_netdev(vport->netdev);
950 free_netdev(vport->netdev);
951 vport->netdev = NULL;
1180 * @netdev: network interface device structure
1183 static void idpf_get_stats64(struct net_device *netdev,
1186 struct idpf_netdev_priv *np = netdev_priv(netdev);
1272 * idpf_set_real_num_queues - set number of queues for netdev
1281 err = netif_set_real_num_rx_queues(vport->netdev, vport->num_rxq);
1285 return netif_set_real_num_tx_queues(vport->netdev, vport->num_txq);
1296 struct idpf_netdev_priv *np = netdev_priv(vport->netdev);
1298 if (vport->link_up && !netif_carrier_ok(vport->netdev)) {
1299 netif_carrier_on(vport->netdev);
1300 netif_tx_start_all_queues(vport->netdev);
1344 struct idpf_netdev_priv *np = netdev_priv(vport->netdev);
1353 netif_carrier_off(vport->netdev);
1540 np = netdev_priv(vport->netdev);
1749 struct net_device *netdev;
1759 netdev = adapter->netdevs[i];
1760 if (!netdev)
1763 netif_carrier_off(netdev);
1764 netif_tx_disable(netdev);
1853 struct idpf_netdev_priv *np = netdev_priv(vport->netdev);
1995 * @netdev: the netdevice
2006 static int idpf_addr_sync(struct net_device *netdev, const u8 *addr)
2008 struct idpf_netdev_priv *np = netdev_priv(netdev);
2015 * @netdev: the netdevice
2026 static int idpf_addr_unsync(struct net_device *netdev, const u8 *addr)
2028 struct idpf_netdev_priv *np = netdev_priv(netdev);
2035 if (ether_addr_equal(addr, netdev->dev_addr))
2044 * idpf_set_rx_mode - NDO callback to set the netdev filters
2045 * @netdev: network interface device structure
2050 static void idpf_set_rx_mode(struct net_device *netdev)
2052 struct idpf_netdev_priv *np = netdev_priv(netdev);
2063 __dev_uc_sync(netdev, idpf_addr_sync, idpf_addr_unsync);
2064 __dev_mc_sync(netdev, idpf_addr_sync, idpf_addr_unsync);
2078 if ((netdev->flags & IFF_PROMISC) &&
2086 if (!(netdev->flags & IFF_PROMISC) &&
2092 if (netdev->flags & IFF_ALLMULTI &&
2098 if (!(netdev->flags & (IFF_ALLMULTI | IFF_PROMISC)) &&
2147 * idpf_set_features - set the netdev feature flags
2148 * @netdev: ptr to the netdev being adjusted
2151 static int idpf_set_features(struct net_device *netdev,
2154 netdev_features_t changed = netdev->features ^ features;
2159 idpf_vport_ctrl_lock(netdev);
2160 vport = idpf_netdev_to_vport(netdev);
2165 dev_err(&adapter->pdev->dev, "Device is resetting, changing netdev features temporarily unavailable.\n");
2171 netdev->features ^= NETIF_F_RXHASH;
2178 netdev->features ^= NETIF_F_GRO_HW;
2185 netdev->features ^= NETIF_F_LOOPBACK;
2190 idpf_vport_ctrl_unlock(netdev);
2197 * @netdev: network interface device structure
2202 * handler is registered with the OS, the netdev watchdog is enabled,
2207 static int idpf_open(struct net_device *netdev)
2212 idpf_vport_ctrl_lock(netdev);
2213 vport = idpf_netdev_to_vport(netdev);
2217 idpf_vport_ctrl_unlock(netdev);
2224 * @netdev: network interface device structure
2229 static int idpf_change_mtu(struct net_device *netdev, int new_mtu)
2234 idpf_vport_ctrl_lock(netdev);
2235 vport = idpf_netdev_to_vport(netdev);
2237 WRITE_ONCE(netdev->mtu, new_mtu);
2241 idpf_vport_ctrl_unlock(netdev);
2249 * @netdev: This port's netdev
2253 struct net_device *netdev,
2256 struct idpf_vport *vport = idpf_netdev_to_vport(netdev);
2309 * @netdev: network interface device structure
2314 static int idpf_set_mac(struct net_device *netdev, void *p)
2316 struct idpf_netdev_priv *np = netdev_priv(netdev);
2322 idpf_vport_ctrl_lock(netdev);
2323 vport = idpf_netdev_to_vport(netdev);
2339 if (ether_addr_equal(netdev->dev_addr, addr->sa_data))
2353 eth_hw_addr_set(netdev, addr->sa_data);
2356 idpf_vport_ctrl_unlock(netdev);