File tree Expand file tree Collapse file tree 4 files changed +11
-29
lines changed Expand file tree Collapse file tree 4 files changed +11
-29
lines changed Original file line number Diff line number Diff line change @@ -3238,7 +3238,6 @@ static inline void unregister_netdevice(struct net_device *dev)
3238
3238
3239
3239
int netdev_refcnt_read (const struct net_device * dev );
3240
3240
void free_netdev (struct net_device * dev );
3241
- void init_dummy_netdev (struct net_device * dev );
3242
3241
3243
3242
struct net_device * netdev_get_xmit_slave (struct net_device * dev ,
3244
3243
struct sk_buff * skb ,
Original file line number Diff line number Diff line change @@ -10762,28 +10762,6 @@ static void init_dummy_netdev_core(struct net_device *dev)
10762
10762
*/
10763
10763
}
10764
10764
10765
- /**
10766
- * init_dummy_netdev - init a dummy network device for NAPI
10767
- * @dev: device to init
10768
- *
10769
- * This takes a network device structure and initializes the minimum
10770
- * amount of fields so it can be used to schedule NAPI polls without
10771
- * registering a full blown interface. This is to be used by drivers
10772
- * that need to tie several hardware interfaces to a single NAPI
10773
- * poll scheduler due to HW limitations.
10774
- */
10775
- void init_dummy_netdev (struct net_device * dev )
10776
- {
10777
- /* Clear everything. Note we don't initialize spinlocks
10778
- * as they aren't supposed to be taken by any of the
10779
- * NAPI code and this dummy netdev is supposed to be
10780
- * only ever used for NAPI polls
10781
- */
10782
- memset (dev , 0 , sizeof (struct net_device ));
10783
- init_dummy_netdev_core (dev );
10784
- }
10785
- EXPORT_SYMBOL_GPL (init_dummy_netdev );
10786
-
10787
10765
/**
10788
10766
* register_netdev - register a network device
10789
10767
* @dev: device to register
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ static void __mptcp_destroy_sock(struct sock *sk);
47
47
static void mptcp_check_send_data_fin (struct sock * sk );
48
48
49
49
DEFINE_PER_CPU (struct mptcp_delegated_action , mptcp_delegated_actions );
50
- static struct net_device mptcp_napi_dev ;
50
+ static struct net_device * mptcp_napi_dev ;
51
51
52
52
/* Returns end sequence number of the receiver's advertised window */
53
53
static u64 mptcp_wnd_end (const struct mptcp_sock * msk )
@@ -4147,11 +4147,13 @@ void __init mptcp_proto_init(void)
4147
4147
if (percpu_counter_init (& mptcp_sockets_allocated , 0 , GFP_KERNEL ))
4148
4148
panic ("Failed to allocate MPTCP pcpu counter\n" );
4149
4149
4150
- init_dummy_netdev (& mptcp_napi_dev );
4150
+ mptcp_napi_dev = alloc_netdev_dummy (0 );
4151
+ if (!mptcp_napi_dev )
4152
+ panic ("Failed to allocate MPTCP dummy netdev\n" );
4151
4153
for_each_possible_cpu (cpu ) {
4152
4154
delegated = per_cpu_ptr (& mptcp_delegated_actions , cpu );
4153
4155
INIT_LIST_HEAD (& delegated -> head );
4154
- netif_napi_add_tx (& mptcp_napi_dev , & delegated -> napi ,
4156
+ netif_napi_add_tx (mptcp_napi_dev , & delegated -> napi ,
4155
4157
mptcp_napi_poll );
4156
4158
napi_enable (& delegated -> napi );
4157
4159
}
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ static DEFINE_SPINLOCK(xfrm_input_afinfo_lock);
48
48
static struct xfrm_input_afinfo const __rcu * xfrm_input_afinfo [2 ][AF_INET6 + 1 ];
49
49
50
50
static struct gro_cells gro_cells ;
51
- static struct net_device xfrm_napi_dev ;
51
+ static struct net_device * xfrm_napi_dev ;
52
52
53
53
static DEFINE_PER_CPU (struct xfrm_trans_tasklet , xfrm_trans_tasklet ) ;
54
54
@@ -825,8 +825,11 @@ void __init xfrm_input_init(void)
825
825
int err ;
826
826
int i ;
827
827
828
- init_dummy_netdev (& xfrm_napi_dev );
829
- err = gro_cells_init (& gro_cells , & xfrm_napi_dev );
828
+ xfrm_napi_dev = alloc_netdev_dummy (0 );
829
+ if (!xfrm_napi_dev )
830
+ panic ("Failed to allocate XFRM dummy netdev\n" );
831
+
832
+ err = gro_cells_init (& gro_cells , xfrm_napi_dev );
830
833
if (err )
831
834
gro_cells .cells = NULL ;
832
835
You can’t perform that action at this time.
0 commit comments