/*
 *  SR-IPv6 implementation
 *
 *  Author:
 *  David Lebrun <david.lebrun@uclouvain.be>
 *
 *
 *  This program is free software; you can redistribute it and/or
 *      modify it under the terms of the GNU General Public License
 *      as published by the Free Software Foundation; either version
 *      2 of the License, or (at your option) any later version.
 */

#ifndef _NET_SEG6_H
#define _NET_SEG6_H

#include <linux/net.h>
#include <linux/ipv6.h>
#include <net/lwtunnel.h>
#include <linux/seg6.h>
#include <linux/rhashtable.h>

static inline void update_csum_diff4(struct sk_buff *skb, __be32 from,
				     __be32 to)
{
	__be32 diff[] = { ~from, to };

	skb->csum = ~csum_partial((char *)diff, sizeof(diff), ~skb->csum);
}

static inline void update_csum_diff16(struct sk_buff *skb, __be32 *from,
				      __be32 *to)
{
	__be32 diff[] = {
		~from[0], ~from[1], ~from[2], ~from[3],
		to[0], to[1], to[2], to[3],
	};

	skb->csum = ~csum_partial((char *)diff, sizeof(diff), ~skb->csum);
}

struct seg6_pernet_data {
	struct mutex lock;
	struct in6_addr __rcu *tun_src;
#ifdef CONFIG_IPV6_SEG6_HMAC
	struct rhashtable hmac_infos;
#endif
};

static inline struct seg6_pernet_data *seg6_pernet(struct net *net)
{
	return net->ipv6.seg6_data;
}

extern int seg6_init(void);
extern void seg6_exit(void);
extern int seg6_iptunnel_init(void);
extern void seg6_iptunnel_exit(void);

extern bool seg6_validate_srh(struct ipv6_sr_hdr *srh, int len);

#endif
tr><td class='sub'>net-next plumbings</td><td class='sub right'>Tobias Klauser</td></tr></table>
<table class='tabs'><tr><td>
<a href='/cgit.cgi/linux/net-next.git/'>summary</a><a href='/cgit.cgi/linux/net-next.git/refs/?id=dd86e373e09fb16b83e8adf5c48c421a4ca76468'>refs</a><a href='/cgit.cgi/linux/net-next.git/log/tools/testing/ktest/examples/README'>log</a><a href='/cgit.cgi/linux/net-next.git/tree/tools/testing/ktest/examples/README?id=dd86e373e09fb16b83e8adf5c48c421a4ca76468'>tree</a><a class='active' href='/cgit.cgi/linux/net-next.git/commit/tools/testing/ktest/examples/README?id=dd86e373e09fb16b83e8adf5c48c421a4ca76468'>commit</a><a href='/cgit.cgi/linux/net-next.git/diff/tools/testing/ktest/examples/README?id=dd86e373e09fb16b83e8adf5c48c421a4ca76468'>diff</a></td><td class='form'><form class='right' method='get' action='/cgit.cgi/linux/net-next.git/log/tools/testing/ktest/examples/README'>
<input type='hidden' name='id' value='dd86e373e09fb16b83e8adf5c48c421a4ca76468'/><select name='qt'>
<option value='grep'>log msg</option>
<option value='author'>author</option>
<option value='committer'>committer</option>
<option value='range'>range</option>
</select>
<input class='txt' type='search' size='10' name='q' value=''/>
<input type='submit' value='search'/>
</form>
</td></tr></table>
<div class='path'>path: <a href='/cgit.cgi/linux/net-next.git/commit/?id=dd86e373e09fb16b83e8adf5c48c421a4ca76468'>root</a>/<a href='/cgit.cgi/linux/net-next.git/commit/tools?id=dd86e373e09fb16b83e8adf5c48c421a4ca76468'>tools</a>/<a href='/cgit.cgi/linux/net-next.git/commit/tools/testing?id=dd86e373e09fb16b83e8adf5c48c421a4ca76468'>testing</a>/<a href='/cgit.cgi/linux/net-next.git/commit/tools/testing/ktest?id=dd86e373e09fb16b83e8adf5c48c421a4ca76468'>ktest</a>/<a href='/cgit.cgi/linux/net-next.git/commit/tools/testing/ktest/examples?id=dd86e373e09fb16b83e8adf5c48c421a4ca76468'>examples</a>/<a href='/cgit.cgi/linux/net-next.git/commit/tools/testing/ktest/examples/README?id=dd86e373e09fb16b83e8adf5c48c421a4ca76468'>README</a></div><div class='content'><div class='cgit-panel'><b>diff options</b><form method='get'><input type='hidden' name='id' value='dd86e373e09fb16b83e8adf5c48c421a4ca76468'/><table><tr><td colspan='2'/></tr><tr><td class='label'>context:</td><td class='ctrl'><select name='context' onchange='this.form.submit();'><option value='1'>1</option><option value='2'>2</option><option value='3' selected='selected'>3</option><option value='4'>4</option><option value='5'>5</option><option value='6'>6</option><option value='7'>7</option><option value='8'>8</option><option value='9'>9</option><option value='10'>10</option><option value='15'>15</option><option value='20'>20</option><option value='25'>25</option><option value='30'>30</option><option value='35'>35</option><option value='40'>40</option></select></td></tr><tr><td class='label'>space:</td><td class='ctrl'><select name='ignorews' onchange='this.form.submit();'><option value='0' selected='selected'>include</option><option value='1'>ignore</option></select></td></tr><tr><td class='label'>mode:</td><td class='ctrl'><select name='dt' onchange='this.form.submit();'><option value='0' selected='selected'>unified</option><option value='1'>ssdiff</option><option value='2'>stat only</option></select></td></tr><tr><td/><td class='ctrl'><noscript><input type='submit' value='reload'/></noscript></td></tr></table></form></div><table summary='commit info' class='commit-info'>
<tr><th>author</th><td>Thomas Gleixner &lt;tglx@linutronix.de&gt;</td><td class='right'>2017-01-31 23:58:38 +0100</td></tr>
<tr><th>committer</th><td>Ingo Molnar &lt;mingo@kernel.org&gt;</td><td class='right'>2017-02-01 08:37:27 +0100</td></tr>
<tr><th>commit</th><td colspan='2' class='oid'><a href='/cgit.cgi/linux/net-next.git/commit/tools/testing/ktest/examples/README?id=dd86e373e09fb16b83e8adf5c48c421a4ca76468'>dd86e373e09fb16b83e8adf5c48c421a4ca76468</a> (<a href='/cgit.cgi/linux/net-next.git/patch/tools/testing/ktest/examples/README?id=dd86e373e09fb16b83e8adf5c48c421a4ca76468'>patch</a>)</td></tr>
<tr><th>tree</th><td colspan='2' class='oid'><a href='/cgit.cgi/linux/net-next.git/tree/?id=dd86e373e09fb16b83e8adf5c48c421a4ca76468'>55703c2ea8584e303e342090614e0aab3509ab21</a> /<a href='/cgit.cgi/linux/net-next.git/tree/tools/testing/ktest/examples/README?id=dd86e373e09fb16b83e8adf5c48c421a4ca76468'>tools/testing/ktest/examples/README</a></td></tr>
<tr><th>parent</th><td colspan='2' class='oid'><a href='/cgit.cgi/linux/net-next.git/commit/tools/testing/ktest/examples/README?id=0b3589be9b98994ce3d5aeca52445d1f5627c4ba'>0b3589be9b98994ce3d5aeca52445d1f5627c4ba</a> (<a href='/cgit.cgi/linux/net-next.git/diff/tools/testing/ktest/examples/README?id=dd86e373e09fb16b83e8adf5c48c421a4ca76468&amp;id2=0b3589be9b98994ce3d5aeca52445d1f5627c4ba'>diff</a>)</td></tr></table>
<div class='commit-subject'>perf/x86/intel/rapl: Make package handling more robust</div><div class='commit-msg'>The package management code in RAPL relies on package mapping being
available before a CPU is started. This changed with:

  9d85eb9119f4 ("x86/smpboot: Make logical package management more robust")

because the ACPI/BIOS information turned out to be unreliable, but that
left RAPL in broken state. This was not noticed because on a regular boot
all CPUs are online before RAPL is initialized.

A possible fix would be to reintroduce the mess which allocates a package
data structure in CPU prepare and when it turns out to already exist in
starting throw it away later in the CPU online callback. But that's a
horrible hack and not required at all because RAPL becomes functional for
perf only in the CPU online callback. That's correct because user space is
not yet informed about the CPU being onlined, so nothing caan rely on RAPL
being available on that particular CPU.

Move the allocation to the CPU online callback and simplify the hotplug
handling. At this point the package mapping is established and correct.

This also adds a missing check for available package data in the
event_init() function.

Reported-by: Yasuaki Ishimatsu &lt;yasu.isimatu@gmail.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Alexander Shishkin &lt;alexander.shishkin@linux.intel.com&gt;
Cc: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
Cc: Jiri Olsa &lt;jolsa@redhat.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Sebastian Siewior &lt;bigeasy@linutronix.de&gt;
Cc: Stephane Eranian &lt;eranian@google.com&gt;
Cc: Vince Weaver &lt;vincent.weaver@maine.edu&gt;
Fixes: 9d85eb9119f4 ("x86/smpboot: Make logical package management more robust")
Link: http://lkml.kernel.org/r/20170131230141.212593966@linutronix.de
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</div><div class='diffstat-header'><a href='/cgit.cgi/linux/net-next.git/diff/?id=dd86e373e09fb16b83e8adf5c48c421a4ca76468'>Diffstat</a> (limited to 'tools/testing/ktest/examples/README')</div><table summary='diffstat' class='diffstat'>