RE: [PATCH net-next 4/5] r8152: support skb_add_rx_frag

From: Hayes Wang
Date: Wed Aug 07 2019 - 00:34:34 EST


Jakub Kicinski [mailto:jakub.kicinski@xxxxxxxxxxxxx]
> Sent: Wednesday, August 07, 2019 6:08 AM
[...]
> > #define RTL8152_REQT_READ 0xc0
> > @@ -720,7 +723,7 @@ struct r8152 {
> > struct net_device *netdev;
> > struct urb *intr_urb;
> > struct tx_agg tx_info[RTL8152_MAX_TX];
> > - struct list_head rx_info;
> > + struct list_head rx_info, rx_used;
>
> I don't see where entries on the rx_used list get freed when driver is
> unloaded, could you explain how that's taken care of?

When the driver is unloaded, all rx_agg would be freed from
info_list list.

The info_list includes all rx_agg buffers which may be idle
or be busy. The rx_done and rx_use are used to determine
the status of rx_agg buffer included in info_list.

info_list: the rx_agg buffer would be inserted in this list
when it is allocated.
rx_done: the rx_agg buffer is ready (contains rx data). Or
it needs to be resubmitted.
rx_use: the rx_agg buffer is busy and couldn't be submitted
yet.


Best Regards,
Hayes