All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rick Jones <rick.jones2@hp.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: rdunlap@xenotime.net, borntrae@de.ibm.com, netdev@vger.kernel.org
Subject: Re: [RFC] changing value of NETDEV_ALIGN to cacheline size
Date: Mon, 15 May 2006 14:39:23 -0700	[thread overview]
Message-ID: <4468F50B.9000102@hp.com> (raw)
In-Reply-To: <20060515.143011.36635008.davem@davemloft.net>

David S. Miller wrote:
> From: "Randy.Dunlap" <rdunlap@xenotime.net>
> Date: Mon, 15 May 2006 08:02:58 -0700
> 
> 
>>>-#define	NETDEV_ALIGN		32
>>>+#define	NETDEV_ALIGN		L1_CACHE_BYTES
>>> #define	NETDEV_ALIGN_CONST	(NETDEV_ALIGN - 1)
>>
>>I don't know about the fixed value of 32, but if this patch is
>>accepted, I'd prefer NETDEV_ALIGN_MASK instead of NETDEV_ALIGN_CONST.
> 
> 
> The reason it's 32 is that old drivers depended on the
> struct being at least 32-byte aligned because they would
> embed structures DMA'd to/from the card in their private
> area and just assumed that would be aligned enough for
> the card's restrictions.
> 
> So setting it to L1_CACHE_BYTES would be wrong, because if
> that happens to be less than 32 it would violate said
> assumption which we are catering to.

How about:

#define NETDEV_ALIGN_MIN 32
#if L1_CACHE_BYTES > NETDEV_ALIGN_MIN
# define NETDEV_ALIGN L1_CACHE_BYTES
#else
# define NETDEV_ALIGN NETDEV_ALIGN_MIN
#endif

rick jones

  reply	other threads:[~2006-05-15 21:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-15 12:08 [RFC] changing value of NETDEV_ALIGN to cacheline size Christian Borntraeger
2006-05-15 15:02 ` Randy.Dunlap
2006-05-15 21:30   ` David S. Miller
2006-05-15 21:39     ` Rick Jones [this message]
2006-05-15 21:58       ` Stephen Hemminger
2006-05-15 22:49       ` David S. Miller
2006-05-15 23:01         ` Rick Jones
2006-05-16 15:16         ` Christian Borntraeger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4468F50B.9000102@hp.com \
    --to=rick.jones2@hp.com \
    --cc=borntrae@de.ibm.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=rdunlap@xenotime.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.