From patchwork Wed Dec 15 08:01:14 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tetsuo Handa X-Patchwork-Id: 75627 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 90447B6F11 for ; Wed, 15 Dec 2010 19:01:23 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753843Ab0LOIBT (ORCPT ); Wed, 15 Dec 2010 03:01:19 -0500 Received: from www262.sakura.ne.jp ([202.181.97.72]:58432 "EHLO www262.sakura.ne.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753724Ab0LOIBS (ORCPT ); Wed, 15 Dec 2010 03:01:18 -0500 Received: from www262.sakura.ne.jp (ksav11.sakura.ne.jp [210.224.165.45]) by www262.sakura.ne.jp (8.14.3/8.14.3) with ESMTP id oBF81ELR047835; Wed, 15 Dec 2010 17:01:14 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) X-Nat-Received: from [202.181.97.72]:56164 [ident-empty] by smtp-proxy.isp with TPROXY id 1292400074.15555 Received: from www262.sakura.ne.jp (localhost [127.0.0.1]) by www262.sakura.ne.jp (8.14.3/8.14.3) with ESMTP id oBF81E20047831; Wed, 15 Dec 2010 17:01:14 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Received: (from i-love@localhost) by www262.sakura.ne.jp (8.14.3/8.14.3/Submit) id oBF81EVm047830; Wed, 15 Dec 2010 17:01:14 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Message-Id: <201012150801.oBF81EVm047830@www262.sakura.ne.jp> X-Authentication-Warning: www262.sakura.ne.jp: i-love set sender to penguin-kernel@i-love.sakura.ne.jp using -f Subject: [2.6.37-rc5] Build error on parisc. From: Tetsuo Handa To: eric.dumazet@gmail.com Cc: netdev@vger.kernel.org MIME-Version: 1.0 Date: Wed, 15 Dec 2010 17:01:14 +0900 X-Anti-Virus: Kaspersky Anti-Virus for Linux Mail Server 5.6.44/RELEASE, bases: 15122010 #4444664, status: clean Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org [2.6.37-rc5] Build error on parisc. Commit 5635c10d "net: make sure struct dst_entry refcount is aligned on 64 bytes" uses manual padding. I triggered BUILD_BUG_ON() when using http://kernel.org/pub/tools/crosstool/files/bin/i686/4.5.1/i686-gcc-4.5.1-nolibc_hppa64-linux.tar.bz2 . make -s CROSS_COMPILE=hppa64-linux- ARCH=parisc include/net/dst.h: In function 'dst_hold': include/net/dst.h:161:2: error: negative width in bit-field '' I think below patch can fix the error but that commit says that we cannot use __atribute((aligned)). Why? --- 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 diff --git a/include/net/dst.h b/include/net/dst.h index ffe9cb7..02df303 100644 --- a/include/net/dst.h +++ b/include/net/dst.h @@ -62,8 +62,6 @@ struct dst_entry { struct hh_cache *hh; #ifdef CONFIG_XFRM struct xfrm_state *xfrm; -#else - void *__pad1; #endif int (*input)(struct sk_buff*); int (*output)(struct sk_buff*); @@ -74,23 +72,15 @@ struct dst_entry { #ifdef CONFIG_NET_CLS_ROUTE __u32 tclassid; -#else - __u32 __pad2; -#endif - - - /* - * Align __refcnt to a 64 bytes alignment - * (L1_CACHE_SIZE would be too much) - */ -#ifdef CONFIG_64BIT - long __pad_to_align_refcnt[1]; #endif /* * __refcnt wants to be on a different cache line from * input/output/ops or performance tanks badly + * + * Align __refcnt to a 64 bytes alignment + * (L1_CACHE_SIZE would be too much) */ - atomic_t __refcnt; /* client references */ + atomic_t __refcnt __aligned(64); /* client references */ int __use; unsigned long lastuse; union { @@ -154,11 +144,6 @@ dst_metric_locked(struct dst_entry *dst, int metric) static inline void dst_hold(struct dst_entry * dst) { - /* - * If your kernel compilation stops here, please check - * __pad_to_align_refcnt declaration in struct dst_entry - */ - BUILD_BUG_ON(offsetof(struct dst_entry, __refcnt) & 63); atomic_inc(&dst->__refcnt); }