[gve] Add missing memory barriers

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>
This commit is contained in:
Michael Brown
2025-10-06 16:39:19 +01:00
parent 5438299649
commit c2d7ddd0c2

View File

@@ -1493,6 +1493,7 @@ static void gve_poll_tx ( struct net_device *netdev ) {
bit = ( dqo->flags & GVE_DQO_TXF_GEN ); bit = ( dqo->flags & GVE_DQO_TXF_GEN );
if ( ( !! bit ) == ( !! gen ) ) if ( ( !! bit ) == ( !! gen ) )
break; break;
rmb();
tx->done++; tx->done++;
/* Ignore non-packet completions */ /* 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 ) ); bit = ( dqo->len & cpu_to_le16 ( GVE_DQO_RXL_GEN ) );
if ( ( !! bit ) == ( !! gen ) ) if ( ( !! bit ) == ( !! gen ) )
break; break;
rmb();
/* Parse completion */ /* Parse completion */
len = ( le16_to_cpu ( dqo->len ) & len = ( le16_to_cpu ( dqo->len ) &
@@ -1610,6 +1612,7 @@ static void gve_poll_rx ( struct net_device *netdev ) {
/* Check sequence number */ /* Check sequence number */
if ( ( gqi->seq & GVE_GQI_RX_SEQ_MASK ) != seq ) if ( ( gqi->seq & GVE_GQI_RX_SEQ_MASK ) != seq )
break; break;
rmb();
seq = gve_next ( seq ); seq = gve_next ( seq );
/* Parse completion */ /* Parse completion */