History

net: fib_notifier: make FIB notifier per-netns

Currently all users of FIB notifier only cares about events in init_net. Later in this patchset, users get interested in other namespaces too. However, for every registered block user is interested only about one namespace. Make the FIB notifier registration per-netns and avoid unnecessary calls of notifier block for other namespaces.

Jiri Pirko committed 7 years ago

Commit 7c550da1 parent a5facc415 files · +78 −105Browse files

Showing the changes to include/linux (1 of 15 files). Show all

Unified · Split

include/linux/mroute_base.h+2−8
@@ -47,7 +47,6 @@ struct vif_entry_notifier_info { · 46 unmodified lines
4747 };
4848
4949 static inline int mr_call_vif_notifier(struct notifier_block *nb,
50− struct net *net,
5150 unsigned short family,
5251 enum fib_event_type event_type,
5352 struct vif_device *vif,
@@ -56,7 +55,6 @@ static inline int mr_call_vif_notifier(struct notifier_block *nb, · 2 unmodified lines
5655 struct vif_entry_notifier_info info = {
5756 .info = {
5857 .family = family,
59− .net = net,
6058 },
6159 .dev = vif->dev,
6260 .vif_index = vif_index,
@@ -64,7 +62,7 @@ static inline int mr_call_vif_notifier(struct notifier_block *nb, · 1 unmodified line
6462 .tb_id = tb_id,
6563 };
6664
67− return call_fib_notifier(nb, net, event_type, &info.info);
65+ return call_fib_notifier(nb, event_type, &info.info);
6866 }
6967
7068 static inline int mr_call_vif_notifiers(struct net *net,
@@ -77,7 +75,6 @@ static inline int mr_call_vif_notifiers(struct net *net, · 6 unmodified lines
7775 struct vif_entry_notifier_info info = {
7876 .info = {
7977 .family = family,
80− .net = net,
8178 },
8279 .dev = vif->dev,
8380 .vif_index = vif_index,
@@ -173,7 +170,6 @@ struct mfc_entry_notifier_info { · 89 unmodified lines
173170 };
174171
175172 static inline int mr_call_mfc_notifier(struct notifier_block *nb,
176− struct net *net,
177173 unsigned short family,
178174 enum fib_event_type event_type,
179175 struct mr_mfc *mfc, u32 tb_id)
@@ -181,13 +177,12 @@ static inline int mr_call_mfc_notifier(struct notifier_block *nb, · 1 unmodified line
181177 struct mfc_entry_notifier_info info = {
182178 .info = {
183179 .family = family,
184− .net = net,
185180 },
186181 .mfc = mfc,
187182 .tb_id = tb_id
188183 };
189184
190− return call_fib_notifier(nb, net, event_type, &info.info);
185+ return call_fib_notifier(nb, event_type, &info.info);
191186 }
192187
193188 static inline int mr_call_mfc_notifiers(struct net *net,
@@ -199,7 +194,6 @@ static inline int mr_call_mfc_notifiers(struct net *net, · 5 unmodified lines
199194 struct mfc_entry_notifier_info info = {
200195 .info = {
201196 .family = family,
202− .net = net,
203197 },
204198 .mfc = mfc,
205199 .tb_id = tb_id

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t