Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 0 additions & 32 deletions modules/proto_ipsec/ipsec.c
Original file line number Diff line number Diff line change
Expand Up @@ -661,38 +661,6 @@ static_assert(sizeof(struct xfrm_algo_osips) == sizeof(struct xfrm_algo)
#define XFRM_OFFLOAD_PACKET 2
#endif

/* Hardware offload state */
int ipsec_hw_offload_ifindex = 0; /* 0 = disabled */
int ipsec_hw_offload_enabled = 0; /* Runtime flag */

/*
* Initialize hardware offload by resolving interface name to index
* Returns: 0 on success, -1 on error
*/
int ipsec_hw_offload_init(const char *ifname)
{
unsigned int ifindex;

if (!ifname || !ifname[0]) {
ipsec_hw_offload_ifindex = 0;
ipsec_hw_offload_enabled = 0;
return 0;
}

ifindex = if_nametoindex(ifname);
if (ifindex == 0) {
LM_ERR("Hardware offload: interface '%s' not found: %s\n",
ifname, strerror(errno));
return -1;
}

ipsec_hw_offload_ifindex = ifindex;
ipsec_hw_offload_enabled = 1;
LM_INFO("Hardware offload enabled on interface '%s' (index %u)\n",
ifname, ifindex);
return 0;
}

/*
* Structure for XFRM hardware offload (xfrm_user_offload)
* This is defined in linux/xfrm.h but may not be available on older kernels
Expand Down
11 changes: 0 additions & 11 deletions modules/proto_ipsec/ipsec.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,17 +160,6 @@ void ipsec_ctx_remove_tmp(struct ipsec_ctx *ctx);
void ipsec_ctx_remove_free_tmp(struct ipsec_ctx *ctx, int _free);
void ipsec_ctx_extend_tmp(struct ipsec_ctx *ctx);

/*
* Hardware Offload support for IPSec
* Modern NICs (e.g., Mellanox ConnectX, Intel QAT) can offload
* ESP encryption/decryption to hardware for better performance.
*/
extern int ipsec_hw_offload_ifindex; /* Interface index for HW offload, 0 = disabled */
extern int ipsec_hw_offload_enabled; /* Runtime flag if offload is active */

/* Initialize hardware offload (resolve interface name to index) */
int ipsec_hw_offload_init(const char *ifname);

/*
* NAT-T UDP Encapsulation Socket Management
*
Expand Down
Loading