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>] [day] [month] [year] [list]
Message-ID: <8A71B368A89016469F72CD08050AD33401359B6C@maui.asicdesigners.com>
Date:	Fri, 26 Feb 2010 17:42:16 -0800
From:	"Dimitrios Michailidis" <dm@...lsio.com>
To:	"Stephen Hemminger" <shemminger@...tta.com>
Cc:	<netdev@...r.kernel.org>
Subject: RE: [PATCH 4/7] cxgb4: Add packet queues and packet DMA code



> -----Original Message-----
> From: Stephen Hemminger [mailto:shemminger@...tta.com]
> Sent: Friday, February 26, 2010 5:31 PM
> To: Dimitrios Michailidis
> Cc: netdev@...r.kernel.org
> Subject: Re: [PATCH 4/7] cxgb4: Add packet queues and packet DMA code
> 
> On Fri, 26 Feb 2010 16:52:10 -0800
> "Dimitrios Michailidis" <dm@...lsio.com> wrote:
> 
> >
> >
> > > -----Original Message-----
> > > From: netdev-owner@...r.kernel.org
> > [mailto:netdev-owner@...r.kernel.org]
> > > On Behalf Of Stephen Hemminger
> > > Sent: Friday, February 26, 2010 4:16 PM
> > > To: Dimitrios Michailidis
> > > Cc: netdev@...r.kernel.org
> > > Subject: Re: [PATCH 4/7] cxgb4: Add packet queues and packet DMA
code
> > >
> > > On Fri, 26 Feb 2010 16:10:07 -0800
> > > "Dimitrios Michailidis" <dm@...lsio.com> wrote:
> > >
> > > >
> > > >
> > > > > -----Original Message-----
> > > > > From: Stephen Hemminger [mailto:shemminger@...tta.com]
> > > > > Sent: Friday, February 26, 2010 3:58 PM
> > > > > To: Dimitrios Michailidis
> > > > > Cc: netdev@...r.kernel.org
> > > > > Subject: Re: [PATCH 4/7] cxgb4: Add packet queues and packet
DMA
> > code
> > > > >
> > > > > On Fri, 26 Feb 2010 15:35:36 -0800
> > > > > Dimitris Michailidis <dm@...lsio.com> wrote:
> > > > >
> > > > > > +
> > > > > > +/**
> > > > > > + *	need_skb_unmap - does the platform need unmapping of
> > sk_buffs?
> > > > > > + *
> > > > > > + *	Returns true if the platfrom needs sk_buff unmapping.
> > The
> > > > compiler
> > > > > > + *	optimizes away unecessary code if this returns true.
> > > > > > + */
> > > > > > +static inline int need_skb_unmap(void)
> > > > > > +{
> > > > > > +	/*
> > > > > > +	 * This structure is used to tell if the platfrom needs
> > buffer
> > > > > > +	 * unmapping by checking if DECLARE_PCI_UNMAP_ADDR
> > defines
> > > > anything.
> > > > > > +	 */
> > > > > > +	struct dummy {
> > > > > > +		DECLARE_PCI_UNMAP_ADDR(addr);
> > > > > > +	};
> > > > > > +
> > > > > > +	return sizeof(struct dummy) != 0;
> > > > > > +}
> > > > > > +
> > > > >
> > > > > I would prefer one code path and let the compiler decide if
unmap
> > > > > should be nop; rather than this kind of trick code.
> > > >
> > > > I believe this function does not generate any code, the compiler
> > > > statically figures out the result and optimizes any conditionals
> > that
> > > > call it.  What option do you have in mind that would tell the
> > compiler
> > > > if unmap is nop?
> > >
> > > Why do you care, let compiler decide.
> >
> > I want the compiler to decide but I must be missing something.  How
is
> > the compiler going to decide?  The purpose of this code is to tell
the
> > compiler if unmapping is nop.  Does it have another way to tell?
> 
> I looked closer, it is all tied up with deferred skb unmapping and
that
> code looks inherited from cxgb3. Not sure why you need to hold to skb
for
> so long: some offload requirement? Anyway keep it they way it is..

Yes, offload packets can have their payload DMAd after their DMA
descriptor is freed and so they need to remain mapped longer.
--
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