Lines Matching full:netdev
27 nfp_repr_inc_tx_stats(struct net_device *netdev, unsigned int len, in nfp_repr_inc_tx_stats() argument
30 struct nfp_repr *repr = netdev_priv(netdev); in nfp_repr_inc_tx_stats()
46 void nfp_repr_inc_rx_stats(struct net_device *netdev, unsigned int len) in nfp_repr_inc_rx_stats() argument
48 struct nfp_repr *repr = netdev_priv(netdev); in nfp_repr_inc_rx_stats()
90 nfp_repr_get_stats64(struct net_device *netdev, struct rtnl_link_stats64 *stats) in nfp_repr_get_stats64() argument
92 struct nfp_repr *repr = netdev_priv(netdev); in nfp_repr_get_stats64()
124 nfp_repr_get_host_stats64(const struct net_device *netdev, in nfp_repr_get_host_stats64() argument
127 struct nfp_repr *repr = netdev_priv(netdev); in nfp_repr_get_host_stats64()
167 static int nfp_repr_change_mtu(struct net_device *netdev, int new_mtu) in nfp_repr_change_mtu() argument
169 struct nfp_repr *repr = netdev_priv(netdev); in nfp_repr_change_mtu()
172 err = nfp_app_check_mtu(repr->app, netdev, new_mtu); in nfp_repr_change_mtu()
176 err = nfp_app_repr_change_mtu(repr->app, netdev, new_mtu); in nfp_repr_change_mtu()
180 netdev->mtu = new_mtu; in nfp_repr_change_mtu()
185 static netdev_tx_t nfp_repr_xmit(struct sk_buff *skb, struct net_device *netdev) in nfp_repr_xmit() argument
187 struct nfp_repr *repr = netdev_priv(netdev); in nfp_repr_xmit()
197 nfp_repr_inc_tx_stats(netdev, len, ret); in nfp_repr_xmit()
202 static int nfp_repr_stop(struct net_device *netdev) in nfp_repr_stop() argument
204 struct nfp_repr *repr = netdev_priv(netdev); in nfp_repr_stop()
211 nfp_port_configure(netdev, false); in nfp_repr_stop()
215 static int nfp_repr_open(struct net_device *netdev) in nfp_repr_open() argument
217 struct nfp_repr *repr = netdev_priv(netdev); in nfp_repr_open()
220 err = nfp_port_configure(netdev, true); in nfp_repr_open()
231 nfp_port_configure(netdev, false); in nfp_repr_open()
236 nfp_repr_fix_features(struct net_device *netdev, netdev_features_t features) in nfp_repr_fix_features() argument
238 struct nfp_repr *repr = netdev_priv(netdev); in nfp_repr_fix_features()
282 nfp_repr_transfer_features(struct net_device *netdev, struct net_device *lower) in nfp_repr_transfer_features() argument
284 struct nfp_repr *repr = netdev_priv(netdev); in nfp_repr_transfer_features()
289 netif_inherit_tso_max(netdev, lower); in nfp_repr_transfer_features()
291 netdev_update_features(netdev); in nfp_repr_transfer_features()
296 unregister_netdev(repr->netdev); in nfp_repr_clean()
297 nfp_app_repr_clean(repr->app, repr->netdev); in nfp_repr_clean()
316 int nfp_repr_init(struct nfp_app *app, struct net_device *netdev, in nfp_repr_init() argument
320 struct nfp_repr *repr = netdev_priv(netdev); in nfp_repr_init()
325 nfp_repr_set_lockdep_class(netdev); in nfp_repr_init()
334 netdev->netdev_ops = &nfp_repr_netdev_ops; in nfp_repr_init()
335 netdev->ethtool_ops = &nfp_port_ethtool_ops; in nfp_repr_init()
337 netdev->max_mtu = pf_netdev->max_mtu; in nfp_repr_init()
341 netdev->priv_flags |= IFF_LIVE_ADDR_CHANGE; in nfp_repr_init()
343 netdev->hw_features = NETIF_F_HIGHDMA; in nfp_repr_init()
345 netdev->hw_features |= NETIF_F_RXCSUM; in nfp_repr_init()
347 netdev->hw_features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM; in nfp_repr_init()
349 netdev->hw_features |= NETIF_F_SG; in nfp_repr_init()
352 netdev->hw_features |= NETIF_F_TSO | NETIF_F_TSO6; in nfp_repr_init()
354 netdev->hw_features |= NETIF_F_RXHASH; in nfp_repr_init()
357 netdev->hw_features |= NETIF_F_GSO_UDP_TUNNEL; in nfp_repr_init()
361 netdev->hw_features |= NETIF_F_GSO_GRE; in nfp_repr_init()
364 netdev->hw_enc_features = netdev->hw_features; in nfp_repr_init()
366 netdev->vlan_features = netdev->hw_features; in nfp_repr_init()
369 netdev->hw_features |= NETIF_F_HW_VLAN_CTAG_RX; in nfp_repr_init()
372 netdev_warn(netdev, "Device advertises both TSO2 and TXVLAN. Refusing to enable TXVLAN.\n"); in nfp_repr_init()
374 netdev->hw_features |= NETIF_F_HW_VLAN_CTAG_TX; in nfp_repr_init()
377 netdev->hw_features |= NETIF_F_HW_VLAN_CTAG_FILTER; in nfp_repr_init()
379 netdev->hw_features |= NETIF_F_HW_VLAN_STAG_RX; in nfp_repr_init()
381 netdev->features = netdev->hw_features; in nfp_repr_init()
386 netdev->features &= ~NETIF_F_HW_VLAN_STAG_RX; in nfp_repr_init()
387 netif_set_tso_max_segs(netdev, NFP_NET_LSO_MAX_SEGS); in nfp_repr_init()
389 netdev->priv_flags |= IFF_NO_QUEUE | IFF_DISABLE_NETPOLL; in nfp_repr_init()
390 netdev->features |= NETIF_F_LLTX; in nfp_repr_init()
393 netdev->features |= NETIF_F_HW_TC; in nfp_repr_init()
394 netdev->hw_features |= NETIF_F_HW_TC; in nfp_repr_init()
397 err = nfp_app_repr_init(app, netdev); in nfp_repr_init()
401 err = register_netdev(netdev); in nfp_repr_init()
408 nfp_app_repr_clean(app, netdev); in nfp_repr_init()
417 free_netdev(repr->netdev); in __nfp_repr_free()
420 void nfp_repr_free(struct net_device *netdev) in nfp_repr_free() argument
422 __nfp_repr_free(netdev_priv(netdev)); in nfp_repr_free()
428 struct net_device *netdev; in nfp_repr_alloc_mqs() local
431 netdev = alloc_etherdev_mqs(sizeof(*repr), txqs, rxqs); in nfp_repr_alloc_mqs()
432 if (!netdev) in nfp_repr_alloc_mqs()
435 netif_carrier_off(netdev); in nfp_repr_alloc_mqs()
437 repr = netdev_priv(netdev); in nfp_repr_alloc_mqs()
438 repr->netdev = netdev; in nfp_repr_alloc_mqs()
445 return netdev; in nfp_repr_alloc_mqs()
448 free_netdev(netdev); in nfp_repr_alloc_mqs()
455 repr->netdev->name); in nfp_repr_clean_and_free()
462 struct net_device *netdev; in nfp_reprs_clean_and_free() local
466 netdev = nfp_repr_get_locked(app, reprs, i); in nfp_reprs_clean_and_free()
467 if (netdev) in nfp_reprs_clean_and_free()
468 nfp_repr_clean_and_free(netdev_priv(netdev)); in nfp_reprs_clean_and_free()
477 struct net_device *netdev; in nfp_reprs_clean_and_free_by_type() local
490 netdev = nfp_repr_get_locked(app, reprs, i); in nfp_reprs_clean_and_free_by_type()
491 if (netdev) in nfp_reprs_clean_and_free_by_type()
492 nfp_app_repr_preclean(app, netdev); in nfp_reprs_clean_and_free_by_type()
515 struct net_device *netdev; in nfp_reprs_resync_phys_ports() local
525 netdev = nfp_repr_get_locked(app, reprs, i); in nfp_reprs_resync_phys_ports()
526 if (!netdev) in nfp_reprs_resync_phys_ports()
529 repr = netdev_priv(netdev); in nfp_reprs_resync_phys_ports()
533 nfp_app_repr_preclean(app, netdev); in nfp_reprs_resync_phys_ports()