diff options
author | Yuval Mintz <yuvalm@mellanox.com> | 2018-02-28 16:29:34 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-03-01 13:13:23 -0500 |
commit | 494fff56379c4ad5b8fe36a5b7ffede4044ca7bb (patch) | |
tree | 700668965ff3ae706986235f91bb8c5267017617 /include/linux/mroute6.h | |
parent | 0bbbf0e7d0e7ea8267836986346a9b3a35b74e4e (diff) |
ipmr, ip6mr: Make mfc_cache a common structure
mfc_cache and mfc6_cache are almost identical - the main difference is
in the origin/group addresses and comparison-key. Make a common
structure encapsulating most of the multicast routing logic - mr_mfc
and convert both ipmr and ip6mr into using it.
For easy conversion [casting, in this case] mr_mfc has to be the first
field inside every multicast routing abstraction utilizing it.
Signed-off-by: Yuval Mintz <yuvalm@mellanox.com>
Acked-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/mroute6.h')
-rw-r--r-- | include/linux/mroute6.h | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/include/linux/mroute6.h b/include/linux/mroute6.h index d5c8dc155a42..6acf576fc135 100644 --- a/include/linux/mroute6.h +++ b/include/linux/mroute6.h | |||
@@ -71,7 +71,7 @@ struct mfc6_cache_cmp_arg { | |||
71 | }; | 71 | }; |
72 | 72 | ||
73 | struct mfc6_cache { | 73 | struct mfc6_cache { |
74 | struct rhlist_head mnode; | 74 | struct mr_mfc _c; |
75 | union { | 75 | union { |
76 | struct { | 76 | struct { |
77 | struct in6_addr mf6c_mcastgrp; | 77 | struct in6_addr mf6c_mcastgrp; |
@@ -79,27 +79,6 @@ struct mfc6_cache { | |||
79 | }; | 79 | }; |
80 | struct mfc6_cache_cmp_arg cmparg; | 80 | struct mfc6_cache_cmp_arg cmparg; |
81 | }; | 81 | }; |
82 | mifi_t mf6c_parent; /* Source interface */ | ||
83 | int mfc_flags; /* Flags on line */ | ||
84 | |||
85 | union { | ||
86 | struct { | ||
87 | unsigned long expires; | ||
88 | struct sk_buff_head unresolved; /* Unresolved buffers */ | ||
89 | } unres; | ||
90 | struct { | ||
91 | unsigned long last_assert; | ||
92 | int minvif; | ||
93 | int maxvif; | ||
94 | unsigned long bytes; | ||
95 | unsigned long pkt; | ||
96 | unsigned long wrong_if; | ||
97 | unsigned long lastuse; | ||
98 | unsigned char ttls[MAXMIFS]; /* TTL thresholds */ | ||
99 | } res; | ||
100 | } mfc_un; | ||
101 | struct list_head list; | ||
102 | struct rcu_head rcu; | ||
103 | }; | 82 | }; |
104 | 83 | ||
105 | #define MFC_STATIC 1 | 84 | #define MFC_STATIC 1 |