Skip to content

Commit 421d954

Browse files
Alexander DuyckJeff Kirsher
authored andcommitted
ixgbe: Fix bit definitions and add support for testing for ipsec support
This patch addresses two issues. First it adds the correct bit definitions for the SECTXSTAT and SECRXSTAT registers. Then it makes use of those definitions to test for if IPsec has been disabled on the part and if so we do not enable it. Signed-off-by: Alexander Duyck <[email protected]> Reported-by: Andre Tomt <[email protected]> Acked-by: Shannon Nelson <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent e9f655e commit 421d954

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -975,10 +975,22 @@ void ixgbe_ipsec_rx(struct ixgbe_ring *rx_ring,
975975
**/
976976
void ixgbe_init_ipsec_offload(struct ixgbe_adapter *adapter)
977977
{
978+
struct ixgbe_hw *hw = &adapter->hw;
978979
struct ixgbe_ipsec *ipsec;
980+
u32 t_dis, r_dis;
979981
size_t size;
980982

981-
if (adapter->hw.mac.type == ixgbe_mac_82598EB)
983+
if (hw->mac.type == ixgbe_mac_82598EB)
984+
return;
985+
986+
/* If there is no support for either Tx or Rx offload
987+
* we should not be advertising support for IPsec.
988+
*/
989+
t_dis = IXGBE_READ_REG(hw, IXGBE_SECTXSTAT) &
990+
IXGBE_SECTXSTAT_SECTX_OFF_DIS;
991+
r_dis = IXGBE_READ_REG(hw, IXGBE_SECRXSTAT) &
992+
IXGBE_SECRXSTAT_SECRX_OFF_DIS;
993+
if (t_dis || r_dis)
982994
return;
983995

984996
ipsec = kzalloc(sizeof(*ipsec), GFP_KERNEL);

drivers/net/ethernet/intel/ixgbe/ixgbe_type.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -599,13 +599,15 @@ struct ixgbe_nvm_version {
599599
#define IXGBE_SECTXCTRL_STORE_FORWARD 0x00000004
600600

601601
#define IXGBE_SECTXSTAT_SECTX_RDY 0x00000001
602-
#define IXGBE_SECTXSTAT_ECC_TXERR 0x00000002
602+
#define IXGBE_SECTXSTAT_SECTX_OFF_DIS 0x00000002
603+
#define IXGBE_SECTXSTAT_ECC_TXERR 0x00000004
603604

604605
#define IXGBE_SECRXCTRL_SECRX_DIS 0x00000001
605606
#define IXGBE_SECRXCTRL_RX_DIS 0x00000002
606607

607608
#define IXGBE_SECRXSTAT_SECRX_RDY 0x00000001
608-
#define IXGBE_SECRXSTAT_ECC_RXERR 0x00000002
609+
#define IXGBE_SECRXSTAT_SECRX_OFF_DIS 0x00000002
610+
#define IXGBE_SECRXSTAT_ECC_RXERR 0x00000004
609611

610612
/* LinkSec (MacSec) Registers */
611613
#define IXGBE_LSECTXCAP 0x08A00

0 commit comments

Comments
 (0)