* Re: [PATCH net-next] vxge: Remove unnecessary ; in do {} while (0) macro
From: David Miller @ 2012-04-03 21:58 UTC (permalink / raw)
To: joe; +Cc: jdmason, netdev, linux-kernel
In-Reply-To: <1333489992.2695.17.camel@joe2Laptop>
From: Joe Perches <joe@perches.com>
Date: Tue, 03 Apr 2012 14:53:12 -0700
> This macro doesn't need a terminating ; so just remove it.
>
> Signed-off-by: Joe Perches <joe@perches.com>
Applied, thanks Joe.
Longer term I'd much rather see this turned into an inline
function with proper type checking etc.
^ permalink raw reply
* [PATCH net-next] vxge: Remove unnecessary ; in do {} while (0) macro
From: Joe Perches @ 2012-04-03 21:53 UTC (permalink / raw)
To: Jon Mason; +Cc: netdev, linux-kernel
This macro doesn't need a terminating ; so just remove it.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/ethernet/neterion/vxge/vxge-main.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/ethernet/neterion/vxge/vxge-main.h b/drivers/net/ethernet/neterion/vxge/vxge-main.h
index f52a42d..372406c 100644
--- a/drivers/net/ethernet/neterion/vxge/vxge-main.h
+++ b/drivers/net/ethernet/neterion/vxge/vxge-main.h
@@ -421,7 +421,7 @@ struct vxge_tx_priv {
timer.function = handle; \
timer.data = (unsigned long) arg; \
mod_timer(&timer, (jiffies + exp)); \
- } while (0);
+ } while (0)
void vxge_initialize_ethtool_ops(struct net_device *ndev);
enum vxge_hw_status vxge_reset_all_vpaths(struct vxgedev *vdev);
^ permalink raw reply related
* Re: [PATCH wireless-next] wireless: Remove unnecessary ; from while (0) macros
From: Arend van Spriel @ 2012-04-03 21:52 UTC (permalink / raw)
To: Joe Perches
Cc: John W. Linville, Christian Lamparter, Brett Rudley,
Roland Vossen, Franky (Zhenhui) Lin, Kan Yan, Bing Zhao,
Larry Finger, Chaoming Li, linux-wireless@vger.kernel.org,
netdev@vger.kernel.org, LKML
In-Reply-To: <1333489609.2695.14.camel@joe2Laptop>
On 04/03/2012 11:46 PM, Joe Perches wrote:
> Semicolons are not necessary after macros that end in while (0).
> Remove them.
>
> Simplify the macros with tests of
> do { if (foo>size) memset1; else memset2;} while (0);
> to a single line memset(,,min_t(size_t, foo, size))
>
Acked-by: Arend van Spriel <arend@broadcom.com>
> Signed-off-by: Joe Perches<joe@perches.com>
> ---
> drivers/net/wireless/ath/carl9170/cmd.h | 6 +++---
> drivers/net/wireless/brcm80211/brcmsmac/d11.h | 2 +-
> drivers/net/wireless/mwifiex/sdio.h | 8 ++++----
> drivers/net/wireless/rtlwifi/rtl8192ce/trx.h | 7 +------
> drivers/net/wireless/rtlwifi/rtl8192de/trx.h | 8 ++------
> drivers/net/wireless/rtlwifi/rtl8192se/def.h | 7 +------
> drivers/net/wireless/rtlwifi/rtl8192se/fw.h | 6 +++---
> 7 files changed, 15 insertions(+), 29 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/carl9170/cmd.h b/drivers/net/wireless/ath/carl9170/cmd.h
> index 885c427..65919c9 100644
> --- a/drivers/net/wireless/ath/carl9170/cmd.h
> +++ b/drivers/net/wireless/ath/carl9170/cmd.h
> @@ -114,7 +114,7 @@ __regwrite_out : \
>
> #define carl9170_regwrite_result() \
> __err; \
> -} while (0);
> +} while (0)
>
>
> #define carl9170_async_regwrite_get_buf() \
> @@ -126,7 +126,7 @@ do { \
> __err = -ENOMEM; \
> goto __async_regwrite_out; \
> } \
> -} while (0);
> +} while (0)
>
> #define carl9170_async_regwrite_begin(carl) \
> do { \
> @@ -169,6 +169,6 @@ __async_regwrite_out: \
>
> #define carl9170_async_regwrite_result() \
> __err; \
> -} while (0);
> +} while (0)
>
> #endif /* __CMD_H */
> diff --git a/drivers/net/wireless/brcm80211/brcmsmac/d11.h b/drivers/net/wireless/brcm80211/brcmsmac/d11.h
> index 1948cb2..3f659e0 100644
> --- a/drivers/net/wireless/brcm80211/brcmsmac/d11.h
> +++ b/drivers/net/wireless/brcm80211/brcmsmac/d11.h
> @@ -733,7 +733,7 @@ struct cck_phy_hdr {
> do { \
> plcp[1] = len& 0xff; \
> plcp[2] = ((len>> 8)& 0xff); \
> - } while (0);
> + } while (0)
>
> #define BRCMS_SET_MIMO_PLCP_AMPDU(plcp) (plcp[3] |= MIMO_PLCP_AMPDU)
> #define BRCMS_CLR_MIMO_PLCP_AMPDU(plcp) (plcp[3]&= ~MIMO_PLCP_AMPDU)
> diff --git a/drivers/net/wireless/mwifiex/sdio.h b/drivers/net/wireless/mwifiex/sdio.h
> index a3fb322..0ead152 100644
> --- a/drivers/net/wireless/mwifiex/sdio.h
> +++ b/drivers/net/wireless/mwifiex/sdio.h
> @@ -193,7 +193,7 @@
> a->mpa_tx.ports |= (1<<(a->mpa_tx.pkt_cnt+1+(MAX_PORT - \
> a->mp_end_port))); \
> a->mpa_tx.pkt_cnt++; \
> -} while (0);
> +} while (0)
>
> /* SDIO Tx aggregation limit ? */
> #define MP_TX_AGGR_PKT_LIMIT_REACHED(a) \
> @@ -211,7 +211,7 @@
> a->mpa_tx.buf_len = 0; \
> a->mpa_tx.ports = 0; \
> a->mpa_tx.start_port = 0; \
> -} while (0);
> +} while (0)
>
> /* SDIO Rx aggregation limit ? */
> #define MP_RX_AGGR_PKT_LIMIT_REACHED(a) \
> @@ -242,7 +242,7 @@
> a->mpa_rx.skb_arr[a->mpa_rx.pkt_cnt] = skb; \
> a->mpa_rx.len_arr[a->mpa_rx.pkt_cnt] = skb->len; \
> a->mpa_rx.pkt_cnt++; \
> -} while (0);
> +} while (0)
>
> /* Reset SDIO Rx aggregation buffer parameters */
> #define MP_RX_AGGR_BUF_RESET(a) do { \
> @@ -250,7 +250,7 @@
> a->mpa_rx.buf_len = 0; \
> a->mpa_rx.ports = 0; \
> a->mpa_rx.start_port = 0; \
> -} while (0);
> +} while (0)
>
>
> /* data structure for SDIO MPA TX */
> diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/trx.h b/drivers/net/wireless/rtlwifi/rtl8192ce/trx.h
> index efb9ab2..c4adb97 100644
> --- a/drivers/net/wireless/rtlwifi/rtl8192ce/trx.h
> +++ b/drivers/net/wireless/rtlwifi/rtl8192ce/trx.h
> @@ -530,12 +530,7 @@
> SET_BITS_OFFSET_LE(__pdesc+28, 0, 32, __val)
>
> #define CLEAR_PCI_TX_DESC_CONTENT(__pdesc, _size) \
> -do { \
> - if (_size> TX_DESC_NEXT_DESC_OFFSET) \
> - memset(__pdesc, 0, TX_DESC_NEXT_DESC_OFFSET); \
> - else \
> - memset(__pdesc, 0, _size); \
> -} while (0);
> + memset(__pdesc, 0, min_t(size_t, _size, TX_DESC_NEXT_DESC_OFFSET))
>
> struct rx_fwinfo_92c {
> u8 gain_trsw[4];
> diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/trx.h b/drivers/net/wireless/rtlwifi/rtl8192de/trx.h
> index 0dc736c..057a524 100644
> --- a/drivers/net/wireless/rtlwifi/rtl8192de/trx.h
> +++ b/drivers/net/wireless/rtlwifi/rtl8192de/trx.h
> @@ -530,12 +530,8 @@
> SET_BITS_OFFSET_LE(__pdesc+28, 0, 32, __val)
>
> #define CLEAR_PCI_TX_DESC_CONTENT(__pdesc, _size) \
> -do { \
> - if (_size> TX_DESC_NEXT_DESC_OFFSET) \
> - memset((void *)__pdesc, 0, TX_DESC_NEXT_DESC_OFFSET); \
> - else \
> - memset((void *)__pdesc, 0, _size); \
> -} while (0);
> + memset((void *)__pdesc, 0, \
> + min_t(size_t, _size, TX_DESC_NEXT_DESC_OFFSET))
>
> /* For 92D early mode */
> #define SET_EARLYMODE_PKTNUM(__paddr, __value) \
> diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/def.h b/drivers/net/wireless/rtlwifi/rtl8192se/def.h
> index d1b0a1e..20afec6 100644
> --- a/drivers/net/wireless/rtlwifi/rtl8192se/def.h
> +++ b/drivers/net/wireless/rtlwifi/rtl8192se/def.h
> @@ -252,12 +252,7 @@
> * the desc is cleared. */
> #define TX_DESC_NEXT_DESC_OFFSET 36
> #define CLEAR_PCI_TX_DESC_CONTENT(__pdesc, _size) \
> -do { \
> - if (_size> TX_DESC_NEXT_DESC_OFFSET) \
> - memset(__pdesc, 0, TX_DESC_NEXT_DESC_OFFSET); \
> - else \
> - memset(__pdesc, 0, _size); \
> -} while (0);
> + memset(__pdesc, 0, min_t(size_t, _size, TX_DESC_NEXT_DESC_OFFSET))
>
> /* Rx Desc */
> #define RX_STATUS_DESC_SIZE 24
> diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/fw.h b/drivers/net/wireless/rtlwifi/rtl8192se/fw.h
> index b4afff6..d53f433 100644
> --- a/drivers/net/wireless/rtlwifi/rtl8192se/fw.h
> +++ b/drivers/net/wireless/rtlwifi/rtl8192se/fw.h
> @@ -345,7 +345,7 @@ enum fw_h2c_cmd {
> do { \
> udelay(1000); \
> rtlpriv->rtlhal.fwcmd_iomap&= (~_Bit); \
> - } while (0);
> + } while (0)
>
> #define FW_CMD_IO_UPDATE(rtlpriv, _val) \
> rtlpriv->rtlhal.fwcmd_iomap = _val;
> @@ -354,13 +354,13 @@ enum fw_h2c_cmd {
> do { \
> rtl_write_word(rtlpriv, LBUS_MON_ADDR, (u16)_val); \
> FW_CMD_IO_UPDATE(rtlpriv, _val); \
> - } while (0);
> + } while (0)
>
> #define FW_CMD_PARA_SET(rtlpriv, _val) \
> do { \
> rtl_write_dword(rtlpriv, LBUS_ADDR_MASK, _val); \
> rtlpriv->rtlhal.fwcmd_ioparam = _val; \
> - } while (0);
> + } while (0)
>
> #define FW_CMD_IO_QUERY(rtlpriv) \
> (u16)(rtlpriv->rtlhal.fwcmd_iomap)
>
>
>
^ permalink raw reply
* Re: [V6 PATCH] virtio-net: send gratuitous packets when needed
From: David Miller @ 2012-04-03 21:49 UTC (permalink / raw)
To: jasowang; +Cc: mst, netdev, qemu-devel, virtualization, linux-kernel
In-Reply-To: <20120328054428.34415.75432.stgit@amd-6168-8-1.englab.nay.redhat.com>
From: Jason Wang <jasowang@redhat.com>
Date: Wed, 28 Mar 2012 13:44:28 +0800
> As hypervior does not have the knowledge of guest network configuration, it's
> better to ask guest to send gratuitous packets when needed.
>
> Guest tests VIRTIO_NET_S_ANNOUNCE bit during config change interrupt and when it
> is set, a workqueue is scheduled to send gratuitous packet through
> NETDEV_NOTIFY_PEERS. This feature is negotiated through bit
> VIRTIO_NET_F_GUEST_ANNOUNCE.
...
> Signed-off-by: Jason Wang <jasowang@redhat.com>
Michael and others, what's the story with this patch?
^ permalink raw reply
* Re: [PATCH v3,1/1] net/hyperv: Add flow control based on hi/low watermark
From: David Miller @ 2012-04-03 21:48 UTC (permalink / raw)
To: haiyangz; +Cc: netdev, kys, olaf, linux-kernel, devel
In-Reply-To: <1332890445-12562-2-git-send-email-haiyangz@microsoft.com>
From: Haiyang Zhang <haiyangz@microsoft.com>
Date: Tue, 27 Mar 2012 16:20:45 -0700
> In the existing code, we only stop queue when the ringbuffer is full,
> so the current packet has to be dropped or retried from upper layer.
>
> This patch stops the tx queue when available ringbuffer is below
> the low watermark. So the ringbuffer still has small amount of space
> available for the current packet. This will reduce the overhead of
> retries on sending.
>
> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
> Reviewed-by: K. Y. Srinivasan <kys@microsoft.com>
Applied to net-next
^ permalink raw reply
* [PATCH wireless-next] wireless: Remove unnecessary ; from while (0) macros
From: Joe Perches @ 2012-04-03 21:46 UTC (permalink / raw)
To: John W. Linville
Cc: Christian Lamparter, Brett Rudley, Roland Vossen,
Arend van Spriel, Franky (Zhenhui) Lin, Kan Yan, Bing Zhao,
Larry Finger, Chaoming Li, linux-wireless-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA, LKML
Semicolons are not necessary after macros that end in while (0).
Remove them.
Simplify the macros with tests of
do { if (foo>size) memset1; else memset2;} while (0);
to a single line memset(,,min_t(size_t, foo, size))
Signed-off-by: Joe Perches <joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
---
drivers/net/wireless/ath/carl9170/cmd.h | 6 +++---
drivers/net/wireless/brcm80211/brcmsmac/d11.h | 2 +-
drivers/net/wireless/mwifiex/sdio.h | 8 ++++----
drivers/net/wireless/rtlwifi/rtl8192ce/trx.h | 7 +------
drivers/net/wireless/rtlwifi/rtl8192de/trx.h | 8 ++------
drivers/net/wireless/rtlwifi/rtl8192se/def.h | 7 +------
drivers/net/wireless/rtlwifi/rtl8192se/fw.h | 6 +++---
7 files changed, 15 insertions(+), 29 deletions(-)
diff --git a/drivers/net/wireless/ath/carl9170/cmd.h b/drivers/net/wireless/ath/carl9170/cmd.h
index 885c427..65919c9 100644
--- a/drivers/net/wireless/ath/carl9170/cmd.h
+++ b/drivers/net/wireless/ath/carl9170/cmd.h
@@ -114,7 +114,7 @@ __regwrite_out : \
#define carl9170_regwrite_result() \
__err; \
-} while (0);
+} while (0)
#define carl9170_async_regwrite_get_buf() \
@@ -126,7 +126,7 @@ do { \
__err = -ENOMEM; \
goto __async_regwrite_out; \
} \
-} while (0);
+} while (0)
#define carl9170_async_regwrite_begin(carl) \
do { \
@@ -169,6 +169,6 @@ __async_regwrite_out: \
#define carl9170_async_regwrite_result() \
__err; \
-} while (0);
+} while (0)
#endif /* __CMD_H */
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/d11.h b/drivers/net/wireless/brcm80211/brcmsmac/d11.h
index 1948cb2..3f659e0 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/d11.h
+++ b/drivers/net/wireless/brcm80211/brcmsmac/d11.h
@@ -733,7 +733,7 @@ struct cck_phy_hdr {
do { \
plcp[1] = len & 0xff; \
plcp[2] = ((len >> 8) & 0xff); \
- } while (0);
+ } while (0)
#define BRCMS_SET_MIMO_PLCP_AMPDU(plcp) (plcp[3] |= MIMO_PLCP_AMPDU)
#define BRCMS_CLR_MIMO_PLCP_AMPDU(plcp) (plcp[3] &= ~MIMO_PLCP_AMPDU)
diff --git a/drivers/net/wireless/mwifiex/sdio.h b/drivers/net/wireless/mwifiex/sdio.h
index a3fb322..0ead152 100644
--- a/drivers/net/wireless/mwifiex/sdio.h
+++ b/drivers/net/wireless/mwifiex/sdio.h
@@ -193,7 +193,7 @@
a->mpa_tx.ports |= (1<<(a->mpa_tx.pkt_cnt+1+(MAX_PORT - \
a->mp_end_port))); \
a->mpa_tx.pkt_cnt++; \
-} while (0);
+} while (0)
/* SDIO Tx aggregation limit ? */
#define MP_TX_AGGR_PKT_LIMIT_REACHED(a) \
@@ -211,7 +211,7 @@
a->mpa_tx.buf_len = 0; \
a->mpa_tx.ports = 0; \
a->mpa_tx.start_port = 0; \
-} while (0);
+} while (0)
/* SDIO Rx aggregation limit ? */
#define MP_RX_AGGR_PKT_LIMIT_REACHED(a) \
@@ -242,7 +242,7 @@
a->mpa_rx.skb_arr[a->mpa_rx.pkt_cnt] = skb; \
a->mpa_rx.len_arr[a->mpa_rx.pkt_cnt] = skb->len; \
a->mpa_rx.pkt_cnt++; \
-} while (0);
+} while (0)
/* Reset SDIO Rx aggregation buffer parameters */
#define MP_RX_AGGR_BUF_RESET(a) do { \
@@ -250,7 +250,7 @@
a->mpa_rx.buf_len = 0; \
a->mpa_rx.ports = 0; \
a->mpa_rx.start_port = 0; \
-} while (0);
+} while (0)
/* data structure for SDIO MPA TX */
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/trx.h b/drivers/net/wireless/rtlwifi/rtl8192ce/trx.h
index efb9ab2..c4adb97 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192ce/trx.h
+++ b/drivers/net/wireless/rtlwifi/rtl8192ce/trx.h
@@ -530,12 +530,7 @@
SET_BITS_OFFSET_LE(__pdesc+28, 0, 32, __val)
#define CLEAR_PCI_TX_DESC_CONTENT(__pdesc, _size) \
-do { \
- if (_size > TX_DESC_NEXT_DESC_OFFSET) \
- memset(__pdesc, 0, TX_DESC_NEXT_DESC_OFFSET); \
- else \
- memset(__pdesc, 0, _size); \
-} while (0);
+ memset(__pdesc, 0, min_t(size_t, _size, TX_DESC_NEXT_DESC_OFFSET))
struct rx_fwinfo_92c {
u8 gain_trsw[4];
diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/trx.h b/drivers/net/wireless/rtlwifi/rtl8192de/trx.h
index 0dc736c..057a524 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192de/trx.h
+++ b/drivers/net/wireless/rtlwifi/rtl8192de/trx.h
@@ -530,12 +530,8 @@
SET_BITS_OFFSET_LE(__pdesc+28, 0, 32, __val)
#define CLEAR_PCI_TX_DESC_CONTENT(__pdesc, _size) \
-do { \
- if (_size > TX_DESC_NEXT_DESC_OFFSET) \
- memset((void *)__pdesc, 0, TX_DESC_NEXT_DESC_OFFSET); \
- else \
- memset((void *)__pdesc, 0, _size); \
-} while (0);
+ memset((void *)__pdesc, 0, \
+ min_t(size_t, _size, TX_DESC_NEXT_DESC_OFFSET))
/* For 92D early mode */
#define SET_EARLYMODE_PKTNUM(__paddr, __value) \
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/def.h b/drivers/net/wireless/rtlwifi/rtl8192se/def.h
index d1b0a1e..20afec6 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/def.h
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/def.h
@@ -252,12 +252,7 @@
* the desc is cleared. */
#define TX_DESC_NEXT_DESC_OFFSET 36
#define CLEAR_PCI_TX_DESC_CONTENT(__pdesc, _size) \
-do { \
- if (_size > TX_DESC_NEXT_DESC_OFFSET) \
- memset(__pdesc, 0, TX_DESC_NEXT_DESC_OFFSET); \
- else \
- memset(__pdesc, 0, _size); \
-} while (0);
+ memset(__pdesc, 0, min_t(size_t, _size, TX_DESC_NEXT_DESC_OFFSET))
/* Rx Desc */
#define RX_STATUS_DESC_SIZE 24
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/fw.h b/drivers/net/wireless/rtlwifi/rtl8192se/fw.h
index b4afff6..d53f433 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/fw.h
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/fw.h
@@ -345,7 +345,7 @@ enum fw_h2c_cmd {
do { \
udelay(1000); \
rtlpriv->rtlhal.fwcmd_iomap &= (~_Bit); \
- } while (0);
+ } while (0)
#define FW_CMD_IO_UPDATE(rtlpriv, _val) \
rtlpriv->rtlhal.fwcmd_iomap = _val;
@@ -354,13 +354,13 @@ enum fw_h2c_cmd {
do { \
rtl_write_word(rtlpriv, LBUS_MON_ADDR, (u16)_val); \
FW_CMD_IO_UPDATE(rtlpriv, _val); \
- } while (0);
+ } while (0)
#define FW_CMD_PARA_SET(rtlpriv, _val) \
do { \
rtl_write_dword(rtlpriv, LBUS_ADDR_MASK, _val); \
rtlpriv->rtlhal.fwcmd_ioparam = _val; \
- } while (0);
+ } while (0)
#define FW_CMD_IO_QUERY(rtlpriv) \
(u16)(rtlpriv->rtlhal.fwcmd_iomap)
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related
* Re: [PATCH] marvell sky2 driver: fix so it works without unaligned accesses
From: David Miller @ 2012-04-03 21:46 UTC (permalink / raw)
To: cmetcalf; +Cc: shemminger, netdev, linux-kernel
In-Reply-To: <201204031527.q33FR04i031747@farm-0027.internal.tilera.com>
From: Chris Metcalf <cmetcalf@tilera.com>
Date: Tue, 3 Apr 2012 11:13:56 -0400
> The driver uses a receive_new() routine that ends up requiring unaligned
> accesses in IP header processing. If the architecture doesn't support
> efficient unaligned accesses, just copy all ingress packets to the bounce
> buffers instead.
>
> This allows the driver to be used on the Tilera TILEmpower-Gx, since
> the tile architecture doesn't currently handle kernel unaligned accesses,
> just userspace.
>
> Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
As Stephen Hemminger alluded to, adjust the copybreak as needed.
If you look at how other device drivers use this CONFIG variable,
you'll get a better idea of what to do here if you want to adjust
the default copybreak.
Also keep in mind the issue brought up by Eric Dumazet in that
not all kinds of sky2 chips would need this copybreak adjustment,
only ones that have the SKY2_HW_RAM_BUFFER bit cleared.
^ permalink raw reply
* Re: [PATCH] marvell sky2 driver: fix irq number assignment bug
From: David Miller @ 2012-04-03 21:41 UTC (permalink / raw)
To: bhutchings; +Cc: cmetcalf, shemminger, netdev, linux-kernel
In-Reply-To: <1333468024.2577.21.camel@bwh-desktop.uk.solarflarecom.com>
From: Ben Hutchings <bhutchings@solarflare.com>
Date: Tue, 3 Apr 2012 16:47:04 +0100
> On Tue, 2012-04-03 at 11:10 -0400, Chris Metcalf wrote:
>> Fix a minor bug that will display wrong IRQ number in ifconfig output.
>>
>> Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
>> ---
>> drivers/net/ethernet/marvell/sky2.c | 7 +++++++
>> 1 files changed, 7 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/marvell/sky2.c b/drivers/net/ethernet/marvell/sky2.c
>> index 423a1a2..879b0a4 100644
>> --- a/drivers/net/ethernet/marvell/sky2.c
>> +++ b/drivers/net/ethernet/marvell/sky2.c
>> @@ -4978,6 +4978,13 @@ static int __devinit sky2_probe(struct pci_dev *pdev,
>> goto err_out_free_netdev;
>> }
>>
>> + /*
>> + * Need to set the IRQ # for the net_device here again after
>> + * setting it in sky2_init_netdev() initially, because MSI
>> + * will assign a new IRQ # to this PCI device.
>> + */
>> + dev->irq = hw->pdev->irq;
>> +
>> err = register_netdev(dev);
>> if (err) {
>> dev_err(&pdev->dev, "cannot register net device\n");
>
> I think the consensus now is that net_device::irq should be left at 0
> for devices that don't support manual configuration (ISA and the like).
Agreed.
^ permalink raw reply
* Re: [PATCH v3] TCP: update ip_local_port_range documentation
From: David Miller @ 2012-04-03 21:40 UTC (permalink / raw)
To: fernando; +Cc: shemminger, netdev
In-Reply-To: <20120404034140.9qatex0wg8ccok4o@webmail.int.intellilink.co.jp>
From: fernando@intellilink.co.jp
Date: Wed, 4 Apr 2012 03:41:40 +0900
> I forgot to add my Signed-off-by and the patch explanation.
> I am aosrry for the noise. Updated patch attached.
Since you put this at the top of the message body, I had to
edit it out of the patch submission by hand.
Your commit message proper needed to be edited by hand as well
because there were missing spaces between the Documentation
file path and the word that came right afterwards.
Furthermore, you had trailing whitespace in your patch, which I also
had to fix up by hand.
You know, this wasn't exactly a rocket-science patch, I spent more
time fixing up your patch than I would have spend implementing
the patch myself. That is _never_ a good sign.
^ permalink raw reply
* Re: [PATCH] tcp: allow splice() to build full TSO packets
From: David Miller @ 2012-04-03 21:36 UTC (permalink / raw)
To: eric.dumazet
Cc: netdev, ncardwell, therbert, ycheng, hkchu, maze, maheshb,
ilpo.jarvinen, nanditad
In-Reply-To: <1333488689.18626.331.camel@edumazet-glaptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Tue, 03 Apr 2012 23:31:29 +0200
> The code in tcp_sendmsg() and do_tcp_sendpages() is similar (actually
> probably copy/pasted) but the thing is tcp_sendmsg() is called once per
> sendmsg() call (and the push logic is OK at the end of it), while a
> single splice() system call can call do_tcp_sendpages() 16 times (or
> even more if pipe buffer was extended by fcntl(F_SETPIPE_SZ))
Ok, so this means that in essence the tcp_mark_push should also only
be done in the final sendpage call.
And since I'm wholly convinced that the URG stuff is a complete
"don't care" for this path, I'm convinced your patch is the right
thing to do.
Applied to 'net' and queued up for -stable, thanks Eric.
> Maybe a real fix would be to call do_tcp_sendpages() exactly once, but I
> tried this today and found needed surgery was complex). Also this would
> lock socket for a long period and could add latencies because of backlog
> processing.
I don't think this is a good idea. Maybe we can do some level of
batching at some point, but it would need to have a limit.
^ permalink raw reply
* Re: [PATCH] tcp: allow splice() to build full TSO packets
From: Eric Dumazet @ 2012-04-03 21:31 UTC (permalink / raw)
To: David Miller
Cc: netdev, ncardwell, therbert, ycheng, hkchu, maze, maheshb,
ilpo.jarvinen, nanditad
In-Reply-To: <20120403.172126.672236532461758456.davem@davemloft.net>
On Tue, 2012-04-03 at 17:21 -0400, David Miller wrote:
> From: Eric Dumazet <eric.dumazet@gmail.com>
> Date: Tue, 03 Apr 2012 21:37:01 +0200
>
> > vmsplice()/splice(pipe, socket) call do_tcp_sendpages() one page at a
> > time, adding at most 4096 bytes to an skb. (assuming PAGE_SIZE=4096)
> >
> > The call to tcp_push() at the end of do_tcp_sendpages() forces an
> > immediate xmit when pipe is not already filled, and tso_fragment() try
> > to split these skb to MSS multiples.
> >
> > 4096 bytes are usually split in a skb with 2 MSS, and a remaining
> > sub-mss skb (assuming MTU=1500)
>
> Interesting.
>
> But why doesn't TCP_NAGLE_CORK save us? That gets passed down into
> the push pending frames logic when MSG_MORE is specified.
>
> As far as I can tell, the combination of TCP_NAGLE_CORK and the TSO
> deferral logic should do the right thing here.
>
> Obviously you see different behavior, but why?
>
> Also, by eliding the tcp_push() call you are introducing other side
> effects:
>
> 1) we won't do the tcp_mark_push logic
>
> 2) we don't set the URG seq
>
> I think #2 can never happen in the vmsplice/splice path, but #1 might
> matter.
>
> That's why I want to concentrate on why the tcp_push() path doesn't
> behave properly when MSG_MORE is set.
It behaves properly I think, but in the tcp_sendmsg() perspective only.
The code in tcp_sendmsg() and do_tcp_sendpages() is similar (actually
probably copy/pasted) but the thing is tcp_sendmsg() is called once per
sendmsg() call (and the push logic is OK at the end of it), while a
single splice() system call can call do_tcp_sendpages() 16 times (or
even more if pipe buffer was extended by fcntl(F_SETPIPE_SZ))
Maybe a real fix would be to call do_tcp_sendpages() exactly once, but I
tried this today and found needed surgery was complex). Also this would
lock socket for a long period and could add latencies because of backlog
processing.
^ permalink raw reply
* Re: [PATCH] ppp: Don't stop and restart queue on every TX packet
From: David Miller @ 2012-04-03 21:29 UTC (permalink / raw)
To: dwmw2; +Cc: paulus, netdev
In-Reply-To: <1332756222.2379.66.camel@shinybook.infradead.org>
From: David Woodhouse <dwmw2@infradead.org>
Date: Mon, 26 Mar 2012 11:03:42 +0100
> For every transmitted packet, ppp_start_xmit() will stop the netdev
> queue and then, if appropriate, restart it. This causes the TX softirq
> to run, entirely gratuitously.
>
> This is "only" a waste of CPU time in the normal case, but it's actively
> harmful when the PPP device is a TEQL slave ― the wakeup will cause the
> offending device to receive the next TX packet from the TEQL queue, when
> it *should* have gone to the next slave in the list. We end up seeing
> large bursts of packets on just *one* slave device, rather than using
> the full available bandwidth over all slaves.
>
> This patch fixes the problem by *not* unconditionally stopping the queue
> in ppp_start_xmit(). It adds a return value from ppp_xmit_process()
> which indicates whether the queue should be stopped or not.
>
> It *doesn't* remove the call to netif_wake_queue() from
> ppp_xmit_process(), because other code paths (especially from
> ppp_output_wakeup()) need it there and it's messy to push it out to the
> other callers to do it based on the return value. So we leave it in
> place ― it's a no-op in the case where the queue wasn't stopped, so it's
> harmless in the TX path.
>
> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Applied, thanks. But:
> --- drivers/net/ppp/ppp_generic.c~ 2012-01-26 00:39:32.000000000 +0000
> +++ drivers/net/ppp/ppp_generic.c 2012-03-26 10:32:31.286744147 +0100
Please -p1 root your patches in the future.
^ permalink raw reply
* Re: [PATCH net: fix /proc/net/dev regression
From: David Miller @ 2012-04-03 21:25 UTC (permalink / raw)
To: greearb; +Cc: eric.dumazet, netdev, mmaruseac
In-Reply-To: <4F7B1910.3010701@candelatech.com>
From: Ben Greear <greearb@candelatech.com>
Date: Tue, 03 Apr 2012 08:36:48 -0700
> On 04/03/2012 01:33 AM, Eric Dumazet wrote:
>> Commit f04565ddf52 (dev: use name hash for dev_seq_ops) added a second
>> regression, as some devices are missing from /proc/net/dev if many
>> devices are defined.
>>
>> When seq_file buffer is filled, the last ->next/show() method is
>> canceled (pos value is reverted to value prior ->next() call)
>>
>> Problem is after above commit, we dont restart the lookup at right
>> position in ->start() method.
>>
>> Fix this by removing the internal 'pos' pointer added in commit, since
>> we need to use the 'loff_t *pos' provided by seq_file layer.
>>
>> This also reverts commit 5cac98dd0 (net: Fix corruption
>> in /proc/*/net/dev_mcast), since its not needed anymore.
>>
>> Reported-by: Ben Greear<greearb@candelatech.com>
>> Signed-off-by: Eric Dumazet<eric.dumazet@gmail.com>
>> Cc: Mihai Maruseac<mmaruseac@ixiacom.com>
>
> This appears to fix the problem. I do find it mildly irritating
> that the ordering is now random in /proc/net/dev, but I guess
> that is the price of progress.
>
> Tested-by: Ben Greear <greearb@candelatech.com>
>
> Thanks for the quick fix!
Applied, and queued up for -stable, thanks everyone.
^ permalink raw reply
* Re: [PATCH] tcp: allow splice() to build full TSO packets
From: David Miller @ 2012-04-03 21:21 UTC (permalink / raw)
To: eric.dumazet
Cc: netdev, ncardwell, therbert, ycheng, hkchu, maze, maheshb,
ilpo.jarvinen, nanditad
In-Reply-To: <1333481821.18626.322.camel@edumazet-glaptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Tue, 03 Apr 2012 21:37:01 +0200
> vmsplice()/splice(pipe, socket) call do_tcp_sendpages() one page at a
> time, adding at most 4096 bytes to an skb. (assuming PAGE_SIZE=4096)
>
> The call to tcp_push() at the end of do_tcp_sendpages() forces an
> immediate xmit when pipe is not already filled, and tso_fragment() try
> to split these skb to MSS multiples.
>
> 4096 bytes are usually split in a skb with 2 MSS, and a remaining
> sub-mss skb (assuming MTU=1500)
Interesting.
But why doesn't TCP_NAGLE_CORK save us? That gets passed down into
the push pending frames logic when MSG_MORE is specified.
As far as I can tell, the combination of TCP_NAGLE_CORK and the TSO
deferral logic should do the right thing here.
Obviously you see different behavior, but why?
Also, by eliding the tcp_push() call you are introducing other side
effects:
1) we won't do the tcp_mark_push logic
2) we don't set the URG seq
I think #2 can never happen in the vmsplice/splice path, but #1 might
matter.
That's why I want to concentrate on why the tcp_push() path doesn't
behave properly when MSG_MORE is set.
^ permalink raw reply
* Re: [PATCH 5/9] ipvs: use adaptive pause in master thread
From: Julian Anastasov @ 2012-04-03 21:16 UTC (permalink / raw)
To: Pablo Neira Ayuso
Cc: Simon Horman, lvs-devel, netdev, netfilter-devel, Wensong Zhang
In-Reply-To: <20120402111145.GA15181@1984>
Hello,
On Mon, 2 Apr 2012, Pablo Neira Ayuso wrote:
> > From: Julian Anastasov <ja@ssi.bg>
> >
> > High rate of sync messages in master can lead to
> > overflowing the socket buffer and dropping the messages.
> > Instead of using fixed pause try to adapt to the sync
> > rate, so that we do not wakeup too often while at the same
> > time staying below the socket buffer limit.
>
> I see. You are avoiding the congestion in the socket queue by putting
> the pressure in your sync_buff queue (I don't find any limit in
> the code for the amount of memory that it may consume btw).
>
> Please, correct me if I'm wrong, but from this I can se you're
> assuming that there's always room in the syn_buff queue to store
> messages. This is valid if the high peak of traffic lasts for short
> time. However, if it lasts long, the worker thread may not be able to
> consume all the messages in time under high stress situation that
> lasts long and the sync_buffer may keep growing more and more.
Agreed, packet processing does not check for any
limits for the sync_queues lists. This can be addressed
additionally, may be there can be some wakeup if threshold
is reached, so that we wake up the master thread early.
But there is always the problem that we do not know how
deep/free is the socket buffer, after how much time the
master thread will wakeup... We have to select some arbitrary
number again.
> Moreover, the backup may receive sync messages talking about old
> states that are not useful anymore to recover the load-balancing in
> case of failover.
Can you explain more? Are you referring to the
2-second buffer delay?
> One more concern, please see below.
> > - schedule_timeout_interruptible(HZ);
> > + /* Max packets to send at once */
> > + if (count > 200)
> > + pause = max(1, (pause - HZ / 20));
> > + else if (count < 20)
> > + pause = min(HZ / 4, (pause + HZ / 20));
> > + schedule_timeout_interruptible(sb ? 1 : pause);
>
> This rate-limits the amount of times the worker is woken up.
>
> Still, this seems to me like an ad-hoc congestion solution. There's no
> justification why those numbers has been chosed, eg. why do we assume
> that we're congested if we've reached 200 packets in one single loop?
200 is arbitrary, 20% of txqueuelen, a way to avoid
large bursts. It is the 'pause = max(1, (pause >> 1));' part
that also matters because we try to increase the wakeup rate, so
that socket buffer is below 50%. We assume sync traffic rate
does not change much but we are still prepared to avoid
drops while pause > 1 jiffie. If sync rate is too high may be
we should wakeup the master thread in sb_queue_tail.
The above logic should be read like this:
- limit bursts to min(200, half of guessed socket buffer size)
- limit pause to HZ/4 jiffies in idle periods
- if socket buffer is full try again after 1 jiffie and
increase the wakeups twice, so that we do not hit the
socket limit again
> To me, congestion control is a complicated thing (there is plenty of
> literature for TCP avoid it). I'm not sure how many patches will
> follow after this one to try to improve your congestion control
> solution.
>
> So, my question is, are you sure you want to enter this domain?
We should start with something. Better ideas are
always welcome.
> IMO, better to stick to some simple solution, ie. just drop messages
> if the worker thread receives a high peak of work, than trying to
> define some sort of rate-limit solution based on assumptions that are
> not generic enough for every setup.
Before now we dropped messages due to large fixed sleep time.
They were dropped when socket buffer was full. Dropping messages is
not nice just because we decided to sleep longer than needed.
With the change we still drop messages but not before pause
reaches 1 jiffie. As we can not use lower sleep time only
additional wakeup in sb_queue_tail can keep up with higher
sync rates. May be we should decide to drop messages only
when some max limit for packets in sync_queues is reached.
Regards
--
Julian Anastasov <ja@ssi.bg>
^ permalink raw reply
* Re: [PATCH] sky2: fix missing register reset on error path in sky2_test_msi()
From: David Miller @ 2012-04-03 21:08 UTC (permalink / raw)
To: shemminger; +Cc: LinoSanfilippo, linux-kernel, netdev
In-Reply-To: <20120403135954.2131ab08@s6510.linuxnetplumber.net>
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Tue, 3 Apr 2012 13:59:54 -0700
> On Tue, 03 Apr 2012 16:30:08 -0400 (EDT)
> David Miller <davem@davemloft.net> wrote:
>
>> From: Stephen Hemminger <shemminger@vyatta.com>
>> Date: Tue, 3 Apr 2012 11:55:47 -0700
>>
>> > On Fri, 30 Mar 2012 19:36:16 +0200
>> > Lino Sanfilippo <LinoSanfilippo@gmx.de> wrote:
>> >
>> >> In sky2_test_msi() the temporarily set SW IRQ in B0 register is not reset in case
>> >> that request_irq() fails.
>> >> With this patch we only set the interrupt mask if request_irq() was successful.
>> >>
>> >> Signed-off-by: Lino Sanfilippo <LinoSanfilippo@gmx.de>
>> >
>> > Ok, but this is a non-serious error case. If request_irq() fails here,
>> > the driver is going to fail to load and on the failure path of
>> > sky2_probe will reset the chip on the way out.
>>
>> So, ACK for net-next? Toss it? What?
>
> Put it in net-next, no need for net or stable.
Done, thanks.
^ permalink raw reply
* Re: [PATCH] sky2: fix missing register reset on error path in sky2_test_msi()
From: Stephen Hemminger @ 2012-04-03 20:59 UTC (permalink / raw)
To: David Miller; +Cc: LinoSanfilippo, linux-kernel, netdev
In-Reply-To: <20120403.163008.1865240185992444794.davem@davemloft.net>
On Tue, 03 Apr 2012 16:30:08 -0400 (EDT)
David Miller <davem@davemloft.net> wrote:
> From: Stephen Hemminger <shemminger@vyatta.com>
> Date: Tue, 3 Apr 2012 11:55:47 -0700
>
> > On Fri, 30 Mar 2012 19:36:16 +0200
> > Lino Sanfilippo <LinoSanfilippo@gmx.de> wrote:
> >
> >> In sky2_test_msi() the temporarily set SW IRQ in B0 register is not reset in case
> >> that request_irq() fails.
> >> With this patch we only set the interrupt mask if request_irq() was successful.
> >>
> >> Signed-off-by: Lino Sanfilippo <LinoSanfilippo@gmx.de>
> >
> > Ok, but this is a non-serious error case. If request_irq() fails here,
> > the driver is going to fail to load and on the failure path of
> > sky2_probe will reset the chip on the way out.
>
> So, ACK for net-next? Toss it? What?
Put it in net-next, no need for net or stable.
^ permalink raw reply
* Re: [PATCH v2 net-next] af_unix: reduce high order page allocations
From: David Miller @ 2012-04-03 20:43 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev
In-Reply-To: <1333466908.18626.274.camel@edumazet-glaptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Tue, 03 Apr 2012 17:28:28 +0200
> unix_dgram_sendmsg() currently builds linear skbs, and this can stress
> page allocator with high order page allocations. When memory gets
> fragmented, this can eventually fail.
>
> We can try to use order-2 allocations for skb head (SKB_MAX_ALLOC) plus
> up to 16 page fragments to lower pressure on buddy allocator.
>
> This patch has no effect on messages of less than 16064 bytes.
> (on 64bit arches with PAGE_SIZE=4096)
>
> For bigger messages (from 16065 to 81600 bytes), this patch brings
> reliability at the expense of performance penalty because of extra pages
> allocations.
>
> netperf -t DG_STREAM -T 0,2 -- -m 16064 -s 200000
> ->4086040 Messages / 10s
>
> netperf -t DG_STREAM -T 0,2 -- -m 16068 -s 200000
> ->3901747 Messages / 10s
>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
> ---
> v2: use SKB_MAX_ALLOC instead of SKB_MAX_ORDER(0, 0) to not slow down
> applications using up to 16000 bytes messages.
Looks good, applied to net-next, thanks Eric!
^ permalink raw reply
* [PATCH] r8169: enable napi on resume.
From: Artem Savkov @ 2012-04-03 20:29 UTC (permalink / raw)
To: romieu; +Cc: nic_swsd, netdev, Artem Savkov
NAPI is disabled during suspend and needs to be enabled on resume. Without
this the driver locks up during resume in rtl_reset_work() trying to disable
NAPI again.
Signed-off-by: Artem Savkov <artem.savkov@gmail.com>
---
drivers/net/ethernet/realtek/r8169.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index d2ec075..e259c88 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -5810,7 +5810,10 @@ static void __rtl8169_resume(struct net_device *dev)
rtl_pll_power_up(tp);
+ rtl_lock_work(tp);
+ napi_enable(&tp->napi);
set_bit(RTL_FLAG_TASK_ENABLED, tp->wk.flags);
+ rtl_unlock_work(tp);
rtl_schedule_task(tp, RTL_FLAG_TASK_RESET_PENDING);
}
--
1.7.9.5
^ permalink raw reply related
* Re: [PATCH] sky2: fix missing register reset on error path in sky2_test_msi()
From: David Miller @ 2012-04-03 20:30 UTC (permalink / raw)
To: shemminger; +Cc: LinoSanfilippo, linux-kernel, netdev
In-Reply-To: <20120403115547.799fcc1f@s6510.linuxnetplumber.net>
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Tue, 3 Apr 2012 11:55:47 -0700
> On Fri, 30 Mar 2012 19:36:16 +0200
> Lino Sanfilippo <LinoSanfilippo@gmx.de> wrote:
>
>> In sky2_test_msi() the temporarily set SW IRQ in B0 register is not reset in case
>> that request_irq() fails.
>> With this patch we only set the interrupt mask if request_irq() was successful.
>>
>> Signed-off-by: Lino Sanfilippo <LinoSanfilippo@gmx.de>
>
> Ok, but this is a non-serious error case. If request_irq() fails here,
> the driver is going to fail to load and on the failure path of
> sky2_probe will reset the chip on the way out.
So, ACK for net-next? Toss it? What?
^ permalink raw reply
* Re: [PATCH V3 net-next 00/28] ethtool: support time stamping and phc clocks
From: David Miller @ 2012-04-03 20:25 UTC (permalink / raw)
To: richardcochran
Cc: mporter, e1000-devel, netdev, jacob.e.keller, john.ronciak,
bhutchings
In-Reply-To: <cover.1333474520.git.richardcochran@gmail.com>
From: Richard Cochran <richardcochran@gmail.com>
Date: Tue, 3 Apr 2012 19:47:24 +0200
> The new feature has been tested on the following hardware:
>
> igb Hardware time stamping in the MAC
I don't know how, it doesn't even build.
drivers/net/ethernet/intel/igb/igb_ethtool.c: In function ‘igb_ethtool_get_ts_info’:
drivers/net/ethernet/intel/igb/igb_ethtool.c:2195:13: error: ‘struct igb_adapter’ has no member named ‘ptp_clock’
drivers/net/ethernet/intel/igb/igb_ethtool.c:2196:3: error: implicit declaration of function ‘ptp_clock_index’ [-Werror=implicit-function-declaration]
drivers/net/ethernet/intel/igb/igb_ethtool.c:2196:44: error: ‘struct igb_adapter’ has no member named ‘ptp_clock’
If these patches depend upon changes not in my tree, and you haven't
even mentioned this, I'm going to be _extremely_ irritated.
------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
^ permalink raw reply
* Re: [PATCH] sky2: fix missing register reset on error path in sky2_test_msi()
From: Lino Sanfilippo @ 2012-04-03 20:09 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: linux-kernel, netdev
In-Reply-To: <20120403115547.799fcc1f@s6510.linuxnetplumber.net>
On Tue, Apr 03, 2012 at 11:55:47AM -0700, Stephen Hemminger wrote:
> Ok, but this is a non-serious error case. If request_irq() fails here,
> the driver is going to fail to load and on the failure path of
> sky2_probe will reset the chip on the way out.
>
Youre right, this is more a cosmetic change than a fix for a real bug.
^ permalink raw reply
* [PATCH] tcp: allow splice() to build full TSO packets
From: Eric Dumazet @ 2012-04-03 19:37 UTC (permalink / raw)
To: David Miller
Cc: netdev, Neal Cardwell, Tom Herbert, Yuchung Cheng, H.K. Jerry Chu,
Maciej Żenczykowski, Mahesh Bandewar, Ilpo Järvinen,
Nandita Dukkipati
vmsplice()/splice(pipe, socket) call do_tcp_sendpages() one page at a
time, adding at most 4096 bytes to an skb. (assuming PAGE_SIZE=4096)
The call to tcp_push() at the end of do_tcp_sendpages() forces an
immediate xmit when pipe is not already filled, and tso_fragment() try
to split these skb to MSS multiples.
4096 bytes are usually split in a skb with 2 MSS, and a remaining
sub-mss skb (assuming MTU=1500)
This makes slow start suboptimal because many small frames are sent to
qdisc/driver layers instead of big ones (constrained by cwnd and packets
in flight of course)
In fact, applications using sendmsg() (adding an additional memory copy)
instead of vmsplice()/splice()/sendfile() are a bit faster because of
this anomaly, especially if serving small files in environments with
large initial [c]wnd.
Call tcp_push() only if MSG_MORE is not set in the flags parameter.
This bit is automatically provided by splice() internals but for the
last page, or on all pages if user specified SPLICE_F_MORE splice()
flag.
In some workloads, this can reduce number of sent logical packets by an
order of magnitude, making zero-copy TCP actually faster than
one-copy :)
Reported-by: Tom Herbert <therbert@google.com>
Cc: Nandita Dukkipati <nanditad@google.com>
Cc: Neal Cardwell <ncardwell@google.com>
Cc: Tom Herbert <therbert@google.com>
Cc: Yuchung Cheng <ycheng@google.com>
Cc: H.K. Jerry Chu <hkchu@google.com>
Cc: Maciej Żenczykowski <maze@google.com>
Cc: Mahesh Bandewar <maheshb@google.com>
Cc: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail>com>
---
net/ipv4/tcp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index cfd7edd..2ff6f45 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -860,7 +860,7 @@ wait_for_memory:
}
out:
- if (copied)
+ if (copied && !(flags & MSG_MORE))
tcp_push(sk, flags, mss_now, tp->nonagle);
return copied;
^ permalink raw reply related
* Re: [PATCH V3 net-next 08/28] ethtool: Add a common function for drivers with transmit time stamping.
From: Ben Hutchings @ 2012-04-03 19:27 UTC (permalink / raw)
To: Richard Cochran
Cc: netdev, David Miller, Martin Porter, Jacob Keller, Jeff Kirsher,
John Ronciak, e1000-devel
In-Reply-To: <a7ec1893167462243c5657d7ad9a8ef4b20d5e97.1333474523.git.richardcochran@gmail.com>
On Tue, 2012-04-03 at 19:47 +0200, Richard Cochran wrote:
> Currently, most drivers do not support transmit SO_TIMESTAMPING. For those
> that do support it, there is one appropriate response to the get_ts_info
> query. This patch adds a common function providing this response.
>
> Signed-off-by: Richard Cochran <richardcochran@gmail.com>
[...]
Reviewed-by: Ben Hutchings <bhutchings@solarflare.com>
--
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
* Re: [PATCH V3 net-next 02/28] ethtool: Introduce a method for getting time stamping capabilities.
From: Ben Hutchings @ 2012-04-03 19:24 UTC (permalink / raw)
To: Richard Cochran
Cc: netdev, David Miller, Martin Porter, Jacob Keller, Jeff Kirsher,
John Ronciak, e1000-devel
In-Reply-To: <40ae199e9b653f8f2bff0a606e11d90b6806a4e5.1333474522.git.richardcochran@gmail.com>
On Tue, 2012-04-03 at 19:47 +0200, Richard Cochran wrote:
> This commit adds a new ethtool ioctl that exposes the SO_TIMESTAMPING
> capabilities of a network interface. In addition, user space programs
> can use this ioctl to discover the PTP Hardware Clock (PHC) device
> associated with the interface.
>
> Since software receive time stamps are handled by the stack, the generic
> ethtool code can answer the query correctly in case the MAC or PHY
> drivers lack special time stamping features.
>
> Signed-off-by: Richard Cochran <richardcochran@gmail.com>
[...]
Reviewed-by: Ben Hutchings <bhutchings@solarflare.com>
--
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
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox