Merge tag 'mlx5-fixes-2020-06-11' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorDavid S. Miller <davem@davemloft.net>
Fri, 12 Jun 2020 01:20:20 +0000 (18:20 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 12 Jun 2020 01:20:20 +0000 (18:20 -0700)
Saeed Mahameed says:

====================
mlx5 fixes 2020-06-11

This series introduces some fixes to mlx5 driver.
For more information please see tag log below.

Please pull and let me know if there is any problem.

For -stable v5.2
  ('net/mlx5: drain health workqueue in case of driver load error')

For -stable v5.3
  ('net/mlx5e: Fix repeated XSK usage on one channel')
  ('net/mlx5: Fix fatal error handling during device load')

For -stable v5.5
 ('net/mlx5: Disable reload while removing the device')

For -stable v5.7
  ('net/mlx5e: CT: Fix ipv6 nat header rewrite actions')
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
net/rxrpc/call_event.c

index 61a51c2..aa1c8ee 100644 (file)
@@ -248,7 +248,18 @@ static void rxrpc_resend(struct rxrpc_call *call, unsigned long now_j)
                if (anno_type != RXRPC_TX_ANNO_RETRANS)
                        continue;
 
+               /* We need to reset the retransmission state, but we need to do
+                * so before we drop the lock as a new ACK/NAK may come in and
+                * confuse things
+                */
+               annotation &= ~RXRPC_TX_ANNO_MASK;
+               annotation |= RXRPC_TX_ANNO_RESENT;
+               call->rxtx_annotations[ix] = annotation;
+
                skb = call->rxtx_buffer[ix];
+               if (!skb)
+                       continue;
+
                rxrpc_get_skb(skb, rxrpc_skb_got);
                spin_unlock_bh(&call->lock);
 
@@ -262,24 +273,6 @@ static void rxrpc_resend(struct rxrpc_call *call, unsigned long now_j)
 
                rxrpc_free_skb(skb, rxrpc_skb_freed);
                spin_lock_bh(&call->lock);
-
-               /* We need to clear the retransmit state, but there are two
-                * things we need to be aware of: A new ACK/NAK might have been
-                * received and the packet might have been hard-ACK'd (in which
-                * case it will no longer be in the buffer).
-                */
-               if (after(seq, call->tx_hard_ack)) {
-                       annotation = call->rxtx_annotations[ix];
-                       anno_type = annotation & RXRPC_TX_ANNO_MASK;
-                       if (anno_type == RXRPC_TX_ANNO_RETRANS ||
-                           anno_type == RXRPC_TX_ANNO_NAK) {
-                               annotation &= ~RXRPC_TX_ANNO_MASK;
-                               annotation |= RXRPC_TX_ANNO_UNACK;
-                       }
-                       annotation |= RXRPC_TX_ANNO_RESENT;
-                       call->rxtx_annotations[ix] = annotation;
-               }
-
                if (after(call->tx_hard_ack, seq))
                        seq = call->tx_hard_ack;
        }