|
@@ -19,8 +19,9 @@ static void ixgbe_ipsec_set_tx_sa(struct ixgbe_hw *hw, u16 idx,
|
|
|
int i;
|
|
|
|
|
|
for (i = 0; i < 4; i++)
|
|
|
- IXGBE_WRITE_REG(hw, IXGBE_IPSTXKEY(i), cpu_to_be32(key[3 - i]));
|
|
|
- IXGBE_WRITE_REG(hw, IXGBE_IPSTXSALT, cpu_to_be32(salt));
|
|
|
+ IXGBE_WRITE_REG(hw, IXGBE_IPSTXKEY(i),
|
|
|
+ (__force u32)cpu_to_be32(key[3 - i]));
|
|
|
+ IXGBE_WRITE_REG(hw, IXGBE_IPSTXSALT, (__force u32)cpu_to_be32(salt));
|
|
|
IXGBE_WRITE_FLUSH(hw);
|
|
|
|
|
|
reg = IXGBE_READ_REG(hw, IXGBE_IPSTXIDX);
|
|
@@ -69,7 +70,8 @@ static void ixgbe_ipsec_set_rx_sa(struct ixgbe_hw *hw, u16 idx, __be32 spi,
|
|
|
int i;
|
|
|
|
|
|
/* store the SPI (in bigendian) and IPidx */
|
|
|
- IXGBE_WRITE_REG(hw, IXGBE_IPSRXSPI, cpu_to_le32(spi));
|
|
|
+ IXGBE_WRITE_REG(hw, IXGBE_IPSRXSPI,
|
|
|
+ (__force u32)cpu_to_le32((__force u32)spi));
|
|
|
IXGBE_WRITE_REG(hw, IXGBE_IPSRXIPIDX, ip_idx);
|
|
|
IXGBE_WRITE_FLUSH(hw);
|
|
|
|
|
@@ -77,8 +79,9 @@ static void ixgbe_ipsec_set_rx_sa(struct ixgbe_hw *hw, u16 idx, __be32 spi,
|
|
|
|
|
|
/* store the key, salt, and mode */
|
|
|
for (i = 0; i < 4; i++)
|
|
|
- IXGBE_WRITE_REG(hw, IXGBE_IPSRXKEY(i), cpu_to_be32(key[3 - i]));
|
|
|
- IXGBE_WRITE_REG(hw, IXGBE_IPSRXSALT, cpu_to_be32(salt));
|
|
|
+ IXGBE_WRITE_REG(hw, IXGBE_IPSRXKEY(i),
|
|
|
+ (__force u32)cpu_to_be32(key[3 - i]));
|
|
|
+ IXGBE_WRITE_REG(hw, IXGBE_IPSRXSALT, (__force u32)cpu_to_be32(salt));
|
|
|
IXGBE_WRITE_REG(hw, IXGBE_IPSRXMOD, mode);
|
|
|
IXGBE_WRITE_FLUSH(hw);
|
|
|
|
|
@@ -97,7 +100,8 @@ static void ixgbe_ipsec_set_rx_ip(struct ixgbe_hw *hw, u16 idx, __be32 addr[])
|
|
|
|
|
|
/* store the ip address */
|
|
|
for (i = 0; i < 4; i++)
|
|
|
- IXGBE_WRITE_REG(hw, IXGBE_IPSRXIPADDR(i), cpu_to_le32(addr[i]));
|
|
|
+ IXGBE_WRITE_REG(hw, IXGBE_IPSRXIPADDR(i),
|
|
|
+ (__force u32)cpu_to_le32((__force u32)addr[i]));
|
|
|
IXGBE_WRITE_FLUSH(hw);
|
|
|
|
|
|
ixgbe_ipsec_set_rx_item(hw, idx, ips_rx_ip_tbl);
|
|
@@ -367,7 +371,8 @@ static struct xfrm_state *ixgbe_ipsec_find_rx_state(struct ixgbe_ipsec *ipsec,
|
|
|
struct xfrm_state *ret = NULL;
|
|
|
|
|
|
rcu_read_lock();
|
|
|
- hash_for_each_possible_rcu(ipsec->rx_sa_list, rsa, hlist, spi)
|
|
|
+ hash_for_each_possible_rcu(ipsec->rx_sa_list, rsa, hlist,
|
|
|
+ (__force u32)spi) {
|
|
|
if (spi == rsa->xs->id.spi &&
|
|
|
((ip4 && *daddr == rsa->xs->id.daddr.a4) ||
|
|
|
(!ip4 && !memcmp(daddr, &rsa->xs->id.daddr.a6,
|
|
@@ -377,6 +382,7 @@ static struct xfrm_state *ixgbe_ipsec_find_rx_state(struct ixgbe_ipsec *ipsec,
|
|
|
xfrm_state_hold(ret);
|
|
|
break;
|
|
|
}
|
|
|
+ }
|
|
|
rcu_read_unlock();
|
|
|
return ret;
|
|
|
}
|
|
@@ -569,7 +575,7 @@ static int ixgbe_ipsec_add_sa(struct xfrm_state *xs)
|
|
|
|
|
|
/* hash the new entry for faster search in Rx path */
|
|
|
hash_add_rcu(ipsec->rx_sa_list, &ipsec->rx_tbl[sa_idx].hlist,
|
|
|
- rsa.xs->id.spi);
|
|
|
+ (__force u64)rsa.xs->id.spi);
|
|
|
} else {
|
|
|
struct tx_sa tsa;
|
|
|
|
|
@@ -653,7 +659,8 @@ static void ixgbe_ipsec_del_sa(struct xfrm_state *xs)
|
|
|
if (!ipsec->ip_tbl[ipi].ref_cnt) {
|
|
|
memset(&ipsec->ip_tbl[ipi], 0,
|
|
|
sizeof(struct rx_ip_sa));
|
|
|
- ixgbe_ipsec_set_rx_ip(hw, ipi, zerobuf);
|
|
|
+ ixgbe_ipsec_set_rx_ip(hw, ipi,
|
|
|
+ (__force __be32 *)zerobuf);
|
|
|
}
|
|
|
}
|
|
|
|