[PATCH] replace skb_clone with skb_get in fcoe_start_io()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



There seems that skb_get could outlight skb_clone, if
retransmitting skb is the major concern.

Signed-off-by: Hillf Danton <dhillf@xxxxxxxxx>
---

--- a/drivers/scsi/fcoe/fcoe.c	2010-09-13 07:07:38.000000000 +0800
+++ b/drivers/scsi/fcoe/fcoe.c	2010-10-17 20:03:08.000000000 +0800
@@ -1373,15 +1373,14 @@ err2:
  */
 static inline int fcoe_start_io(struct sk_buff *skb)
 {
-	struct sk_buff *nskb;
 	int rc;

-	nskb = skb_clone(skb, GFP_ATOMIC);
-	rc = dev_queue_xmit(nskb);
-	if (rc != 0)
+	skb_get(skb); /* bump ref count for retransmitting */
+	rc = dev_queue_xmit(skb);
+	if (rc != NET_XMIT_SUCCESS)
 		return rc;
 	kfree_skb(skb);
-	return 0;
+	return NET_XMIT_SUCCESS;
 }

 /**
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux