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: <bbc963fe-6fcb-1802-aae8-a45aa41ee510@gmail.com>
Date:   Wed, 24 Jul 2019 23:36:05 +0200
From:   Heiner Kallweit <hkallweit1@...il.com>
To:     Saeed Mahameed <saeedm@...lanox.com>,
        "nic_swsd@...ltek.com" <nic_swsd@...ltek.com>,
        "davem@...emloft.net" <davem@...emloft.net>
Cc:     "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [PATCH net-next] r8169: improve rtl_set_rx_mode

On 24.07.2019 23:24, Saeed Mahameed wrote:
> On Wed, 2019-07-24 at 23:04 +0200, Heiner Kallweit wrote:
>> This patch improves and simplifies rtl_set_rx_mode a little.
>> No functional change intended.
>>
>> Signed-off-by: Heiner Kallweit <hkallweit1@...il.com>
>> ---
>>  drivers/net/ethernet/realtek/r8169_main.c | 52 ++++++++++-----------
>> --
>>  1 file changed, 22 insertions(+), 30 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/realtek/r8169_main.c
>> b/drivers/net/ethernet/realtek/r8169_main.c
>> index 9c743d2fc..c39d3a77c 100644
>> --- a/drivers/net/ethernet/realtek/r8169_main.c
>> +++ b/drivers/net/ethernet/realtek/r8169_main.c
>> @@ -61,7 +61,7 @@
>>  
>>  /* Maximum number of multicast addresses to filter (vs. Rx-all-
>> multicast).
>>     The RTL chips use a 64 element hash table based on the Ethernet
>> CRC. */
>> -static const int multicast_filter_limit = 32;
>> +#define	MC_FILTER_LIMIT	32
>>  
>>  #define TX_DMA_BURST	7	/* Maximum PCI burst, '7' is unlimited */
>>  #define InterFrameGap	0x03	/* 3 means InterFrameGap =
>> the shortest one */
>> @@ -4147,53 +4147,45 @@ static void rtl8169_set_magic_reg(struct
>> rtl8169_private *tp, unsigned mac_versi
>>  static void rtl_set_rx_mode(struct net_device *dev)
>>  {
>>  	struct rtl8169_private *tp = netdev_priv(dev);
>> -	u32 mc_filter[2];	/* Multicast hash filter */
>> -	int rx_mode;
>> -	u32 tmp = 0;
>> +	/* Multicast hash filter */
>> +	u32 mc_filter[2] = { 0xffffffff, 0xffffffff };
>> +	u32 rx_mode = AcceptBroadcast | AcceptMyPhys | AcceptMulticast;
>> +	u32 tmp;
>>  
> 
> While you are here, maybe improve the declaration order with a reversed
> xmas tree ..
> 
Indeed .. Thanks.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ