~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/net/tc_act/tc_mpls.h

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
  2 /* Copyright (C) 2019 Netronome Systems, Inc. */
  3 
  4 #ifndef __NET_TC_MPLS_H
  5 #define __NET_TC_MPLS_H
  6 
  7 #include <linux/tc_act/tc_mpls.h>
  8 #include <net/act_api.h>
  9 
 10 struct tcf_mpls_params {
 11         int tcfm_action;
 12         u32 tcfm_label;
 13         u8 tcfm_tc;
 14         u8 tcfm_ttl;
 15         u8 tcfm_bos;
 16         __be16 tcfm_proto;
 17         struct rcu_head rcu;
 18 };
 19 
 20 #define ACT_MPLS_TC_NOT_SET     0xff
 21 #define ACT_MPLS_BOS_NOT_SET    0xff
 22 #define ACT_MPLS_LABEL_NOT_SET  0xffffffff
 23 
 24 struct tcf_mpls {
 25         struct tc_action common;
 26         struct tcf_mpls_params __rcu *mpls_p;
 27 };
 28 #define to_mpls(a) ((struct tcf_mpls *)a)
 29 
 30 static inline bool is_tcf_mpls(const struct tc_action *a)
 31 {
 32 #ifdef CONFIG_NET_CLS_ACT
 33         if (a->ops && a->ops->id == TCA_ID_MPLS)
 34                 return true;
 35 #endif
 36         return false;
 37 }
 38 
 39 static inline u32 tcf_mpls_action(const struct tc_action *a)
 40 {
 41         u32 tcfm_action;
 42 
 43         rcu_read_lock();
 44         tcfm_action = rcu_dereference(to_mpls(a)->mpls_p)->tcfm_action;
 45         rcu_read_unlock();
 46 
 47         return tcfm_action;
 48 }
 49 
 50 static inline __be16 tcf_mpls_proto(const struct tc_action *a)
 51 {
 52         __be16 tcfm_proto;
 53 
 54         rcu_read_lock();
 55         tcfm_proto = rcu_dereference(to_mpls(a)->mpls_p)->tcfm_proto;
 56         rcu_read_unlock();
 57 
 58         return tcfm_proto;
 59 }
 60 
 61 static inline u32 tcf_mpls_label(const struct tc_action *a)
 62 {
 63         u32 tcfm_label;
 64 
 65         rcu_read_lock();
 66         tcfm_label = rcu_dereference(to_mpls(a)->mpls_p)->tcfm_label;
 67         rcu_read_unlock();
 68 
 69         return tcfm_label;
 70 }
 71 
 72 static inline u8 tcf_mpls_tc(const struct tc_action *a)
 73 {
 74         u8 tcfm_tc;
 75 
 76         rcu_read_lock();
 77         tcfm_tc = rcu_dereference(to_mpls(a)->mpls_p)->tcfm_tc;
 78         rcu_read_unlock();
 79 
 80         return tcfm_tc;
 81 }
 82 
 83 static inline u8 tcf_mpls_bos(const struct tc_action *a)
 84 {
 85         u8 tcfm_bos;
 86 
 87         rcu_read_lock();
 88         tcfm_bos = rcu_dereference(to_mpls(a)->mpls_p)->tcfm_bos;
 89         rcu_read_unlock();
 90 
 91         return tcfm_bos;
 92 }
 93 
 94 static inline u8 tcf_mpls_ttl(const struct tc_action *a)
 95 {
 96         u8 tcfm_ttl;
 97 
 98         rcu_read_lock();
 99         tcfm_ttl = rcu_dereference(to_mpls(a)->mpls_p)->tcfm_ttl;
100         rcu_read_unlock();
101 
102         return tcfm_ttl;
103 }
104 
105 #endif /* __NET_TC_MPLS_H */
106 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php