Re: [PATCH net-next v4 1/5] net: hdlc_fr: Simpify fr_rx by using "goto rx_drop" to drop frames
From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Date: 2020-10-30 16:35:08
Also in:
lkml
From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Date: 2020-10-30 16:35:08
Also in:
lkml
On Thu, Oct 29, 2020 at 10:31 PM Xie He [off-list ref] wrote:
1. 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 several times, this patch uses "goto rx_drop" to replace them so that the code looks cleaner. 2. Add code to increase the stats.rx_dropped count whenever we drop a frame. Increase the stats.rx_dropped count both after "goto rx_drop" and after "goto rx_error" because I think we should increase this value whenever an skb is dropped.
In general we try to avoid changing counter behavior like that, as existing users may depend on current behavior, e.g., in dashboards or automated monitoring. I don't know how realistic that is in this specific case, no strong objections. Use good judgment.