Re: [PATCH net-next 2/5] r8152: replace array with linking list for rx information

2019-08-07 Thread Jakub Kicinski
On Wed, 7 Aug 2019 04:34:24 +, Hayes Wang wrote: > Jakub Kicinski [mailto:jakub.kicin...@netronome.com] > > > static int rtl_stop_rx(struct r8152 *tp) > > > { > > > - int i; > > > + struct list_head *cursor, *next, tmp_list; > > > + unsigned long flags; > > > + > > > + INIT_LIST_HEAD(&tmp_lis

RE: [PATCH net-next 2/5] r8152: replace array with linking list for rx information

2019-08-06 Thread Hayes Wang
Jakub Kicinski [mailto:jakub.kicin...@netronome.com] [...] > > static int rtl_stop_rx(struct r8152 *tp) > > { > > - int i; > > + struct list_head *cursor, *next, tmp_list; > > + unsigned long flags; > > + > > + INIT_LIST_HEAD(&tmp_list); > > > > - for (i = 0; i < RTL8152_MAX_RX; i++) >

Re: [PATCH net-next 2/5] r8152: replace array with linking list for rx information

2019-08-06 Thread Jakub Kicinski
On Tue, 6 Aug 2019 12:53:42 -0700, Jakub Kicinski wrote: > > @@ -744,6 +745,8 @@ struct r8152 { > > void (*autosuspend_en)(struct r8152 *tp, bool enable); > > } rtl_ops; > > > > + atomic_t rx_count; > > I wonder what the advantage of rx_count being atomic is, perhpas it > cou

Re: [PATCH net-next 2/5] r8152: replace array with linking list for rx information

2019-08-06 Thread Jakub Kicinski
On Tue, 6 Aug 2019 19:18:01 +0800, Hayes Wang wrote: > The original method uses an array to store the rx information. The > new one uses a list to link each rx structure. Then, it is possible > to increase/decrease the number of rx structure dynamically. > > Signed-off-by: Hayes Wang > --- > dri