Thread (24 messages) flat view 24 messages, 5 authors, 2012-02-13

Re: [PATCH v3 02/16] e100: Support RXFCS feature flag.

From: Michał Mirosław <hidden>
Date: 2012-02-11 16:08:03

2012/2/11  [off-list ref]:
From: Ben Greear <redacted>
[...]
quoted hunk ↗ jump to hunk
@@ -1951,9 +1956,11 @@ static int e100_rx_indicate(struct nic *nic, struct rx *rx,
       }

       /* Get actual data size */
+       if (unlikely(dev->features & NETIF_F_RXFCS))
+               fcs_pad = 4;
       actual_size = le16_to_cpu(rfd->actual_size) & 0x3FFF;
-       if (unlikely(actual_size > RFD_BUF_LEN - sizeof(struct rfd)))
-               actual_size = RFD_BUF_LEN - sizeof(struct rfd);
+       if (unlikely(actual_size > RFD_BUF_LEN + fcs_pad - sizeof(struct rfd)))
+               actual_size = RFD_BUF_LEN + fcs_pad - sizeof(struct rfd);
BTW, Is this even triggered? I looks like this would indicate
corruption in the descriptor.

Best Regards,
Michał Mirosław
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help