@@ -1302,7 +1302,7 @@ struct net_device {
};
#define to_net_dev(d) container_of(d, struct net_device, dev)
-#define NETDEV_ALIGN 32
+#define NETDEV_ALIGN L1_CACHE_BYTES
static inline
int netdev_get_prio_tc_map(const struct net_device *dev, u32 prio)
@@ -122,7 +122,7 @@ static void fc_setup(struct net_device *dev)
* Fill in the fields of the device structure with fibre channel-generic values.
*
* Constructs a new net device, complete with a private data area of
- * size @sizeof_priv. A 32-byte (not bit) alignment is enforced for
+ * size @sizeof_priv. A cache line alignment is enforced for
* this private data area.
*/
struct net_device *alloc_fcdev(int sizeof_priv)
@@ -203,7 +203,7 @@ static void fddi_setup(struct net_device *dev)
* Fill in the fields of the device structure with FDDI-generic values.
*
* Constructs a new net device, complete with a private data area of
- * size @sizeof_priv. A 32-byte (not bit) alignment is enforced for
+ * size @sizeof_priv. A cache line alignment is enforced for
* this private data area.
*/
struct net_device *alloc_fddidev(int sizeof_priv)
@@ -223,7 +223,7 @@ static void hippi_setup(struct net_device *dev)
* Fill in the fields of the device structure with HIPPI-generic values.
*
* Constructs a new net device, complete with a private data area of
- * size @sizeof_priv. A 32-byte (not bit) alignment is enforced for
+ * size @sizeof_priv. A cache line alignment is enforced for
* this private data area.
*/
@@ -625,7 +625,7 @@ static void tr_setup(struct net_device *dev)
* Fill in the fields of the device structure with token ring-generic values.
*
* Constructs a new net device, complete with a private data area of
- * size @sizeof_priv. A 32-byte (not bit) alignment is enforced for
+ * size @sizeof_priv. A cache line alignment is enforced for
* this private data area.
*/
struct net_device *alloc_trdev(int sizeof_priv)
@@ -33,7 +33,7 @@ static void ltalk_setup(struct net_device *dev)
* values. Basically does everything except registering the device.
*
* Constructs a new net device, complete with a private data area of
- * size @sizeof_priv. A 32-byte (not bit) alignment is enforced for
+ * size @sizeof_priv. A cache line alignment is enforced for
* this private data area.
*/
@@ -5935,11 +5935,11 @@ struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name,
alloc_size = sizeof(struct net_device);
if (sizeof_priv) {
- /* ensure 32-byte alignment of private area */
+ /* ensure cache line alignment of private area */
alloc_size = ALIGN(alloc_size, NETDEV_ALIGN);
alloc_size += sizeof_priv;
}
- /* ensure 32-byte alignment of whole construct */
+ /* ensure cache line alignment of whole construct */
alloc_size += NETDEV_ALIGN - 1;
p = kzalloc(alloc_size, GFP_KERNEL);
@@ -360,7 +360,7 @@ EXPORT_SYMBOL(ether_setup);
* values. Basically does everything except registering the device.
*
* Constructs a new net device, complete with a private data area of
- * size (sizeof_priv). A 32-byte (not bit) alignment is enforced for
+ * size (sizeof_priv). A cache line alignment is enforced for
* this private data area.
*/
@@ -530,7 +530,7 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len,
if (WARN_ON(ops->sta_state && (ops->sta_add || ops->sta_remove)))
return NULL;
- /* Ensure 32-byte alignment of our private data and hw private data.
+ /* Ensure cache line alignment of our private data and hw private data.
* We use the wiphy priv data for both our ieee80211_local and for
* the driver's private data
*
32 bytes alignment had a meaning 10 years ago, it is not anymore the case. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> --- include/linux/netdevice.h | 2 +- net/802/fc.c | 2 +- net/802/fddi.c | 2 +- net/802/hippi.c | 2 +- net/802/tr.c | 2 +- net/appletalk/dev.c | 2 +- net/core/dev.c | 4 ++-- net/ethernet/eth.c | 2 +- net/mac80211/main.c | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html