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] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 16 Sep 2011 19:50:28 -0700
From:	Joe Perches <joe@...ches.com>
To:	Jeff Kirsher <jeffrey.t.kirsher@...el.com>
Cc:	davem@...emloft.net,
	Michał Mirosław <mirq-linux@...e.qmqm.pl>,
	netdev@...r.kernel.org, gospo@...hat.com
Subject: Re: [net-next 01/11] ixgb: convert to ndo_fix_features

On Fri, 2011-09-16 at 19:15 -0700, Jeff Kirsher wrote:
> Private rx_csum flags are now duplicate of netdev->features & NETIF_F_RXCSUM.
> Removing this needs deeper surgery.
> diff --git a/drivers/net/ethernet/intel/ixgb/ixgb_main.c b/drivers/net/ethernet/intel/ixgb/ixgb_main.c
[]
> @@ -439,12 +462,14 @@ ixgb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
>  	if (err)
>  		goto err_sw_init;
>  
> -	netdev->features = NETIF_F_SG |
> -			   NETIF_F_HW_CSUM |
> +	netdev->hw_features = NETIF_F_SG |
> +			   NETIF_F_TSO |
> +			   NETIF_F_HW_CSUM;
> +	netdev->features = netdev->hw_features |
>  			   NETIF_F_HW_VLAN_TX |
>  			   NETIF_F_HW_VLAN_RX |
>  			   NETIF_F_HW_VLAN_FILTER;
> -	netdev->features |= NETIF_F_TSO;
> +	netdev->hw_features |= NETIF_F_RXCSUM;

Is there any real reason to do this?
It looks overly complicated for no benefit.

Why not just use something like:

	netdev->hw_features = foo;
	netdev->features = bar;

or maybe use #defines like:

#define FEATURES_DEFAULT (NETIF_F_NETIF_F_SG | NETIF_F_TSO | NETIF_F_HW_CSUM)
#define FEATURES_HW_VLAN (NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_FILTER)

and
	netdev->features = FEATURES_DEFAULT | FEATURES_HW_VLAN;
	netdev->hw_features = FEATURES_DEFAULT | NETIF_F_RXCSUM;


--
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