lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20100906.132223.48506151.davem@davemloft.net>
Date:	Mon, 06 Sep 2010 13:22:23 -0700 (PDT)
From:	David Miller <davem@...emloft.net>
To:	liang.li@...driver.com
Cc:	leoli@...escale.com, avorontsov@...mvista.com,
	netdev@...r.kernel.org, linuxppc-dev@...abs.org
Subject: Re: [v2 PATCH] ucc_geth: fix ethtool set ring param bug

From: Liang Li <liang.li@...driver.com>
Date: Fri,  3 Sep 2010 00:02:44 +0800

> +		printk(KERN_INFO "Stopping interface %s.\n", netdev->name);
 ...
> +		printk(KERN_INFO "Reactivating interface %s.\n", netdev->name);

Please get rid of these log messages.

Also, this isn't the way to implement this.

Abstract out the one and only operation that can fail when you change
the ring size, which is the memory allocations, into seperate code.

Allocate the newly sized rings first, and if that fails abort the
ring size change attempt.  This will let the device continue to
function and operate properly even if the ring resizing fails.

Then stop the RX/TX DMA, switch the ring pointers and configuration
inside of the device, restart RX/TX DMA, and finally free up the
old ring memory.

I know why you want to use *_close() and *_open(), it requires less
coding and work on your part.  But this is why the error handling
behavior is difficult and what happens on failure (device goes down
and becomes inoperative) is extremely unpleasant for the user.

The user should be able to make this kind of change over an SSH
shell that uses the interface itself, and not expect to lose
connectivity completely just because the ring allocation fails.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ