@@ -2444,12 +2444,6 @@ static int ibmvnic_poll(struct napi_struct *napi, int budget)
2444
2444
2445
2445
if (!pending_scrq (adapter , rx_scrq ))
2446
2446
break ;
2447
- /* The queue entry at the current index is peeked at above
2448
- * to determine that there is a valid descriptor awaiting
2449
- * processing. We want to be sure that the current slot
2450
- * holds a valid descriptor before reading its contents.
2451
- */
2452
- dma_rmb ();
2453
2447
next = ibmvnic_next_scrq (adapter , rx_scrq );
2454
2448
rx_buff =
2455
2449
(struct ibmvnic_rx_buff * )be64_to_cpu (next ->
@@ -2516,7 +2510,6 @@ static int ibmvnic_poll(struct napi_struct *napi, int budget)
2516
2510
if (napi_complete_done (napi , frames_processed )) {
2517
2511
enable_scrq_irq (adapter , rx_scrq );
2518
2512
if (pending_scrq (adapter , rx_scrq )) {
2519
- rmb ();
2520
2513
if (napi_reschedule (napi )) {
2521
2514
disable_scrq_irq (adapter , rx_scrq );
2522
2515
goto restart_poll ;
@@ -3189,13 +3182,6 @@ static int ibmvnic_complete_tx(struct ibmvnic_adapter *adapter,
3189
3182
int total_bytes = 0 ;
3190
3183
int num_packets = 0 ;
3191
3184
3192
- /* The queue entry at the current index is peeked at above
3193
- * to determine that there is a valid descriptor awaiting
3194
- * processing. We want to be sure that the current slot
3195
- * holds a valid descriptor before reading its contents.
3196
- */
3197
- dma_rmb ();
3198
-
3199
3185
next = ibmvnic_next_scrq (adapter , scrq );
3200
3186
for (i = 0 ; i < next -> tx_comp .num_comps ; i ++ ) {
3201
3187
if (next -> tx_comp .rcs [i ])
@@ -3569,11 +3555,16 @@ static int pending_scrq(struct ibmvnic_adapter *adapter,
3569
3555
struct ibmvnic_sub_crq_queue * scrq )
3570
3556
{
3571
3557
union sub_crq * entry = & scrq -> msgs [scrq -> cur ];
3558
+ int rc ;
3572
3559
3573
- if (entry -> generic .first & IBMVNIC_CRQ_CMD_RSP )
3574
- return 1 ;
3575
- else
3576
- return 0 ;
3560
+ rc = !!(entry -> generic .first & IBMVNIC_CRQ_CMD_RSP );
3561
+
3562
+ /* Ensure that the SCRQ valid flag is loaded prior to loading the
3563
+ * contents of the SCRQ descriptor
3564
+ */
3565
+ dma_rmb ();
3566
+
3567
+ return rc ;
3577
3568
}
3578
3569
3579
3570
static union sub_crq * ibmvnic_next_scrq (struct ibmvnic_adapter * adapter ,
@@ -3592,8 +3583,8 @@ static union sub_crq *ibmvnic_next_scrq(struct ibmvnic_adapter *adapter,
3592
3583
}
3593
3584
spin_unlock_irqrestore (& scrq -> lock , flags );
3594
3585
3595
- /* Ensure that the entire buffer descriptor has been
3596
- * loaded before reading its contents
3586
+ /* Ensure that the SCRQ valid flag is loaded prior to loading the
3587
+ * contents of the SCRQ descriptor
3597
3588
*/
3598
3589
dma_rmb ();
3599
3590
0 commit comments