mirror of
https://github.com/torvalds/linux.git
synced 2026-04-23 00:55:48 -04:00
ixgbe: restore offloaded SAs after a reset
On a chip reset most of the table contents are lost, so must be restored. This scans the driver's ipsec tables and restores both the filled and empty table slots to their pre-reset values. Signed-off-by: Shannon Nelson <shannon.nelson@oracle.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
This commit is contained in:
committed by
Jeff Kirsher
parent
63a67fe229
commit
6d73a1540b
@@ -298,6 +298,47 @@ static void ixgbe_ipsec_start_engine(struct ixgbe_adapter *adapter)
|
||||
IXGBE_WRITE_FLUSH(hw);
|
||||
}
|
||||
|
||||
/**
|
||||
* ixgbe_ipsec_restore - restore the ipsec HW settings after a reset
|
||||
* @adapter: board private structure
|
||||
**/
|
||||
void ixgbe_ipsec_restore(struct ixgbe_adapter *adapter)
|
||||
{
|
||||
struct ixgbe_ipsec *ipsec = adapter->ipsec;
|
||||
struct ixgbe_hw *hw = &adapter->hw;
|
||||
int i;
|
||||
|
||||
if (!(adapter->flags2 & IXGBE_FLAG2_IPSEC_ENABLED))
|
||||
return;
|
||||
|
||||
/* clean up and restart the engine */
|
||||
ixgbe_ipsec_stop_engine(adapter);
|
||||
ixgbe_ipsec_clear_hw_tables(adapter);
|
||||
ixgbe_ipsec_start_engine(adapter);
|
||||
|
||||
/* reload the IP addrs */
|
||||
for (i = 0; i < IXGBE_IPSEC_MAX_RX_IP_COUNT; i++) {
|
||||
struct rx_ip_sa *ipsa = &ipsec->ip_tbl[i];
|
||||
|
||||
if (ipsa->used)
|
||||
ixgbe_ipsec_set_rx_ip(hw, i, ipsa->ipaddr);
|
||||
}
|
||||
|
||||
/* reload the Rx and Tx keys */
|
||||
for (i = 0; i < IXGBE_IPSEC_MAX_SA_COUNT; i++) {
|
||||
struct rx_sa *rsa = &ipsec->rx_tbl[i];
|
||||
struct tx_sa *tsa = &ipsec->tx_tbl[i];
|
||||
|
||||
if (rsa->used)
|
||||
ixgbe_ipsec_set_rx_sa(hw, i, rsa->xs->id.spi,
|
||||
rsa->key, rsa->salt,
|
||||
rsa->mode, rsa->iptbl_ind);
|
||||
|
||||
if (tsa->used)
|
||||
ixgbe_ipsec_set_tx_sa(hw, i, tsa->key, tsa->salt);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* ixgbe_ipsec_find_empty_idx - find the first unused security parameter index
|
||||
* @ipsec: pointer to ipsec struct
|
||||
|
||||
Reference in New Issue
Block a user