Re: [PATCH net-next v6 1/5] net: hdlc_fr: Simpify fr_rx by using "goto rx_drop" to drop frames

2020-10-31 Thread Xie He
On Sat, Oct 31, 2020 at 12:48 PM Willem de Bruijn wrote: > > Returning code in branches vs an error jump label seems more of a > personal preference, and to me does not pass the benefit/cost threshold. This patch is necessary for the 2nd and 5th patch in this series, because the 2nd and 5th

Re: [PATCH net-next v6 1/5] net: hdlc_fr: Simpify fr_rx by using "goto rx_drop" to drop frames

2020-10-31 Thread Jakub Kicinski
On Sat, 31 Oct 2020 15:47:28 -0400 Willem de Bruijn wrote: > On Sat, Oct 31, 2020 at 12:02 PM Xie He wrote: > > On Sat, Oct 31, 2020 at 8:18 AM Xie He wrote: > > > > Especially without that, I'm not sure this and the follow-on patch add > > > > much value. Minor code cleanups complicate

Re: [PATCH net-next v6 1/5] net: hdlc_fr: Simpify fr_rx by using "goto rx_drop" to drop frames

2020-10-31 Thread Willem de Bruijn
On Sat, Oct 31, 2020 at 12:02 PM Xie He wrote: > > On Sat, Oct 31, 2020 at 8:18 AM Xie He wrote: > > > > > Especially without that, I'm not sure this and the follow-on patch add > > > much value. Minor code cleanups complicate backports of fixes. > > > > To me this is necessary, because I feel

Re: [PATCH net-next v6 1/5] net: hdlc_fr: Simpify fr_rx by using "goto rx_drop" to drop frames

2020-10-31 Thread Xie He
On Sat, Oct 31, 2020 at 8:18 AM Xie He wrote: > > > Especially without that, I'm not sure this and the follow-on patch add > > much value. Minor code cleanups complicate backports of fixes. > > To me this is necessary, because I feel hard to do any development on > un-cleaned-up code. I really

Re: [PATCH net-next v6 1/5] net: hdlc_fr: Simpify fr_rx by using "goto rx_drop" to drop frames

2020-10-31 Thread Xie He
On Sat, Oct 31, 2020 at 7:33 AM Willem de Bruijn wrote: > > > - rx_error: > > +rx_error: > > frad->stats.rx_errors++; /* Mark error */ > > +rx_drop: > > dev_kfree_skb_any(skb); > > return NET_RX_DROP; > > I meant that I don't think errors should be double counted in

Re: [PATCH net-next v6 1/5] net: hdlc_fr: Simpify fr_rx by using "goto rx_drop" to drop frames

2020-10-31 Thread Willem de Bruijn
On Fri, Oct 30, 2020 at 8:50 PM Xie He wrote: > > When the fr_rx function drops a received frame (because the protocol type > is not supported, or because the PVC virtual device that corresponds to > the DLCI number and the protocol type doesn't exist), the function frees > the skb and returns. >

[PATCH net-next v6 1/5] net: hdlc_fr: Simpify fr_rx by using "goto rx_drop" to drop frames

2020-10-30 Thread Xie He
When the fr_rx function drops a received frame (because the protocol type is not supported, or because the PVC virtual device that corresponds to the DLCI number and the protocol type doesn't exist), the function frees the skb and returns. The code for freeing the skb and returning is repeated