#ifndef DIE_H #define DIE_H #include #include #include #include #include #include #include #include #include "built_in.h" static inline void panic(const char *format, ...) __check_format_printf(1, 2); static inline void syslog_panic(const char *format, ...) __check_format_printf(1, 2); static inline void syslog_maybe(bool cond, int priority, const char *format, ...) __check_format_printf(3, 4); static inline void __noreturn __die_hard(void) { exit(EXIT_FAILURE); } static inline void __noreturn __die_harder(void) { _exit(EXIT_FAILURE); } static inline void __noreturn die(void) { __die_hard(); } static inline void __noreturn _die(void) { __die_harder(); } static inline void __noreturn panic(const char *format, ...) { va_list vl; va_start(vl, format); vfprintf(stderr, format, vl); va_end(vl); die(); } static inline void __noreturn syslog_panic(const char *format, ...) { va_list vl; va_start(vl, format); vsyslog(LOG_ERR, format, vl); va_end(vl); die(); } static inline void syslog_maybe(bool cond, int priority, const char *format, ...) { if (cond) { va_list vl; va_start(vl, format); vsyslog(priority, format, vl); va_end(vl); } } #endif /* DIE_H */ t-rx-pump-back'>packet-rx-pump-back net-next plumbingsTobias Klauser
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2017-02-06 16:53:30 -0500
committerDavid S. Miller <davem@davemloft.net>2017-02-06 16:53:30 -0500
commit9172d2a026f95f217da81610037608996d3f6a3f (patch)
tree07ed46ceedeb980d62da34ae26e3aac5f8af7dfb
parent321fa4ffd94e333657e54037d2511c862ec92f6f (diff)
parent04d3a4c6af52a58370795bc9f70dc15f51f8bb84 (diff)
Merge branch 'dsa-add-fabric-notifier'
Vivien Didelot says: ==================== net: dsa: add fabric notifier When a switch fabric is composed of multiple switch chips, these chips must be programmed accordingly when an event occurred on one of them. Examples of such event include hardware bridging: when a Linux bridge spans interconnected chips, they must be programmed to allow external ports to ingress frames on their internal ports. Another example is cross-chip hardware VLANs. Switch chips in-between interconnected bridge ports must also configure a given VLAN to allow packets to pass through them. In order to support that, this patchset introduces a non-intrusive notifier mechanism. It adds a notifier head in every DSA switch tree (the said fabric), and a notifier block in every DSA switch chip. When an even occurs, it is chained to all notifiers of the fabric. Switch chips can react accordingly if they are cross-chip capable. On a dynamic debug enabled system, bridging a port in a multi-chip fabric will print something like this (ZII Rev B board): # brctl addif br0 lan3 mv88e6085 0.1:00: crosschip DSA port 1.0 bridged to br0 mv88e6085 0.4:00: crosschip DSA port 1.0 bridged to br0 # brctl delif br0 lan3 mv88e6085 0.1:00: crosschip DSA port 1.0 unbridged from br0 mv88e6085 0.4:00: crosschip DSA port 1.0 unbridged from br0 Currently only bridging events are added. A patchset introducing support for cross-chip hardware bridging configuration in mv88e6xxx will follow right after. Then events for switchdev operations are next on the line. We should note that non-switchdev events do not support rolling-back switch-wide operations. We'll have to work on closer integration with switchdev for that, like introducing new attributes or objects, to benefit from the prepare and commit phases. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/net/dsa.h17
-rw-r--r--net/dsa/Makefile1
-rw-r--r--net/dsa/dsa.c16
-rw-r--r--net/dsa/dsa2.c6
-rw-r--r--net/dsa/dsa_priv.h8
-rw-r--r--net/dsa/slave.c121
-rw-r--r--net/dsa/switch.c85
7 files changed, 205 insertions, 49 deletions
diff --git a/include/net/dsa.h b/include/net/dsa.h