|
|
b04c25 |
From f7ffcff30109d03d7f0d0ac9594eebc13a8ca883 Mon Sep 17 00:00:00 2001
|
|
|
b04c25 |
From: Grant Grundler <grundler@chromium.org>
|
|
|
b04c25 |
Date: Mon, 9 May 2022 19:28:24 -0700
|
|
|
b04c25 |
Subject: [PATCH 02/13] net: atlantic: reduce scope of is_rsc_complete
|
|
|
b04c25 |
Patch-mainline: v5.18-rc7
|
|
|
b04c25 |
Git-commit: 79784d77ebbd3ec516b7a5ce555d979fb7946202
|
|
|
b04c25 |
References: jsc#PED-1530
|
|
|
b04c25 |
|
|
|
b04c25 |
Don't defer handling the err case outside the loop. That's pointless.
|
|
|
b04c25 |
|
|
|
b04c25 |
And since is_rsc_complete is only used inside this loop, declare
|
|
|
b04c25 |
it inside the loop to reduce it's scope.
|
|
|
b04c25 |
|
|
|
b04c25 |
Signed-off-by: Grant Grundler <grundler@chromium.org>
|
|
|
b04c25 |
Signed-off-by: David S. Miller <davem@davemloft.net>
|
|
|
b04c25 |
Signed-off-by: Denis Kirjanov <denis.kirjanov@suse.com>
|
|
|
b04c25 |
---
|
|
|
b04c25 |
drivers/net/ethernet/aquantia/atlantic/aq_ring.c | 13 ++++++-------
|
|
|
b04c25 |
1 file changed, 6 insertions(+), 7 deletions(-)
|
|
|
b04c25 |
|
|
|
b04c25 |
diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_ring.c b/drivers/net/ethernet/aquantia/atlantic/aq_ring.c
|
|
|
b04c25 |
index 7cf5a48e9a7d..339efdfb1d49 100644
|
|
|
b04c25 |
--- a/drivers/net/ethernet/aquantia/atlantic/aq_ring.c
|
|
|
b04c25 |
+++ b/drivers/net/ethernet/aquantia/atlantic/aq_ring.c
|
|
|
b04c25 |
@@ -345,7 +345,6 @@ int aq_ring_rx_clean(struct aq_ring_s *self,
|
|
|
b04c25 |
int budget)
|
|
|
b04c25 |
{
|
|
|
b04c25 |
struct net_device *ndev = aq_nic_get_ndev(self->aq_nic);
|
|
|
b04c25 |
- bool is_rsc_completed = true;
|
|
|
b04c25 |
int err = 0;
|
|
|
b04c25 |
|
|
|
b04c25 |
for (; (self->sw_head != self->hw_head) && budget;
|
|
|
b04c25 |
@@ -365,6 +364,8 @@ int aq_ring_rx_clean(struct aq_ring_s *self,
|
|
|
b04c25 |
if (!buff->is_eop) {
|
|
|
b04c25 |
buff_ = buff;
|
|
|
b04c25 |
do {
|
|
|
b04c25 |
+ bool is_rsc_completed = true;
|
|
|
b04c25 |
+
|
|
|
b04c25 |
if (buff_->next >= self->size) {
|
|
|
b04c25 |
err = -EIO;
|
|
|
b04c25 |
goto err_exit;
|
|
|
b04c25 |
@@ -376,18 +377,16 @@ int aq_ring_rx_clean(struct aq_ring_s *self,
|
|
|
b04c25 |
next_,
|
|
|
b04c25 |
self->hw_head);
|
|
|
b04c25 |
|
|
|
b04c25 |
- if (unlikely(!is_rsc_completed))
|
|
|
b04c25 |
- break;
|
|
|
b04c25 |
+ if (unlikely(!is_rsc_completed)) {
|
|
|
b04c25 |
+ err = 0;
|
|
|
b04c25 |
+ goto err_exit;
|
|
|
b04c25 |
+ }
|
|
|
b04c25 |
|
|
|
b04c25 |
buff->is_error |= buff_->is_error;
|
|
|
b04c25 |
buff->is_cso_err |= buff_->is_cso_err;
|
|
|
b04c25 |
|
|
|
b04c25 |
} while (!buff_->is_eop);
|
|
|
b04c25 |
|
|
|
b04c25 |
- if (!is_rsc_completed) {
|
|
|
b04c25 |
- err = 0;
|
|
|
b04c25 |
- goto err_exit;
|
|
|
b04c25 |
- }
|
|
|
b04c25 |
if (buff->is_error ||
|
|
|
b04c25 |
(buff->is_lro && buff->is_cso_err)) {
|
|
|
b04c25 |
buff_ = buff;
|
|
|
b04c25 |
--
|
|
|
b04c25 |
2.16.4
|
|
|
b04c25 |
|