* [PATCH net-next] sctp: Pack dst_cookie into 1st cacheline hole for 64bit host
@ 2013-08-05 9:13 Fan Du
2013-08-05 11:42 ` Neil Horman
2013-08-05 19:21 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Fan Du @ 2013-08-05 9:13 UTC (permalink / raw)
To: vyasevich, nhorman; +Cc: davem, netdev
As dst_cookie is used in fast path sctp_transport_dst_check.
Before:
struct sctp_transport {
struct list_head transports; /* 0 16 */
atomic_t refcnt; /* 16 4 */
__u32 dead:1; /* 20:31 4 */
__u32 rto_pending:1; /* 20:30 4 */
__u32 hb_sent:1; /* 20:29 4 */
__u32 pmtu_pending:1; /* 20:28 4 */
/* XXX 28 bits hole, try to pack */
__u32 sack_generation; /* 24 4 */
/* XXX 4 bytes hole, try to pack */
struct flowi fl; /* 32 64 */
/* --- cacheline 1 boundary (64 bytes) was 32 bytes ago --- */
union sctp_addr ipaddr; /* 96 28 */
After:
struct sctp_transport {
struct list_head transports; /* 0 16 */
atomic_t refcnt; /* 16 4 */
__u32 dead:1; /* 20:31 4 */
__u32 rto_pending:1; /* 20:30 4 */
__u32 hb_sent:1; /* 20:29 4 */
__u32 pmtu_pending:1; /* 20:28 4 */
/* XXX 28 bits hole, try to pack */
__u32 sack_generation; /* 24 4 */
u32 dst_cookie; /* 28 4 */
struct flowi fl; /* 32 64 */
/* --- cacheline 1 boundary (64 bytes) was 32 bytes ago --- */
union sctp_addr ipaddr; /* 96 28 */
Signed-off-by: Fan Du <fan.du@windriver.com>
---
include/net/sctp/structs.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index c0f4e29..d9c93a7 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -782,6 +782,7 @@ struct sctp_transport {
/* Has this transport moved the ctsn since we last sacked */
__u32 sack_generation;
+ u32 dst_cookie;
struct flowi fl;
@@ -946,7 +947,6 @@ struct sctp_transport {
__u64 hb_nonce;
struct rcu_head rcu;
- u32 dst_cookie;
};
struct sctp_transport *sctp_transport_new(struct net *, const union sctp_addr *,
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] sctp: Pack dst_cookie into 1st cacheline hole for 64bit host
2013-08-05 9:13 [PATCH net-next] sctp: Pack dst_cookie into 1st cacheline hole for 64bit host Fan Du
@ 2013-08-05 11:42 ` Neil Horman
2013-08-05 19:21 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Neil Horman @ 2013-08-05 11:42 UTC (permalink / raw)
To: Fan Du; +Cc: vyasevich, davem, netdev
On Mon, Aug 05, 2013 at 05:13:03PM +0800, Fan Du wrote:
> As dst_cookie is used in fast path sctp_transport_dst_check.
>
> Before:
> struct sctp_transport {
> struct list_head transports; /* 0 16 */
> atomic_t refcnt; /* 16 4 */
> __u32 dead:1; /* 20:31 4 */
> __u32 rto_pending:1; /* 20:30 4 */
> __u32 hb_sent:1; /* 20:29 4 */
> __u32 pmtu_pending:1; /* 20:28 4 */
>
> /* XXX 28 bits hole, try to pack */
>
> __u32 sack_generation; /* 24 4 */
>
> /* XXX 4 bytes hole, try to pack */
>
> struct flowi fl; /* 32 64 */
> /* --- cacheline 1 boundary (64 bytes) was 32 bytes ago --- */
> union sctp_addr ipaddr; /* 96 28 */
>
> After:
> struct sctp_transport {
> struct list_head transports; /* 0 16 */
> atomic_t refcnt; /* 16 4 */
> __u32 dead:1; /* 20:31 4 */
> __u32 rto_pending:1; /* 20:30 4 */
> __u32 hb_sent:1; /* 20:29 4 */
> __u32 pmtu_pending:1; /* 20:28 4 */
>
> /* XXX 28 bits hole, try to pack */
>
> __u32 sack_generation; /* 24 4 */
> u32 dst_cookie; /* 28 4 */
> struct flowi fl; /* 32 64 */
> /* --- cacheline 1 boundary (64 bytes) was 32 bytes ago --- */
> union sctp_addr ipaddr; /* 96 28 */
>
> Signed-off-by: Fan Du <fan.du@windriver.com>
> ---
> include/net/sctp/structs.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
> index c0f4e29..d9c93a7 100644
> --- a/include/net/sctp/structs.h
> +++ b/include/net/sctp/structs.h
> @@ -782,6 +782,7 @@ struct sctp_transport {
>
> /* Has this transport moved the ctsn since we last sacked */
> __u32 sack_generation;
> + u32 dst_cookie;
>
> struct flowi fl;
>
> @@ -946,7 +947,6 @@ struct sctp_transport {
> __u64 hb_nonce;
>
> struct rcu_head rcu;
> - u32 dst_cookie;
> };
>
> struct sctp_transport *sctp_transport_new(struct net *, const union sctp_addr *,
> --
> 1.7.9.5
>
>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] sctp: Pack dst_cookie into 1st cacheline hole for 64bit host
2013-08-05 9:13 [PATCH net-next] sctp: Pack dst_cookie into 1st cacheline hole for 64bit host Fan Du
2013-08-05 11:42 ` Neil Horman
@ 2013-08-05 19:21 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2013-08-05 19:21 UTC (permalink / raw)
To: fan.du; +Cc: vyasevich, nhorman, netdev
From: Fan Du <fan.du@windriver.com>
Date: Mon, 5 Aug 2013 17:13:03 +0800
> As dst_cookie is used in fast path sctp_transport_dst_check.
...
> Signed-off-by: Fan Du <fan.du@windriver.com>
Applied.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-08-05 19:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-05 9:13 [PATCH net-next] sctp: Pack dst_cookie into 1st cacheline hole for 64bit host Fan Du
2013-08-05 11:42 ` Neil Horman
2013-08-05 19:21 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).