Skip to contentSkip to conversation

r8169: Filtered data on Rx descriptor status context

PATCH In review Corcodel Marian 3 participants 4 messages Aug 9, 2015 – Aug 10, 2015 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 r8169: Filtered data on Rx descriptor status context

We want to start evaluate an RES Receive error summary only when LS (LastFrag) occurred but without FirstFrag

drivers/net/ethernet/realtek/r8169.c +5 -1
index 8bf8c3f..0ee0107 100644
@@ -7305,12 +7305,15 @@ static int rtl_rx(struct net_device *dev, struct rtl8169_private *tp, u32 budget
 		if (status & DescOwn)
 			break;
 
+		if (!(status & LastFrag))
+			break;
+
 		/* This barrier is needed to keep us from reading
 		 * any other fields out of the Rx descriptor until
 		 * we know the status of DescOwn
 		 */
 		dma_rmb();
-
+               if (!(status & FirstFrag)) {
 		if (unlikely(status & RxRES)) {
 			netif_info(tp, rx_err, dev, "Rx ERROR. status = %08x\n",
 				   status);
@@ -7323,6 +7326,7 @@ static int rtl_rx(struct net_device *dev, struct rtl8169_private *tp, u32 budget
 				rtl_schedule_task(tp, RTL_FLAG_TASK_RESET_PENDING);
 				dev->stats.rx_fifo_errors++;
 			}
+	       }
 			if ((status & (RxRUNT | RxCRC)) &&
 			    !(status & (RxRWT | RxFOVF)) &&
 			    (dev->features & NETIF_F_RXALL))
Signature · 1 line
2.1.4
#1 lore raw

Hello.

Quoted 28 lines · Corcodel Marian

We want to start evaluate an RES Receive error summary only when LS (LastFrag) occurred but without FirstFrag

drivers/net/ethernet/realtek/r8169.c +4 -1
index 8bf8c3f..0ee0107 100644
@@ -7305,12 +7305,15 @@ static int rtl_rx(struct net_device *dev, struct rtl8169_private *tp, u32 budget
  		if (status & DescOwn)
  			break;
 
+		if (!(status & LastFrag))
+			break;
+
  		/* This barrier is needed to keep us from reading
  		 * any other fields out of the Rx descriptor until
  		 * we know the status of DescOwn
  		 */
  		dma_rmb();
-
+               if (!(status & FirstFrag)) {
  		if (unlikely(status & RxRES)) {
  			netif_info(tp, rx_err, dev, "Rx ERROR. status = %08x\n",
  				   status);

drivers/net/ethernet/realtek/r8169.c static int rtl_rx(struct net_device *dev, struct rtl8169_private *tp, u32 budget · line 7329

Quoted 4 lines
drivers/net/ethernet/realtek/r8169.c +1 -0
@@ -7323,6 +7326,7 @@ static int rtl_rx(struct net_device *dev, struct rtl8169_private *tp, u32 budget
  				rtl_schedule_task(tp, RTL_FLAG_TASK_RESET_PENDING);
  				dev->stats.rx_fifo_errors++;
  			}
+	       }

This won't do, you should reindent the code.

MBR, Sergei

#4 lore raw
In reply to a message not in the archive

Marian Corcodel <[email protected]> :

Quoted 3 lines

This is specified on data sheet only when LS is set must evaluate
RES bit very important patch.Whi say no here not undestand .Please
read Data sheet for more info.

Your patch ignores the following fact: the driver works with maximally sized receive buffers to avoid fragmented packets - see git log for an enlightning journey through the history of the r8169 driver.

Beyond blind datasheet compliance, have you been able to experience FirstFrag = 0 or LastFrag = 0 receive descriptors with the current in-kernel driver ?

Signature · 1 line
Ueimor