Lines Matching refs: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 WRITE_ONCE(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()
280 nfp_repr_transfer_features(struct net_device *netdev, struct net_device *lower) in nfp_repr_transfer_features() argument
282 struct nfp_repr *repr = netdev_priv(netdev); in nfp_repr_transfer_features()
287 netif_inherit_tso_max(netdev, lower); in nfp_repr_transfer_features()
289 netdev_update_features(netdev); in nfp_repr_transfer_features()
294 unregister_netdev(repr->netdev); in nfp_repr_clean()
295 nfp_app_repr_clean(repr->app, repr->netdev); in nfp_repr_clean()
314 int nfp_repr_init(struct nfp_app *app, struct net_device *netdev, in nfp_repr_init() argument
318 struct nfp_repr *repr = netdev_priv(netdev); in nfp_repr_init()
323 nfp_repr_set_lockdep_class(netdev); in nfp_repr_init()
332 netdev->netdev_ops = &nfp_repr_netdev_ops; in nfp_repr_init()
333 netdev->ethtool_ops = &nfp_port_ethtool_ops; in nfp_repr_init()
335 netdev->max_mtu = pf_netdev->max_mtu; in nfp_repr_init()
339 netdev->priv_flags |= IFF_LIVE_ADDR_CHANGE; in nfp_repr_init()
341 netdev->hw_features = NETIF_F_HIGHDMA; in nfp_repr_init()
343 netdev->hw_features |= NETIF_F_RXCSUM; in nfp_repr_init()
345 netdev->hw_features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM; in nfp_repr_init()
347 netdev->hw_features |= NETIF_F_SG; in nfp_repr_init()
350 netdev->hw_features |= NETIF_F_TSO | NETIF_F_TSO6; in nfp_repr_init()
352 netdev->hw_features |= NETIF_F_RXHASH; in nfp_repr_init()
355 netdev->hw_features |= NETIF_F_GSO_UDP_TUNNEL; in nfp_repr_init()
359 netdev->hw_features |= NETIF_F_GSO_GRE; in nfp_repr_init()
362 netdev->hw_enc_features = netdev->hw_features; in nfp_repr_init()
364 netdev->vlan_features = netdev->hw_features; in nfp_repr_init()
367 netdev->hw_features |= NETIF_F_HW_VLAN_CTAG_RX; in nfp_repr_init()
370 netdev_warn(netdev, "Device advertises both TSO2 and TXVLAN. Refusing to enable TXVLAN.\n"); in nfp_repr_init()
372 netdev->hw_features |= NETIF_F_HW_VLAN_CTAG_TX; in nfp_repr_init()
375 netdev->hw_features |= NETIF_F_HW_VLAN_CTAG_FILTER; in nfp_repr_init()
377 netdev->hw_features |= NETIF_F_HW_VLAN_STAG_RX; in nfp_repr_init()
379 netdev->features = netdev->hw_features; in nfp_repr_init()
384 netdev->features &= ~NETIF_F_HW_VLAN_STAG_RX; in nfp_repr_init()
385 netif_set_tso_max_segs(netdev, NFP_NET_LSO_MAX_SEGS); in nfp_repr_init()
387 netdev->priv_flags |= IFF_NO_QUEUE | IFF_DISABLE_NETPOLL; in nfp_repr_init()
388 netdev->lltx = true; in nfp_repr_init()
391 netdev->features |= NETIF_F_HW_TC; in nfp_repr_init()
392 netdev->hw_features |= NETIF_F_HW_TC; in nfp_repr_init()
395 err = nfp_app_repr_init(app, netdev); in nfp_repr_init()
399 err = register_netdev(netdev); in nfp_repr_init()
406 nfp_app_repr_clean(app, netdev); in nfp_repr_init()
415 free_netdev(repr->netdev); in __nfp_repr_free()
418 void nfp_repr_free(struct net_device *netdev) in nfp_repr_free() argument
420 __nfp_repr_free(netdev_priv(netdev)); in nfp_repr_free()
426 struct net_device *netdev; in nfp_repr_alloc_mqs() local
429 netdev = alloc_etherdev_mqs(sizeof(*repr), txqs, rxqs); in nfp_repr_alloc_mqs()
430 if (!netdev) in nfp_repr_alloc_mqs()
433 netif_carrier_off(netdev); in nfp_repr_alloc_mqs()
435 repr = netdev_priv(netdev); in nfp_repr_alloc_mqs()
436 repr->netdev = netdev; in nfp_repr_alloc_mqs()
443 return netdev; in nfp_repr_alloc_mqs()
446 free_netdev(netdev); in nfp_repr_alloc_mqs()
453 repr->netdev->name); in nfp_repr_clean_and_free()
460 struct net_device *netdev; in nfp_reprs_clean_and_free() local
464 netdev = nfp_repr_get_locked(app, reprs, i); in nfp_reprs_clean_and_free()
465 if (netdev) in nfp_reprs_clean_and_free()
466 nfp_repr_clean_and_free(netdev_priv(netdev)); in nfp_reprs_clean_and_free()
475 struct net_device *netdev; in nfp_reprs_clean_and_free_by_type() local
488 netdev = nfp_repr_get_locked(app, reprs, i); in nfp_reprs_clean_and_free_by_type()
489 if (netdev) in nfp_reprs_clean_and_free_by_type()
490 nfp_app_repr_preclean(app, netdev); in nfp_reprs_clean_and_free_by_type()
513 struct net_device *netdev; in nfp_reprs_resync_phys_ports() local
523 netdev = nfp_repr_get_locked(app, reprs, i); in nfp_reprs_resync_phys_ports()
524 if (!netdev) in nfp_reprs_resync_phys_ports()
527 repr = netdev_priv(netdev); in nfp_reprs_resync_phys_ports()
531 nfp_app_repr_preclean(app, netdev); in nfp_reprs_resync_phys_ports()