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]
Message-ID: <262CB373A6D1F14F9B81E82F74F77D5A4DAE09@avmb2.qlogic.org>
Date:	Wed, 26 Jun 2013 23:43:14 +0000
From:	Shahed Shaikh <shahed.shaikh@...gic.com>
To:	David Laight <David.Laight@...LAB.COM>,
	Jitendra Kalsaria <jitendra.kalsaria@...gic.com>,
	David Miller <davem@...emloft.net>
CC:	netdev <netdev@...r.kernel.org>,
	Sony Chacko <sony.chacko@...gic.com>,
	Dept-NX Linux NIC Driver 
	<Dept_NX_Linux_NIC_Driver@...gic.com>
Subject: RE: [PATCH net-next 4/8] qlcnic: Add support for PEX DMA method to
 read memory section of adapter dump

> -----Original Message-----
> From: David Laight [mailto:David.Laight@...LAB.COM]
> Sent: Monday, June 24, 2013 1:56 AM
> To: Jitendra Kalsaria; David Miller
> Cc: netdev; Sony Chacko; Shahed Shaikh; Dept-NX Linux NIC Driver
> Subject: RE: [PATCH net-next 4/8] qlcnic: Add support for PEX DMA method
> to read memory section of adapter dump
> 
> > From: Shahed Shaikh <shahed.shaikh@...gic.com>
> >
> > This patch adds support to read memory section of adapter dump using
> > PEX DMA method. This method significantly improves total adapter dump
> > collection time.
> 
> Which DMA engine is this using?
> My first thought was that it was the one in the CSB bridge (which ought to
> have a shared interface), but the structures don't seem to match the code I
> have for that.
> 

It's not the one in the CSB bridge.

> ...
> > +struct qlcnic_pex_dma_descriptor {
> > +	u32	read_data_size;
> > +	u32	dma_desc_cmd;
> > +	u32	src_addr_low;
> > +	u32	src_addr_high;
> > +	u32	dma_bus_addr_low;
> > +	u32	dma_bus_addr_high;
> > +	u32	rsvd[6];
> > +} __packed;
> 
> Why __packed??
> Why are the structures following also marked __packed.
> 

 No need of __packed. Will remove in follow up patch.

> ...
> > +	/* Wait for DMA to complete */
> > +	temp_addr = dma_base_addr + QLC_DMA_CMD_STATUS_CTRL;
> > +	for (i = 0; i < 400; i++) {
> > +		dma_sts = qlcnic_ind_rd(adapter, temp_addr);
> > +
> > +		if (dma_sts & BIT_1)
> > +			usleep_range(250, 500);
> > +		else
> > +			break;
> > +	}
> 
> Do these DMA actually take long enough to need to sleep for completion?
> I'd have thought that they'd normally finish almost immediately.
> Sleeping might be reasonable as a 'last hope' check.
> 

We need to call sleep to cover worst case scenarios and we have encountered issues without sleep.
In the follow up patch we will be using usleep_range(50, 100).

> I'd also consider putting the 'wait for complete' code into a separate function
> - allowing overlapped operations.
> 

Sure. I will create a separate function.

> ...
> > +
> > +	if ((tmpl_hdr->version & 0xffffff) >= 0x20001)
> > +		ahw->fw_dump.use_pex_dma = true;
> > +	else
> > +		ahw->fw_dump.use_pex_dma = false;
> 
> You know what's wrong with the above....

Yes. Got it.  Masking is not done properly. It should be
if ((tmpl_hdr->version & 0xfffff) >= 0x20001)

Thanks for review comments.

-Shahed
> 
> 	David


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