Lines Matching refs:ipsec

103 	struct ixgbevf_ipsec *ipsec = adapter->ipsec;  in ixgbevf_ipsec_restore()  local
112 struct rx_sa *r = &ipsec->rx_tbl[i]; in ixgbevf_ipsec_restore()
113 struct tx_sa *t = &ipsec->tx_tbl[i]; in ixgbevf_ipsec_restore()
140 int ixgbevf_ipsec_find_empty_idx(struct ixgbevf_ipsec *ipsec, bool rxtable) in ixgbevf_ipsec_find_empty_idx() argument
145 if (ipsec->num_rx_sa == IXGBE_IPSEC_MAX_SA_COUNT) in ixgbevf_ipsec_find_empty_idx()
150 if (!ipsec->rx_tbl[i].used) in ixgbevf_ipsec_find_empty_idx()
154 if (ipsec->num_tx_sa == IXGBE_IPSEC_MAX_SA_COUNT) in ixgbevf_ipsec_find_empty_idx()
159 if (!ipsec->tx_tbl[i].used) in ixgbevf_ipsec_find_empty_idx()
178 struct xfrm_state *ixgbevf_ipsec_find_rx_state(struct ixgbevf_ipsec *ipsec, in ixgbevf_ipsec_find_rx_state() argument
186 hash_for_each_possible_rcu(ipsec->rx_sa_list, rsa, hlist, in ixgbevf_ipsec_find_rx_state()
267 struct ixgbevf_ipsec *ipsec; in ixgbevf_ipsec_add_sa() local
272 ipsec = adapter->ipsec; in ixgbevf_ipsec_add_sa()
298 ret = ixgbevf_ipsec_find_empty_idx(ipsec, true); in ixgbevf_ipsec_add_sa()
339 memcpy(&ipsec->rx_tbl[sa_idx], &rsa, sizeof(rsa)); in ixgbevf_ipsec_add_sa()
343 ipsec->num_rx_sa++; in ixgbevf_ipsec_add_sa()
346 hash_add_rcu(ipsec->rx_sa_list, &ipsec->rx_tbl[sa_idx].hlist, in ixgbevf_ipsec_add_sa()
352 ret = ixgbevf_ipsec_find_empty_idx(ipsec, false); in ixgbevf_ipsec_add_sa()
379 memcpy(&ipsec->tx_tbl[sa_idx], &tsa, sizeof(tsa)); in ixgbevf_ipsec_add_sa()
383 ipsec->num_tx_sa++; in ixgbevf_ipsec_add_sa()
397 struct ixgbevf_ipsec *ipsec; in ixgbevf_ipsec_del_sa() local
401 ipsec = adapter->ipsec; in ixgbevf_ipsec_del_sa()
406 if (!ipsec->rx_tbl[sa_idx].used) { in ixgbevf_ipsec_del_sa()
412 ixgbevf_ipsec_del_pf_sa(adapter, ipsec->rx_tbl[sa_idx].pfsa); in ixgbevf_ipsec_del_sa()
413 hash_del_rcu(&ipsec->rx_tbl[sa_idx].hlist); in ixgbevf_ipsec_del_sa()
414 memset(&ipsec->rx_tbl[sa_idx], 0, sizeof(struct rx_sa)); in ixgbevf_ipsec_del_sa()
415 ipsec->num_rx_sa--; in ixgbevf_ipsec_del_sa()
419 if (!ipsec->tx_tbl[sa_idx].used) { in ixgbevf_ipsec_del_sa()
425 ixgbevf_ipsec_del_pf_sa(adapter, ipsec->tx_tbl[sa_idx].pfsa); in ixgbevf_ipsec_del_sa()
426 memset(&ipsec->tx_tbl[sa_idx], 0, sizeof(struct tx_sa)); in ixgbevf_ipsec_del_sa()
427 ipsec->num_tx_sa--; in ixgbevf_ipsec_del_sa()
468 struct ixgbevf_ipsec *ipsec = adapter->ipsec; in ixgbevf_ipsec_tx() local
495 tsa = &ipsec->tx_tbl[sa_idx]; in ixgbevf_ipsec_tx()
563 struct ixgbevf_ipsec *ipsec = adapter->ipsec; in ixgbevf_ipsec_rx() local
604 xs = ixgbevf_ipsec_find_rx_state(ipsec, daddr, proto, spi, !!ip4); in ixgbevf_ipsec_rx()
627 struct ixgbevf_ipsec *ipsec; in ixgbevf_init_ipsec_offload() local
638 ipsec = kzalloc(sizeof(*ipsec), GFP_KERNEL); in ixgbevf_init_ipsec_offload()
639 if (!ipsec) in ixgbevf_init_ipsec_offload()
641 hash_init(ipsec->rx_sa_list); in ixgbevf_init_ipsec_offload()
644 ipsec->rx_tbl = kzalloc(size, GFP_KERNEL); in ixgbevf_init_ipsec_offload()
645 if (!ipsec->rx_tbl) in ixgbevf_init_ipsec_offload()
649 ipsec->tx_tbl = kzalloc(size, GFP_KERNEL); in ixgbevf_init_ipsec_offload()
650 if (!ipsec->tx_tbl) in ixgbevf_init_ipsec_offload()
653 ipsec->num_rx_sa = 0; in ixgbevf_init_ipsec_offload()
654 ipsec->num_tx_sa = 0; in ixgbevf_init_ipsec_offload()
656 adapter->ipsec = ipsec; in ixgbevf_init_ipsec_offload()
670 kfree(ipsec->rx_tbl); in ixgbevf_init_ipsec_offload()
671 kfree(ipsec->tx_tbl); in ixgbevf_init_ipsec_offload()
672 kfree(ipsec); in ixgbevf_init_ipsec_offload()
683 struct ixgbevf_ipsec *ipsec = adapter->ipsec; in ixgbevf_stop_ipsec_offload() local
685 adapter->ipsec = NULL; in ixgbevf_stop_ipsec_offload()
686 if (ipsec) { in ixgbevf_stop_ipsec_offload()
687 kfree(ipsec->rx_tbl); in ixgbevf_stop_ipsec_offload()
688 kfree(ipsec->tx_tbl); in ixgbevf_stop_ipsec_offload()
689 kfree(ipsec); in ixgbevf_stop_ipsec_offload()