This source file includes following definitions.
- mlx5e_get_tls_tx_context
- mlx5e_get_tls_rx_context
- mlx5e_tls_build_netdev
- mlx5e_tls_init
- mlx5e_tls_cleanup
- mlx5e_tls_get_count
- mlx5e_tls_get_strings
- mlx5e_tls_get_stats
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33 #ifndef __MLX5E_TLS_H__
34 #define __MLX5E_TLS_H__
35
36 #include "accel/tls.h"
37 #include "en_accel/ktls.h"
38
39 #ifdef CONFIG_MLX5_EN_TLS
40 #include <net/tls.h>
41 #include "en.h"
42
43 struct mlx5e_tls_sw_stats {
44 atomic64_t tx_tls_drop_metadata;
45 atomic64_t tx_tls_drop_resync_alloc;
46 atomic64_t tx_tls_drop_no_sync_data;
47 atomic64_t tx_tls_drop_bypass_required;
48 atomic64_t rx_tls_drop_resync_request;
49 atomic64_t rx_tls_resync_request;
50 atomic64_t rx_tls_resync_reply;
51 atomic64_t rx_tls_auth_fail;
52 };
53
54 struct mlx5e_tls {
55 struct mlx5e_tls_sw_stats sw_stats;
56 };
57
58 struct mlx5e_tls_offload_context_tx {
59 struct tls_offload_context_tx base;
60 u32 expected_seq;
61 __be32 swid;
62 };
63
64 static inline struct mlx5e_tls_offload_context_tx *
65 mlx5e_get_tls_tx_context(struct tls_context *tls_ctx)
66 {
67 BUILD_BUG_ON(sizeof(struct mlx5e_tls_offload_context_tx) >
68 TLS_OFFLOAD_CONTEXT_SIZE_TX);
69 return container_of(tls_offload_ctx_tx(tls_ctx),
70 struct mlx5e_tls_offload_context_tx,
71 base);
72 }
73
74 struct mlx5e_tls_offload_context_rx {
75 struct tls_offload_context_rx base;
76 __be32 handle;
77 };
78
79 static inline struct mlx5e_tls_offload_context_rx *
80 mlx5e_get_tls_rx_context(struct tls_context *tls_ctx)
81 {
82 BUILD_BUG_ON(sizeof(struct mlx5e_tls_offload_context_rx) >
83 TLS_OFFLOAD_CONTEXT_SIZE_RX);
84 return container_of(tls_offload_ctx_rx(tls_ctx),
85 struct mlx5e_tls_offload_context_rx,
86 base);
87 }
88
89 void mlx5e_tls_build_netdev(struct mlx5e_priv *priv);
90 int mlx5e_tls_init(struct mlx5e_priv *priv);
91 void mlx5e_tls_cleanup(struct mlx5e_priv *priv);
92
93 int mlx5e_tls_get_count(struct mlx5e_priv *priv);
94 int mlx5e_tls_get_strings(struct mlx5e_priv *priv, uint8_t *data);
95 int mlx5e_tls_get_stats(struct mlx5e_priv *priv, u64 *data);
96
97 #else
98
99 static inline void mlx5e_tls_build_netdev(struct mlx5e_priv *priv)
100 {
101 if (mlx5_accel_is_ktls_device(priv->mdev))
102 mlx5e_ktls_build_netdev(priv);
103 }
104
105 static inline int mlx5e_tls_init(struct mlx5e_priv *priv) { return 0; }
106 static inline void mlx5e_tls_cleanup(struct mlx5e_priv *priv) { }
107 static inline int mlx5e_tls_get_count(struct mlx5e_priv *priv) { return 0; }
108 static inline int mlx5e_tls_get_strings(struct mlx5e_priv *priv, uint8_t *data) { return 0; }
109 static inline int mlx5e_tls_get_stats(struct mlx5e_priv *priv, u64 *data) { return 0; }
110
111 #endif
112
113 #endif