mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-25 04:41:15 +07:00
47ec5303d7
Pull networking updates from David Miller: 1) Support 6Ghz band in ath11k driver, from Rajkumar Manoharan. 2) Support UDP segmentation in code TSO code, from Eric Dumazet. 3) Allow flashing different flash images in cxgb4 driver, from Vishal Kulkarni. 4) Add drop frames counter and flow status to tc flower offloading, from Po Liu. 5) Support n-tuple filters in cxgb4, from Vishal Kulkarni. 6) Various new indirect call avoidance, from Eric Dumazet and Brian Vazquez. 7) Fix BPF verifier failures on 32-bit pointer arithmetic, from Yonghong Song. 8) Support querying and setting hardware address of a port function via devlink, use this in mlx5, from Parav Pandit. 9) Support hw ipsec offload on bonding slaves, from Jarod Wilson. 10) Switch qca8k driver over to phylink, from Jonathan McDowell. 11) In bpftool, show list of processes holding BPF FD references to maps, programs, links, and btf objects. From Andrii Nakryiko. 12) Several conversions over to generic power management, from Vaibhav Gupta. 13) Add support for SO_KEEPALIVE et al. to bpf_setsockopt(), from Dmitry Yakunin. 14) Various https url conversions, from Alexander A. Klimov. 15) Timestamping and PHC support for mscc PHY driver, from Antoine Tenart. 16) Support bpf iterating over tcp and udp sockets, from Yonghong Song. 17) Support 5GBASE-T i40e NICs, from Aleksandr Loktionov. 18) Add kTLS RX HW offload support to mlx5e, from Tariq Toukan. 19) Fix the ->ndo_start_xmit() return type to be netdev_tx_t in several drivers. From Luc Van Oostenryck. 20) XDP support for xen-netfront, from Denis Kirjanov. 21) Support receive buffer autotuning in MPTCP, from Florian Westphal. 22) Support EF100 chip in sfc driver, from Edward Cree. 23) Add XDP support to mvpp2 driver, from Matteo Croce. 24) Support MPTCP in sock_diag, from Paolo Abeni. 25) Commonize UDP tunnel offloading code by creating udp_tunnel_nic infrastructure, from Jakub Kicinski. 26) Several pci_ --> dma_ API conversions, from Christophe JAILLET. 27) Add FLOW_ACTION_POLICE support to mlxsw, from Ido Schimmel. 28) Add SK_LOOKUP bpf program type, from Jakub Sitnicki. 29) Refactor a lot of networking socket option handling code in order to avoid set_fs() calls, from Christoph Hellwig. 30) Add rfc4884 support to icmp code, from Willem de Bruijn. 31) Support TBF offload in dpaa2-eth driver, from Ioana Ciornei. 32) Support XDP_REDIRECT in qede driver, from Alexander Lobakin. 33) Support PCI relaxed ordering in mlx5 driver, from Aya Levin. 34) Support TCP syncookies in MPTCP, from Flowian Westphal. 35) Fix several tricky cases of PMTU handling wrt. briding, from Stefano Brivio. * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next: (2056 commits) net: thunderx: initialize VF's mailbox mutex before first usage usb: hso: remove bogus check for EINPROGRESS usb: hso: no complaint about kmalloc failure hso: fix bailout in error case of probe ip_tunnel_core: Fix build for archs without _HAVE_ARCH_IPV6_CSUM selftests/net: relax cpu affinity requirement in msg_zerocopy test mptcp: be careful on subflow creation selftests: rtnetlink: make kci_test_encap() return sub-test result selftests: rtnetlink: correct the final return value for the test net: dsa: sja1105: use detected device id instead of DT one on mismatch tipc: set ub->ifindex for local ipv6 address ipv6: add ipv6_dev_find() net: openvswitch: silence suspicious RCU usage warning Revert "vxlan: fix tos value before xmit" ptp: only allow phase values lower than 1 period farsync: switch from 'pci_' to 'dma_' API wan: wanxl: switch from 'pci_' to 'dma_' API hv_netvsc: do not use VF device if link is down dpaa2-eth: Fix passing zero to 'PTR_ERR' warning net: macb: Properly handle phylink on at91sam9x ...
207 lines
5.7 KiB
C
207 lines
5.7 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef _TOOLS_LINUX_COMPILER_H_
|
|
#define _TOOLS_LINUX_COMPILER_H_
|
|
|
|
#ifdef __GNUC__
|
|
#include <linux/compiler-gcc.h>
|
|
#endif
|
|
|
|
#ifndef __compiletime_error
|
|
# define __compiletime_error(message)
|
|
#endif
|
|
|
|
#ifdef __OPTIMIZE__
|
|
# define __compiletime_assert(condition, msg, prefix, suffix) \
|
|
do { \
|
|
extern void prefix ## suffix(void) __compiletime_error(msg); \
|
|
if (!(condition)) \
|
|
prefix ## suffix(); \
|
|
} while (0)
|
|
#else
|
|
# define __compiletime_assert(condition, msg, prefix, suffix) do { } while (0)
|
|
#endif
|
|
|
|
#define _compiletime_assert(condition, msg, prefix, suffix) \
|
|
__compiletime_assert(condition, msg, prefix, suffix)
|
|
|
|
/**
|
|
* compiletime_assert - break build and emit msg if condition is false
|
|
* @condition: a compile-time constant condition to check
|
|
* @msg: a message to emit if condition is false
|
|
*
|
|
* In tradition of POSIX assert, this macro will break the build if the
|
|
* supplied condition is *false*, emitting the supplied error message if the
|
|
* compiler has support to do so.
|
|
*/
|
|
#define compiletime_assert(condition, msg) \
|
|
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
|
|
|
|
/* Optimization barrier */
|
|
/* The "volatile" is due to gcc bugs */
|
|
#define barrier() __asm__ __volatile__("": : :"memory")
|
|
|
|
#ifndef __always_inline
|
|
# define __always_inline inline __attribute__((always_inline))
|
|
#endif
|
|
|
|
#ifndef noinline
|
|
#define noinline
|
|
#endif
|
|
#ifndef __no_tail_call
|
|
#define __no_tail_call
|
|
#endif
|
|
|
|
/* Are two types/vars the same type (ignoring qualifiers)? */
|
|
#ifndef __same_type
|
|
# define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
|
|
#endif
|
|
|
|
#ifdef __ANDROID__
|
|
/*
|
|
* FIXME: Big hammer to get rid of tons of:
|
|
* "warning: always_inline function might not be inlinable"
|
|
*
|
|
* At least on android-ndk-r12/platforms/android-24/arch-arm
|
|
*/
|
|
#undef __always_inline
|
|
#define __always_inline inline
|
|
#endif
|
|
|
|
#define __user
|
|
#define __rcu
|
|
#define __read_mostly
|
|
|
|
#ifndef __attribute_const__
|
|
# define __attribute_const__
|
|
#endif
|
|
|
|
#ifndef __maybe_unused
|
|
# define __maybe_unused __attribute__((unused))
|
|
#endif
|
|
|
|
#ifndef __used
|
|
# define __used __attribute__((__unused__))
|
|
#endif
|
|
|
|
#ifndef __packed
|
|
# define __packed __attribute__((__packed__))
|
|
#endif
|
|
|
|
#ifndef __force
|
|
# define __force
|
|
#endif
|
|
|
|
#ifndef __weak
|
|
# define __weak __attribute__((weak))
|
|
#endif
|
|
|
|
#ifndef likely
|
|
# define likely(x) __builtin_expect(!!(x), 1)
|
|
#endif
|
|
|
|
#ifndef unlikely
|
|
# define unlikely(x) __builtin_expect(!!(x), 0)
|
|
#endif
|
|
|
|
#ifndef __init
|
|
# define __init
|
|
#endif
|
|
|
|
#ifndef noinline
|
|
# define noinline
|
|
#endif
|
|
|
|
#include <linux/types.h>
|
|
|
|
/*
|
|
* Following functions are taken from kernel sources and
|
|
* break aliasing rules in their original form.
|
|
*
|
|
* While kernel is compiled with -fno-strict-aliasing,
|
|
* perf uses -Wstrict-aliasing=3 which makes build fail
|
|
* under gcc 4.4.
|
|
*
|
|
* Using extra __may_alias__ type to allow aliasing
|
|
* in this case.
|
|
*/
|
|
typedef __u8 __attribute__((__may_alias__)) __u8_alias_t;
|
|
typedef __u16 __attribute__((__may_alias__)) __u16_alias_t;
|
|
typedef __u32 __attribute__((__may_alias__)) __u32_alias_t;
|
|
typedef __u64 __attribute__((__may_alias__)) __u64_alias_t;
|
|
|
|
static __always_inline void __read_once_size(const volatile void *p, void *res, int size)
|
|
{
|
|
switch (size) {
|
|
case 1: *(__u8_alias_t *) res = *(volatile __u8_alias_t *) p; break;
|
|
case 2: *(__u16_alias_t *) res = *(volatile __u16_alias_t *) p; break;
|
|
case 4: *(__u32_alias_t *) res = *(volatile __u32_alias_t *) p; break;
|
|
case 8: *(__u64_alias_t *) res = *(volatile __u64_alias_t *) p; break;
|
|
default:
|
|
barrier();
|
|
__builtin_memcpy((void *)res, (const void *)p, size);
|
|
barrier();
|
|
}
|
|
}
|
|
|
|
static __always_inline void __write_once_size(volatile void *p, void *res, int size)
|
|
{
|
|
switch (size) {
|
|
case 1: *(volatile __u8_alias_t *) p = *(__u8_alias_t *) res; break;
|
|
case 2: *(volatile __u16_alias_t *) p = *(__u16_alias_t *) res; break;
|
|
case 4: *(volatile __u32_alias_t *) p = *(__u32_alias_t *) res; break;
|
|
case 8: *(volatile __u64_alias_t *) p = *(__u64_alias_t *) res; break;
|
|
default:
|
|
barrier();
|
|
__builtin_memcpy((void *)p, (const void *)res, size);
|
|
barrier();
|
|
}
|
|
}
|
|
|
|
/*
|
|
* Prevent the compiler from merging or refetching reads or writes. The
|
|
* compiler is also forbidden from reordering successive instances of
|
|
* READ_ONCE and WRITE_ONCE, but only when the compiler is aware of some
|
|
* particular ordering. One way to make the compiler aware of ordering is to
|
|
* put the two invocations of READ_ONCE or WRITE_ONCE in different C
|
|
* statements.
|
|
*
|
|
* These two macros will also work on aggregate data types like structs or
|
|
* unions. If the size of the accessed data type exceeds the word size of
|
|
* the machine (e.g., 32 bits or 64 bits) READ_ONCE() and WRITE_ONCE() will
|
|
* fall back to memcpy and print a compile-time warning.
|
|
*
|
|
* Their two major use cases are: (1) Mediating communication between
|
|
* process-level code and irq/NMI handlers, all running on the same CPU,
|
|
* and (2) Ensuring that the compiler does not fold, spindle, or otherwise
|
|
* mutilate accesses that either do not require ordering or that interact
|
|
* with an explicit memory barrier or atomic instruction that provides the
|
|
* required ordering.
|
|
*/
|
|
|
|
#define READ_ONCE(x) \
|
|
({ \
|
|
union { typeof(x) __val; char __c[1]; } __u = \
|
|
{ .__c = { 0 } }; \
|
|
__read_once_size(&(x), __u.__c, sizeof(x)); \
|
|
__u.__val; \
|
|
})
|
|
|
|
#define WRITE_ONCE(x, val) \
|
|
({ \
|
|
union { typeof(x) __val; char __c[1]; } __u = \
|
|
{ .__val = (val) }; \
|
|
__write_once_size(&(x), __u.__c, sizeof(x)); \
|
|
__u.__val; \
|
|
})
|
|
|
|
|
|
#ifndef __fallthrough
|
|
# define __fallthrough
|
|
#endif
|
|
|
|
/* Indirect macros required for expanded argument pasting, eg. __LINE__. */
|
|
#define ___PASTE(a, b) a##b
|
|
#define __PASTE(a, b) ___PASTE(a, b)
|
|
|
|
#endif /* _TOOLS_LINUX_COMPILER_H */
|