Commit 39224417 authored by David Brownell's avatar David Brownell Committed by Greg Kroah-Hartman

[PATCH] USB GeneLink/NDIS tweaks

USB GeneLink/NDIS tweaks

This patch, from Oliver, discards slightly less data in cases
where memory is very tight.  The GeneLink framing can batch
several packets in one transmission, so it's always possible to
at least report the last one, since it's already sitting in an SKB
and we won't need a new one.

Random note, this seems to be the same issue I saw
mentioned somewhere else recently:  MSFT host drivers
with high latency for submitting bulk packets, so rather
than just queuing them as they arrive, it turns out to be a
win on the MSFT side to batch packets.
parent 714c25ed
......@@ -538,25 +538,25 @@ static int genelink_rx_fixup (struct usbnet *dev, struct sk_buff *skb)
// allocate the skb for the individual packet
gl_skb = alloc_skb (size, GFP_ATOMIC);
if (gl_skb == 0)
return 0;
if (gl_skb) {
// copy the packet data to the new skb
memcpy (gl_skb->data, packet->packet_data, size);
// copy the packet data to the new skb
memcpy (gl_skb->data, packet->packet_data, size);
// set skb data size
gl_skb->len = size;
gl_skb->dev = &dev->net;
// set skb data size
gl_skb->len = size;
gl_skb->dev = &dev->net;
// determine the packet's protocol ID
gl_skb->protocol = eth_type_trans (gl_skb, &dev->net);
// determine the packet's protocol ID
gl_skb->protocol = eth_type_trans (gl_skb, &dev->net);
// update the status
dev->stats.rx_packets++;
dev->stats.rx_bytes += size;
// update the status
dev->stats.rx_packets++;
dev->stats.rx_bytes += size;
// notify os of the received packet
status = netif_rx (gl_skb);
// notify os of the received packet
status = netif_rx (gl_skb);
}
// advance to the next packet
packet = (struct gl_packet *)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment