Steffen Klassert says: ==================== pull request (net-next): ipsec-next 2022-05-13 1) Cleanups for the code behind the XFRM offload API. This is a preparation for the extension of the API for policy offload. From Leon Romanovsky. * 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec-next: xfrm: drop not needed flags variable in XFRM offload struct net/mlx5e: Use XFRM state direction instead of flags netdevsim: rely on XFRM state direction instead of flags ixgbe: propagate XFRM offload state direction instead of flags xfrm: store and rely on direction to construct offload flags xfrm: rename xfrm_state_offload struct to allow reuse xfrm: delete not used number of external headers xfrm: free not used XFRM_ESP_NO_TRAILER flag ====================
Showing the changes to include (1 of 12 files). Show all
Unified · Split
| @@ -126,13 +126,17 @@ struct xfrm_state_walk { · 125 unmodified lines | ||
| 126 | 126 | struct xfrm_address_filter *filter; |
| 127 | 127 | }; |
| 128 | 128 | |
| 129 | −struct xfrm_state_offload { | |
| 129 | +enum { | |
| 130 | + XFRM_DEV_OFFLOAD_IN = 1, | |
| 131 | + XFRM_DEV_OFFLOAD_OUT, | |
| 132 | +}; | |
| 133 | + | |
| 134 | +struct xfrm_dev_offload { | |
| 130 | 135 | struct net_device *dev; |
| 131 | 136 | netdevice_tracker dev_tracker; |
| 132 | 137 | struct net_device *real_dev; |
| 133 | 138 | unsigned long offload_handle; |
| 134 | − unsigned int num_exthdrs; | |
| 135 | − u8 flags; | |
| 139 | + u8 dir : 2; | |
| 136 | 140 | }; |
| 137 | 141 | |
| 138 | 142 | struct xfrm_mode { |
| @@ -247,7 +251,7 @@ struct xfrm_state { · 108 unmodified lines | ||
| 247 | 251 | struct xfrm_lifetime_cur curlft; |
| 248 | 252 | struct hrtimer mtimer; |
| 249 | 253 | |
| 250 | − struct xfrm_state_offload xso; | |
| 254 | + struct xfrm_dev_offload xso; | |
| 251 | 255 | |
| 252 | 256 | /* used to fix curlft->add_time when changing date */ |
| 253 | 257 | long saved_tmo; |
| @@ -1006,7 +1010,7 @@ struct xfrm_offload { · 752 unmodified lines | ||
| 1006 | 1010 | #define CRYPTO_FALLBACK 8 |
| 1007 | 1011 | #define XFRM_GSO_SEGMENT 16 |
| 1008 | 1012 | #define XFRM_GRO 32 |
| 1009 | −#define XFRM_ESP_NO_TRAILER 64 | |
| 1013 | +/* 64 is free */ | |
| 1010 | 1014 | #define XFRM_DEV_RESUME 128 |
| 1011 | 1015 | #define XFRM_XMIT 256 |
| 1012 | 1016 | |
| @@ -1866,7 +1870,7 @@ bool xfrm_dev_offload_ok(struct sk_buff *skb, struct xfrm_state *x); · 853 unmodified lines | ||
| 1866 | 1870 | |
| 1867 | 1871 | static inline void xfrm_dev_state_advance_esn(struct xfrm_state *x) |
| 1868 | 1872 | { |
| 1869 | − struct xfrm_state_offload *xso = &x->xso; | |
| 1873 | + struct xfrm_dev_offload *xso = &x->xso; | |
| 1870 | 1874 | |
| 1871 | 1875 | if (xso->dev && xso->dev->xfrmdev_ops->xdo_dev_state_advance_esn) |
| 1872 | 1876 | xso->dev->xfrmdev_ops->xdo_dev_state_advance_esn(x); |
| @@ -1892,7 +1896,7 @@ static inline bool xfrm_dst_offload_ok(struct dst_entry *dst) · 19 unmodified lines | ||
| 1892 | 1896 | |
| 1893 | 1897 | static inline void xfrm_dev_state_delete(struct xfrm_state *x) |
| 1894 | 1898 | { |
| 1895 | − struct xfrm_state_offload *xso = &x->xso; | |
| 1899 | + struct xfrm_dev_offload *xso = &x->xso; | |
| 1896 | 1900 | |
| 1897 | 1901 | if (xso->dev) |
| 1898 | 1902 | xso->dev->xfrmdev_ops->xdo_dev_state_delete(x); |
| @@ -1900,7 +1904,7 @@ static inline void xfrm_dev_state_delete(struct xfrm_state *x) · 1 unmodified line | ||
| 1900 | 1904 | |
| 1901 | 1905 | static inline void xfrm_dev_state_free(struct xfrm_state *x) |
| 1902 | 1906 | { |
| 1903 | − struct xfrm_state_offload *xso = &x->xso; | |
| 1907 | + struct xfrm_dev_offload *xso = &x->xso; | |
| 1904 | 1908 | struct net_device *dev = xso->dev; |
| 1905 | 1909 | |
| 1906 | 1910 | if (dev && dev->xfrmdev_ops) { |