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]
Date:	Sun, 27 Oct 2013 14:22:07 +0000
From:	Sathya Perla <Sathya.Perla@...lex.Com>
To:	Gavin Shan <shangw@...ux.vnet.ibm.com>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: RE: [PATCH 1/2] net/benet: Identify interface type in advance

> -----Original Message-----
> From: Gavin Shan [mailto:shangw@...ux.vnet.ibm.com]
> 
> Function be_map_pci_bars() is being called in be_ctrl_init(). Since
> be_ctrl_init() has fetched the value of PCI config register 0x58,
> we needn't access the same register in be_map_pci_bars() again to
> incur unnecessary PCI config access.
> 
> Signed-off-by: Gavin Shan <shangw@...ux.vnet.ibm.com>
> ---
>  drivers/net/ethernet/emulex/benet/be_main.c |    9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/ethernet/emulex/benet/be_main.c
> b/drivers/net/ethernet/emulex/benet/be_main.c
> index 2c38cc4..1a799d2 100644
> --- a/drivers/net/ethernet/emulex/benet/be_main.c
> +++ b/drivers/net/ethernet/emulex/benet/be_main.c
> @@ -3960,11 +3960,6 @@ static int be_roce_map_pci_bars(struct be_adapter *adapter)
>  static int be_map_pci_bars(struct be_adapter *adapter)
>  {
>  	u8 __iomem *addr;
> -	u32 sli_intf;
> -
> -	pci_read_config_dword(adapter->pdev, SLI_INTF_REG_OFFSET, &sli_intf);
> -	adapter->if_type = (sli_intf & SLI_INTF_IF_TYPE_MASK) >>
> -				SLI_INTF_IF_TYPE_SHIFT;
> 
>  	if (BEx_chip(adapter) && be_physfn(adapter)) {
>  		adapter->csr = pci_iomap(adapter->pdev, 2, 0);
> @@ -4011,7 +4006,9 @@ static int be_ctrl_init(struct be_adapter *adapter)
> 
>  	pci_read_config_dword(adapter->pdev, SLI_INTF_REG_OFFSET, &sli_intf);
>  	adapter->sli_family = (sli_intf & SLI_INTF_FAMILY_MASK) >>
> -				 SLI_INTF_FAMILY_SHIFT;
> +				SLI_INTF_FAMILY_SHIFT;
> +	adapter->if_type = (sli_intf & SLI_INTF_IF_TYPE_MASK) >>
> +				SLI_INTF_IF_TYPE_SHIFT;

Gavin, adapter->if_type is not being used anywhere in the driver.
We could just get rid of it.

>  	adapter->virtfn = (sli_intf & SLI_INTF_FT_MASK) ? 1 : 0;
> 
>  	status = be_map_pci_bars(adapter);
> --
> 1.7.9.5

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