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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <228e1254af247a66ebbae649f5a1385b8da64597.camel@mellanox.com>
Date:   Wed, 24 Jul 2019 21:24:44 +0000
From:   Saeed Mahameed <saeedm@...lanox.com>
To:     "nic_swsd@...ltek.com" <nic_swsd@...ltek.com>,
        "hkallweit1@...il.com" <hkallweit1@...il.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 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 ..

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ