• Home
  • Raw
  • Download

Lines Matching refs:dev

89 void netdev_set_default_ethtool_ops(struct net_device *dev,
91 void netdev_sw_irq_coalesce_default_on(struct net_device *dev);
264 #define netdev_uc_count(dev) netdev_hw_addr_list_count(&(dev)->uc) argument
265 #define netdev_uc_empty(dev) netdev_hw_addr_list_empty(&(dev)->uc) argument
266 #define netdev_for_each_uc_addr(ha, dev) \ argument
267 netdev_hw_addr_list_for_each(ha, &(dev)->uc)
272 #define netdev_mc_count(dev) netdev_hw_addr_list_count(&(dev)->mc) argument
273 #define netdev_mc_empty(dev) netdev_hw_addr_list_empty(&(dev)->mc) argument
274 #define netdev_for_each_mc_addr(ha, dev) \ argument
275 netdev_hw_addr_list_for_each(ha, &(dev)->mc)
301 #define LL_RESERVED_SPACE(dev) \ argument
302 ((((dev)->hard_header_len + READ_ONCE((dev)->needed_headroom)) \
304 #define LL_RESERVED_SPACE_EXTRA(dev,extra) \ argument
305 ((((dev)->hard_header_len + READ_ONCE((dev)->needed_headroom) + (extra)) \
309 int (*create) (struct sk_buff *skb, struct net_device *dev,
315 const struct net_device *dev,
372 struct net_device *dev; member
563 int dev_set_threaded(struct net_device *dev, bool threaded);
649 struct net_device *dev; member
749 bool rps_may_expire_flow(struct net_device *dev, u16 rxq_index, u32 flow_id,
843 typedef u16 (*select_queue_fallback_t)(struct net_device *dev,
858 const struct net_device *dev; member
898 const struct net_device *dev; member
1382 int (*ndo_init)(struct net_device *dev);
1383 void (*ndo_uninit)(struct net_device *dev);
1384 int (*ndo_open)(struct net_device *dev);
1385 int (*ndo_stop)(struct net_device *dev);
1387 struct net_device *dev);
1389 struct net_device *dev,
1391 u16 (*ndo_select_queue)(struct net_device *dev,
1394 void (*ndo_change_rx_flags)(struct net_device *dev,
1396 void (*ndo_set_rx_mode)(struct net_device *dev);
1397 int (*ndo_set_mac_address)(struct net_device *dev,
1399 int (*ndo_validate_addr)(struct net_device *dev);
1400 int (*ndo_do_ioctl)(struct net_device *dev,
1402 int (*ndo_eth_ioctl)(struct net_device *dev,
1404 int (*ndo_siocbond)(struct net_device *dev,
1406 int (*ndo_siocwandev)(struct net_device *dev,
1408 int (*ndo_siocdevprivate)(struct net_device *dev,
1411 int (*ndo_set_config)(struct net_device *dev,
1413 int (*ndo_change_mtu)(struct net_device *dev,
1415 int (*ndo_neigh_setup)(struct net_device *dev,
1417 void (*ndo_tx_timeout) (struct net_device *dev,
1420 void (*ndo_get_stats64)(struct net_device *dev,
1422 bool (*ndo_has_offload_stats)(const struct net_device *dev, int attr_id);
1424 const struct net_device *dev,
1426 struct net_device_stats* (*ndo_get_stats)(struct net_device *dev);
1428 int (*ndo_vlan_rx_add_vid)(struct net_device *dev,
1430 int (*ndo_vlan_rx_kill_vid)(struct net_device *dev,
1433 void (*ndo_poll_controller)(struct net_device *dev);
1434 int (*ndo_netpoll_setup)(struct net_device *dev,
1436 void (*ndo_netpoll_cleanup)(struct net_device *dev);
1438 int (*ndo_set_vf_mac)(struct net_device *dev,
1440 int (*ndo_set_vf_vlan)(struct net_device *dev,
1443 int (*ndo_set_vf_rate)(struct net_device *dev,
1446 int (*ndo_set_vf_spoofchk)(struct net_device *dev,
1448 int (*ndo_set_vf_trust)(struct net_device *dev,
1450 int (*ndo_get_vf_config)(struct net_device *dev,
1453 int (*ndo_set_vf_link_state)(struct net_device *dev,
1455 int (*ndo_get_vf_stats)(struct net_device *dev,
1459 int (*ndo_set_vf_port)(struct net_device *dev,
1462 int (*ndo_get_vf_port)(struct net_device *dev,
1464 int (*ndo_get_vf_guid)(struct net_device *dev,
1468 int (*ndo_set_vf_guid)(struct net_device *dev,
1472 struct net_device *dev,
1474 int (*ndo_setup_tc)(struct net_device *dev,
1478 int (*ndo_fcoe_enable)(struct net_device *dev);
1479 int (*ndo_fcoe_disable)(struct net_device *dev);
1480 int (*ndo_fcoe_ddp_setup)(struct net_device *dev,
1484 int (*ndo_fcoe_ddp_done)(struct net_device *dev,
1486 int (*ndo_fcoe_ddp_target)(struct net_device *dev,
1490 int (*ndo_fcoe_get_hbainfo)(struct net_device *dev,
1497 int (*ndo_fcoe_get_wwn)(struct net_device *dev,
1502 int (*ndo_rx_flow_steer)(struct net_device *dev,
1507 int (*ndo_add_slave)(struct net_device *dev,
1510 int (*ndo_del_slave)(struct net_device *dev,
1512 struct net_device* (*ndo_get_xmit_slave)(struct net_device *dev,
1515 struct net_device* (*ndo_sk_get_lower_dev)(struct net_device *dev,
1517 netdev_features_t (*ndo_fix_features)(struct net_device *dev,
1519 int (*ndo_set_features)(struct net_device *dev,
1521 int (*ndo_neigh_construct)(struct net_device *dev,
1523 void (*ndo_neigh_destroy)(struct net_device *dev,
1528 struct net_device *dev,
1535 struct net_device *dev,
1539 struct net_device *dev,
1543 struct net_device *dev,
1548 struct net_device *dev,
1552 int (*ndo_mdb_add)(struct net_device *dev,
1556 int (*ndo_mdb_del)(struct net_device *dev,
1559 int (*ndo_mdb_del_bulk)(struct net_device *dev,
1562 int (*ndo_mdb_dump)(struct net_device *dev,
1565 int (*ndo_mdb_get)(struct net_device *dev,
1569 int (*ndo_bridge_setlink)(struct net_device *dev,
1575 struct net_device *dev,
1578 int (*ndo_bridge_dellink)(struct net_device *dev,
1581 int (*ndo_change_carrier)(struct net_device *dev,
1583 int (*ndo_get_phys_port_id)(struct net_device *dev,
1585 int (*ndo_get_port_parent_id)(struct net_device *dev,
1587 int (*ndo_get_phys_port_name)(struct net_device *dev,
1590 struct net_device *dev);
1594 int (*ndo_set_tx_maxrate)(struct net_device *dev,
1597 int (*ndo_get_iflink)(const struct net_device *dev);
1598 int (*ndo_fill_metadata_dst)(struct net_device *dev,
1600 void (*ndo_set_rx_headroom)(struct net_device *dev,
1602 int (*ndo_bpf)(struct net_device *dev,
1604 int (*ndo_xdp_xmit)(struct net_device *dev, int n,
1607 struct net_device * (*ndo_xdp_get_xmit_slave)(struct net_device *dev,
1609 int (*ndo_xsk_wakeup)(struct net_device *dev,
1611 int (*ndo_tunnel_ctl)(struct net_device *dev,
1614 struct net_device * (*ndo_get_peer_dev)(struct net_device *dev);
1617 ktime_t (*ndo_get_tstamp)(struct net_device *dev,
1620 int (*ndo_hwtstamp_get)(struct net_device *dev,
1622 int (*ndo_hwtstamp_set)(struct net_device *dev,
2329 void (*priv_destructor)(struct net_device *dev);
2346 struct device dev; member
2439 #define to_net_dev(d) container_of(d, struct net_device, dev)
2446 #define SET_NETDEV_DEVLINK_PORT(dev, port) \ argument
2448 WARN_ON((dev)->reg_state != NETREG_UNINITIALIZED); \
2449 ((dev)->devlink_port = (port)); \
2452 static inline bool netif_elide_gro(const struct net_device *dev) in netif_elide_gro() argument
2454 if (!(dev->features & NETIF_F_GRO) || dev->xdp_prog) in netif_elide_gro()
2462 int netdev_get_prio_tc_map(const struct net_device *dev, u32 prio) in netdev_get_prio_tc_map() argument
2464 return dev->prio_tc_map[prio & TC_BITMASK]; in netdev_get_prio_tc_map()
2468 int netdev_set_prio_tc_map(struct net_device *dev, u8 prio, u8 tc) in netdev_set_prio_tc_map() argument
2470 if (tc >= dev->num_tc) in netdev_set_prio_tc_map()
2473 dev->prio_tc_map[prio & TC_BITMASK] = tc & TC_BITMASK; in netdev_set_prio_tc_map()
2477 int netdev_txq_to_tc(struct net_device *dev, unsigned int txq);
2478 void netdev_reset_tc(struct net_device *dev);
2479 int netdev_set_tc_queue(struct net_device *dev, u8 tc, u16 count, u16 offset);
2480 int netdev_set_num_tc(struct net_device *dev, u8 num_tc);
2483 int netdev_get_num_tc(struct net_device *dev) in netdev_get_num_tc() argument
2485 return dev->num_tc; in netdev_get_num_tc()
2504 void netdev_unbind_sb_channel(struct net_device *dev,
2506 int netdev_bind_sb_channel_queue(struct net_device *dev,
2509 int netdev_set_sb_channel(struct net_device *dev, u16 channel);
2510 static inline int netdev_get_sb_channel(struct net_device *dev) in netdev_get_sb_channel() argument
2512 return max_t(int, -dev->num_tc, 0); in netdev_get_sb_channel()
2516 struct netdev_queue *netdev_get_tx_queue(const struct net_device *dev, in netdev_get_tx_queue() argument
2519 DEBUG_NET_WARN_ON_ONCE(index >= dev->num_tx_queues); in netdev_get_tx_queue()
2520 return &dev->_tx[index]; in netdev_get_tx_queue()
2523 static inline struct netdev_queue *skb_get_tx_queue(const struct net_device *dev, in skb_get_tx_queue() argument
2526 return netdev_get_tx_queue(dev, skb_get_queue_mapping(skb)); in skb_get_tx_queue()
2529 static inline void netdev_for_each_tx_queue(struct net_device *dev, in netdev_for_each_tx_queue() argument
2537 for (i = 0; i < dev->num_tx_queues; i++) in netdev_for_each_tx_queue()
2538 f(dev, &dev->_tx[i], arg); in netdev_for_each_tx_queue()
2541 #define netdev_lockdep_set_classes(dev) \ argument
2548 (dev)->qdisc_tx_busylock = &qdisc_tx_busylock_key; \
2549 lockdep_set_class(&(dev)->addr_list_lock, \
2551 for (i = 0; i < (dev)->num_tx_queues; i++) \
2552 lockdep_set_class(&(dev)->_tx[i]._xmit_lock, \
2556 u16 netdev_pick_tx(struct net_device *dev, struct sk_buff *skb,
2558 struct netdev_queue *netdev_core_pick_tx(struct net_device *dev,
2565 static inline unsigned netdev_get_fwd_headroom(struct net_device *dev) in netdev_get_fwd_headroom() argument
2567 return dev->priv_flags & IFF_PHONY_HEADROOM ? 0 : dev->needed_headroom; in netdev_get_fwd_headroom()
2570 static inline void netdev_set_rx_headroom(struct net_device *dev, int new_hr) in netdev_set_rx_headroom() argument
2572 if (dev->netdev_ops->ndo_set_rx_headroom) in netdev_set_rx_headroom()
2573 dev->netdev_ops->ndo_set_rx_headroom(dev, new_hr); in netdev_set_rx_headroom()
2577 static inline void netdev_reset_rx_headroom(struct net_device *dev) in netdev_reset_rx_headroom() argument
2579 netdev_set_rx_headroom(dev, -1); in netdev_reset_rx_headroom()
2582 static inline void *netdev_get_ml_priv(struct net_device *dev, in netdev_get_ml_priv() argument
2585 if (dev->ml_priv_type != type) in netdev_get_ml_priv()
2588 return dev->ml_priv; in netdev_get_ml_priv()
2591 static inline void netdev_set_ml_priv(struct net_device *dev, in netdev_set_ml_priv() argument
2595 WARN(dev->ml_priv_type && dev->ml_priv_type != type, in netdev_set_ml_priv()
2597 dev->ml_priv_type, type); in netdev_set_ml_priv()
2598 WARN(!dev->ml_priv_type && dev->ml_priv, in netdev_set_ml_priv()
2601 dev->ml_priv = ml_priv; in netdev_set_ml_priv()
2602 dev->ml_priv_type = type; in netdev_set_ml_priv()
2609 struct net *dev_net(const struct net_device *dev) in dev_net() argument
2611 return read_pnet(&dev->nd_net); in dev_net()
2615 struct net *dev_net_rcu(const struct net_device *dev) in dev_net_rcu() argument
2617 return read_pnet_rcu(&dev->nd_net); in dev_net_rcu()
2621 void dev_net_set(struct net_device *dev, struct net *net) in dev_net_set() argument
2623 write_pnet(&dev->nd_net, net); in dev_net_set()
2632 static inline void *netdev_priv(const struct net_device *dev) in netdev_priv() argument
2634 return (void *)dev->priv; in netdev_priv()
2640 #define SET_NETDEV_DEV(net, pdev) ((net)->dev.parent = (pdev))
2646 #define SET_NETDEV_DEVTYPE(net, devtype) ((net)->dev.type = (devtype))
2648 void netif_queue_set_napi(struct net_device *dev, unsigned int queue_index,
2662 void netif_napi_add_weight(struct net_device *dev, struct napi_struct *napi,
2675 netif_napi_add(struct net_device *dev, struct napi_struct *napi, in netif_napi_add() argument
2678 netif_napi_add_weight(dev, napi, poll, NAPI_POLL_WEIGHT); in netif_napi_add()
2682 netif_napi_add_tx_weight(struct net_device *dev, in netif_napi_add_tx_weight() argument
2688 netif_napi_add_weight(dev, napi, poll, weight); in netif_napi_add_tx_weight()
2701 static inline void netif_napi_add_tx(struct net_device *dev, in netif_napi_add_tx() argument
2705 netif_napi_add_tx_weight(dev, napi, poll, NAPI_POLL_WEIGHT); in netif_napi_add_tx()
2733 struct net_device *dev; /* NULL is wildcarded here */ member
2794 void dev_lstats_read(struct net_device *dev, u64 *packets, u64 *bytes);
2796 static inline void dev_sw_netstats_rx_add(struct net_device *dev, unsigned int len) in dev_sw_netstats_rx_add() argument
2798 struct pcpu_sw_netstats *tstats = this_cpu_ptr(dev->tstats); in dev_sw_netstats_rx_add()
2806 static inline void dev_sw_netstats_tx_add(struct net_device *dev, in dev_sw_netstats_tx_add() argument
2810 struct pcpu_sw_netstats *tstats = this_cpu_ptr(dev->tstats); in dev_sw_netstats_tx_add()
2818 static inline void dev_lstats_add(struct net_device *dev, unsigned int len) in dev_lstats_add() argument
2820 struct pcpu_lstats *lstats = this_cpu_ptr(dev->lstats); in dev_lstats_add()
2845 #define devm_netdev_alloc_pcpu_stats(dev, type) \ argument
2847 typeof(type) __percpu *pcpu_stats = devm_alloc_percpu(dev, type);\
2947 int register_netdevice_notifier_dev_net(struct net_device *dev,
2950 int unregister_netdevice_notifier_dev_net(struct net_device *dev,
2955 struct net_device *dev; member
3005 int netdev_offload_xstats_enable(struct net_device *dev,
3008 int netdev_offload_xstats_disable(struct net_device *dev,
3010 bool netdev_offload_xstats_enabled(const struct net_device *dev,
3012 int netdev_offload_xstats_get(struct net_device *dev,
3021 void netdev_offload_xstats_push_delta(struct net_device *dev,
3026 struct net_device *dev) in netdev_notifier_info_init() argument
3028 info->dev = dev; in netdev_notifier_info_init()
3035 return info->dev; in netdev_notifier_info_to_dev()
3044 int call_netdevice_notifiers(unsigned long val, struct net_device *dev);
3072 static inline struct net_device *next_net_device(struct net_device *dev) in next_net_device() argument
3077 net = dev_net(dev); in next_net_device()
3078 lh = dev->dev_list.next; in next_net_device()
3082 static inline struct net_device *next_net_device_rcu(struct net_device *dev) in next_net_device_rcu() argument
3087 net = dev_net(dev); in next_net_device_rcu()
3088 lh = rcu_dereference(list_next_rcu(&dev->dev_list)); in next_net_device_rcu()
3105 int netdev_boot_setup_check(struct net_device *dev);
3117 int dev_get_iflink(const struct net_device *dev);
3118 int dev_fill_metadata_dst(struct net_device *dev, struct sk_buff *skb);
3119 int dev_fill_forward_path(const struct net_device *dev, const u8 *daddr,
3127 int dev_alloc_name(struct net_device *dev, const char *name);
3128 int dev_open(struct net_device *dev, struct netlink_ext_ack *extack);
3129 void dev_close(struct net_device *dev);
3131 void dev_disable_lro(struct net_device *dev);
3133 u16 dev_pick_tx_zero(struct net_device *dev, struct sk_buff *skb,
3160 int register_netdevice(struct net_device *dev);
3161 void unregister_netdevice_queue(struct net_device *dev, struct list_head *head);
3163 static inline void unregister_netdevice(struct net_device *dev) in unregister_netdevice() argument
3165 unregister_netdevice_queue(dev, NULL); in unregister_netdevice()
3168 int netdev_refcnt_read(const struct net_device *dev);
3169 void free_netdev(struct net_device *dev);
3170 void init_dummy_netdev(struct net_device *dev);
3172 struct net_device *netdev_get_xmit_slave(struct net_device *dev,
3175 struct net_device *netdev_sk_get_lowest_dev(struct net_device *dev,
3185 void netdev_copy_name(struct net_device *dev, char *name);
3187 static inline int dev_hard_header(struct sk_buff *skb, struct net_device *dev, in dev_hard_header() argument
3192 if (!dev->header_ops || !dev->header_ops->create) in dev_hard_header()
3195 return dev->header_ops->create(skb, dev, type, daddr, saddr, len); in dev_hard_header()
3201 const struct net_device *dev = skb->dev; in dev_parse_header() local
3203 if (!dev->header_ops || !dev->header_ops->parse) in dev_parse_header()
3205 return dev->header_ops->parse(skb, haddr); in dev_parse_header()
3210 const struct net_device *dev = skb->dev; in dev_parse_header_protocol() local
3212 if (!dev->header_ops || !dev->header_ops->parse_protocol) in dev_parse_header_protocol()
3214 return dev->header_ops->parse_protocol(skb); in dev_parse_header_protocol()
3218 static inline bool dev_validate_header(const struct net_device *dev, in dev_validate_header() argument
3221 if (likely(len >= dev->hard_header_len)) in dev_validate_header()
3223 if (len < dev->min_header_len) in dev_validate_header()
3227 memset(ll_header + len, 0, dev->hard_header_len - len); in dev_validate_header()
3231 if (dev->header_ops && dev->header_ops->validate) in dev_validate_header()
3232 return dev->header_ops->validate(ll_header, len); in dev_validate_header()
3237 static inline bool dev_has_header(const struct net_device *dev) in dev_has_header() argument
3239 return dev->header_ops && dev->header_ops->create; in dev_has_header()
3315 static inline void netif_tx_schedule_all(struct net_device *dev) in netif_tx_schedule_all() argument
3319 for (i = 0; i < dev->num_tx_queues; i++) in netif_tx_schedule_all()
3320 netif_schedule_queue(netdev_get_tx_queue(dev, i)); in netif_tx_schedule_all()
3334 static inline void netif_start_queue(struct net_device *dev) in netif_start_queue() argument
3336 netif_tx_start_queue(netdev_get_tx_queue(dev, 0)); in netif_start_queue()
3339 static inline void netif_tx_start_all_queues(struct net_device *dev) in netif_tx_start_all_queues() argument
3343 for (i = 0; i < dev->num_tx_queues; i++) { in netif_tx_start_all_queues()
3344 struct netdev_queue *txq = netdev_get_tx_queue(dev, i); in netif_tx_start_all_queues()
3358 static inline void netif_wake_queue(struct net_device *dev) in netif_wake_queue() argument
3360 netif_tx_wake_queue(netdev_get_tx_queue(dev, 0)); in netif_wake_queue()
3363 static inline void netif_tx_wake_all_queues(struct net_device *dev) in netif_tx_wake_all_queues() argument
3367 for (i = 0; i < dev->num_tx_queues; i++) { in netif_tx_wake_all_queues()
3368 struct netdev_queue *txq = netdev_get_tx_queue(dev, i); in netif_tx_wake_all_queues()
3392 static inline void netif_stop_queue(struct net_device *dev) in netif_stop_queue() argument
3394 netif_tx_stop_queue(netdev_get_tx_queue(dev, 0)); in netif_stop_queue()
3397 void netif_tx_stop_all_queues(struct net_device *dev);
3410 static inline bool netif_queue_stopped(const struct net_device *dev) in netif_queue_stopped() argument
3412 return netif_tx_queue_stopped(netdev_get_tx_queue(dev, 0)); in netif_queue_stopped()
3558 static inline void netdev_sent_queue(struct net_device *dev, unsigned int bytes) in netdev_sent_queue() argument
3560 netdev_tx_sent_queue(netdev_get_tx_queue(dev, 0), bytes); in netdev_sent_queue()
3563 static inline bool __netdev_sent_queue(struct net_device *dev, in __netdev_sent_queue() argument
3567 return __netdev_tx_sent_queue(netdev_get_tx_queue(dev, 0), bytes, in __netdev_sent_queue()
3614 static inline void netdev_completed_queue(struct net_device *dev, in netdev_completed_queue() argument
3617 netdev_tx_completed_queue(netdev_get_tx_queue(dev, 0), pkts, bytes); in netdev_completed_queue()
3633 static inline void netdev_tx_reset_subqueue(const struct net_device *dev, in netdev_tx_reset_subqueue() argument
3636 netdev_tx_reset_queue(netdev_get_tx_queue(dev, qid)); in netdev_tx_reset_subqueue()
3659 static inline u16 netdev_cap_txqueue(struct net_device *dev, u16 queue_index) in netdev_cap_txqueue() argument
3661 if (unlikely(queue_index >= dev->real_num_tx_queues)) { in netdev_cap_txqueue()
3663 dev->name, queue_index, in netdev_cap_txqueue()
3664 dev->real_num_tx_queues); in netdev_cap_txqueue()
3677 static inline bool netif_running(const struct net_device *dev) in netif_running() argument
3679 return test_bit(__LINK_STATE_START, &dev->state); in netif_running()
3696 static inline void netif_start_subqueue(struct net_device *dev, u16 queue_index) in netif_start_subqueue() argument
3698 struct netdev_queue *txq = netdev_get_tx_queue(dev, queue_index); in netif_start_subqueue()
3710 static inline void netif_stop_subqueue(struct net_device *dev, u16 queue_index) in netif_stop_subqueue() argument
3712 struct netdev_queue *txq = netdev_get_tx_queue(dev, queue_index); in netif_stop_subqueue()
3723 static inline bool __netif_subqueue_stopped(const struct net_device *dev, in __netif_subqueue_stopped() argument
3726 struct netdev_queue *txq = netdev_get_tx_queue(dev, queue_index); in __netif_subqueue_stopped()
3738 static inline bool netif_subqueue_stopped(const struct net_device *dev, in netif_subqueue_stopped() argument
3741 return __netif_subqueue_stopped(dev, skb_get_queue_mapping(skb)); in netif_subqueue_stopped()
3751 static inline void netif_wake_subqueue(struct net_device *dev, u16 queue_index) in netif_wake_subqueue() argument
3753 struct netdev_queue *txq = netdev_get_tx_queue(dev, queue_index); in netif_wake_subqueue()
3759 int netif_set_xps_queue(struct net_device *dev, const struct cpumask *mask,
3761 int __netif_set_xps_queue(struct net_device *dev, const unsigned long *mask,
3848 static inline int netif_set_xps_queue(struct net_device *dev, in netif_set_xps_queue() argument
3855 static inline int __netif_set_xps_queue(struct net_device *dev, in __netif_set_xps_queue() argument
3869 static inline bool netif_is_multiqueue(const struct net_device *dev) in netif_is_multiqueue() argument
3871 return dev->num_tx_queues > 1; in netif_is_multiqueue()
3874 int netif_set_real_num_tx_queues(struct net_device *dev, unsigned int txq);
3877 int netif_set_real_num_rx_queues(struct net_device *dev, unsigned int rxq);
3879 static inline int netif_set_real_num_rx_queues(struct net_device *dev, in netif_set_real_num_rx_queues() argument
3882 dev->real_num_rx_queues = rxqs; in netif_set_real_num_rx_queues()
3886 int netif_set_real_num_queues(struct net_device *dev,
3956 bool netdev_is_rx_handler_busy(struct net_device *dev);
3957 int netdev_rx_handler_register(struct net_device *dev,
3960 void netdev_rx_handler_unregister(struct net_device *dev);
3972 int generic_hwtstamp_get_lower(struct net_device *dev,
3974 int generic_hwtstamp_set_lower(struct net_device *dev,
3979 int __dev_change_flags(struct net_device *dev, unsigned int flags,
3981 int dev_change_flags(struct net_device *dev, unsigned int flags,
3985 int __dev_change_net_namespace(struct net_device *dev, struct net *net,
3988 int dev_change_net_namespace(struct net_device *dev, struct net *net, in dev_change_net_namespace() argument
3991 return __dev_change_net_namespace(dev, net, pat, 0); in dev_change_net_namespace()
3995 int dev_pre_changeaddr_notify(struct net_device *dev, const char *addr,
3997 int dev_set_mac_address(struct net_device *dev, struct sockaddr *sa,
3999 int dev_set_mac_address_user(struct net_device *dev, struct sockaddr *sa,
4002 int dev_get_port_parent_id(struct net_device *dev,
4006 struct sk_buff *validate_xmit_skb_list(struct sk_buff *skb, struct net_device *dev, bool *again);
4007 struct sk_buff *dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev,
4011 u8 dev_xdp_prog_count(struct net_device *dev);
4012 int dev_xdp_propagate(struct net_device *dev, struct netdev_bpf *bpf);
4013 u32 dev_xdp_prog_id(struct net_device *dev, enum bpf_xdp_mode mode);
4015 u32 dev_get_min_mp_channel_count(const struct net_device *dev);
4017 int __dev_forward_skb(struct net_device *dev, struct sk_buff *skb);
4018 int dev_forward_skb(struct net_device *dev, struct sk_buff *skb);
4019 int dev_forward_skb_nomtu(struct net_device *dev, struct sk_buff *skb);
4020 bool is_skb_forwardable(const struct net_device *dev,
4023 static __always_inline bool __is_skb_forwardable(const struct net_device *dev, in __is_skb_forwardable() argument
4030 if (!(dev->flags & IFF_UP)) in __is_skb_forwardable()
4036 len = dev->mtu + dev->hard_header_len + vlan_hdr_len; in __is_skb_forwardable()
4049 void netdev_core_stats_inc(struct net_device *dev, u32 offset);
4052 static inline void dev_core_stats_##FIELD##_inc(struct net_device *dev) \
4054 netdev_core_stats_inc(dev, \
4063 static __always_inline int ____dev_forward_skb(struct net_device *dev, in DEV_CORE_STATS_INC()
4068 unlikely(!__is_skb_forwardable(dev, skb, check_mtu))) { in DEV_CORE_STATS_INC()
4069 dev_core_stats_rx_dropped_inc(dev); in DEV_CORE_STATS_INC()
4074 skb_scrub_packet(skb, !net_eq(dev_net(dev), dev_net(skb->dev))); in DEV_CORE_STATS_INC()
4079 bool dev_nit_active(struct net_device *dev);
4080 void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev);
4082 static inline void __dev_put(struct net_device *dev) in __dev_put() argument
4084 if (dev) { in __dev_put()
4086 this_cpu_dec(*dev->pcpu_refcnt); in __dev_put()
4088 refcount_dec(&dev->dev_refcnt); in __dev_put()
4093 static inline void __dev_hold(struct net_device *dev) in __dev_hold() argument
4095 if (dev) { in __dev_hold()
4097 this_cpu_inc(*dev->pcpu_refcnt); in __dev_hold()
4099 refcount_inc(&dev->dev_refcnt); in __dev_hold()
4104 static inline void __netdev_tracker_alloc(struct net_device *dev, in __netdev_tracker_alloc() argument
4109 ref_tracker_alloc(&dev->refcnt_tracker, tracker, gfp); in __netdev_tracker_alloc()
4116 static inline void netdev_tracker_alloc(struct net_device *dev, in netdev_tracker_alloc() argument
4120 refcount_dec(&dev->refcnt_tracker.no_tracker); in netdev_tracker_alloc()
4121 __netdev_tracker_alloc(dev, tracker, gfp); in netdev_tracker_alloc()
4125 static inline void netdev_tracker_free(struct net_device *dev, in netdev_tracker_free() argument
4129 ref_tracker_free(&dev->refcnt_tracker, tracker); in netdev_tracker_free()
4133 static inline void netdev_hold(struct net_device *dev, in netdev_hold() argument
4136 if (dev) { in netdev_hold()
4137 __dev_hold(dev); in netdev_hold()
4138 __netdev_tracker_alloc(dev, tracker, gfp); in netdev_hold()
4142 static inline void netdev_put(struct net_device *dev, in netdev_put() argument
4145 if (dev) { in netdev_put()
4146 netdev_tracker_free(dev, tracker); in netdev_put()
4147 __dev_put(dev); in netdev_put()
4158 static inline void dev_hold(struct net_device *dev) in dev_hold() argument
4160 netdev_hold(dev, NULL, GFP_ATOMIC); in dev_hold()
4170 static inline void dev_put(struct net_device *dev) in dev_put() argument
4172 netdev_put(dev, NULL); in dev_put()
4200 void linkwatch_fire_event(struct net_device *dev);
4209 void linkwatch_sync_dev(struct net_device *dev);
4217 static inline bool netif_carrier_ok(const struct net_device *dev) in netif_carrier_ok() argument
4219 return !test_bit(__LINK_STATE_NOCARRIER, &dev->state); in netif_carrier_ok()
4222 unsigned long dev_trans_start(struct net_device *dev);
4224 void __netdev_watchdog_up(struct net_device *dev);
4226 void netif_carrier_on(struct net_device *dev);
4227 void netif_carrier_off(struct net_device *dev);
4228 void netif_carrier_event(struct net_device *dev);
4242 static inline void netif_dormant_on(struct net_device *dev) in netif_dormant_on() argument
4244 if (!test_and_set_bit(__LINK_STATE_DORMANT, &dev->state)) in netif_dormant_on()
4245 linkwatch_fire_event(dev); in netif_dormant_on()
4254 static inline void netif_dormant_off(struct net_device *dev) in netif_dormant_off() argument
4256 if (test_and_clear_bit(__LINK_STATE_DORMANT, &dev->state)) in netif_dormant_off()
4257 linkwatch_fire_event(dev); in netif_dormant_off()
4266 static inline bool netif_dormant(const struct net_device *dev) in netif_dormant() argument
4268 return test_bit(__LINK_STATE_DORMANT, &dev->state); in netif_dormant()
4282 static inline void netif_testing_on(struct net_device *dev) in netif_testing_on() argument
4284 if (!test_and_set_bit(__LINK_STATE_TESTING, &dev->state)) in netif_testing_on()
4285 linkwatch_fire_event(dev); in netif_testing_on()
4294 static inline void netif_testing_off(struct net_device *dev) in netif_testing_off() argument
4296 if (test_and_clear_bit(__LINK_STATE_TESTING, &dev->state)) in netif_testing_off()
4297 linkwatch_fire_event(dev); in netif_testing_off()
4306 static inline bool netif_testing(const struct net_device *dev) in netif_testing() argument
4308 return test_bit(__LINK_STATE_TESTING, &dev->state); in netif_testing()
4318 static inline bool netif_oper_up(const struct net_device *dev) in netif_oper_up() argument
4320 unsigned int operstate = READ_ONCE(dev->operstate); in netif_oper_up()
4332 static inline bool netif_device_present(const struct net_device *dev) in netif_device_present() argument
4334 return test_bit(__LINK_STATE_PRESENT, &dev->state); in netif_device_present()
4337 void netif_device_detach(struct net_device *dev);
4339 void netif_device_attach(struct net_device *dev);
4484 static inline void netif_trans_update(struct net_device *dev) in netif_trans_update() argument
4486 struct netdev_queue *txq = netdev_get_tx_queue(dev, 0); in netif_trans_update()
4497 void netif_tx_lock(struct net_device *dev);
4499 static inline void netif_tx_lock_bh(struct net_device *dev) in netif_tx_lock_bh() argument
4502 netif_tx_lock(dev); in netif_tx_lock_bh()
4505 void netif_tx_unlock(struct net_device *dev);
4507 static inline void netif_tx_unlock_bh(struct net_device *dev) in netif_tx_unlock_bh() argument
4509 netif_tx_unlock(dev); in netif_tx_unlock_bh()
4513 #define HARD_TX_LOCK(dev, txq, cpu) { \ argument
4514 if (!(dev)->lltx) { \
4521 #define HARD_TX_TRYLOCK(dev, txq) \ argument
4522 (!(dev)->lltx ? \
4526 #define HARD_TX_UNLOCK(dev, txq) { \ argument
4527 if (!(dev)->lltx) { \
4534 static inline void netif_tx_disable(struct net_device *dev) in netif_tx_disable() argument
4541 spin_lock(&dev->tx_global_lock); in netif_tx_disable()
4542 for (i = 0; i < dev->num_tx_queues; i++) { in netif_tx_disable()
4543 struct netdev_queue *txq = netdev_get_tx_queue(dev, i); in netif_tx_disable()
4549 spin_unlock(&dev->tx_global_lock); in netif_tx_disable()
4553 static inline void netif_addr_lock(struct net_device *dev) in netif_addr_lock() argument
4558 nest_level = dev->nested_level; in netif_addr_lock()
4560 spin_lock_nested(&dev->addr_list_lock, nest_level); in netif_addr_lock()
4563 static inline void netif_addr_lock_bh(struct net_device *dev) in netif_addr_lock_bh() argument
4568 nest_level = dev->nested_level; in netif_addr_lock_bh()
4571 spin_lock_nested(&dev->addr_list_lock, nest_level); in netif_addr_lock_bh()
4574 static inline void netif_addr_unlock(struct net_device *dev) in netif_addr_unlock() argument
4576 spin_unlock(&dev->addr_list_lock); in netif_addr_unlock()
4579 static inline void netif_addr_unlock_bh(struct net_device *dev) in netif_addr_unlock_bh() argument
4581 spin_unlock_bh(&dev->addr_list_lock); in netif_addr_unlock_bh()
4588 #define for_each_dev_addr(dev, ha) \ argument
4589 list_for_each_entry_rcu(ha, &dev->dev_addrs.list, list)
4593 void ether_setup(struct net_device *dev);
4610 int register_netdev(struct net_device *dev);
4611 void unregister_netdev(struct net_device *dev);
4613 int devm_register_netdev(struct device *dev, struct net_device *ndev);
4621 struct net_device *dev,
4626 struct net_device *dev,
4632 struct net_device *dev,
4636 struct net_device *dev,
4642 void dev_addr_mod(struct net_device *dev, unsigned int offset,
4646 __dev_addr_set(struct net_device *dev, const void *addr, size_t len) in __dev_addr_set() argument
4648 dev_addr_mod(dev, 0, addr, len); in __dev_addr_set()
4651 static inline void dev_addr_set(struct net_device *dev, const u8 *addr) in dev_addr_set() argument
4653 __dev_addr_set(dev, addr, dev->addr_len); in dev_addr_set()
4656 int dev_addr_add(struct net_device *dev, const unsigned char *addr,
4658 int dev_addr_del(struct net_device *dev, const unsigned char *addr,
4662 int dev_uc_add(struct net_device *dev, const unsigned char *addr);
4663 int dev_uc_add_excl(struct net_device *dev, const unsigned char *addr);
4664 int dev_uc_del(struct net_device *dev, const unsigned char *addr);
4668 void dev_uc_flush(struct net_device *dev);
4669 void dev_uc_init(struct net_device *dev);
4680 static inline int __dev_uc_sync(struct net_device *dev, in __dev_uc_sync() argument
4686 return __hw_addr_sync_dev(&dev->uc, dev, sync, unsync); in __dev_uc_sync()
4696 static inline void __dev_uc_unsync(struct net_device *dev, in __dev_uc_unsync() argument
4700 __hw_addr_unsync_dev(&dev->uc, dev, unsync); in __dev_uc_unsync()
4704 int dev_mc_add(struct net_device *dev, const unsigned char *addr);
4705 int dev_mc_add_global(struct net_device *dev, const unsigned char *addr);
4706 int dev_mc_add_excl(struct net_device *dev, const unsigned char *addr);
4707 int dev_mc_del(struct net_device *dev, const unsigned char *addr);
4708 int dev_mc_del_global(struct net_device *dev, const unsigned char *addr);
4712 void dev_mc_flush(struct net_device *dev);
4713 void dev_mc_init(struct net_device *dev);
4724 static inline int __dev_mc_sync(struct net_device *dev, in __dev_mc_sync() argument
4730 return __hw_addr_sync_dev(&dev->mc, dev, sync, unsync); in __dev_mc_sync()
4740 static inline void __dev_mc_unsync(struct net_device *dev, in __dev_mc_unsync() argument
4744 __hw_addr_unsync_dev(&dev->mc, dev, unsync); in __dev_mc_unsync()
4748 void dev_set_rx_mode(struct net_device *dev);
4749 int dev_set_promiscuity(struct net_device *dev, int inc);
4750 int dev_set_allmulti(struct net_device *dev, int inc);
4751 void netdev_state_change(struct net_device *dev);
4752 void __netdev_notify_peers(struct net_device *dev);
4753 void netdev_notify_peers(struct net_device *dev);
4754 void netdev_features_change(struct net_device *dev);
4757 struct rtnl_link_stats64 *dev_get_stats(struct net_device *dev,
4763 void dev_get_tstats64(struct net_device *dev, struct rtnl_link_stats64 *s);
4781 bool netdev_has_upper_dev(struct net_device *dev, struct net_device *upper_dev);
4782 struct net_device *netdev_upper_get_next_dev_rcu(struct net_device *dev,
4786 #define netdev_for_each_upper_dev_rcu(dev, updev, iter) \ argument
4787 for (iter = &(dev)->adj_list.upper, \
4788 updev = netdev_upper_get_next_dev_rcu(dev, &(iter)); \
4790 updev = netdev_upper_get_next_dev_rcu(dev, &(iter)))
4792 int netdev_walk_all_upper_dev_rcu(struct net_device *dev,
4797 bool netdev_has_upper_dev_all_rcu(struct net_device *dev,
4800 bool netdev_has_any_upper_dev(struct net_device *dev);
4802 void *netdev_lower_get_next_private(struct net_device *dev,
4804 void *netdev_lower_get_next_private_rcu(struct net_device *dev,
4807 #define netdev_for_each_lower_private(dev, priv, iter) \ argument
4808 for (iter = (dev)->adj_list.lower.next, \
4809 priv = netdev_lower_get_next_private(dev, &(iter)); \
4811 priv = netdev_lower_get_next_private(dev, &(iter)))
4813 #define netdev_for_each_lower_private_rcu(dev, priv, iter) \ argument
4814 for (iter = &(dev)->adj_list.lower, \
4815 priv = netdev_lower_get_next_private_rcu(dev, &(iter)); \
4817 priv = netdev_lower_get_next_private_rcu(dev, &(iter)))
4819 void *netdev_lower_get_next(struct net_device *dev,
4822 #define netdev_for_each_lower_dev(dev, ldev, iter) \ argument
4823 for (iter = (dev)->adj_list.lower.next, \
4824 ldev = netdev_lower_get_next(dev, &(iter)); \
4826 ldev = netdev_lower_get_next(dev, &(iter)))
4828 struct net_device *netdev_next_lower_dev_rcu(struct net_device *dev,
4830 int netdev_walk_all_lower_dev(struct net_device *dev,
4834 int netdev_walk_all_lower_dev_rcu(struct net_device *dev,
4840 void *netdev_lower_get_first_private_rcu(struct net_device *dev);
4841 struct net_device *netdev_master_upper_dev_get(struct net_device *dev);
4842 struct net_device *netdev_master_upper_dev_get_rcu(struct net_device *dev);
4843 int netdev_upper_dev_link(struct net_device *dev, struct net_device *upper_dev,
4845 int netdev_master_upper_dev_link(struct net_device *dev,
4849 void netdev_upper_dev_unlink(struct net_device *dev,
4853 struct net_device *dev,
4857 struct net_device *dev);
4860 struct net_device *dev);
4861 void netdev_adjacent_rename_links(struct net_device *dev, char *oldname);
4862 void *netdev_lower_dev_get_private(struct net_device *dev,
4887 void netdev_bonding_info_change(struct net_device *dev,
4891 void ethtool_notify(struct net_device *dev, unsigned int cmd, const void *data);
4893 static inline void ethtool_notify(struct net_device *dev, unsigned int cmd, in ethtool_notify() argument
4925 void netdev_rx_csum_fault(struct net_device *dev, struct sk_buff *skb);
4927 static inline void netdev_rx_csum_fault(struct net_device *dev, in netdev_rx_csum_fault() argument
4936 static inline ktime_t netdev_get_tstamp(struct net_device *dev, in netdev_get_tstamp() argument
4940 const struct net_device_ops *ops = dev->netdev_ops; in netdev_get_tstamp()
4943 return ops->ndo_get_tstamp(dev, hwtstamps, cycles); in netdev_get_tstamp()
4971 struct sk_buff *skb, struct net_device *dev, in __netdev_start_xmit() argument
4975 return ops->ndo_start_xmit(skb, dev); in __netdev_start_xmit()
4978 static inline netdev_tx_t netdev_start_xmit(struct sk_buff *skb, struct net_device *dev, in netdev_start_xmit() argument
4981 const struct net_device_ops *ops = dev->netdev_ops; in netdev_start_xmit()
4984 rc = __netdev_start_xmit(ops, skb, dev, more); in netdev_start_xmit()
4998 const char *netdev_drivername(const struct net_device *dev);
5014 struct net_device *dev) in netdev_get_wanted_features() argument
5016 return (dev->features & ~dev->hw_features) | dev->wanted_features; in netdev_get_wanted_features()
5031 int __netdev_update_features(struct net_device *dev);
5032 void netdev_update_features(struct net_device *dev);
5033 void netdev_change_features(struct net_device *dev);
5036 struct net_device *dev);
5039 struct net_device *dev,
5086 void netif_set_tso_max_size(struct net_device *dev, unsigned int size);
5087 void netif_set_tso_max_segs(struct net_device *dev, unsigned int segs);
5092 netif_get_gro_max_size(const struct net_device *dev, const struct sk_buff *skb) in netif_get_gro_max_size() argument
5096 READ_ONCE(dev->gro_max_size) : in netif_get_gro_max_size()
5097 READ_ONCE(dev->gro_ipv4_max_size); in netif_get_gro_max_size()
5101 netif_get_gso_max_size(const struct net_device *dev, const struct sk_buff *skb) in netif_get_gso_max_size() argument
5105 READ_ONCE(dev->gso_max_size) : in netif_get_gso_max_size()
5106 READ_ONCE(dev->gso_ipv4_max_size); in netif_get_gso_max_size()
5109 static inline bool netif_is_macsec(const struct net_device *dev) in netif_is_macsec() argument
5111 return dev->priv_flags & IFF_MACSEC; in netif_is_macsec()
5114 static inline bool netif_is_macvlan(const struct net_device *dev) in netif_is_macvlan() argument
5116 return dev->priv_flags & IFF_MACVLAN; in netif_is_macvlan()
5119 static inline bool netif_is_macvlan_port(const struct net_device *dev) in netif_is_macvlan_port() argument
5121 return dev->priv_flags & IFF_MACVLAN_PORT; in netif_is_macvlan_port()
5124 static inline bool netif_is_bond_master(const struct net_device *dev) in netif_is_bond_master() argument
5126 return dev->flags & IFF_MASTER && dev->priv_flags & IFF_BONDING; in netif_is_bond_master()
5129 static inline bool netif_is_bond_slave(const struct net_device *dev) in netif_is_bond_slave() argument
5131 return dev->flags & IFF_SLAVE && dev->priv_flags & IFF_BONDING; in netif_is_bond_slave()
5134 static inline bool netif_supports_nofcs(struct net_device *dev) in netif_supports_nofcs() argument
5136 return dev->priv_flags & IFF_SUPP_NOFCS; in netif_supports_nofcs()
5139 static inline bool netif_has_l3_rx_handler(const struct net_device *dev) in netif_has_l3_rx_handler() argument
5141 return dev->priv_flags & IFF_L3MDEV_RX_HANDLER; in netif_has_l3_rx_handler()
5144 static inline bool netif_is_l3_master(const struct net_device *dev) in netif_is_l3_master() argument
5146 return dev->priv_flags & IFF_L3MDEV_MASTER; in netif_is_l3_master()
5149 static inline bool netif_is_l3_slave(const struct net_device *dev) in netif_is_l3_slave() argument
5151 return dev->priv_flags & IFF_L3MDEV_SLAVE; in netif_is_l3_slave()
5154 static inline int dev_sdif(const struct net_device *dev) in dev_sdif() argument
5157 if (netif_is_l3_slave(dev)) in dev_sdif()
5158 return dev->ifindex; in dev_sdif()
5163 static inline bool netif_is_bridge_master(const struct net_device *dev) in netif_is_bridge_master() argument
5165 return dev->priv_flags & IFF_EBRIDGE; in netif_is_bridge_master()
5168 static inline bool netif_is_bridge_port(const struct net_device *dev) in netif_is_bridge_port() argument
5170 return dev->priv_flags & IFF_BRIDGE_PORT; in netif_is_bridge_port()
5173 static inline bool netif_is_ovs_master(const struct net_device *dev) in netif_is_ovs_master() argument
5175 return dev->priv_flags & IFF_OPENVSWITCH; in netif_is_ovs_master()
5178 static inline bool netif_is_ovs_port(const struct net_device *dev) in netif_is_ovs_port() argument
5180 return dev->priv_flags & IFF_OVS_DATAPATH; in netif_is_ovs_port()
5183 static inline bool netif_is_any_bridge_master(const struct net_device *dev) in netif_is_any_bridge_master() argument
5185 return netif_is_bridge_master(dev) || netif_is_ovs_master(dev); in netif_is_any_bridge_master()
5188 static inline bool netif_is_any_bridge_port(const struct net_device *dev) in netif_is_any_bridge_port() argument
5190 return netif_is_bridge_port(dev) || netif_is_ovs_port(dev); in netif_is_any_bridge_port()
5193 static inline bool netif_is_team_master(const struct net_device *dev) in netif_is_team_master() argument
5195 return dev->priv_flags & IFF_TEAM; in netif_is_team_master()
5198 static inline bool netif_is_team_port(const struct net_device *dev) in netif_is_team_port() argument
5200 return dev->priv_flags & IFF_TEAM_PORT; in netif_is_team_port()
5203 static inline bool netif_is_lag_master(const struct net_device *dev) in netif_is_lag_master() argument
5205 return netif_is_bond_master(dev) || netif_is_team_master(dev); in netif_is_lag_master()
5208 static inline bool netif_is_lag_port(const struct net_device *dev) in netif_is_lag_port() argument
5210 return netif_is_bond_slave(dev) || netif_is_team_port(dev); in netif_is_lag_port()
5213 static inline bool netif_is_rxfh_configured(const struct net_device *dev) in netif_is_rxfh_configured() argument
5215 return dev->priv_flags & IFF_RXFH_CONFIGURED; in netif_is_rxfh_configured()
5218 static inline bool netif_is_failover(const struct net_device *dev) in netif_is_failover() argument
5220 return dev->priv_flags & IFF_FAILOVER; in netif_is_failover()
5223 static inline bool netif_is_failover_slave(const struct net_device *dev) in netif_is_failover_slave() argument
5225 return dev->priv_flags & IFF_FAILOVER_SLAVE; in netif_is_failover_slave()
5229 static inline void netif_keep_dst(struct net_device *dev) in netif_keep_dst() argument
5231 dev->priv_flags &= ~(IFF_XMIT_DST_RELEASE | IFF_XMIT_DST_RELEASE_PERM); in netif_keep_dst()
5235 static inline bool netif_reduces_vlan_mtu(struct net_device *dev) in netif_reduces_vlan_mtu() argument
5238 return netif_is_macsec(dev); in netif_reduces_vlan_mtu()
5247 static inline const char *netdev_name(const struct net_device *dev) in netdev_name() argument
5249 if (!dev->name[0] || strchr(dev->name, '%')) in netdev_name()
5251 return dev->name; in netdev_name()
5254 static inline const char *netdev_reg_state(const struct net_device *dev) in netdev_reg_state() argument
5256 u8 reg_state = READ_ONCE(dev->reg_state); in netdev_reg_state()
5267 WARN_ONCE(1, "%s: unknown reg_state %d\n", dev->name, reg_state); in netdev_reg_state()
5279 #define netdev_WARN(dev, format, args...) \ argument
5280 WARN(1, "netdevice: %s%s: " format, netdev_name(dev), \
5281 netdev_reg_state(dev), ##args)
5283 #define netdev_WARN_ONCE(dev, format, args...) \ argument
5284 WARN_ONCE(1, "netdevice: %s%s: " format, netdev_name(dev), \
5285 netdev_reg_state(dev), ##args)