mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson
synced 2025-09-02 08:32:55 +00:00

Include the TLS headers unconditionally and define driver TLS symbols
used in code compiled also when CONFIG_TLS_DEVICE=n to fix the
following errors:
../drivers/net/ethernet/fungible/funeth/funeth_tx.c: In function ‘write_pkt_desc’:
../drivers/net/ethernet/fungible/funeth/funeth_tx.c:244:13: error: implicit declaration of function ‘tls_driver_ctx’ [-Werror=implicit-function-declaration]
244 | tls_ctx = tls_driver_ctx(skb->sk, TLS_OFFLOAD_CTX_DIR_TX);
| ^~~~~~~~~~~~~~
../drivers/net/ethernet/fungible/funeth/funeth_tx.c:244:37: error: ‘TLS_OFFLOAD_CTX_DIR_TX’ undeclared (first use in this function)
244 | tls_ctx = tls_driver_ctx(skb->sk, TLS_OFFLOAD_CTX_DIR_TX);
| ^~~~~~~~~~~~~~~~~~~~~~
../drivers/net/ethernet/fungible/funeth/funeth_tx.c:244:37: note: each undeclared identifier is reported only once for each function it appears in
../drivers/net/ethernet/fungible/funeth/funeth_tx.c:245:23: error: dereferencing pointer to incomplete type ‘struct fun_ktls_tx_ctx’
245 | tls->tlsid = tls_ctx->tlsid;
| ^~
../drivers/net/ethernet/fungible/funeth/funeth_tx.c: In function ‘fun_start_xmit’:
../drivers/net/ethernet/fungible/funeth/funeth_tx.c:310:6: error: implicit declaration of function ‘tls_is_sk_tx_device_offloaded’ [-Werror=implicit-function-declaration]
310 | tls_is_sk_tx_device_offloaded(skb->sk)) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/net/ethernet/fungible/funeth/funeth_tx.c:311:9: error: implicit declaration of function ‘fun_tls_tx’; did you mean ‘fun_xdp_tx’? [-Werror=implicit-function-declaration]
311 | skb = fun_tls_tx(skb, q, &tls_len);
| ^~~~~~~~~~
| fun_xdp_tx
../drivers/net/ethernet/fungible/funeth/funeth_tx.c:311:7: warning: assignment to ‘struct sk_buff *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
311 | skb = fun_tls_tx(skb, q, &tls_len);
| ^
Fixes: db37bc177d
("net/funeth: add the data path")
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Dimitris Michailidis <dmichail@fungible.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
31 lines
503 B
C
31 lines
503 B
C
/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */
|
|
|
|
#ifndef _FUN_KTLS_H
|
|
#define _FUN_KTLS_H
|
|
|
|
#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);
|
|
|
|
#else
|
|
|
|
static inline void fun_ktls_init(struct net_device *netdev)
|
|
{
|
|
}
|
|
|
|
static inline void fun_ktls_cleanup(struct funeth_priv *fp)
|
|
{
|
|
}
|
|
#endif
|
|
|
|
#endif /* _FUN_KTLS_H */
|