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()
123 nfp_repr_get_host_stats64(const struct net_device *netdev, in nfp_repr_get_host_stats64() argument
126 struct nfp_repr *repr = netdev_priv(netdev); in nfp_repr_get_host_stats64()
166 static int nfp_repr_change_mtu(struct net_device *netdev, int new_mtu) in nfp_repr_change_mtu() argument
168 struct nfp_repr *repr = netdev_priv(netdev); in nfp_repr_change_mtu()
171 err = nfp_app_check_mtu(repr->app, netdev, new_mtu); in nfp_repr_change_mtu()
175 err = nfp_app_repr_change_mtu(repr->app, netdev, new_mtu); in nfp_repr_change_mtu()
179 netdev->mtu = new_mtu; in nfp_repr_change_mtu()
184 static netdev_tx_t nfp_repr_xmit(struct sk_buff *skb, struct net_device *netdev) in nfp_repr_xmit() argument
186 struct nfp_repr *repr = netdev_priv(netdev); in nfp_repr_xmit()
196 nfp_repr_inc_tx_stats(netdev, len, ret); in nfp_repr_xmit()
201 static int nfp_repr_stop(struct net_device *netdev) in nfp_repr_stop() argument
203 struct nfp_repr *repr = netdev_priv(netdev); in nfp_repr_stop()
210 nfp_port_configure(netdev, false); in nfp_repr_stop()
214 static int nfp_repr_open(struct net_device *netdev) in nfp_repr_open() argument
216 struct nfp_repr *repr = netdev_priv(netdev); in nfp_repr_open()
219 err = nfp_port_configure(netdev, true); in nfp_repr_open()
230 nfp_port_configure(netdev, false); in nfp_repr_open()
235 nfp_repr_fix_features(struct net_device *netdev, netdev_features_t features) in nfp_repr_fix_features() argument
237 struct nfp_repr *repr = netdev_priv(netdev); in nfp_repr_fix_features()
281 nfp_repr_transfer_features(struct net_device *netdev, struct net_device *lower) in nfp_repr_transfer_features() argument
283 struct nfp_repr *repr = netdev_priv(netdev); in nfp_repr_transfer_features()
288 netdev->gso_max_size = lower->gso_max_size; in nfp_repr_transfer_features()
289 netdev->gso_max_segs = lower->gso_max_segs; 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->features = netdev->hw_features; in nfp_repr_init()
382 netdev->features &= ~(NETIF_F_TSO | NETIF_F_TSO6); in nfp_repr_init()
383 netdev->gso_max_segs = NFP_NET_LSO_MAX_SEGS; in nfp_repr_init()
385 netdev->priv_flags |= IFF_NO_QUEUE | IFF_DISABLE_NETPOLL; in nfp_repr_init()
386 netdev->features |= NETIF_F_LLTX; in nfp_repr_init()
389 netdev->features |= NETIF_F_HW_TC; in nfp_repr_init()
390 netdev->hw_features |= NETIF_F_HW_TC; in nfp_repr_init()
393 err = nfp_app_repr_init(app, netdev); in nfp_repr_init()
397 err = register_netdev(netdev); in nfp_repr_init()
404 nfp_app_repr_clean(app, netdev); in nfp_repr_init()
413 free_netdev(repr->netdev); in __nfp_repr_free()
416 void nfp_repr_free(struct net_device *netdev) in nfp_repr_free() argument
418 __nfp_repr_free(netdev_priv(netdev)); in nfp_repr_free()
424 struct net_device *netdev; in nfp_repr_alloc_mqs() local
427 netdev = alloc_etherdev_mqs(sizeof(*repr), txqs, rxqs); in nfp_repr_alloc_mqs()
428 if (!netdev) in nfp_repr_alloc_mqs()
431 netif_carrier_off(netdev); in nfp_repr_alloc_mqs()
433 repr = netdev_priv(netdev); in nfp_repr_alloc_mqs()
434 repr->netdev = netdev; in nfp_repr_alloc_mqs()
441 return netdev; in nfp_repr_alloc_mqs()
444 free_netdev(netdev); in nfp_repr_alloc_mqs()
451 repr->netdev->name); in nfp_repr_clean_and_free()
458 struct net_device *netdev; in nfp_reprs_clean_and_free() local
462 netdev = nfp_repr_get_locked(app, reprs, i); in nfp_reprs_clean_and_free()
463 if (netdev) in nfp_reprs_clean_and_free()
464 nfp_repr_clean_and_free(netdev_priv(netdev)); in nfp_reprs_clean_and_free()
473 struct net_device *netdev; in nfp_reprs_clean_and_free_by_type() local
486 netdev = nfp_repr_get_locked(app, reprs, i); in nfp_reprs_clean_and_free_by_type()
487 if (netdev) in nfp_reprs_clean_and_free_by_type()
488 nfp_app_repr_preclean(app, netdev); in nfp_reprs_clean_and_free_by_type()
512 struct net_device *netdev; in nfp_reprs_resync_phys_ports() local
522 netdev = nfp_repr_get_locked(app, reprs, i); in nfp_reprs_resync_phys_ports()
523 if (!netdev) in nfp_reprs_resync_phys_ports()
526 repr = netdev_priv(netdev); in nfp_reprs_resync_phys_ports()
530 nfp_app_repr_preclean(app, netdev); in nfp_reprs_resync_phys_ports()