net/txgbe: fix adding crypto SA
authorJiawen Wu <jiawenwu@trustnetic.com>
Fri, 5 Mar 2021 02:14:38 +0000 (10:14 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 8 Mar 2021 11:32:33 +0000 (12:32 +0100)
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 <jiawenwu@trustnetic.com>
drivers/net/txgbe/txgbe_ipsec.c

index 9f4eee4..a43b95a 100644 (file)
@@ -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]);