Merge branch 'devel' into next
[firefly-linux-kernel-4.4.55.git] / Documentation / networking / driver.txt
index a9ad58b49cc5459c82789bce189d9af51f77344e..03283daa64fef72360667fb979a256aa10a3bb91 100644 (file)
@@ -13,7 +13,7 @@ Transmit path guidelines:
        static int drv_hard_start_xmit(struct sk_buff *skb,
                                       struct net_device *dev)
        {
-               struct drv *dp = dev->priv;
+               struct drv *dp = netdev_priv(dev);
 
                lock_tx(dp);
                ...
@@ -37,7 +37,7 @@ Transmit path guidelines:
                ...
        }
 
-   And then at the end of your TX reclaimation event handling:
+   And then at the end of your TX reclamation event handling:
 
        if (netif_queue_stopped(dp->dev) &&
             TX_BUFFS_AVAIL(dp) > (MAX_SKB_FRAGS + 1))
@@ -61,7 +61,10 @@ Transmit path guidelines:
 2) Do not forget to update netdev->trans_start to jiffies after
    each new tx packet is given to the hardware.
 
-3) Do not forget that once you return 0 from your hard_start_xmit
+3) A hard_start_xmit method must not modify the shared parts of a
+   cloned SKB.
+
+4) Do not forget that once you return 0 from your hard_start_xmit
    method, it is your driver's responsibility to free up the SKB
    and in some finite amount of time.