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: <20080714194228.GU19302@solarflare.com>
Date:	Mon, 14 Jul 2008 20:42:30 +0100
From:	Ben Hutchings <bhutchings@...arflare.com>
To:	Yevgeny Petrilin <yevgenyp@...lanox.co.il>
Cc:	jeff@...zik.org, netdev@...r.kernel.org,
	Liran Liss <liranl@...lanox.co.il>, tziporet@...lanox.co.il,
	Roland Dreier <rdreier@...co.com>
Subject: Re: [PATCH RFC 03/10] mlx4_en: net_device implementation

Yevgeny Petrilin wrote:
[...]
> +static void mlx4_en_restart(struct work_struct *work)
> +{
> +	struct mlx4_en_priv *priv = container_of(work, struct mlx4_en_priv,
> +						 watchdog_task);
> +	struct mlx4_en_dev *mdev = priv->mdev;
> +	struct net_device *dev = priv->dev;
> +
> +	mlx4_dbg(mdev, "Watchdog task called for port %d\n", priv->port);
> +	mlx4_en_stop_port(dev);
> +	if (mlx4_en_start_port(dev))
> +	    mlx4_err(mdev, "Failed restarting port %d\n", priv->port);

The indentation is slightly off here.

> +}
> +
> +
> +int mlx4_en_open(struct net_device *dev)
> +{
> +	struct mlx4_en_priv *priv = netdev_priv(dev);
> +	struct mlx4_en_dev *mdev = priv->mdev;
> +	int i;
> +	int err = 0;
> +
> +	mlx4_dbg(mdev, "Open called for port:%d\n", priv->port);
> +
> +	down(&mdev->state_sem);

This is already under RTNL; why do you need your own semaphore?
(And why are you using semaphores, not mutexes?)

[...]
> +int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port,
> +			struct mlx4_en_port_profile *prof)
> +{
[...]
> +#ifdef NETIF_F_TSO
> +	dev->features |= NETIF_F_TSO;
> +#endif
> +#ifdef NETIF_F_TSO6
> +	dev->features |= NETIF_F_TSO6;
> +#endif
[...]

These ifdef's are unneeded; the flags are always defined.

Ben.

-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
--
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