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

Showing the changes to include (1 of 4 files). Show all

Unified · Split

include/net/xfrm.h+5−5
@@ -126,7 +126,7 @@ struct xfrm_state_walk { · 125 unmodified lines
126 struct xfrm_address_filter *filter;126 struct xfrm_address_filter *filter;
127};127};
128 128
129struct xfrm_state_offload {129struct xfrm_dev_offload {
130 struct net_device *dev;130 struct net_device *dev;
131 netdevice_tracker dev_tracker;131 netdevice_tracker dev_tracker;
132 struct net_device *real_dev;132 struct net_device *real_dev;
@@ -246,7 +246,7 @@ struct xfrm_state { · 113 unmodified lines
246 struct xfrm_lifetime_cur curlft;246 struct xfrm_lifetime_cur curlft;
247 struct hrtimer mtimer;247 struct hrtimer mtimer;
248 248
249 struct xfrm_state_offload xso;249 struct xfrm_dev_offload xso;
250 250
251 /* used to fix curlft->add_time when changing date */251 /* used to fix curlft->add_time when changing date */
252 long saved_tmo;252 long saved_tmo;
@@ -1865,7 +1865,7 @@ bool xfrm_dev_offload_ok(struct sk_buff *skb, struct xfrm_state *x); · 1612 unmodified lines
1865 1865
1866static inline void xfrm_dev_state_advance_esn(struct xfrm_state *x)1866static inline void xfrm_dev_state_advance_esn(struct xfrm_state *x)
1867{1867{
1868 struct xfrm_state_offload *xso = &x->xso;1868 struct xfrm_dev_offload *xso = &x->xso;
1869 1869
1870 if (xso->dev && xso->dev->xfrmdev_ops->xdo_dev_state_advance_esn)1870 if (xso->dev && xso->dev->xfrmdev_ops->xdo_dev_state_advance_esn)
1871 xso->dev->xfrmdev_ops->xdo_dev_state_advance_esn(x);1871 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
1891 1891
1892static inline void xfrm_dev_state_delete(struct xfrm_state *x)1892static inline void xfrm_dev_state_delete(struct xfrm_state *x)
1893{1893{
1894 struct xfrm_state_offload *xso = &x->xso;1894 struct xfrm_dev_offload *xso = &x->xso;
1895 1895
1896 if (xso->dev)1896 if (xso->dev)
1897 xso->dev->xfrmdev_ops->xdo_dev_state_delete(x);1897 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
1899 1899
1900static inline void xfrm_dev_state_free(struct xfrm_state *x)1900static inline void xfrm_dev_state_free(struct xfrm_state *x)
1901{1901{
1902 struct xfrm_state_offload *xso = &x->xso;1902 struct xfrm_dev_offload *xso = &x->xso;
1903 struct net_device *dev = xso->dev;1903 struct net_device *dev = xso->dev;
1904 1904
1905 if (dev && dev->xfrmdev_ops) {1905 if (dev && dev->xfrmdev_ops) {