On 5/2/06, Ben Greear <[EMAIL PROTECTED]> wrote:
In commit: a292ca6efbc1f259ddfb9c902367f2588e0e8b0f
to e1000_main.c, there is the change below.
I am curious why the skb_put no longer subtracts ETHERNET_FCS_SIZE
from the length. Is the idea that we will now always include the
FCS at the end of the skb?
This is a long and hairy story behind this, but there is a bit called
SECRC that controls hardware stripping of the CRC. In *this* driver
we turned that bit on, so that we didn't have to mess with skb->len -=
4 and the nasty negative unwrap if we were using multiple descriptors
for rx.
Since then, we've removed multiple descriptor rx.
And after that, I've discovered that some BMCs are very unhappy if we
strip CRCs using SECRC.
So, my related question is: is it okay if we just always leave the CRC
on the end of the data? It doesn't seem to harm anything.
It also seems that the skb_put for the else clause is missing here, but
I think it is fixed in some later patch.
The main reason I ask is that I have a patch that enabled reception of the
FCS in 2.6.13. It used a flag to determine whether to subtract the
ETHERNET_FCS_SIZE
from length (or not, if we are capturing FCS). I am trying to figure out if
this
is still needed in the later releases.
Well, its a changing picture. I had planned to eventually enable the
hardware to strip the CRC if we aren't connected to some kind of
offboard management. We'll get there in steps.
Thanks,
Ben
@@ -3613,17 +3618,40 @@ #endif
}
}
- /* Good Receive */
- skb_put(skb, length - ETHERNET_FCS_SIZE);
+ /* code added for copybreak, this should improve
+ * performance for small packets with large amounts
+ * of reassembly being done in the stack */
+#define E1000_CB_LENGTH 256
+ if ((length < E1000_CB_LENGTH) &&
+ !rx_ring->rx_skb_top &&
+ /* or maybe (status & E1000_RXD_STAT_EOP) && */
+ !multi_descriptor) {
+ struct sk_buff *new_skb =
+ dev_alloc_skb(length + NET_IP_ALIGN);
+ if (new_skb) {
+ skb_reserve(new_skb, NET_IP_ALIGN);
+ new_skb->dev = netdev;
+ memcpy(new_skb->data - NET_IP_ALIGN,
+ skb->data - NET_IP_ALIGN,
+ length + NET_IP_ALIGN);
+ /* save the skb in buffer_info as good */
+ buffer_info->skb = skb;
+ skb = new_skb;
+ skb_put(skb, length);
+ }
+ }
+
+ /* end copybreak code */
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html