Lines Matching full:ipsec
17 struct nsim_ipsec *ipsec = &ns->ipsec; in nsim_dbg_netdev_ops_read() local
26 bufsize = (ipsec->count * 4 * 60) + 60; in nsim_dbg_netdev_ops_read()
34 ipsec->count, ipsec->tx); in nsim_dbg_netdev_ops_read()
37 struct nsim_sa *sap = &ipsec->sa[i]; in nsim_dbg_netdev_ops_read()
68 static int nsim_ipsec_find_empty_idx(struct nsim_ipsec *ipsec) in nsim_ipsec_find_empty_idx() argument
72 if (ipsec->count == NSIM_IPSEC_MAX_SA_COUNT) in nsim_ipsec_find_empty_idx()
77 if (!ipsec->sa[i].used) in nsim_ipsec_find_empty_idx()
94 netdev_err(dev, "Unsupported IPsec algorithm\n"); in nsim_ipsec_parse_proto_keys()
99 netdev_err(dev, "IPsec offload requires %d bit authentication\n", in nsim_ipsec_parse_proto_keys()
109 netdev_err(dev, "Unsupported IPsec algorithm - please use %s\n", in nsim_ipsec_parse_proto_keys()
120 netdev_err(dev, "IPsec hw offload only supports 128 bit keys with optional 32 bit salt\n"); in nsim_ipsec_parse_proto_keys()
131 struct nsim_ipsec *ipsec; in nsim_ipsec_add_sa() local
140 ipsec = &ns->ipsec; in nsim_ipsec_add_sa()
143 NL_SET_ERR_MSG_MOD(extack, "Unsupported protocol for ipsec offload"); in nsim_ipsec_add_sa()
153 NL_SET_ERR_MSG_MOD(extack, "Unsupported ipsec offload type"); in nsim_ipsec_add_sa()
158 ret = nsim_ipsec_find_empty_idx(ipsec); in nsim_ipsec_add_sa()
189 memcpy(&ipsec->sa[sa_idx], &sa, sizeof(sa)); in nsim_ipsec_add_sa()
195 ipsec->count++; in nsim_ipsec_add_sa()
203 struct nsim_ipsec *ipsec = &ns->ipsec; in nsim_ipsec_del_sa() local
207 if (!ipsec->sa[sa_idx].used) { in nsim_ipsec_del_sa()
213 memset(&ipsec->sa[sa_idx], 0, sizeof(struct nsim_sa)); in nsim_ipsec_del_sa()
214 ipsec->count--; in nsim_ipsec_del_sa()
220 struct nsim_ipsec *ipsec = &ns->ipsec; in nsim_ipsec_offload_ok() local
222 ipsec->ok++; in nsim_ipsec_offload_ok()
236 struct nsim_ipsec *ipsec = &ns->ipsec; in nsim_ipsec_tx() local
264 tsa = &ipsec->sa[sa_idx]; in nsim_ipsec_tx()
275 ipsec->tx++; in nsim_ipsec_tx()
291 ns->ipsec.pfile = debugfs_create_file("ipsec", 0400, in nsim_ipsec_init()
298 struct nsim_ipsec *ipsec = &ns->ipsec; in nsim_ipsec_teardown() local
300 if (ipsec->count) in nsim_ipsec_teardown()
301 netdev_err(ns->netdev, "tearing down IPsec offload with %d SAs left\n", in nsim_ipsec_teardown()
302 ipsec->count); in nsim_ipsec_teardown()
303 debugfs_remove_recursive(ipsec->pfile); in nsim_ipsec_teardown()