]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[gve] Add missing memory barriers
authorMichael Brown <mcb30@ipxe.org>
Mon, 6 Oct 2025 15:39:19 +0000 (16:39 +0100)
committerMichael Brown <mcb30@ipxe.org>
Thu, 9 Oct 2025 15:42:20 +0000 (16:42 +0100)
Ensure that remainder of completion records are read only after
verifying the generation bit (or sequence number).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/drivers/net/gve.c

index 11ef353519da58bc10061783ce293dd40cd7c531..1696c249d4ac7a678798568e697c9bef573cef42 100644 (file)
@@ -1493,6 +1493,7 @@ static void gve_poll_tx ( struct net_device *netdev ) {
                        bit = ( dqo->flags & GVE_DQO_TXF_GEN );
                        if ( ( !! bit ) == ( !! gen ) )
                                break;
+                       rmb();
                        tx->done++;
 
                        /* Ignore non-packet completions */
@@ -1583,6 +1584,7 @@ static void gve_poll_rx ( struct net_device *netdev ) {
                        bit = ( dqo->len & cpu_to_le16 ( GVE_DQO_RXL_GEN ) );
                        if ( ( !! bit ) == ( !! gen ) )
                                break;
+                       rmb();
 
                        /* Parse completion */
                        len = ( le16_to_cpu ( dqo->len ) &
@@ -1610,6 +1612,7 @@ static void gve_poll_rx ( struct net_device *netdev ) {
                        /* Check sequence number */
                        if ( ( gqi->seq & GVE_GQI_RX_SEQ_MASK ) != seq )
                                break;
+                       rmb();
                        seq = gve_next ( seq );
 
                        /* Parse completion */