From: Jiawen Wu Date: Fri, 5 Mar 2021 02:14:38 +0000 (+0800) Subject: net/txgbe: fix adding crypto SA X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=f9d1a07f64ddb0fbcac74e9861249b4525db61bc;p=dpdk.git net/txgbe: fix adding crypto SA By register definition, Ipsec Rx IPv4 address should to be written in the reg(0). Fixes: 07cafb2adbc5 ("net/txgbe: add security session create operation") Cc: stable@dpdk.org Signed-off-by: Jiawen Wu --- diff --git a/drivers/net/txgbe/txgbe_ipsec.c b/drivers/net/txgbe/txgbe_ipsec.c index 9f4eee4081..a43b95aa2b 100644 --- a/drivers/net/txgbe/txgbe_ipsec.c +++ b/drivers/net/txgbe/txgbe_ipsec.c @@ -145,11 +145,11 @@ txgbe_crypto_add_sa(struct txgbe_crypto_session *ic_session) reg_val = TXGBE_IPSRXIDX_ENA | TXGBE_IPSRXIDX_WRITE | TXGBE_IPSRXIDX_TB_IP | (ip_index << 3); if (priv->rx_ip_tbl[ip_index].ip.type == IPv4) { - wr32(hw, TXGBE_IPSRXADDR(0), 0); + uint32_t ipv4 = priv->rx_ip_tbl[ip_index].ip.ipv4; + wr32(hw, TXGBE_IPSRXADDR(0), rte_cpu_to_be_32(ipv4)); wr32(hw, TXGBE_IPSRXADDR(1), 0); wr32(hw, TXGBE_IPSRXADDR(2), 0); - wr32(hw, TXGBE_IPSRXADDR(3), - priv->rx_ip_tbl[ip_index].ip.ipv4); + wr32(hw, TXGBE_IPSRXADDR(3), 0); } else { wr32(hw, TXGBE_IPSRXADDR(0), priv->rx_ip_tbl[ip_index].ip.ipv6[0]);