Skip to content

Commit da68b4a

Browse files
Jakub Kicinskidavem330
authored andcommitted
net/tls: move definition of tls ops into net/tls.h
There seems to be no reason for tls_ops to be defined in netdevice.h which is included in a lot of places. Don't wrap the struct/enum declaration in ifdefs, it trickles down unnecessary ifdefs into driver code. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Reviewed-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 9e99579 commit da68b4a

File tree

2 files changed

+18
-22
lines changed

2 files changed

+18
-22
lines changed

include/linux/netdevice.h

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -914,34 +914,13 @@ struct xfrmdev_ops {
914914
};
915915
#endif
916916

917-
#if IS_ENABLED(CONFIG_TLS_DEVICE)
918-
enum tls_offload_ctx_dir {
919-
TLS_OFFLOAD_CTX_DIR_RX,
920-
TLS_OFFLOAD_CTX_DIR_TX,
921-
};
922-
923-
struct tls_crypto_info;
924-
struct tls_context;
925-
926-
struct tlsdev_ops {
927-
int (*tls_dev_add)(struct net_device *netdev, struct sock *sk,
928-
enum tls_offload_ctx_dir direction,
929-
struct tls_crypto_info *crypto_info,
930-
u32 start_offload_tcp_sn);
931-
void (*tls_dev_del)(struct net_device *netdev,
932-
struct tls_context *ctx,
933-
enum tls_offload_ctx_dir direction);
934-
void (*tls_dev_resync_rx)(struct net_device *netdev,
935-
struct sock *sk, u32 seq, u64 rcd_sn);
936-
};
937-
#endif
938-
939917
struct dev_ifalias {
940918
struct rcu_head rcuhead;
941919
char ifalias[];
942920
};
943921

944922
struct devlink;
923+
struct tlsdev_ops;
945924

946925
/*
947926
* This structure defines the management hooks for network devices.

include/net/tls.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,23 @@ struct tls_context {
277277
void (*unhash)(struct sock *sk);
278278
};
279279

280+
enum tls_offload_ctx_dir {
281+
TLS_OFFLOAD_CTX_DIR_RX,
282+
TLS_OFFLOAD_CTX_DIR_TX,
283+
};
284+
285+
struct tlsdev_ops {
286+
int (*tls_dev_add)(struct net_device *netdev, struct sock *sk,
287+
enum tls_offload_ctx_dir direction,
288+
struct tls_crypto_info *crypto_info,
289+
u32 start_offload_tcp_sn);
290+
void (*tls_dev_del)(struct net_device *netdev,
291+
struct tls_context *ctx,
292+
enum tls_offload_ctx_dir direction);
293+
void (*tls_dev_resync_rx)(struct net_device *netdev,
294+
struct sock *sk, u32 seq, u64 rcd_sn);
295+
};
296+
280297
struct tls_offload_context_rx {
281298
/* sw must be the first member of tls_offload_context_rx */
282299
struct tls_sw_context_rx sw;

0 commit comments

Comments
 (0)