driverdev-devel.linuxdriverproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: octeon: Drop on uncorrectable alignment or FCS error
@ 2020-01-08 16:10 Alexander X Sverdlin
  2020-01-10 12:48 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 4+ messages in thread
From: Alexander X Sverdlin @ 2020-01-08 16:10 UTC (permalink / raw)
  To: devel
  Cc: Aaro Koskinen, Greg Kroah-Hartman, Ralf Baechle,
	Alexander Sverdlin, netdev, David S. Miller

From: Alexander Sverdlin <alexander.sverdlin@nokia.com>

Currently in case of alignment or FCS error if the packet cannot be
corrected it's still not dropped. Report the error properly and drop the
packet while making the code around a little bit more readable.

Fixes: 80ff0fd3ab ("Staging: Add octeon-ethernet driver files.")
Signed-off-by: Alexander Sverdlin <alexander.sverdlin@nokia.com>
---
 drivers/staging/octeon/ethernet-rx.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/octeon/ethernet-rx.c b/drivers/staging/octeon/ethernet-rx.c
index 2c16230..edee9b5 100644
--- a/drivers/staging/octeon/ethernet-rx.c
+++ b/drivers/staging/octeon/ethernet-rx.c
@@ -69,15 +69,17 @@ static inline int cvm_oct_check_rcv_error(struct cvmx_wqe *work)
 	else
 		port = work->word1.cn38xx.ipprt;
 
-	if ((work->word2.snoip.err_code == 10) && (work->word1.len <= 64)) {
+	if ((work->word2.snoip.err_code == 10) && (work->word1.len <= 64))
 		/*
 		 * Ignore length errors on min size packets. Some
 		 * equipment incorrectly pads packets to 64+4FCS
 		 * instead of 60+4FCS.  Note these packets still get
 		 * counted as frame errors.
 		 */
-	} else if (work->word2.snoip.err_code == 5 ||
-		   work->word2.snoip.err_code == 7) {
+		return 0;
+
+	if (work->word2.snoip.err_code == 5 ||
+	    work->word2.snoip.err_code == 7) {
 		/*
 		 * We received a packet with either an alignment error
 		 * or a FCS error. This may be signalling that we are
@@ -125,14 +127,12 @@ static inline int cvm_oct_check_rcv_error(struct cvmx_wqe *work)
 				return 1;
 			}
 		}
-	} else {
-		printk_ratelimited("Port %d receive error code %d, packet dropped\n",
-				   port, work->word2.snoip.err_code);
-		cvm_oct_free_work(work);
-		return 1;
 	}
 
-	return 0;
+	printk_ratelimited("Port %d receive error code %d, packet dropped\n",
+			   port, work->word2.snoip.err_code);
+	cvm_oct_free_work(work);
+	return 1;
 }
 
 static void copy_segments_to_skb(struct cvmx_wqe *work, struct sk_buff *skb)
-- 
2.4.6

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] staging: octeon: Drop on uncorrectable alignment or FCS error
  2020-01-08 16:10 [PATCH] staging: octeon: Drop on uncorrectable alignment or FCS error Alexander X Sverdlin
@ 2020-01-10 12:48 ` Greg Kroah-Hartman
  2020-10-09  9:34   ` Alexander Sverdlin
  0 siblings, 1 reply; 4+ messages in thread
From: Greg Kroah-Hartman @ 2020-01-10 12:48 UTC (permalink / raw)
  To: Alexander X Sverdlin
  Cc: devel, netdev, David S. Miller, Ralf Baechle, Aaro Koskinen

On Wed, Jan 08, 2020 at 05:10:42PM +0100, Alexander X Sverdlin wrote:
> From: Alexander Sverdlin <alexander.sverdlin@nokia.com>
> 
> Currently in case of alignment or FCS error if the packet cannot be
> corrected it's still not dropped. Report the error properly and drop the
> packet while making the code around a little bit more readable.
> 
> Fixes: 80ff0fd3ab ("Staging: Add octeon-ethernet driver files.")
> Signed-off-by: Alexander Sverdlin <alexander.sverdlin@nokia.com>
> ---
>  drivers/staging/octeon/ethernet-rx.c | 18 +++++++++---------
>  1 file changed, 9 insertions(+), 9 deletions(-)

This driver is now deleted from the tree, sorry.

greg k-h
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] staging: octeon: Drop on uncorrectable alignment or FCS error
  2020-01-10 12:48 ` Greg Kroah-Hartman
@ 2020-10-09  9:34   ` Alexander Sverdlin
  2020-10-09  9:40     ` Greg Kroah-Hartman
  0 siblings, 1 reply; 4+ messages in thread
From: Alexander Sverdlin @ 2020-10-09  9:34 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: devel, netdev, David S. Miller, Ralf Baechle, Aaro Koskinen

Hello Greg,

On 10/01/2020 13:48, Greg Kroah-Hartman wrote:
> On Wed, Jan 08, 2020 at 05:10:42PM +0100, Alexander X Sverdlin wrote:
>> From: Alexander Sverdlin <alexander.sverdlin@nokia.com>
>>
>> Currently in case of alignment or FCS error if the packet cannot be
>> corrected it's still not dropped. Report the error properly and drop the
>> packet while making the code around a little bit more readable.
>>
>> Fixes: 80ff0fd3ab ("Staging: Add octeon-ethernet driver files.")
>> Signed-off-by: Alexander Sverdlin <alexander.sverdlin@nokia.com>
>> ---
>>  drivers/staging/octeon/ethernet-rx.c | 18 +++++++++---------
>>  1 file changed, 9 insertions(+), 9 deletions(-)
> 
> This driver is now deleted from the tree, sorry.

Now that the driver is restored, would you please consider this patch again?

-- 
Best regards,
Alexander Sverdlin.
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] staging: octeon: Drop on uncorrectable alignment or FCS error
  2020-10-09  9:34   ` Alexander Sverdlin
@ 2020-10-09  9:40     ` Greg Kroah-Hartman
  0 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2020-10-09  9:40 UTC (permalink / raw)
  To: Alexander Sverdlin
  Cc: devel, netdev, David S. Miller, Ralf Baechle, Aaro Koskinen

On Fri, Oct 09, 2020 at 11:34:47AM +0200, Alexander Sverdlin wrote:
> Hello Greg,
> 
> On 10/01/2020 13:48, Greg Kroah-Hartman wrote:
> > On Wed, Jan 08, 2020 at 05:10:42PM +0100, Alexander X Sverdlin wrote:
> >> From: Alexander Sverdlin <alexander.sverdlin@nokia.com>
> >>
> >> Currently in case of alignment or FCS error if the packet cannot be
> >> corrected it's still not dropped. Report the error properly and drop the
> >> packet while making the code around a little bit more readable.
> >>
> >> Fixes: 80ff0fd3ab ("Staging: Add octeon-ethernet driver files.")
> >> Signed-off-by: Alexander Sverdlin <alexander.sverdlin@nokia.com>
> >> ---
> >>  drivers/staging/octeon/ethernet-rx.c | 18 +++++++++---------
> >>  1 file changed, 9 insertions(+), 9 deletions(-)
> > 
> > This driver is now deleted from the tree, sorry.
> 
> Now that the driver is restored, would you please consider this patch again?

Feel free to submit it again if you feel it is still needed.

thanks,

greg k-h
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-10-09 10:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-08 16:10 [PATCH] staging: octeon: Drop on uncorrectable alignment or FCS error Alexander X Sverdlin
2020-01-10 12:48 ` Greg Kroah-Hartman
2020-10-09  9:34   ` Alexander Sverdlin
2020-10-09  9:40     ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).