/* SPDX-License-Identifier: GPL-2.0 */ /* Atomic operations usable in machine independent code */ #ifndef _LINUX_ATOMIC_H #define _LINUX_ATOMIC_H #include #include #include /* * Relaxed variants of xchg, cmpxchg and some atomic operations. * * We support four variants: * * - Fully ordered: The default implementation, no suffix required. * - Acquire: Provides ACQUIRE semantics, _acquire suffix. * - Release: Provides RELEASE semantics, _release suffix. * - Relaxed: No ordering guarantees, _relaxed suffix. * * For compound atomics performing both a load and a store, ACQUIRE * semantics apply only to the load and RELEASE semantics only to the * store portion of the operation. Note that a failed cmpxchg_acquire * does -not- imply any memory ordering constraints. * * See Documentation/memory-barriers.txt for ACQUIRE/RELEASE definitions. */ #define atomic_cond_read_acquire(v, c) smp_cond_load_acquire(&(v)->counter, (c)) #define atomic_cond_read_relaxed(v, c) smp_cond_load_relaxed(&(v)->counter, (c)) #define atomic64_cond_read_acquire(v, c) smp_cond_load_acquire(&(v)->counter, (c)) #define atomic64_cond_read_relaxed(v, c) smp_cond_load_relaxed(&(v)->counter, (c)) /* * The idea here is to build acquire/release variants by adding explicit * barriers on top of the relaxed variant. In the case where the relaxed * variant is already fully ordered, no additional barriers are needed. * * If an architecture overrides __atomic_acquire_fence() it will probably * want to define smp_mb__after_spinlock(). */ #ifndef __atomic_acquire_fence #define __atomic_acquire_fence smp_mb__after_atomic #endif #ifndef __atomic_release_fence #define __atomic_release_fence smp_mb__before_atomic #endif #ifndef __atomic_pre_full_fence #define __atomic_pre_full_fence smp_mb__before_atomic #endif #ifndef __atomic_post_full_fence #define __atomic_post_full_fence smp_mb__after_atomic #endif #define __atomic_op_acquire(op, args...) \ ({ \ typeof(op##_relaxed(args)) __ret = op##_relaxed(args); \ __atomic_acquire_fence(); \ __ret; \ }) #define __atomic_op_release(op, args...) \ ({ \ __atomic_release_fence(); \ op##_relaxed(args); \ }) #define __atomic_op_fence(op, args...) \ ({ \ typeof(op##_relaxed(args)) __ret; \ __atomic_pre_full_fence(); \ __ret = op##_relaxed(args); \ __atomic_post_full_fence(); \ __ret; \ }) #include #include #include #endif /* _LINUX_ATOMIC_H */ 1.y'>linux-3.1.y Hosts the 0x221E linux distro kernel.Ubuntu
summaryrefslogtreecommitdiff
path: root/net/8021q
AgeCommit message (Expand)Author
2024-03-29netlink: introduce type-checking attribute iterationJohannes Berg
2024-02-26rtnetlink: prepare nla_put_iflink() to run under RCUEric Dumazet
2024-02-21net: vlan: constify the struct device_type usageRicardo B. Marliere
2024-02-13vlan: use netdev_lockdep_set_classes()Eric Dumazet
2024-02-13vlan: use xarray iterator to implement /proc/net/vlan/configEric Dumazet
2024-01-19vlan: skip nested type that is not IFLA_VLAN_QOS_MAPPINGLin Ma
2023-12-21Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/netPaolo Abeni
2023-12-19net: check vlan filter feature in vlan_vids_add_by_dev() and vlan_vids_del_by...Liu Jian
2023-11-18net: ethtool: Refactor identical get_ts_info implementations.Richard Cochran
2023-10-28net: fill in MODULE_DESCRIPTION()s under net/802*Jakub Kicinski
2023-08-18Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/netJakub Kicinski
2023-08-14Revert "vlan: Fix VLAN 0 memory leak"Vlad Buslov
2023-08-10Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/netJakub Kicinski
2023-08-09vlan: Fix VLAN 0 memory leakVlad Buslov
2023-08-02net: vlan: convert to ndo_hwtstamp_get() / ndo_hwtstamp_set()Maxim Georgiev
2023-05-17vlan: fix a potential uninit-value in vlan_dev_hard_start_xmit()Eric Dumazet
2023-04-21vlan: Add MACsec offload operations for VLAN interfaceEmeel Hakim
2023-03-17vlan: partially enable SIOCSHWTSTAMP in containerVadim Fedorenko
2022-10-28net: Remove the obsolte u64_stats_fetch_*_irq() users (net).Thomas Gleixner
2022-08-25net: gro: skb_gro_header helper functionRichard Gobert
2022-08-22vlan: move from strlcpy with unused retval to strscpyWolfram Sang
2022-07-14Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/netJakub Kicinski
2022-07-09vlan: fix memory leak in vlan_newlink()Eric Dumazet