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, 26 Feb 2010 15:57:56 -0800
From:	Stephen Hemminger <shemminger@...tta.com>
To:	Dimitris Michailidis <dm@...lsio.com>
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.

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