mbox series

[net-next,v2,0/2] lib8390: Remove custom padding solution

Message ID 20201118165107.12419-1-W_Armin@gmx.de
Headers show
Series lib8390: Remove custom padding solution | expand

Message

Armin Wolf Nov. 18, 2020, 4:51 p.m. UTC
When padding undersized frames, lib8390.c utilizes a stack scratch area
plus memset/memcpy. In doing so, it is overwriting content already
zeroed with memset, which seems not optimal even when commented as
being more efficient. Using eth_skb_pad() allows us to remove
memset/memcpy and the stack scratch area altogether.

v2 changes:
- split cleanup of variables in seperate patch
- revise commit description


Armin Wolf (2):
  lib8390: Use eth_skb_pad()
  lib8390: Cleanup variables

 drivers/net/ethernet/8390/lib8390.c | 25 +++++++++++--------------
 1 file changed, 11 insertions(+), 14 deletions(-)

--
2.20.1

Comments

Jakub Kicinski Nov. 20, 2020, 8:02 p.m. UTC | #1
On Wed, 18 Nov 2020 17:51:07 +0100 Armin Wolf wrote:
>  	unsigned long e8390_base = dev->base_addr;

>  	struct ei_device *ei_local = netdev_priv(dev);

> -	int send_length, output_page;

> +	int output_page;

>  	unsigned long flags;


The last two lines should be swapped to follow the reverse xmas tree
ordering of variables.

More importantly this driver is marked as:

S:	Orphan / Obsolete

in MAINTAINERS. Are you actually using hardware which needs this code,
or are those changes purely based on code inspection?

You should either change the state of the driver in MAINTAINERS, or find
another driver / part of the kernel to refactor.