summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2022-03-10 07:01:20 +0300
committerJakub Kicinski <kuba@kernel.org>2022-03-10 07:01:20 +0300
commitc01e605904f1c8e25cfaecf04edaaa2824674065 (patch)
tree2772d34dcd633587e2ff997adcd38d6670da29cd
parent4a5eaa2fde59d08d0ca14f985a61c6c745555bbb (diff)
parentb23f9239195a1af116d6b388cd00c9002f80f80f (diff)
downloadlinux-c01e605904f1c8e25cfaecf04edaaa2824674065.tar.xz
Merge branch 'net-fungible-fix-errors-when-config_tls_device-n'
Dimitris Michailidis says: ==================== net/fungible: fix errors when CONFIG_TLS_DEVICE=n This pair of patches fix compile errors in funeth when CONFIG_TLS_DEVICE=n. The errors are due to symbols that are not defined in this config but are used in code guarded by "if (IS_ENABLED(CONFIG_TLS_DEVICE) ..." One option is to place this code under preprocessor guards that will keep the compiler from looking at the code. The option adopted here is to define the offending symbols also when CONFIG_TLS_DEVICE=n. The first patch does this for two functions in tls.h. The second does the same for driver symbols and makes tls.h inclusion unconditional. ==================== Link: https://lore.kernel.org/r/20220309034032.405212-1-dmichail@fungible.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
-rw-r--r--drivers/net/ethernet/fungible/funeth/funeth_ktls.h7
-rw-r--r--drivers/net/ethernet/fungible/funeth/funeth_tx.c9
-rw-r--r--include/net/tls.h2
3 files changed, 8 insertions, 10 deletions
diff --git a/drivers/net/ethernet/fungible/funeth/funeth_ktls.h b/drivers/net/ethernet/fungible/funeth/funeth_ktls.h
index 1b21cccf1278..9d6f2141a959 100644
--- a/drivers/net/ethernet/fungible/funeth/funeth_ktls.h
+++ b/drivers/net/ethernet/fungible/funeth/funeth_ktls.h
@@ -3,17 +3,16 @@
#ifndef _FUN_KTLS_H
#define _FUN_KTLS_H
-struct net_device;
-struct funeth_priv;
-
-#ifdef CONFIG_TLS_DEVICE
#include <net/tls.h>
+struct funeth_priv;
+
struct fun_ktls_tx_ctx {
__be64 tlsid;
u32 next_seq;
};
+#if IS_ENABLED(CONFIG_TLS_DEVICE)
int fun_ktls_init(struct net_device *netdev);
void fun_ktls_cleanup(struct funeth_priv *fp);
diff --git a/drivers/net/ethernet/fungible/funeth/funeth_tx.c b/drivers/net/ethernet/fungible/funeth/funeth_tx.c
index 46684afa97a0..ff6e29237253 100644
--- a/drivers/net/ethernet/fungible/funeth/funeth_tx.c
+++ b/drivers/net/ethernet/fungible/funeth/funeth_tx.c
@@ -7,6 +7,7 @@
#include <linux/tcp.h>
#include <uapi/linux/udp.h>
#include "funeth.h"
+#include "funeth_ktls.h"
#include "funeth_txrx.h"
#include "funeth_trace.h"
#include "fun_queue.h"
@@ -75,12 +76,10 @@ static __be16 tcp_hdr_doff_flags(const struct tcphdr *th)
return *(__be16 *)&tcp_flag_word(th);
}
-#if IS_ENABLED(CONFIG_TLS_DEVICE)
-#include "funeth_ktls.h"
-
static struct sk_buff *fun_tls_tx(struct sk_buff *skb, struct funeth_txq *q,
unsigned int *tls_len)
{
+#if IS_ENABLED(CONFIG_TLS_DEVICE)
const struct fun_ktls_tx_ctx *tls_ctx;
u32 datalen, seq;
@@ -108,8 +107,10 @@ static struct sk_buff *fun_tls_tx(struct sk_buff *skb, struct funeth_txq *q,
FUN_QSTAT_INC(q, tx_tls_drops);
return skb;
-}
+#else
+ return NULL;
#endif
+}
/* Write as many descriptors as needed for the supplied skb starting at the
* current producer location. The caller has made certain enough descriptors
diff --git a/include/net/tls.h b/include/net/tls.h
index 526cb2c3b724..b6968a5b5538 100644
--- a/include/net/tls.h
+++ b/include/net/tls.h
@@ -626,7 +626,6 @@ tls_offload_ctx_rx(const struct tls_context *tls_ctx)
return (struct tls_offload_context_rx *)tls_ctx->priv_ctx_rx;
}
-#if IS_ENABLED(CONFIG_TLS_DEVICE)
static inline void *__tls_driver_ctx(struct tls_context *tls_ctx,
enum tls_offload_ctx_dir direction)
{
@@ -641,7 +640,6 @@ tls_driver_ctx(const struct sock *sk, enum tls_offload_ctx_dir direction)
{
return __tls_driver_ctx(tls_get_ctx(sk), direction);
}
-#endif
#define RESYNC_REQ BIT(0)
#define RESYNC_REQ_ASYNC BIT(1)