mirror of
https://github.com/ipxe/ipxe
synced 2025-12-06 17:30:26 +03:00
[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:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user