* Re: [PATCH net-next] net: fix warning of versioncheck
From: David Miller @ 2011-07-07 7:26 UTC (permalink / raw)
To: shanwei; +Cc: netdev, eilong, sjur.brandeland
In-Reply-To: <4E152325.4050202@cn.fujitsu.com>
From: Shan Wei <shanwei@cn.fujitsu.com>
Date: Thu, 07 Jul 2011 11:08:21 +0800
>
> net-next-2.6/drivers/net/bnx2x/bnx2x_sp.c: 19 linux/version.h not needed.
> net-next-2.6/drivers/net/caif/caif_hsi.c: 9 linux/version.h not needed.
>
> Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
Applied.
^ permalink raw reply
* Re: [PATCHv2] vmxnet3: round down # of queues to power of two
From: David Miller @ 2011-07-07 7:26 UTC (permalink / raw)
To: sbhatewara; +Cc: pv-drivers, netdev, dtor, yongwang
In-Reply-To: <alpine.LRH.2.00.1107061813100.3509@sbhatewara-dev1.eng.vmware.com>
From: Shreyas Bhatewara <sbhatewara@vmware.com>
Date: Wed, 6 Jul 2011 18:16:53 -0700 (PDT)
>
> vmxnet3 device supports only power-of-two number of queues. The driver
> therefore needs to check this and rounds down the number of queues to the
> nearest power of two.
>
> Signed-off-by: Yong Wang <yongwang@vmware.com>
> Signed-off-by: Shreyas N Bhatewara <sbhatewara@vmware.com>
> Reviewed-by: Dmitry Torokhov <dtor@vmware.com>
Applied.
^ permalink raw reply
* Re: [PATCH v3 4/4] packet: Add pre-defragmentation support for ipv4
From: David Miller @ 2011-07-07 7:25 UTC (permalink / raw)
To: eric.dumazet; +Cc: mika.penttila, netdev
In-Reply-To: <1309966077.2292.30.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Wed, 06 Jul 2011 17:27:57 +0200
> We probably need to add some atomic_inc(&sk->sk_drops) to at least
> warn the application.
I fully support adding some kind of statistics support to AF_PACKET
sockets.
^ permalink raw reply
* Re: [PATCH v2 net-next af-packet 1/2] Enhance af-packet to provide (near zero)lossless packet capture functionality.
From: David Miller @ 2011-07-07 7:13 UTC (permalink / raw)
To: loke.chetan
Cc: netdev, eric.dumazet, joe, bhutchings, shemminger, linux-kernel
In-Reply-To: <CAAsGZS67G8H5NLBxQTY88+T1cRQ3aiwBXK5qa8SJ_TbQ7xqvhw@mail.gmail.com>
From: chetan loke <loke.chetan@gmail.com>
Date: Wed, 6 Jul 2011 17:45:20 -0400
> new format:
>
> union bd_header_u {
> /* renamed struct bd_v1 to hdr_v1 */
> struct hdr_v1 h1;
> } __attribute__ ((__packed__));
>
> struct block_desc {
> __u16 version;
> __u16 offset_to_priv;
> union bd_header_u hdr;
> } __attribute__ ((__packed__));
>
> Is this ok with you?
Get rid of __packed__, it's going to kill performance on RISC
platforms. If you use __packed__, regardless of the actual alignment,
the compiler must assume that each part of the struct "might" be
unaligned. So on architectures such as sparc where alignment matters,
a word is going to be accessed by a sequence of byte loads/stores.
Do not use packed unless absolutely enforced by a protocol or hardware
data structure, it's evil.
^ permalink raw reply
* [PATCH net-next] net: doc: fix compile warning of no format arguments in ifenslave.c
From: Shan Wei @ 2011-07-07 7:04 UTC (permalink / raw)
To: rdunlap, David Miller, netdev, linux-doc
Fix following warning in ifenslave.c with gcc version 4.5.2 (Ubuntu/Linaro 4.5.2-8ubuntu4).
Documentation/networking/ifenslave.c:263:4: warning: format not a string literal and no format arguments
Documentation/networking/ifenslave.c:271:3: warning: format not a string literal and no format arguments
Documentation/networking/ifenslave.c:277:3: warning: format not a string literal and no format arguments
Documentation/networking/ifenslave.c:285:3: warning: format not a string literal and no format arguments
Documentation/networking/ifenslave.c:291:3: warning: format not a string literal and no format arguments
Documentation/networking/ifenslave.c:292:3: warning: format not a string literal and no format arguments
Documentation/networking/ifenslave.c:312:4: warning: format not a string literal and no format arguments
Documentation/networking/ifenslave.c:323:3: warning: format not a string literal and no format arguments
Documentation/networking/ifenslave.c:342:4: warning: format not a string literal and no format arguments
Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
---
Documentation/networking/ifenslave.c | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/Documentation/networking/ifenslave.c b/Documentation/networking/ifenslave.c
index 2bac961..65968fb 100644
--- a/Documentation/networking/ifenslave.c
+++ b/Documentation/networking/ifenslave.c
@@ -260,7 +260,7 @@ int main(int argc, char *argv[])
case 'V': opt_V++; exclusive++; break;
case '?':
- fprintf(stderr, usage_msg);
+ fprintf(stderr, "%s", usage_msg);
res = 2;
goto out;
}
@@ -268,13 +268,13 @@ int main(int argc, char *argv[])
/* options check */
if (exclusive > 1) {
- fprintf(stderr, usage_msg);
+ fprintf(stderr, "%s", usage_msg);
res = 2;
goto out;
}
if (opt_v || opt_V) {
- printf(version);
+ printf("%s", version);
if (opt_V) {
res = 0;
goto out;
@@ -282,14 +282,14 @@ int main(int argc, char *argv[])
}
if (opt_u) {
- printf(usage_msg);
+ printf("%s", usage_msg);
res = 0;
goto out;
}
if (opt_h) {
- printf(usage_msg);
- printf(help_msg);
+ printf("%s", usage_msg);
+ printf("%s", help_msg);
res = 0;
goto out;
}
@@ -309,7 +309,7 @@ int main(int argc, char *argv[])
goto out;
} else {
/* Just show usage */
- fprintf(stderr, usage_msg);
+ fprintf(stderr, "%s", usage_msg);
res = 2;
goto out;
}
@@ -320,7 +320,7 @@ int main(int argc, char *argv[])
master_ifname = *spp++;
if (master_ifname == NULL) {
- fprintf(stderr, usage_msg);
+ fprintf(stderr, "%s", usage_msg);
res = 2;
goto out;
}
@@ -339,7 +339,7 @@ int main(int argc, char *argv[])
if (slave_ifname == NULL) {
if (opt_d || opt_c) {
- fprintf(stderr, usage_msg);
+ fprintf(stderr, "%s", usage_msg);
res = 2;
goto out;
}
--
1.7.4.1
^ permalink raw reply related
* Re: [PATCH linux-firmware] bnx2x: Adding FW 7.0.23.0
From: Ariel Elior @ 2011-07-07 6:59 UTC (permalink / raw)
To: dwmw2; +Cc: eilong, netdev
In-Reply-To: <1309795666.16026.22.camel@lb-tlvb-ariel.il.broadcom.com>
On Mon, 2011-07-04 at 19:07 +0300, Ariel Elior wrote:
> On Mon, 2011-07-04 at 18:59 +0300, Ariel Elior wrote:
> > This FW supports multiple concurrent classes of service in network traffic.
> >
> > Signed-off-by: Ariel Elior <ariele@broadcom.com>
> > Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
> > ---
> in case you need it, the patch is also available under
> http://linux.broadcom.com/eilong/FW-7.0.23.0/0001-bnx2x-Adding-FW-7.0.23.0.patch
> thanks,
> Ariel
David, were you able to obtain the FW?
Thanks,
Ariel
^ permalink raw reply
* Re: [Bugme-new] [Bug 38102] New: BUG kmalloc-2048: Poison overwritten
From: Eric Dumazet @ 2011-07-07 6:48 UTC (permalink / raw)
To: Alexey Zaytsev
Cc: Michael Büsch, Neil Horman, Andrew Morton, netdev,
Gary Zambrano, bugme-daemon, David S. Miller, Pekka Pietikainen,
Florian Schirmer, Felix Fietkau, Michael Buesch
In-Reply-To: <CAB9v_DFmXS7_0Sx7VgVzViMSqOTtpaqiKrBABcfARigZabr5fA@mail.gmail.com>
Le jeudi 07 juillet 2011 à 10:32 +0400, Alexey Zaytsev a écrit :
> Sorry, been busy for the last couple days. Any patches I should test?
Please try :
diff --git a/drivers/net/b44.c b/drivers/net/b44.c
index 6c4ef96..860b236 100644
--- a/drivers/net/b44.c
+++ b/drivers/net/b44.c
@@ -688,8 +688,8 @@ static int b44_alloc_rx_skb(struct b44 *bp, int src_idx, u32 dest_idx_unmasked)
ctrl |= DESC_CTRL_EOT;
dp = &bp->rx_ring[dest_idx];
- dp->ctrl = cpu_to_le32(ctrl);
dp->addr = cpu_to_le32((u32) mapping + bp->dma_offset);
+ dp->ctrl = cpu_to_le32(ctrl);
if (bp->flags & B44_FLAG_RX_RING_HACK)
b44_sync_dma_desc_for_device(bp->sdev, bp->rx_ring_dma,
@@ -725,13 +725,15 @@ static void b44_recycle_rx(struct b44 *bp, int src_idx, u32 dest_idx_unmasked)
DMA_BIDIRECTIONAL);
ctrl = src_desc->ctrl;
+ src_desc->ctrl = (ctrl & cpu_to_le32(DESC_CTRL_EOT));
if (dest_idx == (B44_RX_RING_SIZE - 1))
ctrl |= cpu_to_le32(DESC_CTRL_EOT);
else
ctrl &= cpu_to_le32(~DESC_CTRL_EOT);
- dest_desc->ctrl = ctrl;
dest_desc->addr = src_desc->addr;
+ dest_desc->ctrl = ctrl;
+ src_desc->addr = 0;
src_map->skb = NULL;
@@ -1118,6 +1120,7 @@ static void b44_init_rings(struct b44 *bp)
if (b44_alloc_rx_skb(bp, -1, i) < 0)
break;
}
+ bp->rx_prod = i;
}
/*
@@ -1405,8 +1408,7 @@ static void b44_init_hw(struct b44 *bp, int reset_kind)
(RX_PKT_OFFSET << DMARX_CTRL_ROSHIFT)));
bw32(bp, B44_DMARX_ADDR, bp->rx_ring_dma + bp->dma_offset);
- bw32(bp, B44_DMARX_PTR, bp->rx_pending);
- bp->rx_prod = bp->rx_pending;
+ bw32(bp, B44_DMARX_PTR, 0);
bw32(bp, B44_MIB_CTRL, MIB_CTRL_CLR_ON_READ);
}
^ permalink raw reply related
* Re: [Bugme-new] [Bug 38102] New: BUG kmalloc-2048: Poison overwritten
From: Alexey Zaytsev @ 2011-07-07 6:32 UTC (permalink / raw)
To: Eric Dumazet
Cc: Michael Büsch, Neil Horman, Andrew Morton, netdev,
Gary Zambrano, bugme-daemon, David S. Miller, Pekka Pietikainen,
Florian Schirmer, Felix Fietkau, Michael Buesch
In-Reply-To: <1309971379.2292.64.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC>
Sorry, been busy for the last couple days. Any patches I should test?
^ permalink raw reply
* linux-next: manual merge of the staging tree with the net tree
From: Stephen Rothwell @ 2011-07-07 5:28 UTC (permalink / raw)
To: Greg KH; +Cc: linux-next, linux-kernel, Jesper Juhl, David Miller, netdev
Hi Greg,
Today's linux-next merge of the staging tree got a conflict in
drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c between commit
219eb47e6f35 ("net/staging: add needed interrupt.h and hardirq.h
includes") from the net tree and commit 41134db17a7d ("Remove unneeded
version.h includes from drivers/staging/rtl*/") from the staging tree.
I fixed it up (see below) and can carry the fix as necessary.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --cc drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c
index 00ee02f,52a7386..0000000
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c
@@@ -19,8 -19,6 +19,7 @@@
#include <linux/random.h>
#include <linux/delay.h>
#include <linux/slab.h>
- #include <linux/version.h>
+#include <linux/interrupt.h>
#include <asm/uaccess.h>
#include "dot11d.h"
^ permalink raw reply
* [PATCH 0/4] skge: driver update
From: Stephen Hemminger @ 2011-07-07 5:00 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev
Add one pci id, and cleanup table.
Make support for really old hardware optional.
^ permalink raw reply
* [PATCH 3/4] skge: make support for old Genesis chips optional
From: Stephen Hemminger @ 2011-07-07 5:00 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev
In-Reply-To: <20110707050003.998140428@vyatta.com>
[-- Attachment #1: skge-genesis-optional.patch --]
[-- Type: text/plain, Size: 11015 bytes --]
The GENESIS boards are really old PCI-X boards that are rare.
Marvell has dropped support for this hardware and there is no reason
for most users to have to have this code.
Rather than riddling code with ifdef's make one macro and let
the compiler do the dead code elimination. This saves about 15%
of the text size.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
--- a/drivers/net/Kconfig 2011-07-06 19:26:47.503999151 -0700
+++ b/drivers/net/Kconfig 2011-07-06 19:29:14.639999138 -0700
@@ -2303,6 +2303,15 @@ config SKGE_DEBUG
If unsure, say N.
+config SKGE_GENESIS
+ bool "Support for older SysKonnect Genesis boards"
+ depends on SKGE
+ help
+ This enables support for the older and uncommon SysKonnect Genesis
+ chips, which support MII via an external transceiver, instead of
+ an internal one. Disabling this option will save some memory
+ by making code smaller. If unsure say Y.
+
config SKY2
tristate "SysKonnect Yukon2 support"
depends on PCI
--- a/drivers/net/skge.c 2011-07-06 19:28:58.836000719 -0700
+++ b/drivers/net/skge.c 2011-07-06 19:29:14.639999138 -0700
@@ -85,6 +85,9 @@ MODULE_PARM_DESC(debug, "Debug level (0=
static DEFINE_PCI_DEVICE_TABLE(skge_id_table) = {
{ PCI_DEVICE(PCI_VENDOR_ID_3COM, 0x1700) }, /* 3Com 3C940 */
{ PCI_DEVICE(PCI_VENDOR_ID_3COM, 0x80EB) }, /* 3Com 3C940B */
+#ifdef CONFIG_SKGE_GENESIS
+ { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x4300) }, /* SK-9xx */
+#endif
{ PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x4320) }, /* SK-98xx V2.0 */
{ PCI_DEVICE(PCI_VENDOR_ID_DLINK, 0x4b01) }, /* D-Link DGE-530T (rev.B) */
{ PCI_DEVICE(PCI_VENDOR_ID_DLINK, 0x4c00) }, /* D-Link DGE-530T */
@@ -119,6 +122,15 @@ static const u32 txirqmask[] = { IS_XA1_
static const u32 napimask[] = { IS_R1_F|IS_XA1_F, IS_R2_F|IS_XA2_F };
static const u32 portmask[] = { IS_PORT_1, IS_PORT_2 };
+static inline bool is_genesis(const struct skge_hw *hw)
+{
+#ifdef CONFIG_SKGE_GENESIS
+ return hw->chip_id == CHIP_ID_GENESIS;
+#else
+ return false;
+#endif
+}
+
static int skge_get_regs_len(struct net_device *dev)
{
return 0x4000;
@@ -146,7 +158,7 @@ static void skge_get_regs(struct net_dev
/* Wake on Lan only supported on Yukon chips with rev 1 or above */
static u32 wol_supported(const struct skge_hw *hw)
{
- if (hw->chip_id == CHIP_ID_GENESIS)
+ if (is_genesis(hw))
return 0;
if (hw->chip_id == CHIP_ID_YUKON && hw->chip_rev == 0)
@@ -270,7 +282,7 @@ static u32 skge_supported_modes(const st
SUPPORTED_Autoneg |
SUPPORTED_TP);
- if (hw->chip_id == CHIP_ID_GENESIS)
+ if (is_genesis(hw))
supported &= ~(SUPPORTED_10baseT_Half |
SUPPORTED_10baseT_Full |
SUPPORTED_100baseT_Half |
@@ -433,7 +445,7 @@ static void skge_get_ethtool_stats(struc
{
struct skge_port *skge = netdev_priv(dev);
- if (skge->hw->chip_id == CHIP_ID_GENESIS)
+ if (is_genesis(skge->hw))
genesis_get_stats(skge, data);
else
yukon_get_stats(skge, data);
@@ -448,7 +460,7 @@ static struct net_device_stats *skge_get
struct skge_port *skge = netdev_priv(dev);
u64 data[ARRAY_SIZE(skge_stats)];
- if (skge->hw->chip_id == CHIP_ID_GENESIS)
+ if (is_genesis(skge->hw))
genesis_get_stats(skge, data);
else
yukon_get_stats(skge, data);
@@ -589,7 +601,7 @@ static int skge_set_pauseparam(struct ne
/* Chip internal frequency for clock calculations */
static inline u32 hwkhz(const struct skge_hw *hw)
{
- return (hw->chip_id == CHIP_ID_GENESIS) ? 53125 : 78125;
+ return is_genesis(hw) ? 53125 : 78125;
}
/* Chip HZ to microseconds */
@@ -674,7 +686,7 @@ static void skge_led(struct skge_port *s
int port = skge->port;
spin_lock_bh(&hw->phy_lock);
- if (hw->chip_id == CHIP_ID_GENESIS) {
+ if (is_genesis(hw)) {
switch (mode) {
case LED_MODE_OFF:
if (hw->phy_type == SK_PHY_BCOM)
@@ -1053,7 +1065,6 @@ static void skge_link_down(struct skge_p
netif_info(skge, link, skge->netdev, "Link is down\n");
}
-
static void xm_link_down(struct skge_hw *hw, int port)
{
struct net_device *dev = hw->dev[port];
@@ -1172,7 +1183,6 @@ static void genesis_reset(struct skge_hw
xm_write32(hw, port, XM_MODE, reg | XM_MD_FRF);
}
-
/* Convert mode to MII values */
static const u16 phy_pause_map[] = {
[FLOW_MODE_NONE] = 0,
@@ -2405,7 +2415,7 @@ static void skge_phy_reset(struct skge_p
netif_carrier_off(skge->netdev);
spin_lock_bh(&hw->phy_lock);
- if (hw->chip_id == CHIP_ID_GENESIS) {
+ if (is_genesis(hw)) {
genesis_reset(hw, port);
genesis_mac_init(hw, port);
} else {
@@ -2436,7 +2446,8 @@ static int skge_ioctl(struct net_device
case SIOCGMIIREG: {
u16 val = 0;
spin_lock_bh(&hw->phy_lock);
- if (hw->chip_id == CHIP_ID_GENESIS)
+
+ if (is_genesis(hw))
err = __xm_phy_read(hw, skge->port, data->reg_num & 0x1f, &val);
else
err = __gm_phy_read(hw, skge->port, data->reg_num & 0x1f, &val);
@@ -2447,7 +2458,7 @@ static int skge_ioctl(struct net_device
case SIOCSMIIREG:
spin_lock_bh(&hw->phy_lock);
- if (hw->chip_id == CHIP_ID_GENESIS)
+ if (is_genesis(hw))
err = xm_phy_write(hw, skge->port, data->reg_num & 0x1f,
data->val_in);
else
@@ -2559,7 +2570,7 @@ static int skge_up(struct net_device *de
/* Initialize MAC */
spin_lock_bh(&hw->phy_lock);
- if (hw->chip_id == CHIP_ID_GENESIS)
+ if (is_genesis(hw))
genesis_mac_init(hw, port);
else
yukon_mac_init(hw, port);
@@ -2621,7 +2632,7 @@ static int skge_down(struct net_device *
netif_tx_disable(dev);
- if (hw->chip_id == CHIP_ID_GENESIS && hw->phy_type == SK_PHY_XMAC)
+ if (is_genesis(hw) && hw->phy_type == SK_PHY_XMAC)
del_timer_sync(&skge->link_timer);
napi_disable(&skge->napi);
@@ -2633,7 +2644,7 @@ static int skge_down(struct net_device *
spin_unlock_irq(&hw->hw_lock);
skge_write8(skge->hw, SK_REG(skge->port, LNK_LED_REG), LED_OFF);
- if (hw->chip_id == CHIP_ID_GENESIS)
+ if (is_genesis(hw))
genesis_stop(skge);
else
yukon_stop(skge);
@@ -2661,7 +2672,7 @@ static int skge_down(struct net_device *
skge_rx_stop(hw, port);
- if (hw->chip_id == CHIP_ID_GENESIS) {
+ if (is_genesis(hw)) {
skge_write8(hw, SK_REG(port, TX_MFF_CTRL2), MFF_RST_SET);
skge_write8(hw, SK_REG(port, RX_MFF_CTRL2), MFF_RST_SET);
} else {
@@ -2957,7 +2968,7 @@ static void yukon_set_multicast(struct n
static inline u16 phy_length(const struct skge_hw *hw, u32 status)
{
- if (hw->chip_id == CHIP_ID_GENESIS)
+ if (is_genesis(hw))
return status >> XMR_FS_LEN_SHIFT;
else
return status >> GMR_FS_LEN_SHIFT;
@@ -2965,7 +2976,7 @@ static inline u16 phy_length(const struc
static inline int bad_phy_status(const struct skge_hw *hw, u32 status)
{
- if (hw->chip_id == CHIP_ID_GENESIS)
+ if (is_genesis(hw))
return (status & (XMR_FS_ERR | XMR_FS_2L_VLAN)) != 0;
else
return (status & GMR_FS_ANY_ERR) ||
@@ -2975,9 +2986,8 @@ static inline int bad_phy_status(const s
static void skge_set_multicast(struct net_device *dev)
{
struct skge_port *skge = netdev_priv(dev);
- struct skge_hw *hw = skge->hw;
- if (hw->chip_id == CHIP_ID_GENESIS)
+ if (is_genesis(skge->hw))
genesis_set_multicast(dev);
else
yukon_set_multicast(dev);
@@ -3057,7 +3067,7 @@ error:
"rx err, slot %td control 0x%x status 0x%x\n",
e - skge->rx_ring.start, control, status);
- if (skge->hw->chip_id == CHIP_ID_GENESIS) {
+ if (is_genesis(skge->hw)) {
if (status & (XMR_FS_RUNT|XMR_FS_LNG_ERR))
dev->stats.rx_length_errors++;
if (status & XMR_FS_FRA_ERR)
@@ -3171,7 +3181,7 @@ static void skge_mac_parity(struct skge_
++dev->stats.tx_heartbeat_errors;
- if (hw->chip_id == CHIP_ID_GENESIS)
+ if (is_genesis(hw))
skge_write16(hw, SK_REG(port, TX_MFF_CTRL1),
MFF_CLR_PERR);
else
@@ -3183,7 +3193,7 @@ static void skge_mac_parity(struct skge_
static void skge_mac_intr(struct skge_hw *hw, int port)
{
- if (hw->chip_id == CHIP_ID_GENESIS)
+ if (is_genesis(hw))
genesis_mac_intr(hw, port);
else
yukon_mac_intr(hw, port);
@@ -3195,7 +3205,7 @@ static void skge_error_irq(struct skge_h
struct pci_dev *pdev = hw->pdev;
u32 hwstatus = skge_read32(hw, B0_HWE_ISRC);
- if (hw->chip_id == CHIP_ID_GENESIS) {
+ if (is_genesis(hw)) {
/* clear xmac errors */
if (hwstatus & (IS_NO_STAT_M1|IS_NO_TIST_M1))
skge_write16(hw, RX_MFF_CTRL1, MFF_CLR_INSTAT);
@@ -3278,7 +3288,7 @@ static void skge_extirq(unsigned long ar
struct skge_port *skge = netdev_priv(dev);
spin_lock(&hw->phy_lock);
- if (hw->chip_id != CHIP_ID_GENESIS)
+ if (!is_genesis(hw))
yukon_phy_intr(skge);
else if (hw->phy_type == SK_PHY_BCOM)
bcom_phy_intr(skge);
@@ -3397,7 +3407,7 @@ static int skge_set_mac_address(struct n
memcpy_toio(hw->regs + B2_MAC_1 + port*8, dev->dev_addr, ETH_ALEN);
memcpy_toio(hw->regs + B2_MAC_2 + port*8, dev->dev_addr, ETH_ALEN);
- if (hw->chip_id == CHIP_ID_GENESIS)
+ if (is_genesis(hw))
xm_outaddr(hw, port, XM_SA, dev->dev_addr);
else {
gma_set_addr(hw, port, GM_SRC_ADDR_1L, dev->dev_addr);
@@ -3473,6 +3483,7 @@ static int skge_reset(struct skge_hw *hw
switch (hw->chip_id) {
case CHIP_ID_GENESIS:
+#ifdef CONFIG_SKGE_GENESIS
switch (hw->phy_type) {
case SK_PHY_XMAC:
hw->phy_addr = PHY_ADDR_XMAC;
@@ -3486,6 +3497,10 @@ static int skge_reset(struct skge_hw *hw
return -EOPNOTSUPP;
}
break;
+#else
+ dev_err(&hw->pdev->dev, "Genesis chip detected but not configured\n");
+ return -EOPNOTSUPP;
+#endif
case CHIP_ID_YUKON:
case CHIP_ID_YUKON_LITE:
@@ -3508,7 +3523,7 @@ static int skge_reset(struct skge_hw *hw
/* read the adapters RAM size */
t8 = skge_read8(hw, B2_E_0);
- if (hw->chip_id == CHIP_ID_GENESIS) {
+ if (is_genesis(hw)) {
if (t8 == 3) {
/* special case: 4 x 64k x 36, offset = 0x80000 */
hw->ram_size = 0x100000;
@@ -3523,10 +3538,10 @@ static int skge_reset(struct skge_hw *hw
hw->intr_mask = IS_HW_ERR;
/* Use PHY IRQ for all but fiber based Genesis board */
- if (!(hw->chip_id == CHIP_ID_GENESIS && hw->phy_type == SK_PHY_XMAC))
+ if (!(is_genesis(hw) && hw->phy_type == SK_PHY_XMAC))
hw->intr_mask |= IS_EXT_REG;
- if (hw->chip_id == CHIP_ID_GENESIS)
+ if (is_genesis(hw))
genesis_init(hw);
else {
/* switch power to VCC (WA for VAUX problem) */
@@ -3591,7 +3606,7 @@ static int skge_reset(struct skge_hw *hw
skge_write32(hw, B0_IMSK, hw->intr_mask);
for (i = 0; i < hw->ports; i++) {
- if (hw->chip_id == CHIP_ID_GENESIS)
+ if (is_genesis(hw))
genesis_reset(hw, i);
else
yukon_reset(hw, i);
@@ -3802,9 +3817,9 @@ static struct net_device *skge_devinit(s
skge->port = port;
/* Only used for Genesis XMAC */
- setup_timer(&skge->link_timer, xm_link_timer, (unsigned long) skge);
-
- if (hw->chip_id != CHIP_ID_GENESIS) {
+ if (is_genesis(hw))
+ setup_timer(&skge->link_timer, xm_link_timer, (unsigned long) skge);
+ else {
dev->hw_features = NETIF_F_IP_CSUM | NETIF_F_SG |
NETIF_F_RXCSUM;
dev->features |= dev->hw_features;
^ permalink raw reply
* [PATCH 1/4] skge: cleanup pci id table
From: Stephen Hemminger @ 2011-07-07 5:00 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev
In-Reply-To: <20110707050003.998140428@vyatta.com>
[-- Attachment #1: skge-pci-id.patch --]
[-- Type: text/plain, Size: 2094 bytes --]
The PCI table was using mix of defines for device id and hard coded
hex values. This patch change it to all hex values. It also adds
comments based on the names provided in the vendor driver table.
There is NO CHANGE to the actual resulting table.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
--- a/drivers/net/skge.c 2011-06-08 09:08:33.000000000 -0700
+++ b/drivers/net/skge.c 2011-07-06 18:33:07.299999438 -0700
@@ -83,17 +83,16 @@ module_param(debug, int, 0);
MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)");
static DEFINE_PCI_DEVICE_TABLE(skge_id_table) = {
- { PCI_DEVICE(PCI_VENDOR_ID_3COM, PCI_DEVICE_ID_3COM_3C940) },
- { PCI_DEVICE(PCI_VENDOR_ID_3COM, PCI_DEVICE_ID_3COM_3C940B) },
- { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_GE) },
- { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_YU) },
- { PCI_DEVICE(PCI_VENDOR_ID_DLINK, PCI_DEVICE_ID_DLINK_DGE510T) },
- { PCI_DEVICE(PCI_VENDOR_ID_DLINK, 0x4b01) }, /* DGE-530T */
- { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4320) },
- { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x5005) }, /* Belkin */
- { PCI_DEVICE(PCI_VENDOR_ID_CNET, PCI_DEVICE_ID_CNET_GIGACARD) },
- { PCI_DEVICE(PCI_VENDOR_ID_LINKSYS, PCI_DEVICE_ID_LINKSYS_EG1064) },
- { PCI_VENDOR_ID_LINKSYS, 0x1032, PCI_ANY_ID, 0x0015 },
+ { PCI_DEVICE(PCI_VENDOR_ID_3COM, 0x1700) }, /* 3Com 3C940 */
+ { PCI_DEVICE(PCI_VENDOR_ID_3COM, 0x80EB) }, /* 3Com 3C940B */
+ { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x4320) }, /* SK-98xx V2.0 */
+ { PCI_DEVICE(PCI_VENDOR_ID_DLINK, 0x4b01) }, /* D-Link DGE-530T (rev.B) */
+ { PCI_DEVICE(PCI_VENDOR_ID_DLINK, 0x4c00) }, /* D-Link DGE-530T */
+ { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4320) }, /* Marvell Yukon 88E8001/8003/8010 */
+ { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x5005) }, /* Belkin */
+ { PCI_DEVICE(PCI_VENDOR_ID_CNET, 0x434E) }, /* CNet PowerG-2000 */
+ { PCI_DEVICE(PCI_VENDOR_ID_LINKSYS, 0x1064) }, /* Linksys EG1064 v2 */
+ { PCI_VENDOR_ID_LINKSYS, 0x1032, PCI_ANY_ID, 0x0015 }, /* Linksys EG1032 v2 */
{ 0 }
};
MODULE_DEVICE_TABLE(pci, skge_id_table);
^ permalink raw reply
* [PATCH 2/4] add pci-id for DGE-530T
From: Stephen Hemminger @ 2011-07-07 5:00 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev
In-Reply-To: <20110707050003.998140428@vyatta.com>
[-- Attachment #1: skge-add-dlink.patch --]
[-- Type: text/plain, Size: 811 bytes --]
See also: https://bugzilla.kernel.org/show_bug.cgi?id=38862
Reported-by: jameshenderson@ruggedcom.com
--- a/drivers/net/skge.c 2011-07-06 19:27:02.459999149 -0700
+++ b/drivers/net/skge.c 2011-07-06 19:28:58.836000719 -0700
@@ -88,6 +88,7 @@ static DEFINE_PCI_DEVICE_TABLE(skge_id_t
{ PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x4320) }, /* SK-98xx V2.0 */
{ PCI_DEVICE(PCI_VENDOR_ID_DLINK, 0x4b01) }, /* D-Link DGE-530T (rev.B) */
{ PCI_DEVICE(PCI_VENDOR_ID_DLINK, 0x4c00) }, /* D-Link DGE-530T */
+ { PCI_DEVICE(PCI_VENDOR_ID_DLINK, 0x4302) }, /* D-Link DGE-530T Rev C1 */
{ PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4320) }, /* Marvell Yukon 88E8001/8003/8010 */
{ PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x5005) }, /* Belkin */
{ PCI_DEVICE(PCI_VENDOR_ID_CNET, 0x434E) }, /* CNet PowerG-2000 */
^ permalink raw reply
* [PATCH 4/4] skge: update version
From: Stephen Hemminger @ 2011-07-07 5:00 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev
In-Reply-To: <20110707050003.998140428@vyatta.com>
[-- Attachment #1: skge-version.patch --]
[-- Type: text/plain, Size: 856 bytes --]
Update version number, and take "New" off the config information
since old sk98lin has been gone for a couple years.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
--- a/drivers/net/Kconfig 2011-07-06 21:58:12.139686271 -0700
+++ b/drivers/net/Kconfig 2011-07-06 21:58:30.071682326 -0700
@@ -2272,7 +2272,7 @@ config SIS190
will be called sis190. This is recommended.
config SKGE
- tristate "New SysKonnect GigaEthernet support"
+ tristate "SysKonnect GigaEthernet support"
depends on PCI
select CRC32
---help---
--- a/drivers/net/skge.c 2011-07-06 21:57:53.915690195 -0700
+++ b/drivers/net/skge.c 2011-07-06 21:58:06.675686411 -0700
@@ -50,7 +50,7 @@
#include "skge.h"
#define DRV_NAME "skge"
-#define DRV_VERSION "1.13"
+#define DRV_VERSION "1.14"
#define DEFAULT_TX_RING_SIZE 128
#define DEFAULT_RX_RING_SIZE 512
^ permalink raw reply
* Re: [Bugme-new] [Bug 38032] New: default values of /proc/sys/net/ipv4/udp_mem does not consider huge page allocation
From: Eric Dumazet @ 2011-07-07 4:38 UTC (permalink / raw)
To: starlight, David Miller
Cc: Andrew Morton, linux-mm, netdev, bugme-daemon, Rafael Aquini
In-Reply-To: <1310011173.2481.20.camel@edumazet-laptop>
Lets use following patch ?
[PATCH] net: refine {udp|tcp|sctp}_mem limits
Current tcp/udp/sctp global memory limits are not taking into account
hugepages allocations, and allow 50% of ram to be used by buffers of a
single protocol [ not counting space used by sockets / inodes ...]
Lets use nr_free_buffer_pages() and allow a default of 1/8 of kernel ram
per protocol, and a minimum of 128 pages.
Heavy duty machines sysadmins probably need to tweak limits anyway.
References: https://bugzilla.stlinux.com/show_bug.cgi?id=38032
Reported-by: starlight <starlight@binnacle.cx>
Suggested-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
net/ipv4/tcp.c | 10 ++--------
net/ipv4/udp.c | 10 ++--------
net/sctp/protocol.c | 11 +----------
3 files changed, 5 insertions(+), 26 deletions(-)
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 054a59d..46febca 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -3220,7 +3220,7 @@ __setup("thash_entries=", set_thash_entries);
void __init tcp_init(void)
{
struct sk_buff *skb = NULL;
- unsigned long nr_pages, limit;
+ unsigned long limit;
int i, max_share, cnt;
unsigned long jiffy = jiffies;
@@ -3277,13 +3277,7 @@ void __init tcp_init(void)
sysctl_tcp_max_orphans = cnt / 2;
sysctl_max_syn_backlog = max(128, cnt / 256);
- /* Set the pressure threshold to be a fraction of global memory that
- * is up to 1/2 at 256 MB, decreasing toward zero with the amount of
- * memory, with a floor of 128 pages.
- */
- nr_pages = totalram_pages - totalhigh_pages;
- limit = min(nr_pages, 1UL<<(28-PAGE_SHIFT)) >> (20-PAGE_SHIFT);
- limit = (limit * (nr_pages >> (20-PAGE_SHIFT))) >> (PAGE_SHIFT-11);
+ limit = nr_free_buffer_pages() / 8;
limit = max(limit, 128UL);
sysctl_tcp_mem[0] = limit / 4 * 3;
sysctl_tcp_mem[1] = limit;
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 48cd88e..198f75b 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -2209,16 +2209,10 @@ void __init udp_table_init(struct udp_table *table, const char *name)
void __init udp_init(void)
{
- unsigned long nr_pages, limit;
+ unsigned long limit;
udp_table_init(&udp_table, "UDP");
- /* Set the pressure threshold up by the same strategy of TCP. It is a
- * fraction of global memory that is up to 1/2 at 256 MB, decreasing
- * toward zero with the amount of memory, with a floor of 128 pages.
- */
- nr_pages = totalram_pages - totalhigh_pages;
- limit = min(nr_pages, 1UL<<(28-PAGE_SHIFT)) >> (20-PAGE_SHIFT);
- limit = (limit * (nr_pages >> (20-PAGE_SHIFT))) >> (PAGE_SHIFT-11);
+ limit = nr_free_buffer_pages() / 8;
limit = max(limit, 128UL);
sysctl_udp_mem[0] = limit / 4 * 3;
sysctl_udp_mem[1] = limit;
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index 67380a2..207175b 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -1058,7 +1058,6 @@ SCTP_STATIC __init int sctp_init(void)
int status = -EINVAL;
unsigned long goal;
unsigned long limit;
- unsigned long nr_pages;
int max_share;
int order;
@@ -1148,15 +1147,7 @@ SCTP_STATIC __init int sctp_init(void)
/* Initialize handle used for association ids. */
idr_init(&sctp_assocs_id);
- /* Set the pressure threshold to be a fraction of global memory that
- * is up to 1/2 at 256 MB, decreasing toward zero with the amount of
- * memory, with a floor of 128 pages.
- * Note this initializes the data in sctpv6_prot too
- * Unabashedly stolen from tcp_init
- */
- nr_pages = totalram_pages - totalhigh_pages;
- limit = min(nr_pages, 1UL<<(28-PAGE_SHIFT)) >> (20-PAGE_SHIFT);
- limit = (limit * (nr_pages >> (20-PAGE_SHIFT))) >> (PAGE_SHIFT-11);
+ limit = nr_free_buffer_pages() / 8;
limit = max(limit, 128UL);
sysctl_sctp_mem[0] = limit / 4 * 3;
sysctl_sctp_mem[1] = limit;
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related
* Re: [Bugme-new] [Bug 38032] New: default values of /proc/sys/net/ipv4/udp_mem does not consider huge page allocation
From: Eric Dumazet @ 2011-07-07 3:59 UTC (permalink / raw)
To: starlight; +Cc: Andrew Morton, linux-mm, netdev, bugme-daemon, Rafael Aquini
In-Reply-To: <6.2.5.6.2.20110706212254.05bff4c8@binnacle.cx>
Le mercredi 06 juillet 2011 à 21:31 -0400, starlight@binnacle.cx a
écrit :
> For anyone who may not have read the bugzilla, a
> possibly larger concern subsequently discovered is
> that actual kernel memory consumption is double the
> total of the values reported by 'netstat -nau', at
> least when mostly small packets are received and
> a RHEL 5 kernel is in use. The tunable enforces based
> on the 'netstat' value rather than the actual value
> in the RH kernel. Maybe not an issue in the
> mainline, but it took a few additional system
> hangs in the lab before we figured this out
> and divided the 'udm_mem' maximum value in half.
>
Several problems here
1) Hugepages can be setup after system boot, and udp_mem/tcp_mem not
updated accordingly.
2) Using SLUB debug or kmemcheck for instance adds lot of overhead, that
we dont take into account (it would probably be expensive to do so).
Even ksize(ptr) is not able to really report memory usage of an object.
3) What happens if both tcp and udp sockets are in use on the system,
shouls we half both udp_mem and tcp_mem just in case ?
Now if you also use SCTP sockets, UDP-Lite sockets, lot of file
mappings, huge pages, conntracking, posix timers (currently not
limited), threads, ..., what happens ? Should we then set udp_mem to 1%
of current limit just in case ?
What about fixing the real problem instead ?
When you say the system freezes, is it in the UDP stack, or elsewhere ?
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply
* [PATCH net-next] net: fix warning of versioncheck
From: Shan Wei @ 2011-07-07 3:08 UTC (permalink / raw)
To: David Miller, netdev, eilong, sjur.brandeland
net-next-2.6/drivers/net/bnx2x/bnx2x_sp.c: 19 linux/version.h not needed.
net-next-2.6/drivers/net/caif/caif_hsi.c: 9 linux/version.h not needed.
Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
---
drivers/net/bnx2x/bnx2x_sp.c | 1 -
drivers/net/caif/caif_hsi.c | 1 -
2 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/drivers/net/bnx2x/bnx2x_sp.c b/drivers/net/bnx2x/bnx2x_sp.c
index 5bdf094..f6322a1 100644
--- a/drivers/net/bnx2x/bnx2x_sp.c
+++ b/drivers/net/bnx2x/bnx2x_sp.c
@@ -16,7 +16,6 @@
* Written by: Vladislav Zolotarov
*
*/
-#include <linux/version.h>
#include <linux/module.h>
#include <linux/crc32.h>
#include <linux/netdevice.h>
diff --git a/drivers/net/caif/caif_hsi.c b/drivers/net/caif/caif_hsi.c
index 016108a..b41c2fc 100644
--- a/drivers/net/caif/caif_hsi.c
+++ b/drivers/net/caif/caif_hsi.c
@@ -6,7 +6,6 @@
* License terms: GNU General Public License (GPL) version 2.
*/
-#include <linux/version.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/device.h>
--
1.7.4.1
^ permalink raw reply related
* RE: [Pv-drivers] [PATCH] vmxnet3: round down # of queues to power of two
From: Yong Wang @ 2011-07-07 1:53 UTC (permalink / raw)
To: Dmitry Torokhov, pv-drivers@vmware.com
Cc: Shreyas Bhatewara, netdev@vger.kernel.org
In-Reply-To: <201107061808.39918.dtor@vmware.com>
I just want to point out that rounddown_pow_of_two() returns 0 when (1) the input is 1; and (2) the __buildin_constant_p(n) path is taken. In the vmxnet3 case, even if num_rx_queues is 1, we are safe as its value is not known to be constant at compile time and 1 will be returned by taking the other path (1UL << (fls_long(n) - 1)). The original check of power_of_two is there just to be on the safe side.
Related to this, I wonder if we should always return 1 when the input is 1 (1 is also a power of two as 2^0). I don't have the history of this API though and curious if there are any users of this API that depend on this behavior?
Thanks,
Yong
> -----Original Message-----
> From: Dmitry Torokhov [mailto:dtor@vmware.com]
> Sent: Wednesday, July 06, 2011 6:09 PM
> To: pv-drivers@vmware.com
> Cc: Shreyas Bhatewara; netdev@vger.kernel.org; Yong Wang
> Subject: Re: [Pv-drivers] [PATCH] vmxnet3: round down # of queues to power of
> two
>
> On Wednesday, July 06, 2011 05:58:51 PM Shreyas Bhatewara wrote:
>
> >
> > + if (!is_power_of_2(num_rx_queues))
> > + num_rx_queues = rounddown_pow_of_two(num_rx_queues);
> > +
>
> No need to do the check, just do:
>
> num_rx_queues = rounddown_pow_of_two(num_rx_queues);
>
> Thanks,
> Dmitry
^ permalink raw reply
* Re: [Bugme-new] [Bug 38032] New: default values of /proc/sys/net/ipv4/udp_mem does not consider huge page allocation
From: starlight @ 2011-07-07 1:31 UTC (permalink / raw)
To: Andrew Morton, linux-mm, netdev; +Cc: bugme-daemon, Rafael Aquini
In-Reply-To: <20110706160318.2c604ae9.akpm@linux-foundation.org>
For anyone who may not have read the bugzilla, a
possibly larger concern subsequently discovered is
that actual kernel memory consumption is double the
total of the values reported by 'netstat -nau', at
least when mostly small packets are received and
a RHEL 5 kernel is in use. The tunable enforces based
on the 'netstat' value rather than the actual value
in the RH kernel. Maybe not an issue in the
mainline, but it took a few additional system
hangs in the lab before we figured this out
and divided the 'udm_mem' maximum value in half.
At 04:03 PM 7/6/2011 -0700, Andrew Morton wrote:
>
>(switched to email. Please respond via emailed reply-to-all,
>not via the bugzilla web interface).
>
>(cc's added)
>
>On Tue, 21 Jun 2011 00:35:22 GMT
>bugzilla-daemon@bugzilla.kernel.org wrote:
>
>> https://bugzilla.kernel.org/show_bug.cgi?id=38032
>>
>> Summary: default values of
>/proc/sys/net/ipv4/udp_mem does not
>> consider huge page allocatio
>> Product: Memory Management
>> Version: 2.5
>> Platform: All
>> OS/Version: Linux
>> Tree: Mainline
>> Status: NEW
>> Severity: normal
>> Priority: P1
>> Component: Other
>> AssignedTo: akpm@linux-foundation.org
>> ReportedBy: starlight@binnacle.cx
>> Regression: No
>>
>>
>> In the RHEL 5.5 back-port of this tunable we ran into trouble locking up
>> systems because the boot-time default is set based on physical memory does not
>> account for the hugepages= in the boot parameters. So the UDP socket buffer
>> limit can exceed phyisical memory. Don't know if this is an issue in mainline
>> kernels but it seems likely so reporting this as a courtesy. Seems like it
>> would be easy to fix the default to account for the memory reserved by
>> hugepages which is not available for slab allocations.
>>
>> https://bugzilla.redhat.com/show_bug.cgi?id=714833
>>
>
>Yes, we've made similar mistakes in other places.
>
>I don't think we really have an official formula for what callers
>should be doing here. net/ipv4/udp.c:udp_init() does
>
> nr_pages = totalram_pages - totalhigh_pages;
>
>
>which assumes that totalram_pages does not include the pages which were
>lost to hugepage allocations.
>
>I *think* that this is now the case, but it wasn't always the case - we
>made relatively recent fixes to the totalram_pages maintenance.
>
>Perhaps UDP should be using the misnamed nr_free_buffer_pages()
>here.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply
* Re: [PATCHv2] vmxnet3: round down # of queues to power of two
From: Shreyas Bhatewara @ 2011-07-07 1:16 UTC (permalink / raw)
To: pv-drivers@vmware.com, netdev@vger.kernel.org, dtor; +Cc: yongwang
In-Reply-To: <alpine.LRH.2.00.1107061751120.3509@sbhatewara-dev1.eng.vmware.com>
vmxnet3 device supports only power-of-two number of queues. The driver
therefore needs to check this and rounds down the number of queues to the
nearest power of two.
Signed-off-by: Yong Wang <yongwang@vmware.com>
Signed-off-by: Shreyas N Bhatewara <sbhatewara@vmware.com>
Reviewed-by: Dmitry Torokhov <dtor@vmware.com>
--
diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c
index fabcded..009277e 100644
--- a/drivers/net/vmxnet3/vmxnet3_drv.c
+++ b/drivers/net/vmxnet3/vmxnet3_drv.c
@@ -2897,6 +2897,7 @@ vmxnet3_probe_device(struct pci_dev *pdev,
else
#endif
num_rx_queues = 1;
+ num_rx_queues = rounddown_pow_of_two(num_rx_queues);
if (enable_mq)
num_tx_queues = min(VMXNET3_DEVICE_MAX_TX_QUEUES,
@@ -2904,6 +2905,7 @@ vmxnet3_probe_device(struct pci_dev *pdev,
else
num_tx_queues = 1;
+ num_tx_queues = rounddown_pow_of_two(num_tx_queues);
netdev = alloc_etherdev_mq(sizeof(struct vmxnet3_adapter),
max(num_tx_queues, num_rx_queues));
printk(KERN_INFO "# of Tx queues : %d, # of Rx queues : %d\n",
@@ -3088,6 +3090,7 @@ vmxnet3_remove_device(struct pci_dev *pdev)
else
#endif
num_rx_queues = 1;
+ num_rx_queues = rounddown_pow_of_two(num_rx_queues);
cancel_work_sync(&adapter->work);
diff --git a/drivers/net/vmxnet3/vmxnet3_int.h b/drivers/net/vmxnet3/vmxnet3_int.h
index a9cb3fa..b18eac1 100644
--- a/drivers/net/vmxnet3/vmxnet3_int.h
+++ b/drivers/net/vmxnet3/vmxnet3_int.h
@@ -56,6 +56,7 @@
#include <linux/if_vlan.h>
#include <linux/if_arp.h>
#include <linux/inetdevice.h>
+#include <linux/log2.h>
#include "vmxnet3_defs.h"
@@ -69,10 +70,10 @@
/*
* Version numbers
*/
-#define VMXNET3_DRIVER_VERSION_STRING "1.1.14.0-k"
+#define VMXNET3_DRIVER_VERSION_STRING "1.1.18.0-k"
/* a 32-bit int, each byte encode a verion number in VMXNET3_DRIVER_VERSION */
-#define VMXNET3_DRIVER_VERSION_NUM 0x01010E00
+#define VMXNET3_DRIVER_VERSION_NUM 0x01011200
#if defined(CONFIG_PCI_MSI)
/* RSS only makes sense if MSI-X is supported. */
^ permalink raw reply related
* Re: [Pv-drivers] [PATCH] vmxnet3: round down # of queues to power of two
From: Dmitry Torokhov @ 2011-07-07 1:08 UTC (permalink / raw)
To: pv-drivers; +Cc: Shreyas Bhatewara, netdev@vger.kernel.org, yongwang
In-Reply-To: <alpine.LRH.2.00.1107061751120.3509@sbhatewara-dev1.eng.vmware.com>
On Wednesday, July 06, 2011 05:58:51 PM Shreyas Bhatewara wrote:
>
> + if (!is_power_of_2(num_rx_queues))
> + num_rx_queues = rounddown_pow_of_two(num_rx_queues);
> +
No need to do the check, just do:
num_rx_queues = rounddown_pow_of_two(num_rx_queues);
Thanks,
Dmitry
^ permalink raw reply
* [PATCH] vmxnet3: round down # of queues to power of two
From: Shreyas Bhatewara @ 2011-07-07 0:58 UTC (permalink / raw)
To: pv-drivers@vmware.com, netdev@vger.kernel.org; +Cc: yongwang
vmxnet3 device supports only power-of-two number of queues. The driver
therefore needs to check this and rounds down the number of queues to the
nearest power of two.
Signed-off-by: Yong Wang <yongwang@vmware.com>
Signed-off-by: Shreyas N Bhatewara <sbhatewara@vmware.com>
--
diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c
index fabcded..4ee7750 100644
--- a/drivers/net/vmxnet3/vmxnet3_drv.c
+++ b/drivers/net/vmxnet3/vmxnet3_drv.c
@@ -2898,12 +2898,18 @@ vmxnet3_probe_device(struct pci_dev *pdev,
#endif
num_rx_queues = 1;
+ if (!is_power_of_2(num_rx_queues))
+ num_rx_queues = rounddown_pow_of_two(num_rx_queues);
+
if (enable_mq)
num_tx_queues = min(VMXNET3_DEVICE_MAX_TX_QUEUES,
(int)num_online_cpus());
else
num_tx_queues = 1;
+ if (!is_power_of_2(num_tx_queues))
+ num_tx_queues = rounddown_pow_of_two(num_tx_queues);
+
netdev = alloc_etherdev_mq(sizeof(struct vmxnet3_adapter),
max(num_tx_queues, num_rx_queues));
printk(KERN_INFO "# of Tx queues : %d, # of Rx queues : %d\n",
@@ -3089,6 +3095,9 @@ vmxnet3_remove_device(struct pci_dev *pdev)
#endif
num_rx_queues = 1;
+ if (!is_power_of_2(num_rx_queues))
+ num_rx_queues = rounddown_pow_of_two(num_rx_queues);
+
cancel_work_sync(&adapter->work);
unregister_netdev(netdev);
diff --git a/drivers/net/vmxnet3/vmxnet3_int.h b/drivers/net/vmxnet3/vmxnet3_int.h
index a9cb3fa..b18eac1 100644
--- a/drivers/net/vmxnet3/vmxnet3_int.h
+++ b/drivers/net/vmxnet3/vmxnet3_int.h
@@ -56,6 +56,7 @@
#include <linux/if_vlan.h>
#include <linux/if_arp.h>
#include <linux/inetdevice.h>
+#include <linux/log2.h>
#include "vmxnet3_defs.h"
@@ -69,10 +70,10 @@
/*
* Version numbers
*/
-#define VMXNET3_DRIVER_VERSION_STRING "1.1.14.0-k"
+#define VMXNET3_DRIVER_VERSION_STRING "1.1.18.0-k"
/* a 32-bit int, each byte encode a verion number in VMXNET3_DRIVER_VERSION */
-#define VMXNET3_DRIVER_VERSION_NUM 0x01010E00
+#define VMXNET3_DRIVER_VERSION_NUM 0x01011200
#if defined(CONFIG_PCI_MSI)
/* RSS only makes sense if MSI-X is supported. */
^ permalink raw reply related
* Re: [PATCH 00/14] Swap-over-NBD without deadlocking v5
From: Andrew Morton @ 2011-07-06 23:51 UTC (permalink / raw)
To: Mel Gorman
Cc: Linux-MM, Linux-Netdev, LKML, David Miller, Neil Brown,
Peter Zijlstra
In-Reply-To: <1308575540-25219-1-git-send-email-mgorman@suse.de>
On Mon, 20 Jun 2011 14:12:06 +0100
Mel Gorman <mgorman@suse.de> wrote:
> Swapping over NBD is something that is technically possible but not
> often advised. While there are number of guides on the internet
> on how to configure it and nbd-client supports a -swap switch to
> "prevent deadlocks", the fact of the matter is a machine using NBD
> for swap can be locked up within minutes if swap is used intensively.
>
> The problem is that network block devices do not use mempools like
> normal block devices do. As the host cannot control where they receive
> packets from, they cannot reliably work out in advance how much memory
> they might need.
>
> Some years ago, Peter Ziljstra developed a series of patches that
> supported swap over an NFS that some distributions are carrying in
> their kernels. This patch series borrows very heavily from Peter's work
> to support swapping over NBD (the relatively straight-forward case)
> and uses throttling instead of dynamically resized memory reserves
> so the series is not too unwieldy for review.
I have to say, I look over these patches and my mind wants to turn to
things like puppies. And ice cream.
There's quite some complexity added here in areas which are already
reliably unreliable and afaik swap-over-NBD is not a thing which a lot
of people want to do. I can see that swap-over-NFS would be useful to
some people, and the fact that distros are carrying swap-over-NFS
patches has weight.
Do these patches lead on to swap-over-NFS? If so, how much more
additional complexity are we buying into for that?
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply
* Re: [PATCH 01/14] mm: Serialize access to min_free_kbytes
From: Andrew Morton @ 2011-07-06 23:44 UTC (permalink / raw)
To: Mel Gorman
Cc: Linux-MM, Linux-Netdev, LKML, David Miller, Neil Brown,
Peter Zijlstra
In-Reply-To: <1308575540-25219-2-git-send-email-mgorman@suse.de>
On Mon, 20 Jun 2011 14:12:07 +0100
Mel Gorman <mgorman@suse.de> wrote:
> There is a race between the min_free_kbytes sysctl, memory hotplug
> and transparent hugepage support enablement. Memory hotplug uses a
> zonelists_mutex to avoid a race when building zonelists. Reuse it to
> serialise watermark updates.
This patch appears to be a standalone fix, unrelated to the overall
patch series?
How does one trigger the race and what happens when it hits, btw?
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply
* Re: [PATCH V8 2/4 net-next] skbuff: skb supports zero-copy buffers
From: Shirley Ma @ 2011-07-06 23:24 UTC (permalink / raw)
To: Zan Lynx; +Cc: David Miller, mst, netdev, kvm, linux-kernel
In-Reply-To: <4E14E939.5040904@acm.org>
On Wed, 2011-07-06 at 17:01 -0600, Zan Lynx wrote:
> On 7/6/2011 4:22 PM, Shirley Ma wrote:
> > This patch adds userspace buffers support in skb shared info. A new
> > struct skb_ubuf_info is needed to maintain the userspace buffers
> > argument and index, a callback is used to notify userspace to
> release
> > the buffers once lower device has done DMA (Last reference to that
> skb
> > has gone).
> >
> > If there is any userspace apps to reference these userspace buffers,
> > then these userspaces buffers will be copied into kernel. This way
> we
> > can prevent userspace apps from holding these userspace buffers too
> long.
> >
> > Use destructor_arg to point to the userspace buffer info; a new tx
> flags
> > SKBTX_DEV_ZEROCOPY is added for zero-copy buffer check.
> >
> > Signed-off-by: Shirley Ma <xma@...ibm.com>
>
> I was just reading this patch and noticed that you check if
> uarg->callback is set before calling it in skb_release_data, but you
> do
> not check before calling it in skb_copy_ubufs.
>
> I was only skimming so I have probably missed something...
It is a redundant check. The userspace buffer info always has a callback
to release the buffers. I should have removed it after using tx_flags.
Thanks
Shirley
^ 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