All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 1/6] ethtool: Remove exception to the requirement of holding RTNL lock
       [not found] <HEAD <1333672667.2652.22.camel@bwh-desktop.uk.solarflarecom.com>
@ 2012-04-06  0:38 ` Ben Hutchings
  2012-04-06  0:39 ` [PATCH net-next 2/6] doc, net: Remove obsolete reference to dev->poll Ben Hutchings
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: Ben Hutchings @ 2012-04-06  0:38 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

Commit e52ac3398c3d772d372b9b62ab408fd5eec96840 ('net: Use device
model to get driver name in skb_gso_segment()') removed the only
in-tree caller of ethtool ops that doesn't hold the RTNL lock.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
 include/linux/ethtool.h |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index 560a247..89d68d8 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -923,8 +923,7 @@ static inline u32 ethtool_rxfh_indir_default(u32 index, u32 n_rx_rings)
  *
  * All operations are optional (i.e. the function pointer may be set
  * to %NULL) and callers must take this into account.  Callers must
- * hold the RTNL, except that for @get_drvinfo the caller may or may
- * not hold the RTNL.
+ * hold the RTNL lock.
  *
  * See the structures used by these operations for further documentation.
  *
-- 
1.7.7.6



-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH net-next 2/6] doc, net: Remove obsolete reference to dev->poll
       [not found] <HEAD <1333672667.2652.22.camel@bwh-desktop.uk.solarflarecom.com>
  2012-04-06  0:38 ` [PATCH net-next 1/6] ethtool: Remove exception to the requirement of holding RTNL lock Ben Hutchings
@ 2012-04-06  0:39 ` Ben Hutchings
  2012-04-06  0:39 ` [PATCH net-next 3/6] doc, net: Update documentation of synchronisation for TX multiqueue Ben Hutchings
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: Ben Hutchings @ 2012-04-06  0:39 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

Commit bea3348eef27e6044b6161fd04c3152215f96411 ('[NET]: Make NAPI
polling independent of struct net_device objects.') removed the
automatic disabling of NAPI polling by dev_close(), and drivers
must now do this themselves.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
 Documentation/networking/netdevices.txt |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/Documentation/networking/netdevices.txt b/Documentation/networking/netdevices.txt
index 8935834..336fe8e 100644
--- a/Documentation/networking/netdevices.txt
+++ b/Documentation/networking/netdevices.txt
@@ -54,8 +54,7 @@ dev->open:
 dev->stop:
 	Synchronization: rtnl_lock() semaphore.
 	Context: process
-	Note1: netif_running() is guaranteed false
-	Note2: dev->poll() is guaranteed to be stopped
+	Note: netif_running() is guaranteed false
 
 dev->do_ioctl:
 	Synchronization: rtnl_lock() semaphore.
-- 
1.7.7.6



-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH net-next 3/6] doc, net: Update documentation of synchronisation for TX multiqueue
       [not found] <HEAD <1333672667.2652.22.camel@bwh-desktop.uk.solarflarecom.com>
  2012-04-06  0:38 ` [PATCH net-next 1/6] ethtool: Remove exception to the requirement of holding RTNL lock Ben Hutchings
  2012-04-06  0:39 ` [PATCH net-next 2/6] doc, net: Remove obsolete reference to dev->poll Ben Hutchings
@ 2012-04-06  0:39 ` Ben Hutchings
  2012-04-06  0:39 ` [PATCH net-next 4/6] doc, net: Update netdev operation names Ben Hutchings
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: Ben Hutchings @ 2012-04-06  0:39 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

Commits e308a5d806c852f56590ffdd3834d0df0cbed8d7 ('netdev: Add
netdev->addr_list_lock protection.') and
e8a0464cc950972824e2e128028ae3db666ec1ed ('netdev: Allocate multiple
queues for TX.') introduced more fine-grained locks.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
 Documentation/networking/netdevices.txt |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Documentation/networking/netdevices.txt b/Documentation/networking/netdevices.txt
index 336fe8e..b107733 100644
--- a/Documentation/networking/netdevices.txt
+++ b/Documentation/networking/netdevices.txt
@@ -65,7 +65,7 @@ dev->get_stats:
 	Context: nominally process, but don't sleep inside an rwlock
 
 dev->hard_start_xmit:
-	Synchronization: netif_tx_lock spinlock.
+	Synchronization: __netif_tx_lock spinlock.
 
 	When the driver sets NETIF_F_LLTX in dev->features this will be
 	called without holding netif_tx_lock. In this case the driver
@@ -87,12 +87,12 @@ dev->hard_start_xmit:
 	  Only valid when NETIF_F_LLTX is set.
 
 dev->tx_timeout:
-	Synchronization: netif_tx_lock spinlock.
+	Synchronization: netif_tx_lock spinlock; all TX queues frozen.
 	Context: BHs disabled
 	Notes: netif_queue_stopped() is guaranteed true
 
 dev->set_rx_mode:
-	Synchronization: netif_tx_lock spinlock.
+	Synchronization: netif_addr_lock spinlock.
 	Context: BHs disabled
 
 struct napi_struct synchronization rules
-- 
1.7.7.6



-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH net-next 4/6] doc, net: Update netdev operation names
       [not found] <HEAD <1333672667.2652.22.camel@bwh-desktop.uk.solarflarecom.com>
                   ` (2 preceding siblings ...)
  2012-04-06  0:39 ` [PATCH net-next 3/6] doc, net: Update documentation of synchronisation for TX multiqueue Ben Hutchings
@ 2012-04-06  0:39 ` Ben Hutchings
  2012-04-06  0:40 ` [PATCH net-next 5/6] doc, net: Remove instruction to set net_device::trans_start Ben Hutchings
  2012-04-06  0:40 ` [PATCH net-next 6/6] doc, net: Update ndo_start_xmit return type and values Ben Hutchings
  5 siblings, 0 replies; 6+ messages in thread
From: Ben Hutchings @ 2012-04-06  0:39 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

Commits d314774cf2cd5dfeb39a00d37deee65d4c627927 ('netdev: network
device operations infrastructure') and
008298231abbeb91bc7be9e8b078607b816d1a4a ('netdev: add more functions
to netdevice ops') moved and renamed net device operation pointers.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
 Documentation/networking/driver.txt     |   12 ++++++------
 Documentation/networking/netdevices.txt |   16 ++++++++--------
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/Documentation/networking/driver.txt b/Documentation/networking/driver.txt
index 03283da..83ce060 100644
--- a/Documentation/networking/driver.txt
+++ b/Documentation/networking/driver.txt
@@ -2,7 +2,7 @@ Document about softnet driver issues
 
 Transmit path guidelines:
 
-1) The hard_start_xmit method must never return '1' under any
+1) The ndo_start_xmit method must never return '1' under any
    normal circumstances.  It is considered a hard error unless
    there is no way your device can tell ahead of time when it's
    transmit function will become busy.
@@ -61,10 +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) A hard_start_xmit method must not modify the shared parts of a
+3) An ndo_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
+4) Do not forget that once you return 0 from your ndo_start_xmit
    method, it is your driver's responsibility to free up the SKB
    and in some finite amount of time.
 
@@ -74,7 +74,7 @@ Transmit path guidelines:
    This error can deadlock sockets waiting for send buffer room
    to be freed up.
 
-   If you return 1 from the hard_start_xmit method, you must not keep
+   If you return 1 from the ndo_start_xmit method, you must not keep
    any reference to that SKB and you must not attempt to free it up.
 
 Probing guidelines:
@@ -85,10 +85,10 @@ Probing guidelines:
 
 Close/stop guidelines:
 
-1) After the dev->stop routine has been called, the hardware must
+1) After the ndo_stop routine has been called, the hardware must
    not receive or transmit any data.  All in flight packets must
    be aborted. If necessary, poll or wait for completion of 
    any reset commands.
 
-2) The dev->stop routine will be called by unregister_netdevice
+2) The ndo_stop routine will be called by unregister_netdevice
    if device is still UP.
diff --git a/Documentation/networking/netdevices.txt b/Documentation/networking/netdevices.txt
index b107733..c7ecc70 100644
--- a/Documentation/networking/netdevices.txt
+++ b/Documentation/networking/netdevices.txt
@@ -47,24 +47,24 @@ packets is preferred.
 
 struct net_device synchronization rules
 =======================================
-dev->open:
+ndo_open:
 	Synchronization: rtnl_lock() semaphore.
 	Context: process
 
-dev->stop:
+ndo_stop:
 	Synchronization: rtnl_lock() semaphore.
 	Context: process
 	Note: netif_running() is guaranteed false
 
-dev->do_ioctl:
+ndo_do_ioctl:
 	Synchronization: rtnl_lock() semaphore.
 	Context: process
 
-dev->get_stats:
+ndo_get_stats:
 	Synchronization: dev_base_lock rwlock.
 	Context: nominally process, but don't sleep inside an rwlock
 
-dev->hard_start_xmit:
+ndo_start_xmit:
 	Synchronization: __netif_tx_lock spinlock.
 
 	When the driver sets NETIF_F_LLTX in dev->features this will be
@@ -86,12 +86,12 @@ dev->hard_start_xmit:
 	o NETDEV_TX_LOCKED Locking failed, please retry quickly.
 	  Only valid when NETIF_F_LLTX is set.
 
-dev->tx_timeout:
+ndo_tx_timeout:
 	Synchronization: netif_tx_lock spinlock; all TX queues frozen.
 	Context: BHs disabled
 	Notes: netif_queue_stopped() is guaranteed true
 
-dev->set_rx_mode:
+ndo_set_rx_mode:
 	Synchronization: netif_addr_lock spinlock.
 	Context: BHs disabled
 
@@ -99,7 +99,7 @@ struct napi_struct synchronization rules
 ========================================
 napi->poll:
 	Synchronization: NAPI_STATE_SCHED bit in napi->state.  Device
-		driver's dev->close method will invoke napi_disable() on
+		driver's ndo_stop method will invoke napi_disable() on
 		all NAPI instances which will do a sleeping poll on the
 		NAPI_STATE_SCHED napi->state bit, waiting for all pending
 		NAPI activity to cease.
-- 
1.7.7.6



-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH net-next 5/6] doc, net: Remove instruction to set net_device::trans_start
       [not found] <HEAD <1333672667.2652.22.camel@bwh-desktop.uk.solarflarecom.com>
                   ` (3 preceding siblings ...)
  2012-04-06  0:39 ` [PATCH net-next 4/6] doc, net: Update netdev operation names Ben Hutchings
@ 2012-04-06  0:40 ` Ben Hutchings
  2012-04-06  0:40 ` [PATCH net-next 6/6] doc, net: Update ndo_start_xmit return type and values Ben Hutchings
  5 siblings, 0 replies; 6+ messages in thread
From: Ben Hutchings @ 2012-04-06  0:40 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

Commit 08baf561083bc27a953aa087dd8a664bb2b88e8e ('net:
txq_trans_update() helper') made it unnecessary for most drivers to
set net_device::trans_start (or netdev_queue::trans_start).

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
 Documentation/networking/driver.txt |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/Documentation/networking/driver.txt b/Documentation/networking/driver.txt
index 83ce060..2128e41 100644
--- a/Documentation/networking/driver.txt
+++ b/Documentation/networking/driver.txt
@@ -58,13 +58,10 @@ Transmit path guidelines:
             TX_BUFFS_AVAIL(dp) > 0)
 		netif_wake_queue(dp->dev);
 
-2) Do not forget to update netdev->trans_start to jiffies after
-   each new tx packet is given to the hardware.
-
-3) An ndo_start_xmit method must not modify the shared parts of a
+2) An ndo_start_xmit method must not modify the shared parts of a
    cloned SKB.
 
-4) Do not forget that once you return 0 from your ndo_start_xmit
+3) Do not forget that once you return 0 from your ndo_start_xmit
    method, it is your driver's responsibility to free up the SKB
    and in some finite amount of time.
 
-- 
1.7.7.6



-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH net-next 6/6] doc, net: Update ndo_start_xmit return type and values
       [not found] <HEAD <1333672667.2652.22.camel@bwh-desktop.uk.solarflarecom.com>
                   ` (4 preceding siblings ...)
  2012-04-06  0:40 ` [PATCH net-next 5/6] doc, net: Remove instruction to set net_device::trans_start Ben Hutchings
@ 2012-04-06  0:40 ` Ben Hutchings
  5 siblings, 0 replies; 6+ messages in thread
From: Ben Hutchings @ 2012-04-06  0:40 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

Commit dc1f8bf68b311b1537cb65893430b6796118498a ('netdev: change
transmit to limited range type') changed the required return type and
9a1654ba0b50402a6bd03c7b0fe9b0200a5ea7b1 ('net: Optimize
hard_start_xmit() return checking') changed the valid numerical
return values.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
 Documentation/networking/driver.txt |   22 ++++++++++++----------
 1 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/Documentation/networking/driver.txt b/Documentation/networking/driver.txt
index 2128e41..da59e28 100644
--- a/Documentation/networking/driver.txt
+++ b/Documentation/networking/driver.txt
@@ -2,16 +2,16 @@ Document about softnet driver issues
 
 Transmit path guidelines:
 
-1) The ndo_start_xmit method must never return '1' under any
-   normal circumstances.  It is considered a hard error unless
+1) The ndo_start_xmit method must not return NETDEV_TX_BUSY under
+   any normal circumstances.  It is considered a hard error unless
    there is no way your device can tell ahead of time when it's
    transmit function will become busy.
 
    Instead it must maintain the queue properly.  For example,
    for a driver implementing scatter-gather this means:
 
-	static int drv_hard_start_xmit(struct sk_buff *skb,
-		   		       struct net_device *dev)
+	static netdev_tx_t drv_hard_start_xmit(struct sk_buff *skb,
+					       struct net_device *dev)
 	{
 		struct drv *dp = netdev_priv(dev);
 
@@ -23,7 +23,7 @@ Transmit path guidelines:
 			unlock_tx(dp);
 			printk(KERN_ERR PFX "%s: BUG! Tx Ring full when queue awake!\n",
 			       dev->name);
-			return 1;
+			return NETDEV_TX_BUSY;
 		}
 
 		... queue packet to card ...
@@ -35,6 +35,7 @@ Transmit path guidelines:
 		...
 		unlock_tx(dp);
 		...
+		return NETDEV_TX_OK;
 	}
 
    And then at the end of your TX reclamation event handling:
@@ -61,9 +62,9 @@ Transmit path guidelines:
 2) An ndo_start_xmit method must not modify the shared parts of a
    cloned SKB.
 
-3) Do not forget that once you return 0 from your ndo_start_xmit
-   method, it is your driver's responsibility to free up the SKB
-   and in some finite amount of time.
+3) Do not forget that once you return NETDEV_TX_OK from your
+   ndo_start_xmit method, it is your driver's responsibility to free
+   up the SKB and in some finite amount of time.
 
    For example, this means that it is not allowed for your TX
    mitigation scheme to let TX packets "hang out" in the TX
@@ -71,8 +72,9 @@ Transmit path guidelines:
    This error can deadlock sockets waiting for send buffer room
    to be freed up.
 
-   If you return 1 from the ndo_start_xmit method, you must not keep
-   any reference to that SKB and you must not attempt to free it up.
+   If you return NETDEV_TX_BUSY from the ndo_start_xmit method, you
+   must not keep any reference to that SKB and you must not attempt
+   to free it up.
 
 Probing guidelines:
 
-- 
1.7.7.6


-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-04-06  0:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <HEAD <1333672667.2652.22.camel@bwh-desktop.uk.solarflarecom.com>
2012-04-06  0:38 ` [PATCH net-next 1/6] ethtool: Remove exception to the requirement of holding RTNL lock Ben Hutchings
2012-04-06  0:39 ` [PATCH net-next 2/6] doc, net: Remove obsolete reference to dev->poll Ben Hutchings
2012-04-06  0:39 ` [PATCH net-next 3/6] doc, net: Update documentation of synchronisation for TX multiqueue Ben Hutchings
2012-04-06  0:39 ` [PATCH net-next 4/6] doc, net: Update netdev operation names Ben Hutchings
2012-04-06  0:40 ` [PATCH net-next 5/6] doc, net: Remove instruction to set net_device::trans_start Ben Hutchings
2012-04-06  0:40 ` [PATCH net-next 6/6] doc, net: Update ndo_start_xmit return type and values Ben Hutchings

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.