History

xfrm: rename xfrm_state_offload struct to allow reuse

The struct xfrm_state_offload has all fields needed to hold information for offloaded policies too. In order to do not create new struct with same fields, let's rename existing one and reuse it later.

Leon Romanovsky committed 4 years ago

Commit 87e0a941 parent a36708e4 files · +9 −9Browse files

Unified · Split

4 files
  1. include/net/xfrm.h +5 −5
  2. net/xfrm/xfrm_device.c +1 −1
  3. net/xfrm/xfrm_state.c +2 −2
  4. net/xfrm/xfrm_user.c +1 −1
include/net/xfrm.h+5−5
@@ -126,7 +126,7 @@ struct xfrm_state_walk { · 125 unmodified lines
126126 struct xfrm_address_filter *filter;
127127 };
128128
129−struct xfrm_state_offload {
129+struct xfrm_dev_offload {
130130 struct net_device *dev;
131131 netdevice_tracker dev_tracker;
132132 struct net_device *real_dev;
@@ -246,7 +246,7 @@ struct xfrm_state { · 113 unmodified lines
246246 struct xfrm_lifetime_cur curlft;
247247 struct hrtimer mtimer;
248248
249− struct xfrm_state_offload xso;
249+ struct xfrm_dev_offload xso;
250250
251251 /* used to fix curlft->add_time when changing date */
252252 long saved_tmo;
@@ -1865,7 +1865,7 @@ bool xfrm_dev_offload_ok(struct sk_buff *skb, struct xfrm_state *x); · 1612 unmodified lines
18651865
18661866 static inline void xfrm_dev_state_advance_esn(struct xfrm_state *x)
18671867 {
1868− struct xfrm_state_offload *xso = &x->xso;
1868+ struct xfrm_dev_offload *xso = &x->xso;
18691869
18701870 if (xso->dev && xso->dev->xfrmdev_ops->xdo_dev_state_advance_esn)
18711871 xso->dev->xfrmdev_ops->xdo_dev_state_advance_esn(x);
@@ -1891,7 +1891,7 @@ static inline bool xfrm_dst_offload_ok(struct dst_entry *dst) · 19 unmodified lines
18911891
18921892 static inline void xfrm_dev_state_delete(struct xfrm_state *x)
18931893 {
1894− struct xfrm_state_offload *xso = &x->xso;
1894+ struct xfrm_dev_offload *xso = &x->xso;
18951895
18961896 if (xso->dev)
18971897 xso->dev->xfrmdev_ops->xdo_dev_state_delete(x);
@@ -1899,7 +1899,7 @@ static inline void xfrm_dev_state_delete(struct xfrm_state *x) · 1 unmodified line
18991899
19001900 static inline void xfrm_dev_state_free(struct xfrm_state *x)
19011901 {
1902− struct xfrm_state_offload *xso = &x->xso;
1902+ struct xfrm_dev_offload *xso = &x->xso;
19031903 struct net_device *dev = xso->dev;
19041904
19051905 if (dev && dev->xfrmdev_ops) {
net/xfrm/xfrm_device.c+1−1
@@ -212,7 +212,7 @@ int xfrm_dev_state_add(struct net *net, struct xfrm_state *x, · 211 unmodified lines
212212 int err;
213213 struct dst_entry *dst;
214214 struct net_device *dev;
215− struct xfrm_state_offload *xso = &x->xso;
215+ struct xfrm_dev_offload *xso = &x->xso;
216216 xfrm_address_t *saddr;
217217 xfrm_address_t *daddr;
218218
net/xfrm/xfrm_state.c+2−2
@@ -751,7 +751,7 @@ xfrm_dev_state_flush_secctx_check(struct net *net, struct net_device *dev, bool · 750 unmodified lines
751751
752752 for (i = 0; i <= net->xfrm.state_hmask; i++) {
753753 struct xfrm_state *x;
754− struct xfrm_state_offload *xso;
754+ struct xfrm_dev_offload *xso;
755755
756756 hlist_for_each_entry(x, net->xfrm.state_bydst+i, bydst) {
757757 xso = &x->xso;
@@ -835,7 +835,7 @@ int xfrm_dev_state_flush(struct net *net, struct net_device *dev, bool task_vali · 77 unmodified lines
835835 err = -ESRCH;
836836 for (i = 0; i <= net->xfrm.state_hmask; i++) {
837837 struct xfrm_state *x;
838− struct xfrm_state_offload *xso;
838+ struct xfrm_dev_offload *xso;
839839 restart:
840840 hlist_for_each_entry(x, net->xfrm.state_bydst+i, bydst) {
841841 xso = &x->xso;
net/xfrm/xfrm_user.c+1−1
@@ -840,7 +840,7 @@ static int copy_sec_ctx(struct xfrm_sec_ctx *s, struct sk_buff *skb) · 839 unmodified lines
840840 return 0;
841841 }
842842
843−static int copy_user_offload(struct xfrm_state_offload *xso, struct sk_buff *skb)
843+static int copy_user_offload(struct xfrm_dev_offload *xso, struct sk_buff *skb)
844844 {
845845 struct xfrm_user_offload *xuo;
846846 struct nlattr *attr;

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