* Re: [patch] usbnet: fix 100% CPU use on suspended device
From: Alan Stern @ 2010-07-26 14:36 UTC (permalink / raw)
To: Elly Jones; +Cc: David Miller, netdev, linux-usb
In-Reply-To: <AANLkTik=b3ps_iMOC=mjDs2quLwBPUKbiqn0nKU3EbB1@mail.gmail.com>
On Mon, 26 Jul 2010, Elly Jones wrote:
> On Mon, Jul 26, 2010 at 12:57 AM, David Miller <davem@davemloft.net> wrote:
> > From: Elly Jones <ellyjones@google.com>
> > Date: Wed, 21 Jul 2010 14:51:48 -0400
> >
> >> Subject: [patch] usbnet: fix 100% CPU use on suspended device
> >> From: Elly Jones <ellyjones@google.com>
> >>
> >> This patch causes the usbnet module not to attempt to submit URBs to the device
> >> if the device is not ready to accept them. This fixes a misbehavior trigged by
> >> the Qualcomm Gobi driver (released under GPL through their Code Aurora
> >> initiative) which causes the usbnet core to consume 100% of CPU attempting and
> >> failing to submit URBs. This patch is against Linus's 2.6 repo commit
> >> a9f7f2e74ae0e6a801a2433dc8e9124d73da0cb4.
> >> Signed-off-by: Elizabeth Jones <ellyjones@google.com>
> >
> > If the Qualcomm Gobi driver is the only one where this happens, maybe the
> > real problem is in that driver.
>
> The member in question (dev->udev->can_submit) is documented as 'URBs
> may be submitted'. The existing code doesn't honor that flag. It is
> somewhat puzzling that (so far) only the Gobi driver seems to use that
> flag, but I don't think the bug lies in their driver here.
That flag is not intended for use by drivers but by the USB core. (It
gets cleared only when the device is suspended.) usbnet and Gobi
shouldn't need to look at it.
> > I'm not applying this until a USB person looks more deeply into this.
>
> Alright. Can you suggest a particular USB person to bother?
>
> >> ---
> >> diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
> >> index 81c76ad..df7e72e 100644
> >> --- a/drivers/net/usb/usbnet.c
> >> +++ b/drivers/net/usb/usbnet.c
> >> @@ -1172,6 +1172,7 @@ static void usbnet_bh (unsigned long param)
> >> // or are we maybe short a few urbs?
> >> } else if (netif_running (dev->net) &&
> >> netif_device_present (dev->net) &&
> >> + dev->udev->can_submit &&
> >> !timer_pending (&dev->delay) &&
> >> !test_bit (EVENT_RX_HALT, &dev->flags)) {
> >> int temp = dev->rxq.qlen;
This isn't right. The problem should be fixed some other way. Under
what circumstances are URBs submitted incorrectly?
Alan Stern
^ permalink raw reply
* Re: [Bug #15704] [r8169] WARNING: at net/sched/sch_generic.c
From: Eric Dumazet @ 2010-07-26 14:34 UTC (permalink / raw)
To: Sergey Senozhatsky
Cc: Rafael J. Wysocki, Linux Kernel Mailing List, Kernel Testers List,
Maciej Rutecki, netdev
In-Reply-To: <20100726131629.GA4398@swordfish.minsk.epam.com>
Le lundi 26 juillet 2010 à 16:16 +0300, Sergey Senozhatsky a écrit :
> On (07/23/10 14:15), Rafael J. Wysocki wrote:
> > Bug-Entry : http://bugzilla.kernel.org/show_bug.cgi?id=15704
> > Subject : [r8169] WARNING: at net/sched/sch_generic.c
> > Submitter : Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
> > Date : 2010-03-31 10:21 (115 days old)
> > Message-ID : <20100331102142.GA3294@swordfish.minsk.epam.com>
> > References : http://marc.info/?l=linux-kernel&m=127003090406108&w=2
> >
> >
>
> Hello,
> Sorry for the dealy - I've been away.
> So, the bad news are that this is probably the last time I can test this bug. This laptop will
> no longer be available. Sorry.
>
>
> [ 2599.495508] pktgen 2.73: Packet Generator for packet performance testing.
> [ 2630.016019] ------------[ cut here ]------------
> [ 2630.016031] WARNING: at net/sched/sch_generic.c:258 dev_watchdog+0xc1/0x129()
> [ 2630.016035] Hardware name: F3JC
> [ 2630.016038] NETDEV WATCHDOG: eth0 (r8169): transmit queue 0 timed out
> [ 2630.016041] Modules linked in: pktgen ipv6 arc4 ecb iwl3945 snd_hwdep iwlcore snd_seq_dummy snd_hda_codec_si3054 snd_hda_codec_realtek snd_seq_oss snd_seq_midi_event snd_seq snd_seq_device mac80211 snd_pcm_oss snd_mixer_oss asus_laptop
> snd_hda_intel sparse_keymap sdhci_pci sdhci mmc_core led_class cfg80211 snd_hda_codec snd_pcm snd_timer snd_page_alloc snd rng_core soundcore usb_storage sg psmouse evdev i2c_i801 serio_raw r8169 mii uhci_hcd ehci_hcd sd_mod sr_mod usbcore
> cdrom ata_piix
> [ 2630.016114] Pid: 4282, comm: kpktgend_0 Not tainted 2.6.35-rc6-dbg-git1-00136-g459ab2a-dirty #75
> [ 2630.016118] Call Trace:
> [ 2630.016125] [<c102e3ae>] warn_slowpath_common+0x65/0x7a
> [ 2630.016131] [<c12695f3>] ? dev_watchdog+0xc1/0x129
> [ 2630.016136] [<c102e427>] warn_slowpath_fmt+0x26/0x2a
> [ 2630.016142] [<c12695f3>] dev_watchdog+0xc1/0x129
> [ 2630.016149] [<c10370b3>] ? run_timer_softirq+0x136/0x22b
> [ 2630.016154] [<c103710c>] run_timer_softirq+0x18f/0x22b
> [ 2630.016160] [<c10370b3>] ? run_timer_softirq+0x136/0x22b
> [ 2630.016165] [<c1269532>] ? dev_watchdog+0x0/0x129
> [ 2630.016171] [<c1032c35>] __do_softirq+0x88/0x10c
> [ 2630.016177] [<c1032ce8>] do_softirq+0x2f/0x47
> [ 2630.016182] [<c1032fa5>] irq_exit+0x38/0x75
> [ 2630.016187] [<c10159b8>] smp_apic_timer_interrupt+0x5f/0x6d
> [ 2630.016195] [<f80555e4>] ? pktgen_xmit+0xda2/0xe6f [pktgen]
> [ 2630.016202] [<c12c75a2>] apic_timer_interrupt+0x36/0x3c
> [ 2630.016208] [<f80555e4>] ? pktgen_xmit+0xda2/0xe6f [pktgen]
> [ 2630.016214] [<f80555e4>] ? pktgen_xmit+0xda2/0xe6f [pktgen]
> [ 2630.016220] [<c104007b>] ? __kfifo_peek_n+0x13/0x2b
> [ 2630.016226] [<c1032edd>] ? _local_bh_enable_ip+0x9d/0xb3
> [ 2630.016231] [<c1032efb>] local_bh_enable_ip+0x8/0xa
> [ 2630.016236] [<c12c6aaa>] _raw_spin_unlock_bh+0x2f/0x32
> [ 2630.016242] [<f80555e4>] pktgen_xmit+0xda2/0xe6f [pktgen]
> [ 2630.016253] [<f91707b8>] ? rtl8169_start_xmit+0x0/0x307 [r8169]
> [ 2630.016261] [<c11800d8>] ? plist_add+0x85/0x87
> [ 2630.016267] [<f80558ac>] ? pktgen_thread_worker+0x96/0x5c3 [pktgen]
> [ 2630.016273] [<c1029096>] ? get_parent_ip+0xb/0x31
> [ 2630.016279] [<c1029138>] ? sub_preempt_count+0x7c/0x89
> [ 2630.016285] [<f8055986>] pktgen_thread_worker+0x170/0x5c3 [pktgen]
> [ 2630.016290] [<c12c52bb>] ? schedule+0x535/0x545
> [ 2630.016296] [<c103fd96>] ? autoremove_wake_function+0x0/0x2f
> [ 2630.016301] [<c103fd96>] ? autoremove_wake_function+0x0/0x2f
> [ 2630.016307] [<f8055816>] ? pktgen_thread_worker+0x0/0x5c3 [pktgen]
> [ 2630.016313] [<c103faa6>] kthread+0x6a/0x6f
> [ 2630.016318] [<c103fa3c>] ? kthread+0x0/0x6f
> [ 2630.016324] [<c1002d82>] kernel_thread_helper+0x6/0x10
> [ 2630.016328] ---[ end trace 0bdadff7f249bd0d ]---
> [ 2630.032549] r8169 0000:02:00.0: eth0: link up
>
>
> Sergey
r8169 driver misses a netif_carrier_off() call somewhere, probably when
adapter is reset
Sergey, do you run a pktgen only test (sending packets, and not
receiving packets during the test), or a mixed workload ?
r8169 is known to reset if the RX ring buffer is stressed too much.
^ permalink raw reply
* [PATCH] ethoc: add devinit/devexit section initializers
From: Jonas Bonn @ 2010-07-26 14:01 UTC (permalink / raw)
To: netdev; +Cc: thomas, Jonas Bonn
Signed-off-by: Jonas Bonn <jonas@southpole.se>
---
drivers/net/ethoc.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethoc.c b/drivers/net/ethoc.c
index fc26097..7fc2de5 100644
--- a/drivers/net/ethoc.c
+++ b/drivers/net/ethoc.c
@@ -637,7 +637,7 @@ static void ethoc_mdio_poll(struct net_device *dev)
{
}
-static int ethoc_mdio_probe(struct net_device *dev)
+static int __devinit ethoc_mdio_probe(struct net_device *dev)
{
struct ethoc *priv = netdev_priv(dev);
struct phy_device *phy;
@@ -877,7 +877,7 @@ static const struct net_device_ops ethoc_netdev_ops = {
* ethoc_probe() - initialize OpenCores ethernet MAC
* pdev: platform device
*/
-static int ethoc_probe(struct platform_device *pdev)
+static int __devinit ethoc_probe(struct platform_device *pdev)
{
struct net_device *netdev = NULL;
struct resource *res = NULL;
@@ -1088,7 +1088,7 @@ out:
* ethoc_remove() - shutdown OpenCores ethernet MAC
* @pdev: platform device
*/
-static int ethoc_remove(struct platform_device *pdev)
+static int __devexit ethoc_remove(struct platform_device *pdev)
{
struct net_device *netdev = platform_get_drvdata(pdev);
struct ethoc *priv = netdev_priv(netdev);
@@ -1142,7 +1142,7 @@ MODULE_DEVICE_TABLE(of, ethoc_match);
static struct platform_driver ethoc_driver = {
.probe = ethoc_probe,
- .remove = ethoc_remove,
+ .remove = __devexit_p(ethoc_remove),
.suspend = ethoc_suspend,
.resume = ethoc_resume,
.driver = {
--
1.7.1
^ permalink raw reply related
* Last Ipv6 address removal causes "addrconf_sysctl_unregister", which inihibits from changing disable_ipv6 setting
From: Mahesh Kelkar @ 2010-07-26 14:03 UTC (permalink / raw)
To: Brian Haley; +Cc: netdev, David Miller
Odd behavior associated with the patch:
**Last address removal causes "addrconf_sysctl_unregister", which
inihibits from changing disable_ipv6 setting
(connected issue: With disable_ipv6 set to 1 on an interface, ff00:/8
and fe80::/64 are still added on device UP)
Current sysctl config:
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
Steps:
- Remove last IPv6 address assigned to the "eth0" interface
- inet6_addr_del => addrconf_ifdown(idev->dev, 1) => does the device
sysctl unregister
******Not sure why the addrconf_sysctl_unregister is necessary on last
address removal*******
- Now, "sysctl -a" does not show "net.ipv6.conf.eth0.disable_ipv6"
Problem:
- If you WANT to assign IPv6 address to eth0,
-> Do it once, which fails due to "disable_ipv6" check in
addrconf_add_dev OR ipv6_add_addr
-> But, this process does "addrconf_sysctl_register" (addrconf_add_dev
=> ipv6_find_idev => ipv6_add_dev)
-> set net.ipv6.conf.eth0.disable_ipv6=0 and then successfully assign
ipv6-address to the eth0
(Another alternative is to change all or default to 1; but I wanted to
disable ipv6 by default)
===============
Probable Solution:
===============
@@ -1948,7 +1959,7 @@ static int inet6_addr_del(int ifindex, s
disable IPv6 on this interface.
*/
if (idev->addr_list == NULL)
- addrconf_ifdown(idev->dev, 1);
+ addrconf_ifdown(idev->dev, 0);
return 0;
}
}
I have tested the above solution and it seems to work fine - so far.
^ permalink raw reply
* lock_sock or sock_hold ?
From: Neshama Parhoti @ 2010-07-26 14:00 UTC (permalink / raw)
To: netdev
hello everyone,
can you please be kind and help me understand the differences between
lock_sock and sock_hold ?
i can see that lock_sock takes a spin lock (bh) to mark owned = 1, and
then takes a mutex, whereas sock_hold only increases the atomic
refcnt.
but how do i know which of them I should use ?
i'm puzzled as to when should those two different APIs be used..
thank you a lot
~pnesh
^ permalink raw reply
* [PATCH] sky2: Fix most checkpatch errors
From: Mike McCormack @ 2010-07-26 13:28 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev
Tidy up whitespace and formatting to reduce from
38 errors to 4 and 20 fewer warnings.
Signed-off-by: Mike McCormack <mikem@ring3k.org>
---
drivers/net/sky2.c | 88 ++++++++++++++++++++++++++--------------------------
1 files changed, 44 insertions(+), 44 deletions(-)
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index 8b85c02..51752d8 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -61,7 +61,7 @@
* similar to Tigon3.
*/
-#define RX_LE_SIZE 1024
+#define RX_LE_SIZE 1024
#define RX_LE_BYTES (RX_LE_SIZE*sizeof(struct sky2_rx_le))
#define RX_MAX_PENDING (RX_LE_SIZE/6 - 2)
#define RX_DEF_PENDING RX_MAX_PENDING
@@ -79,7 +79,7 @@
#define SKY2_EEPROM_MAGIC 0x9955aabb
-#define RING_NEXT(x,s) (((x)+1) & ((s)-1))
+#define RING_NEXT(x, s) (((x)+1) & ((s)-1))
static const u32 default_msg =
NETIF_MSG_DRV | NETIF_MSG_PROBE | NETIF_MSG_LINK
@@ -103,7 +103,7 @@ static DEFINE_PCI_DEVICE_TABLE(sky2_id_table) = {
{ PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9E00) }, /* SK-9Exx */
{ PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9E01) }, /* SK-9E21M */
{ PCI_DEVICE(PCI_VENDOR_ID_DLINK, 0x4b00) }, /* DGE-560T */
- { PCI_DEVICE(PCI_VENDOR_ID_DLINK, 0x4001) }, /* DGE-550SX */
+ { PCI_DEVICE(PCI_VENDOR_ID_DLINK, 0x4001) }, /* DGE-550SX */
{ PCI_DEVICE(PCI_VENDOR_ID_DLINK, 0x4B02) }, /* DGE-560SX */
{ PCI_DEVICE(PCI_VENDOR_ID_DLINK, 0x4B03) }, /* DGE-550T */
{ PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4340) }, /* 88E8021 */
@@ -172,7 +172,7 @@ static int gm_phy_write(struct sky2_hw *hw, unsigned port, u16 reg, u16 val)
udelay(10);
}
- dev_warn(&hw->pdev->dev,"%s: phy write timeout\n", hw->dev[port]->name);
+ dev_warn(&hw->pdev->dev, "%s: phy write timeout\n", hw->dev[port]->name);
return -ETIMEDOUT;
io_error:
@@ -276,7 +276,7 @@ static void sky2_power_aux(struct sky2_hw *hw)
Y2_COR_CLK_LNK2_DIS | Y2_CLK_GAT_LNK2_DIS);
/* switch power to VAUX if supported and PME from D3cold */
- if ( (sky2_read32(hw, B0_CTST) & Y2_VAUX_AVAIL) &&
+ if ((sky2_read32(hw, B0_CTST) & Y2_VAUX_AVAIL) &&
pci_pme_capable(hw->pdev, PCI_D3cold))
sky2_write8(hw, B0_POWER_CTRL,
(PC_VAUX_ENA | PC_VCC_ENA |
@@ -333,7 +333,7 @@ static void sky2_phy_init(struct sky2_hw *hw, unsigned port)
struct sky2_port *sky2 = netdev_priv(hw->dev[port]);
u16 ctrl, ct1000, adv, pg, ledctrl, ledover, reg;
- if ( (sky2->flags & SKY2_FLAG_AUTO_SPEED) &&
+ if ((sky2->flags & SKY2_FLAG_AUTO_SPEED) &&
!(hw->flags & SKY2_HW_NEWER_PHY)) {
u16 ectrl = gm_phy_read(hw, port, PHY_MARV_EXT_CTRL);
@@ -375,8 +375,8 @@ static void sky2_phy_init(struct sky2_hw *hw, unsigned port)
ctrl |= PHY_M_PC_MDI_XMODE(PHY_M_PC_ENA_AUTO);
/* downshift on PHY 88E1112 and 88E1149 is changed */
- if ( (sky2->flags & SKY2_FLAG_AUTO_SPEED) &&
- (hw->flags & SKY2_HW_NEWER_PHY)) {
+ if ((sky2->flags & SKY2_FLAG_AUTO_SPEED) &&
+ (hw->flags & SKY2_HW_NEWER_PHY)) {
/* set downshift counter to 3x and enable downshift */
ctrl &= ~PHY_M_PC_DSC_MSK;
ctrl |= PHY_M_PC_DSC(2) | PHY_M_PC_DOWN_S_ENA;
@@ -476,7 +476,7 @@ static void sky2_phy_init(struct sky2_hw *hw, unsigned port)
adv |= fiber_fc_adv[sky2->flow_mode];
} else {
reg |= GM_GPCR_AU_FCT_DIS;
- reg |= gm_fc_disable[sky2->flow_mode];
+ reg |= gm_fc_disable[sky2->flow_mode];
/* Forward pause packets to GMAC? */
if (sky2->flow_mode & FC_RX)
@@ -817,8 +817,8 @@ static void sky2_set_tx_stfwd(struct sky2_hw *hw, unsigned port)
{
struct net_device *dev = hw->dev[port];
- if ( (hw->chip_id == CHIP_ID_YUKON_EX &&
- hw->chip_rev != CHIP_REV_YU_EX_A0) ||
+ if ((hw->chip_id == CHIP_ID_YUKON_EX &&
+ hw->chip_rev != CHIP_REV_YU_EX_A0) ||
hw->chip_id >= CHIP_ID_YUKON_FE_P) {
/* Yukon-Extreme B0 and further Extreme devices */
sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T), TX_STFW_ENA);
@@ -1078,7 +1078,7 @@ static inline struct sky2_rx_le *sky2_next_rx(struct sky2_port *sky2)
return le;
}
-static unsigned sky2_get_rx_threshold(struct sky2_port* sky2)
+static unsigned sky2_get_rx_threshold(struct sky2_port *sky2)
{
unsigned size;
@@ -1089,7 +1089,7 @@ static unsigned sky2_get_rx_threshold(struct sky2_port* sky2)
return (size - 8) / sizeof(u32);
}
-static unsigned sky2_get_rx_data_size(struct sky2_port* sky2)
+static unsigned sky2_get_rx_data_size(struct sky2_port *sky2)
{
struct rx_ring_info *re;
unsigned size;
@@ -1113,7 +1113,7 @@ static unsigned sky2_get_rx_data_size(struct sky2_port* sky2)
}
/* Build description to hardware for one receive segment */
-static void sky2_rx_add(struct sky2_port *sky2, u8 op,
+static void sky2_rx_add(struct sky2_port *sky2, u8 op,
dma_addr_t map, unsigned len)
{
struct sky2_rx_le *le;
@@ -1599,16 +1599,16 @@ static void sky2_hw_up(struct sky2_port *sky2)
tx_init(sky2);
/*
- * On dual port PCI-X card, there is an problem where status
+ * On dual port PCI-X card, there is an problem where status
* can be received out of order due to split transactions
*/
if (otherdev && netif_running(otherdev) &&
- (cap = pci_find_capability(hw->pdev, PCI_CAP_ID_PCIX))) {
- u16 cmd;
+ (cap = pci_find_capability(hw->pdev, PCI_CAP_ID_PCIX))) {
+ u16 cmd;
cmd = sky2_pci_read16(hw, cap + PCI_X_CMD);
- cmd &= ~PCI_X_CMD_MAX_SPLIT;
- sky2_pci_write16(hw, cap + PCI_X_CMD, cmd);
+ cmd &= ~PCI_X_CMD_MAX_SPLIT;
+ sky2_pci_write16(hw, cap + PCI_X_CMD, cmd);
}
sky2_mac_init(hw, port);
@@ -1749,8 +1749,8 @@ static netdev_tx_t sky2_xmit_frame(struct sk_buff *skb,
u16 mss;
u8 ctrl;
- if (unlikely(tx_avail(sky2) < tx_le_req(skb)))
- return NETDEV_TX_BUSY;
+ if (unlikely(tx_avail(sky2) < tx_le_req(skb)))
+ return NETDEV_TX_BUSY;
len = skb_headlen(skb);
mapping = pci_map_single(hw->pdev, skb->data, len, PCI_DMA_TODEVICE);
@@ -1778,9 +1778,9 @@ static netdev_tx_t sky2_xmit_frame(struct sk_buff *skb,
if (!(hw->flags & SKY2_HW_NEW_LE))
mss += ETH_HLEN + ip_hdrlen(skb) + tcp_hdrlen(skb);
- if (mss != sky2->tx_last_mss) {
+ if (mss != sky2->tx_last_mss) {
le = get_tx_le(sky2, &slot);
- le->addr = cpu_to_le32(mss);
+ le->addr = cpu_to_le32(mss);
if (hw->flags & SKY2_HW_NEW_LE)
le->opcode = OP_MSS | HW_OWNER;
@@ -1808,8 +1808,8 @@ static netdev_tx_t sky2_xmit_frame(struct sk_buff *skb,
/* Handle TCP checksum offload */
if (skb->ip_summed == CHECKSUM_PARTIAL) {
/* On Yukon EX (some versions) encoding change. */
- if (hw->flags & SKY2_HW_AUTO_TX_SUM)
- ctrl |= CALSUM; /* auto checksum */
+ if (hw->flags & SKY2_HW_AUTO_TX_SUM)
+ ctrl |= CALSUM; /* auto checksum */
else {
const unsigned offset = skb_transport_offset(skb);
u32 tcpsum;
@@ -2430,7 +2430,7 @@ nobuf:
static struct sk_buff *sky2_receive(struct net_device *dev,
u16 length, u32 status)
{
- struct sky2_port *sky2 = netdev_priv(dev);
+ struct sky2_port *sky2 = netdev_priv(dev);
struct rx_ring_info *re = sky2->rx_ring + sky2->rx_next;
struct sk_buff *skb = NULL;
u16 count = (status & GMR_FS_LEN) >> 16;
@@ -2751,7 +2751,7 @@ static void sky2_hw_intr(struct sky2_hw *hw)
pci_err = sky2_pci_read16(hw, PCI_STATUS);
if (net_ratelimit())
dev_err(&pdev->dev, "PCI hardware error (0x%x)\n",
- pci_err);
+ pci_err);
sky2_pci_write16(hw, PCI_STATUS,
pci_err | PCI_STATUS_ERROR_BITS);
@@ -3019,7 +3019,7 @@ static int __devinit sky2_init(struct sky2_hw *hw)
hw->chip_id = sky2_read8(hw, B2_CHIP_ID);
hw->chip_rev = (sky2_read8(hw, B2_MAC_CFG) & CFG_CHIP_R_MSK) >> 4;
- switch(hw->chip_id) {
+ switch (hw->chip_id) {
case CHIP_ID_YUKON_XL:
hw->flags = SKY2_HW_GIGABIT | SKY2_HW_NEWER_PHY;
if (hw->chip_rev < CHIP_REV_YU_XL_A2)
@@ -3543,13 +3543,13 @@ static const struct sky2_stat {
{ "tx_mac_pause", GM_TXF_MPAUSE },
{ "rx_mac_pause", GM_RXF_MPAUSE },
{ "collisions", GM_TXF_COL },
- { "late_collision",GM_TXF_LAT_COL },
- { "aborted", GM_TXF_ABO_COL },
+ { "late_collision", GM_TXF_LAT_COL },
+ { "aborted", GM_TXF_ABO_COL },
{ "single_collisions", GM_TXF_SNG_COL },
{ "multi_collisions", GM_TXF_MUL_COL },
{ "rx_short", GM_RXF_SHT },
- { "rx_runt", GM_RXE_FRAG },
+ { "rx_runt", GM_RXE_FRAG },
{ "rx_64_byte_packets", GM_RXF_64B },
{ "rx_65_to_127_byte_packets", GM_RXF_127B },
{ "rx_128_to_255_byte_packets", GM_RXF_255B },
@@ -3690,7 +3690,7 @@ static int sky2_set_mac_address(struct net_device *dev, void *p)
return 0;
}
-static void inline sky2_add_filter(u8 filter[8], const u8 *addr)
+static inline void sky2_add_filter(u8 filter[8], const u8 *addr)
{
u32 bit;
@@ -3916,7 +3916,7 @@ static int sky2_set_coalesce(struct net_device *dev,
return -EINVAL;
if (ecmd->rx_max_coalesced_frames > RX_MAX_PENDING)
return -EINVAL;
- if (ecmd->rx_max_coalesced_frames_irq >RX_MAX_PENDING)
+ if (ecmd->rx_max_coalesced_frames_irq > RX_MAX_PENDING)
return -EINVAL;
if (ecmd->tx_coalesce_usecs == 0)
@@ -4095,14 +4095,14 @@ static int sky2_get_eeprom_len(struct net_device *dev)
u16 reg2;
reg2 = sky2_pci_read16(hw, PCI_DEV_REG2);
- return 1 << ( ((reg2 & PCI_VPD_ROM_SZ) >> 14) + 8);
+ return 1 << (((reg2 & PCI_VPD_ROM_SZ) >> 14) + 8);
}
static int sky2_vpd_wait(const struct sky2_hw *hw, int cap, u16 busy)
{
unsigned long start = jiffies;
- while ( (sky2_pci_read16(hw, cap + PCI_VPD_ADDR) & PCI_VPD_ADDR_F) == busy) {
+ while ((sky2_pci_read16(hw, cap + PCI_VPD_ADDR) & PCI_VPD_ADDR_F) == busy) {
/* Can take up to 10.6 ms for write */
if (time_after(jiffies, start + HZ/4)) {
dev_err(&hw->pdev->dev, "VPD cycle timed out\n");
@@ -4225,7 +4225,7 @@ static const struct ethtool_ops sky2_ethtool_ops = {
.get_eeprom_len = sky2_get_eeprom_len,
.get_eeprom = sky2_get_eeprom,
.set_eeprom = sky2_set_eeprom,
- .set_sg = ethtool_op_set_sg,
+ .set_sg = ethtool_op_set_sg,
.set_tx_csum = sky2_set_tx_csum,
.set_tso = sky2_set_tso,
.get_rx_csum = sky2_get_rx_csum,
@@ -4278,7 +4278,7 @@ static void sky2_show_vpd(struct seq_file *seq, struct sky2_hw *hw)
u16 reg2;
reg2 = sky2_pci_read16(hw, PCI_DEV_REG2);
- vpd_size = 1 << ( ((reg2 & PCI_VPD_ROM_SZ) >> 14) + 8);
+ vpd_size = 1 << (((reg2 & PCI_VPD_ROM_SZ) >> 14) + 8);
seq_printf(seq, "%s Product Data\n", pci_name(hw->pdev));
buf = kmalloc(vpd_size, GFP_KERNEL);
@@ -4381,7 +4381,7 @@ static int sky2_debug_show(struct seq_file *seq, void *v)
seq_printf(seq, "%u:", idx);
sop = 0;
- switch(le->opcode & ~HW_OWNER) {
+ switch (le->opcode & ~HW_OWNER) {
case OP_ADDR64:
seq_printf(seq, " %#x:", a);
break;
@@ -4450,7 +4450,7 @@ static int sky2_device_event(struct notifier_block *unused,
if (dev->netdev_ops->ndo_open != sky2_up || !sky2_debug)
return NOTIFY_DONE;
- switch(event) {
+ switch (event) {
case NETDEV_CHANGENAME:
if (sky2->debugfs) {
sky2->debugfs = debugfs_rename(sky2_debug, sky2->debugfs,
@@ -4645,7 +4645,7 @@ static int __devinit sky2_test_msi(struct sky2_hw *hw)
struct pci_dev *pdev = hw->pdev;
int err;
- init_waitqueue_head (&hw->msi_wait);
+ init_waitqueue_head(&hw->msi_wait);
sky2_write32(hw, B0_IMSK, Y2_IS_IRQ_SW);
@@ -4682,7 +4682,7 @@ static const char *sky2_name(u8 chipid, char *buf, int sz)
{
const char *name[] = {
"XL", /* 0xb3 */
- "EC Ultra", /* 0xb4 */
+ "EC Ultra", /* 0xb4 */
"Extreme", /* 0xb5 */
"EC", /* 0xb6 */
"FE", /* 0xb7 */
@@ -4762,7 +4762,7 @@ static int __devinit sky2_probe(struct pci_dev *pdev,
* this driver uses software swapping.
*/
reg &= ~PCI_REV_DESC;
- err = pci_write_config_dword(pdev,PCI_DEV_REG2, reg);
+ err = pci_write_config_dword(pdev, PCI_DEV_REG2, reg);
if (err) {
dev_err(&pdev->dev, "PCI write config failed\n");
goto err_out_free_regions;
@@ -4814,10 +4814,10 @@ static int __devinit sky2_probe(struct pci_dev *pdev,
if (!disable_msi && pci_enable_msi(pdev) == 0) {
err = sky2_test_msi(hw);
if (err == -EOPNOTSUPP)
- pci_disable_msi(pdev);
+ pci_disable_msi(pdev);
else if (err)
goto err_out_free_netdev;
- }
+ }
err = register_netdev(dev);
if (err) {
--
1.5.6.5
^ permalink raw reply related
* Re: [patch] usbnet: fix 100% CPU use on suspended device
From: Elly Jones @ 2010-07-26 13:26 UTC (permalink / raw)
To: David Miller
Cc: netdev-u79uwXL29TY76Z2rM5mHXA, linux-usb-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20100725.215739.183063953.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
On Mon, Jul 26, 2010 at 12:57 AM, David Miller <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org> wrote:
> From: Elly Jones <ellyjones-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
> Date: Wed, 21 Jul 2010 14:51:48 -0400
>
>> Subject: [patch] usbnet: fix 100% CPU use on suspended device
>> From: Elly Jones <ellyjones-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
>>
>> This patch causes the usbnet module not to attempt to submit URBs to the device
>> if the device is not ready to accept them. This fixes a misbehavior trigged by
>> the Qualcomm Gobi driver (released under GPL through their Code Aurora
>> initiative) which causes the usbnet core to consume 100% of CPU attempting and
>> failing to submit URBs. This patch is against Linus's 2.6 repo commit
>> a9f7f2e74ae0e6a801a2433dc8e9124d73da0cb4.
>> Signed-off-by: Elizabeth Jones <ellyjones-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
>
> If the Qualcomm Gobi driver is the only one where this happens, maybe the
> real problem is in that driver.
The member in question (dev->udev->can_submit) is documented as 'URBs
may be submitted'. The existing code doesn't honor that flag. It is
somewhat puzzling that (so far) only the Gobi driver seems to use that
flag, but I don't think the bug lies in their driver here.
> I'm not applying this until a USB person looks more deeply into this.
Alright. Can you suggest a particular USB person to bother?
>> ---
>> diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
>> index 81c76ad..df7e72e 100644
>> --- a/drivers/net/usb/usbnet.c
>> +++ b/drivers/net/usb/usbnet.c
>> @@ -1172,6 +1172,7 @@ static void usbnet_bh (unsigned long param)
>> // or are we maybe short a few urbs?
>> } else if (netif_running (dev->net) &&
>> netif_device_present (dev->net) &&
>> + dev->udev->can_submit &&
>> !timer_pending (&dev->delay) &&
>> !test_bit (EVENT_RX_HALT, &dev->flags)) {
>> int temp = dev->rxq.qlen;
>> --
>
-- Elly
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" 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
* Re: [PATCH 2.6.35-rc1] net-next: Fix an overflow bug in vmxnet3 Tx descriptor
From: Bhavesh Davda @ 2010-07-26 12:10 UTC (permalink / raw)
To: David Miller; +Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
In-Reply-To: <20100725.170611.71132252.davem@davemloft.net>
Sorry about that. I'll keep that in mind for future patches. Thanks for fixing up and commiting this patch.
Regards
- Bhavesh
(From my iPhone)
On Jul 25, 2010, at 5:05 PM, "David Miller" <davem@davemloft.net> wrote:
> From: Bhavesh Davda <bhavesh@vmware.com>
> Date: Sat, 24 Jul 2010 17:43:29 -0700
>
>> ---
>
> If you put the "---" there are the beginning of your message,
> the whole commit message is discarded by GIT.
>
> I said you should put "---" at the end of the commit message,
> when you want to add more side commentary that should not appear
> in the commit message but is for people in this thread to read.
>
> I fixed this up when adding your patch, but I have no idea why
> you did this. Please don't do it again.
>
>> Fix an overflow bug in vmxnet3 Tx descriptor
>>
>> This patch fixes a bug where a 16K buffer on a Tx descriptor was overflowing
>> into the 'gen' bit in the descriptor thereby corrupting the descriptor and
>> stalling the transmit ring.
>>
>> Signed-off-by: Bhavesh Davda <bhavesh@vmware.com>
>> Signed-off-by: Shreyas Bhatewara <sbhatewara@vmware.com>
>> Signed-off-by: Matthew Delco <delcoM@vmware.com>
>> Signed-off-by: Ronghua Zhang <ronghua@vmware.com>
>
> Applied, thanks.
^ permalink raw reply
* [PATCH V4] Export SMBIOS provided firmware instance and label to sysfs
From: Narendra K @ 2010-07-26 10:56 UTC (permalink / raw)
To: netdev, linux-hotplug, linux-pci
Cc: matt_domsch, charles_rose, jordan_hargrave, vijay_nijhawan
Hello,
V3 -> V4:
Updated the contact field in Documentation/ABI directory.
Please consider for inclusion -
From: Narendra K <narendra_k@dell.com>
Subject: [PATCH] Export SMBIOS provided firmware instance and label to sysfs
This patch exports SMBIOS provided firmware instance and label
of onboard pci devices to sysfs
Signed-off-by: Jordan Hargrave <jordan_hargrave@dell.com>
Signed-off-by: Narendra K <narendra_k@dell.com>
---
Documentation/ABI/testing/sysfs-bus-pci | 27 ++++++
drivers/firmware/dmi_scan.c | 25 ++++++
drivers/pci/Makefile | 3 +
drivers/pci/pci-label.c | 143 +++++++++++++++++++++++++++++++
drivers/pci/pci-sysfs.c | 5 +
drivers/pci/pci.h | 9 ++
include/linux/dmi.h | 9 ++
7 files changed, 221 insertions(+), 0 deletions(-)
create mode 100644 drivers/pci/pci-label.c
diff --git a/Documentation/ABI/testing/sysfs-bus-pci b/Documentation/ABI/testing/sysfs-bus-pci
index 428676c..11855ca 100644
--- a/Documentation/ABI/testing/sysfs-bus-pci
+++ b/Documentation/ABI/testing/sysfs-bus-pci
@@ -179,3 +179,30 @@ Contact: linux-pci@vger.kernel.org
Description:
This symbolic link points to the PCI hotplug controller driver
module that manages the hotplug slot.
+
+What: /sys/bus/pci/devices/.../label
+Date: July 2010
+Contact: Narendra K <narendra_k@dell.com>, linux-bugs@dell.com
+Description:
+ Reading this attribute will provide the firmware
+ given name(SMBIOS type 41 string) of the PCI device.
+ The attribute will be created only if the firmware
+ has given a name to the PCI device.
+Users:
+ Userspace applications interested in knowing the
+ firmware assigned name of the PCI device.
+
+What: /sys/bus/pci/devices/.../index
+Date: July 2010
+Contact: Narendra K <narendra_k@dell.com>, linux-bugs@dell.com
+Description:
+ Reading this attribute will provide the firmware
+ given instance(SMBIOS type 41 device type instance)
+ of the PCI device. The attribute will be created
+ only if the firmware has given a device type instance
+ to the PCI device.
+Users:
+ Userspace applications interested in knowing the
+ firmware assigned device type instance of the PCI
+ device that can help in understanding the firmware
+ intended order of the PCI device.
diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c
index d464672..b3d22d6 100644
--- a/drivers/firmware/dmi_scan.c
+++ b/drivers/firmware/dmi_scan.c
@@ -277,6 +277,29 @@ static void __init dmi_save_ipmi_device(const struct dmi_header *dm)
list_add_tail(&dev->list, &dmi_devices);
}
+static void __init dmi_save_dev_onboard(int instance, int segment, int bus,
+ int devfn, const char *name)
+{
+ struct dmi_dev_onboard *onboard_dev;
+
+ onboard_dev = dmi_alloc(sizeof(*onboard_dev) + strlen(name) + 1);
+ if (!onboard_dev) {
+ printk(KERN_ERR "dmi_save_dev_onboard: out of memory.\n");
+ return;
+ }
+ onboard_dev->instance = instance;
+ onboard_dev->segment = segment;
+ onboard_dev->bus = bus;
+ onboard_dev->devfn = devfn;
+
+ strcpy((char *)&onboard_dev[1], name);
+ onboard_dev->dev.type = DMI_DEV_TYPE_DEV_ONBOARD;
+ onboard_dev->dev.name = (char *)&onboard_dev[1];
+ onboard_dev->dev.device_data = onboard_dev;
+
+ list_add(&onboard_dev->dev.list, &dmi_devices);
+}
+
static void __init dmi_save_extended_devices(const struct dmi_header *dm)
{
const u8 *d = (u8*) dm + 5;
@@ -285,6 +308,8 @@ static void __init dmi_save_extended_devices(const struct dmi_header *dm)
if ((*d & 0x80) == 0)
return;
+ dmi_save_dev_onboard(*(d+1), *(u16 *)(d+2), *(d+4), *(d+5),
+ dmi_string_nosave(dm, *(d-1)));
dmi_save_one_device(*d & 0x7f, dmi_string_nosave(dm, *(d - 1)));
}
diff --git a/drivers/pci/Makefile b/drivers/pci/Makefile
index 0b51857..dc1aa09 100644
--- a/drivers/pci/Makefile
+++ b/drivers/pci/Makefile
@@ -55,6 +55,9 @@ obj-$(CONFIG_MICROBLAZE) += setup-bus.o
#
obj-$(CONFIG_ACPI) += pci-acpi.o
+# SMBIOS provided firmware instance and labels
+obj-$(CONFIG_DMI) += pci-label.o
+
# Cardbus & CompactPCI use setup-bus
obj-$(CONFIG_HOTPLUG) += setup-bus.o
diff --git a/drivers/pci/pci-label.c b/drivers/pci/pci-label.c
new file mode 100644
index 0000000..111500e
--- /dev/null
+++ b/drivers/pci/pci-label.c
@@ -0,0 +1,143 @@
+/*
+ * Purpose: Export the firmware instance and label associated with
+ * a pci device to sysfs
+ * Copyright (C) 2010 Dell Inc.
+ * by Narendra K <Narendra_K@dell.com>,
+ * Jordan Hargrave <Jordan_Hargrave@dell.com>
+ *
+ * SMBIOS defines type 41 for onboard pci devices. This code retrieves
+ * the instance number and string from the type 41 record and exports
+ * it to sysfs.
+ *
+ * Please see http://linux.dell.com/wiki/index.php/Oss/libnetdevname for more
+ * information.
+ */
+
+#include <linux/dmi.h>
+#include <linux/sysfs.h>
+#include <linux/pci.h>
+#include <linux/pci_ids.h>
+#include <linux/module.h>
+#include <linux/device.h>
+#include "pci.h"
+
+enum smbios_attr_enum {
+ SMBIOS_ATTR_NONE = 0,
+ SMBIOS_ATTR_LABEL_SHOW,
+ SMBIOS_ATTR_INSTANCE_SHOW,
+};
+
+static mode_t
+find_smbios_instance_string(struct pci_dev *pdev, char *buf,
+ enum smbios_attr_enum attribute)
+{
+ const struct dmi_device *dmi;
+ struct dmi_dev_onboard *donboard;
+ int bus;
+ int devfn;
+
+ bus = pdev->bus->number;
+ devfn = pdev->devfn;
+
+ dmi = NULL;
+ while ((dmi = dmi_find_device(DMI_DEV_TYPE_DEV_ONBOARD,
+ NULL, dmi)) != NULL) {
+ donboard = dmi->device_data;
+ if (donboard && donboard->bus == bus &&
+ donboard->devfn == devfn) {
+ if (buf) {
+ if (attribute == SMBIOS_ATTR_INSTANCE_SHOW)
+ return scnprintf(buf, PAGE_SIZE,
+ "%d\n",
+ donboard->instance);
+ else if (attribute == SMBIOS_ATTR_LABEL_SHOW)
+ return scnprintf(buf, PAGE_SIZE,
+ "%s\n",
+ dmi->name);
+ }
+ return strlen(dmi->name);
+ }
+ }
+ return 0;
+}
+
+static mode_t
+smbios_instance_string_exist(struct kobject *kobj, struct attribute *attr,
+ int n)
+{
+ struct device *dev;
+ struct pci_dev *pdev;
+
+ dev = container_of(kobj, struct device, kobj);
+ pdev = to_pci_dev(dev);
+
+ return find_smbios_instance_string(pdev, NULL, SMBIOS_ATTR_NONE) ?
+ S_IRUGO : 0;
+}
+
+static ssize_t
+smbioslabel_show(struct device *dev, struct device_attribute *attr, char *buf)
+{
+ struct pci_dev *pdev;
+ pdev = to_pci_dev(dev);
+
+ return find_smbios_instance_string(pdev, buf,
+ SMBIOS_ATTR_LABEL_SHOW);
+}
+
+static ssize_t
+smbiosinstance_show(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ struct pci_dev *pdev;
+ pdev = to_pci_dev(dev);
+
+ return find_smbios_instance_string(pdev, buf,
+ SMBIOS_ATTR_INSTANCE_SHOW);
+}
+
+static struct device_attribute smbios_attr_label = {
+ .attr = {.name = "label", .mode = 0444, .owner = THIS_MODULE},
+ .show = smbioslabel_show,
+};
+
+static struct device_attribute smbios_attr_instance = {
+ .attr = {.name = "index", .mode = 0444, .owner = THIS_MODULE},
+ .show = smbiosinstance_show,
+};
+
+static struct attribute *smbios_attributes[] = {
+ &smbios_attr_label.attr,
+ &smbios_attr_instance.attr,
+ NULL,
+};
+
+static struct attribute_group smbios_attr_group = {
+ .attrs = smbios_attributes,
+ .is_visible = smbios_instance_string_exist,
+};
+
+static int
+pci_create_smbiosname_file(struct pci_dev *pdev)
+{
+ if (!sysfs_create_group(&pdev->dev.kobj, &smbios_attr_group))
+ return 0;
+ return -ENODEV;
+}
+
+static void
+pci_remove_smbiosname_file(struct pci_dev *pdev)
+{
+ sysfs_remove_group(&pdev->dev.kobj, &smbios_attr_group);
+}
+
+void pci_create_firmware_label_files(struct pci_dev *pdev)
+{
+ if (!pci_create_smbiosname_file(pdev))
+ ;
+}
+
+void pci_remove_firmware_label_files(struct pci_dev *pdev)
+{
+ pci_remove_smbiosname_file(pdev);
+}
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
index afd2fbf..01fd799 100644
--- a/drivers/pci/pci-sysfs.c
+++ b/drivers/pci/pci-sysfs.c
@@ -1132,6 +1132,8 @@ int __must_check pci_create_sysfs_dev_files (struct pci_dev *pdev)
pci_create_slot_links(pdev);
+ pci_create_firmware_label_files(pdev);
+
return 0;
err_vga_file:
@@ -1201,6 +1203,9 @@ void pci_remove_sysfs_dev_files(struct pci_dev *pdev)
sysfs_remove_bin_file(&pdev->dev.kobj, pdev->rom_attr);
kfree(pdev->rom_attr);
}
+
+ pci_remove_firmware_label_files(pdev);
+
}
static int __init pci_sysfs_init(void)
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index f8077b3..d930338 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -11,6 +11,15 @@
extern int pci_uevent(struct device *dev, struct kobj_uevent_env *env);
extern int pci_create_sysfs_dev_files(struct pci_dev *pdev);
extern void pci_remove_sysfs_dev_files(struct pci_dev *pdev);
+#ifndef CONFIG_DMI
+static inline void pci_create_firmware_label_files(struct pci_dev *pdev)
+{ return 0; }
+static inline void pci_remove_firmware_label_files(struct pci_dev *pdev)
+{ return 0; }
+#else
+extern void pci_create_firmware_label_files(struct pci_dev *pdev);
+extern void pci_remove_firmware_label_files(struct pci_dev *pdev);
+#endif
extern void pci_cleanup_rom(struct pci_dev *dev);
#ifdef HAVE_PCI_MMAP
extern int pci_mmap_fits(struct pci_dev *pdev, int resno,
diff --git a/include/linux/dmi.h b/include/linux/dmi.h
index a8a3e1a..90e087f 100644
--- a/include/linux/dmi.h
+++ b/include/linux/dmi.h
@@ -20,6 +20,7 @@ enum dmi_device_type {
DMI_DEV_TYPE_SAS,
DMI_DEV_TYPE_IPMI = -1,
DMI_DEV_TYPE_OEM_STRING = -2,
+ DMI_DEV_TYPE_DEV_ONBOARD = -3,
};
struct dmi_header {
@@ -37,6 +38,14 @@ struct dmi_device {
#ifdef CONFIG_DMI
+struct dmi_dev_onboard {
+ struct dmi_device dev;
+ int instance;
+ int segment;
+ int bus;
+ int devfn;
+};
+
extern int dmi_check_system(const struct dmi_system_id *list);
const struct dmi_system_id *dmi_first_match(const struct dmi_system_id *list);
extern const char * dmi_get_system_info(int field);
--
1.6.5.2
With regards,
Narendra K
^ permalink raw reply related
* Re: [PATCH] drop_monitor: use genl_register_family_with_ops()
From: Neil Horman @ 2010-07-26 10:44 UTC (permalink / raw)
To: Changli Gao; +Cc: David S. Miller, netdev, linux-kernel
In-Reply-To: <1280136017-17526-1-git-send-email-xiaosuo@gmail.com>
On Mon, Jul 26, 2010 at 05:20:17PM +0800, Changli Gao wrote:
> Signed-off-by: Changli Gao <xiaosuo@gmail.com>
> ----
> net/core/drop_monitor.c | 19 +++++--------------
> 1 file changed, 5 insertions(+), 14 deletions(-)
> diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c
> index 646ef3b..bdb0e96 100644
> --- a/net/core/drop_monitor.c
> +++ b/net/core/drop_monitor.c
> @@ -357,21 +357,12 @@ static int __init init_net_drop_monitor(void)
> return -ENOSPC;
> }
>
> - if (genl_register_family(&net_drop_monitor_family) < 0) {
> + rc = genl_register_family_with_ops(&net_drop_monitor_family,
> + dropmon_ops,
> + ARRAY_SIZE(dropmon_ops));
> + if (rc) {
> printk(KERN_ERR "Could not create drop monitor netlink family\n");
> - return -EFAULT;
> - }
> -
> - rc = -EFAULT;
> -
> - for (i = 0; i < ARRAY_SIZE(dropmon_ops); i++) {
> - ret = genl_register_ops(&net_drop_monitor_family,
> - &dropmon_ops[i]);
> - if (ret) {
> - printk(KERN_CRIT "Failed to register operation %d\n",
> - dropmon_ops[i].cmd);
> - goto out_unreg;
> - }
> + return rc;
> }
>
> rc = register_netdevice_notifier(&dropmon_net_notifier);
>
Looks good to me, thanks!
Acked-by: Neil Horman <nhorman@tuxdriver.com>
^ permalink raw reply
* Re: Another oops + repost
From: Eric W. Biederman @ 2010-07-26 9:45 UTC (permalink / raw)
To: Martín Ferrari; +Cc: netdev, 577640
In-Reply-To: <AANLkTimC8q6_ZU60VX5SmXGqsD+RCpf4RaF3MLQptsG4@mail.gmail.com>
Martín Ferrari <martin.ferrari@gmail.com> writes:
> Hi,
>
> On Thu, Jul 22, 2010 at 18:43, Eric W. Biederman <ebiederm@xmission.com> wrote:
>
>>> First of all, I would like to know if anybody was able to fix this
>>> problem that got kinda lost in the thread:
>>
>> I can't reproduce this on 2.6.35-rc1+
>>
>> Can you please test a 2.6.35-rc version? If you can still reproduce
>> it there can you send me your .config? Otherwise I expect my last
>> round of changes to sysfs fixed whatever was the underlying problem.
>
> I just download and compiled rc6, and all of these problems seem to be
> solved. Thanks a lot!
Welcome. I'm glad to hear there wasn't some weird corner case
that I had missed.
Eric
^ permalink raw reply
* [PATCH] genetlink: use genl_register_family_with_ops()
From: Changli Gao @ 2010-07-26 9:21 UTC (permalink / raw)
To: David S. Miller; +Cc: linux-kernel, netdev, Changli Gao
Signed-off-by: Changli Gao <xiaosuo@gmail.com>
----
net/netlink/genetlink.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c
index aa4308a..2a2bcc8 100644
--- a/net/netlink/genetlink.c
+++ b/net/netlink/genetlink.c
@@ -873,11 +873,7 @@ static int __init genl_init(void)
for (i = 0; i < GENL_FAM_TAB_SIZE; i++)
INIT_LIST_HEAD(&family_ht[i]);
- err = genl_register_family(&genl_ctrl);
- if (err < 0)
- goto problem;
-
- err = genl_register_ops(&genl_ctrl, &genl_ctrl_ops);
+ err = genl_register_family_with_ops(&genl_ctrl, &genl_ctrl_ops, 1);
if (err < 0)
goto problem;
^ permalink raw reply related
* [PATCH] drop_monitor: use genl_register_family_with_ops()
From: Changli Gao @ 2010-07-26 9:20 UTC (permalink / raw)
To: Neil Horman; +Cc: David S. Miller, netdev, linux-kernel, Changli Gao
Signed-off-by: Changli Gao <xiaosuo@gmail.com>
----
net/core/drop_monitor.c | 19 +++++--------------
1 file changed, 5 insertions(+), 14 deletions(-)
diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c
index 646ef3b..bdb0e96 100644
--- a/net/core/drop_monitor.c
+++ b/net/core/drop_monitor.c
@@ -357,21 +357,12 @@ static int __init init_net_drop_monitor(void)
return -ENOSPC;
}
- if (genl_register_family(&net_drop_monitor_family) < 0) {
+ rc = genl_register_family_with_ops(&net_drop_monitor_family,
+ dropmon_ops,
+ ARRAY_SIZE(dropmon_ops));
+ if (rc) {
printk(KERN_ERR "Could not create drop monitor netlink family\n");
- return -EFAULT;
- }
-
- rc = -EFAULT;
-
- for (i = 0; i < ARRAY_SIZE(dropmon_ops); i++) {
- ret = genl_register_ops(&net_drop_monitor_family,
- &dropmon_ops[i]);
- if (ret) {
- printk(KERN_CRIT "Failed to register operation %d\n",
- dropmon_ops[i].cmd);
- goto out_unreg;
- }
+ return rc;
}
rc = register_netdevice_notifier(&dropmon_net_notifier);
^ permalink raw reply related
* [PATCH v2] ks8842: Support 100Mbps when accessed via timberdale
From: Richard Röjfors @ 2010-07-26 8:51 UTC (permalink / raw)
To: netdev; +Cc: davem
This patch removes the code which disables 100Mbps advertising when
the ks8842 is accessed via timberdale.
At higher speed it's good to be nice to the internal state machine
of timberdale by acking interrupts. That is done by a write to the
interrupt ack register (IAR).
Signed-off-by: Richard Röjfors <richard.rojfors@pelagicore.com>
---
diff --git a/drivers/net/ks8842.c b/drivers/net/ks8842.c
index 634dad1..289b0be 100644
--- a/drivers/net/ks8842.c
+++ b/drivers/net/ks8842.c
@@ -34,7 +34,12 @@
#define DRV_NAME "ks8842"
/* Timberdale specific Registers */
-#define REG_TIMB_RST 0x1c
+#define REG_TIMB_RST 0x1c
+#define REG_TIMB_FIFO 0x20
+#define REG_TIMB_ISR 0x24
+#define REG_TIMB_IER 0x28
+#define REG_TIMB_IAR 0x2C
+#define REQ_TIMB_DMA_RESUME 0x30
/* KS8842 registers */
@@ -282,10 +287,6 @@ static void ks8842_reset_hw(struct ks8842_adapter *adapter)
/* restart port auto-negotiation */
ks8842_enable_bits(adapter, 49, 1 << 13, REG_P1CR4);
- if (!(adapter->conf_flags & MICREL_KS884X))
- /* only advertise 10Mbps */
- ks8842_clear_bits(adapter, 49, 3 << 2, REG_P1CR4);
-
/* Enable the transmitter */
ks8842_enable_tx(adapter);
@@ -543,6 +544,10 @@ void ks8842_tasklet(unsigned long arg)
/* Ack */
ks8842_write16(adapter, 18, isr, REG_ISR);
+ if (!(adapter->conf_flags & MICREL_KS884X))
+ /* Ack in the timberdale IP as well */
+ iowrite32(0x1, adapter->hw_addr + REG_TIMB_IAR);
+
if (!netif_running(netdev))
return;
^ permalink raw reply related
* Re: [PATCH] ks8842: Support 100Mbps when accessed via timberdale
From: Richard Röjfors @ 2010-07-26 8:44 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <20100725.170327.226755551.davem@davemloft.net>
On 07/26/2010 02:03 AM, David Miller wrote:
>
> I'm not applying this patch, flow control is important and
> should be enabled by default whenever possible. Please
> instead go try and figure out if flow control trigger
> points or RX/TX ring sizes need adjustment instead.
I agree, I will look at the flow control.
--Richard
^ permalink raw reply
* Re: IPv6 Anycast?
From: Simon Horman @ 2010-07-26 8:44 UTC (permalink / raw)
To: Stuart Sheldon; +Cc: Ulrich Weber, Mikael Abrahamsson, netdev
In-Reply-To: <4C49C92D.30705@actusa.net>
On Fri, Jul 23, 2010 at 09:54:05AM -0700, Stuart Sheldon wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Hi Ulrich,
>
> Thanks, that resolves half the issue. So as of right now, there is no
> userspace program to add anycast addresses?
I was hoping to have some useful information, but alas I failed on that count.
Looking at ip(8) it seems that the following ought to work:
ip addr add fd16:a2f5:c4d7::7/48 anycast fd16:a2f5:c4d7::8 dev eth0
However, it seems not to, and then I found this in the manpage :-(
anycast - not implemented the destinations are anycast
addresses assigned to this host. They are mainly equivalent to
local with one difference: such addresses are invalid when used as
the source address of any packet.
^ permalink raw reply
* [PATCH] usbnet: use jiffies in schedule_timeout(), not msecs
From: Kulikov Vasiliy @ 2010-07-26 8:25 UTC (permalink / raw)
To: kernel-janitors
Cc: David Brownell, Greg Kroah-Hartman, David S. Miller,
Ben Hutchings, Joe Perches, Stephen Hemminger, Jussi Kivilinna,
netdev, linux-usb, linux-kernel
usbnet_terminate_urbs() uses schedule_timeout() with argument 3 msecs.
schedule_timeout() uses jiffies as argument, so convert msecs to jiffies
with msecs_to_jiffies().
Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
---
drivers/net/usb/usbnet.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index 7eab407..b243386 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -624,7 +624,7 @@ static void usbnet_terminate_urbs(struct usbnet *dev)
while (!skb_queue_empty(&dev->rxq)
&& !skb_queue_empty(&dev->txq)
&& !skb_queue_empty(&dev->done)) {
- schedule_timeout(UNLINK_TIMEOUT_MS);
+ schedule_timeout(msecs_to_jiffies(UNLINK_TIMEOUT_MS));
set_current_state(TASK_UNINTERRUPTIBLE);
netif_dbg(dev, ifdown, dev->net,
"waited for %d urb completions\n", temp);
--
1.7.0.4
^ permalink raw reply related
* [patch] ipvs: provide default ip_vs_conn_{in,out}_get_proto
From: Simon Horman @ 2010-07-26 7:56 UTC (permalink / raw)
To: lvs-devel, netdev; +Cc: Wensong Zhang, Julian Anastasov, Patrick McHardy
This removes duplicate code by providing a default implementation
which is used by 3 of the 4 modules that provide these call.
Signed-off-by: Simon Horman <horms@verge.net.au>
include/net/ip_vs.h | 12 +++++++
net/netfilter/ipvs/ip_vs_conn.c | 45 ++++++++++++++++++++++++++
net/netfilter/ipvs/ip_vs_proto_sctp.c | 53 +------------------------------
net/netfilter/ipvs/ip_vs_proto_tcp.c | 50 +----------------------------
net/netfilter/ipvs/ip_vs_proto_udp.c | 56 +--------------------------------
5 files changed, 63 insertions(+), 153 deletions(-)
Index: nf-next-2.6/net/netfilter/ipvs/ip_vs_proto_sctp.c
===================================================================
--- nf-next-2.6.orig/net/netfilter/ipvs/ip_vs_proto_sctp.c 2010-07-18 15:16:58.000000000 +0900
+++ nf-next-2.6/net/netfilter/ipvs/ip_vs_proto_sctp.c 2010-07-18 15:17:01.000000000 +0900
@@ -8,55 +8,6 @@
#include <net/sctp/checksum.h>
#include <net/ip_vs.h>
-
-static struct ip_vs_conn *
-sctp_conn_in_get(int af,
- const struct sk_buff *skb,
- struct ip_vs_protocol *pp,
- const struct ip_vs_iphdr *iph,
- unsigned int proto_off,
- int inverse)
-{
- __be16 _ports[2], *pptr;
-
- pptr = skb_header_pointer(skb, proto_off, sizeof(_ports), _ports);
- if (pptr == NULL)
- return NULL;
-
- if (likely(!inverse))
- return ip_vs_conn_in_get(af, iph->protocol,
- &iph->saddr, pptr[0],
- &iph->daddr, pptr[1]);
- else
- return ip_vs_conn_in_get(af, iph->protocol,
- &iph->daddr, pptr[1],
- &iph->saddr, pptr[0]);
-}
-
-static struct ip_vs_conn *
-sctp_conn_out_get(int af,
- const struct sk_buff *skb,
- struct ip_vs_protocol *pp,
- const struct ip_vs_iphdr *iph,
- unsigned int proto_off,
- int inverse)
-{
- __be16 _ports[2], *pptr;
-
- pptr = skb_header_pointer(skb, proto_off, sizeof(_ports), _ports);
- if (pptr == NULL)
- return NULL;
-
- if (likely(!inverse))
- return ip_vs_conn_out_get(af, iph->protocol,
- &iph->saddr, pptr[0],
- &iph->daddr, pptr[1]);
- else
- return ip_vs_conn_out_get(af, iph->protocol,
- &iph->daddr, pptr[1],
- &iph->saddr, pptr[0]);
-}
-
static int
sctp_conn_schedule(int af, struct sk_buff *skb, struct ip_vs_protocol *pp,
int *verdict, struct ip_vs_conn **cpp)
@@ -1169,8 +1120,8 @@ struct ip_vs_protocol ip_vs_protocol_sct
.register_app = sctp_register_app,
.unregister_app = sctp_unregister_app,
.conn_schedule = sctp_conn_schedule,
- .conn_in_get = sctp_conn_in_get,
- .conn_out_get = sctp_conn_out_get,
+ .conn_in_get = ip_vs_conn_in_get_proto,
+ .conn_out_get = ip_vs_conn_out_get_proto,
.snat_handler = sctp_snat_handler,
.dnat_handler = sctp_dnat_handler,
.csum_check = sctp_csum_check,
Index: nf-next-2.6/net/netfilter/ipvs/ip_vs_proto_tcp.c
===================================================================
--- nf-next-2.6.orig/net/netfilter/ipvs/ip_vs_proto_tcp.c 2010-07-18 15:16:58.000000000 +0900
+++ nf-next-2.6/net/netfilter/ipvs/ip_vs_proto_tcp.c 2010-07-18 15:17:01.000000000 +0900
@@ -27,52 +27,6 @@
#include <net/ip_vs.h>
-
-static struct ip_vs_conn *
-tcp_conn_in_get(int af, const struct sk_buff *skb, struct ip_vs_protocol *pp,
- const struct ip_vs_iphdr *iph, unsigned int proto_off,
- int inverse)
-{
- __be16 _ports[2], *pptr;
-
- pptr = skb_header_pointer(skb, proto_off, sizeof(_ports), _ports);
- if (pptr == NULL)
- return NULL;
-
- if (likely(!inverse)) {
- return ip_vs_conn_in_get(af, iph->protocol,
- &iph->saddr, pptr[0],
- &iph->daddr, pptr[1]);
- } else {
- return ip_vs_conn_in_get(af, iph->protocol,
- &iph->daddr, pptr[1],
- &iph->saddr, pptr[0]);
- }
-}
-
-static struct ip_vs_conn *
-tcp_conn_out_get(int af, const struct sk_buff *skb, struct ip_vs_protocol *pp,
- const struct ip_vs_iphdr *iph, unsigned int proto_off,
- int inverse)
-{
- __be16 _ports[2], *pptr;
-
- pptr = skb_header_pointer(skb, proto_off, sizeof(_ports), _ports);
- if (pptr == NULL)
- return NULL;
-
- if (likely(!inverse)) {
- return ip_vs_conn_out_get(af, iph->protocol,
- &iph->saddr, pptr[0],
- &iph->daddr, pptr[1]);
- } else {
- return ip_vs_conn_out_get(af, iph->protocol,
- &iph->daddr, pptr[1],
- &iph->saddr, pptr[0]);
- }
-}
-
-
static int
tcp_conn_schedule(int af, struct sk_buff *skb, struct ip_vs_protocol *pp,
int *verdict, struct ip_vs_conn **cpp)
@@ -721,8 +675,8 @@ struct ip_vs_protocol ip_vs_protocol_tcp
.register_app = tcp_register_app,
.unregister_app = tcp_unregister_app,
.conn_schedule = tcp_conn_schedule,
- .conn_in_get = tcp_conn_in_get,
- .conn_out_get = tcp_conn_out_get,
+ .conn_in_get = ip_vs_conn_in_get_proto,
+ .conn_out_get = ip_vs_conn_out_get_proto,
.snat_handler = tcp_snat_handler,
.dnat_handler = tcp_dnat_handler,
.csum_check = tcp_csum_check,
Index: nf-next-2.6/net/netfilter/ipvs/ip_vs_proto_udp.c
===================================================================
--- nf-next-2.6.orig/net/netfilter/ipvs/ip_vs_proto_udp.c 2010-07-18 15:16:58.000000000 +0900
+++ nf-next-2.6/net/netfilter/ipvs/ip_vs_proto_udp.c 2010-07-18 15:17:01.000000000 +0900
@@ -27,58 +27,6 @@
#include <net/ip.h>
#include <net/ip6_checksum.h>
-static struct ip_vs_conn *
-udp_conn_in_get(int af, const struct sk_buff *skb, struct ip_vs_protocol *pp,
- const struct ip_vs_iphdr *iph, unsigned int proto_off,
- int inverse)
-{
- struct ip_vs_conn *cp;
- __be16 _ports[2], *pptr;
-
- pptr = skb_header_pointer(skb, proto_off, sizeof(_ports), _ports);
- if (pptr == NULL)
- return NULL;
-
- if (likely(!inverse)) {
- cp = ip_vs_conn_in_get(af, iph->protocol,
- &iph->saddr, pptr[0],
- &iph->daddr, pptr[1]);
- } else {
- cp = ip_vs_conn_in_get(af, iph->protocol,
- &iph->daddr, pptr[1],
- &iph->saddr, pptr[0]);
- }
-
- return cp;
-}
-
-
-static struct ip_vs_conn *
-udp_conn_out_get(int af, const struct sk_buff *skb, struct ip_vs_protocol *pp,
- const struct ip_vs_iphdr *iph, unsigned int proto_off,
- int inverse)
-{
- struct ip_vs_conn *cp;
- __be16 _ports[2], *pptr;
-
- pptr = skb_header_pointer(skb, proto_off, sizeof(_ports), _ports);
- if (pptr == NULL)
- return NULL;
-
- if (likely(!inverse)) {
- cp = ip_vs_conn_out_get(af, iph->protocol,
- &iph->saddr, pptr[0],
- &iph->daddr, pptr[1]);
- } else {
- cp = ip_vs_conn_out_get(af, iph->protocol,
- &iph->daddr, pptr[1],
- &iph->saddr, pptr[0]);
- }
-
- return cp;
-}
-
-
static int
udp_conn_schedule(int af, struct sk_buff *skb, struct ip_vs_protocol *pp,
int *verdict, struct ip_vs_conn **cpp)
@@ -520,8 +468,8 @@ struct ip_vs_protocol ip_vs_protocol_udp
.init = udp_init,
.exit = udp_exit,
.conn_schedule = udp_conn_schedule,
- .conn_in_get = udp_conn_in_get,
- .conn_out_get = udp_conn_out_get,
+ .conn_in_get = ip_vs_conn_in_get_proto,
+ .conn_out_get = ip_vs_conn_out_get_proto,
.snat_handler = udp_snat_handler,
.dnat_handler = udp_dnat_handler,
.csum_check = udp_csum_check,
Index: nf-next-2.6/net/netfilter/ipvs/ip_vs_conn.c
===================================================================
--- nf-next-2.6.orig/net/netfilter/ipvs/ip_vs_conn.c 2010-07-18 15:16:58.000000000 +0900
+++ nf-next-2.6/net/netfilter/ipvs/ip_vs_conn.c 2010-07-18 16:37:44.000000000 +0900
@@ -271,6 +271,29 @@ struct ip_vs_conn *ip_vs_conn_in_get
return cp;
}
+struct ip_vs_conn *
+ip_vs_conn_in_get_proto(int af, const struct sk_buff *skb,
+ struct ip_vs_protocol *pp,
+ const struct ip_vs_iphdr *iph,
+ unsigned int proto_off, int inverse)
+{
+ __be16 _ports[2], *pptr;
+
+ pptr = skb_header_pointer(skb, proto_off, sizeof(_ports), _ports);
+ if (pptr == NULL)
+ return NULL;
+
+ if (likely(!inverse))
+ return ip_vs_conn_in_get(af, iph->protocol,
+ &iph->saddr, pptr[0],
+ &iph->daddr, pptr[1]);
+ else
+ return ip_vs_conn_in_get(af, iph->protocol,
+ &iph->daddr, pptr[1],
+ &iph->saddr, pptr[0]);
+}
+EXPORT_SYMBOL_GPL(ip_vs_conn_in_get_proto);
+
/* Get reference to connection template */
struct ip_vs_conn *ip_vs_ct_in_get
(int af, int protocol, const union nf_inet_addr *s_addr, __be16 s_port,
@@ -356,6 +379,28 @@ struct ip_vs_conn *ip_vs_conn_out_get
return ret;
}
+struct ip_vs_conn *
+ip_vs_conn_out_get_proto(int af, const struct sk_buff *skb,
+ struct ip_vs_protocol *pp,
+ const struct ip_vs_iphdr *iph,
+ unsigned int proto_off, int inverse)
+{
+ __be16 _ports[2], *pptr;
+
+ pptr = skb_header_pointer(skb, proto_off, sizeof(_ports), _ports);
+ if (pptr == NULL)
+ return NULL;
+
+ if (likely(!inverse))
+ return ip_vs_conn_out_get(af, iph->protocol,
+ &iph->saddr, pptr[0],
+ &iph->daddr, pptr[1]);
+ else
+ return ip_vs_conn_out_get(af, iph->protocol,
+ &iph->daddr, pptr[1],
+ &iph->saddr, pptr[0]);
+}
+EXPORT_SYMBOL_GPL(ip_vs_conn_out_get_proto);
/*
* Put back the conn and restart its timer with its timeout
Index: nf-next-2.6/include/net/ip_vs.h
===================================================================
--- nf-next-2.6.orig/include/net/ip_vs.h 2010-07-18 15:16:58.000000000 +0900
+++ nf-next-2.6/include/net/ip_vs.h 2010-07-18 16:37:44.000000000 +0900
@@ -632,10 +632,22 @@ extern struct ip_vs_conn *ip_vs_ct_in_ge
(int af, int protocol, const union nf_inet_addr *s_addr, __be16 s_port,
const union nf_inet_addr *d_addr, __be16 d_port);
+struct ip_vs_conn * ip_vs_conn_in_get_proto(int af, const struct sk_buff *skb,
+ struct ip_vs_protocol *pp,
+ const struct ip_vs_iphdr *iph,
+ unsigned int proto_off,
+ int inverse);
+
extern struct ip_vs_conn *ip_vs_conn_out_get
(int af, int protocol, const union nf_inet_addr *s_addr, __be16 s_port,
const union nf_inet_addr *d_addr, __be16 d_port);
+struct ip_vs_conn * ip_vs_conn_out_get_proto(int af, const struct sk_buff *skb,
+ struct ip_vs_protocol *pp,
+ const struct ip_vs_iphdr *iph,
+ unsigned int proto_off,
+ int inverse);
+
/* put back the conn without restarting its timer */
static inline void __ip_vs_conn_put(struct ip_vs_conn *cp)
{
^ permalink raw reply
* [patch] ipvs: remove EXPERIMENTAL tag
From: Simon Horman @ 2010-07-26 7:56 UTC (permalink / raw)
To: lvs-devel, netdev; +Cc: Wensong Zhang, Julian Anastasov, Patrick McHardy
IPVS was merged into the kernel quite a long time ago and
has been seeing wide-spread production use for even longer.
It seems appropriate for it to be no longer tagged as EXPERIMENTAL
Signed-off-as: Simon Horman <horms@verge.net.au>
Index: nf-next-2.6/net/netfilter/ipvs/Kconfig
===================================================================
--- nf-next-2.6.orig/net/netfilter/ipvs/Kconfig 2010-07-26 16:44:36.000000000 +0900
+++ nf-next-2.6/net/netfilter/ipvs/Kconfig 2010-07-26 16:45:02.000000000 +0900
@@ -26,7 +26,7 @@ if IP_VS
config IP_VS_IPV6
bool "IPv6 support for IPVS"
- depends on EXPERIMENTAL && (IPV6 = y || IP_VS = IPV6)
+ depends on IPV6 = y || IP_VS = IPV6
---help---
Add IPv6 support to IPVS. This is incomplete and might be dangerous.
^ permalink raw reply
* Re: Splice status
From: Changli Gao @ 2010-07-26 7:41 UTC (permalink / raw)
To: Ofer Heifetz
Cc: Eric Dumazet, Jens Axboe, netdev@vger.kernel.org, Nick Piggin
In-Reply-To: <EE71107DF0D1F24FA2D95041E64AB9E80114797BC8AB@IL-MB01.marvell.com>
On Sun, Jul 25, 2010 at 10:47 PM, Ofer Heifetz <oferh@marvell.com> wrote:
> Hi Eric,
>
> Still trying to get better performance with splice, I noticed that when using splice there are twice the file size memcpy (placed a counter in memcpy), I verified it via samba file transfer and splice-fromnet/out.
>
> I also used the splice-fromnet/out and using ftrace I did notice that data is copied twice using these routines: skb_splice_bits, pipe_to_file.
>
> I thought that the main goal of splice is to refrain from one copy when moving data from network to file descriptor.
>
> If there are the same number of memcpy and context switches and in samba copy additional vfs overhead it makes sense that splice deteriates the samba overall write performance.
>
The support for SPLICE_F_MOVE is removed by Nick in commit
http://git.kernel.org/?p=linux/kernel/git/next/linux-next.git;a=commitdiff;h=485ddb4b9741bafb70b22e5c1f9b4f37dc3e85bd
.
Nick, can we add it back now?
--
Regards,
Changli Gao(xiaosuo@gmail.com)
^ permalink raw reply
* [patch] caif: handle snprintf() return
From: Dan Carpenter @ 2010-07-26 7:23 UTC (permalink / raw)
To: Sjur Braendeland; +Cc: David S. Miller, netdev, kernel-janitors
snprintf() returns the number of bytes that would have been written. It
can be larger than the size of the buffer. The current code won't
overflow, but people cut and paste this stuff so lets do it right and
also make the static checkers happy.
Signed-off-by: Dan Carpenter <error27@gmail.com>
diff --git a/drivers/net/caif/caif_spi.c b/drivers/net/caif/caif_spi.c
index 6c94803..f5058ff 100644
--- a/drivers/net/caif/caif_spi.c
+++ b/drivers/net/caif/caif_spi.c
@@ -165,6 +165,9 @@ static ssize_t dbgfs_state(struct file *file, char __user *user_buf,
len += snprintf((buf + len), (DEBUGFS_BUF_SIZE - len),
"Next RX len: %d\n", cfspi->rx_npck_len);
+ if (len > DEBUGFS_BUF_SIZE)
+ len = DEBUGFS_BUF_SIZE;
+
size = simple_read_from_buffer(user_buf, count, ppos, buf, len);
kfree(buf);
^ permalink raw reply related
* [PATCH] genetlink: cleanup code according to CodingStyle
From: Changli Gao @ 2010-07-26 6:46 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, Changli Gao
If the function is exported, the EXPORT* macro for it should follow immediately
after the closing function brace line.
Signed-off-by: Changli Gao <xiaosuo@gmail.com>
----
net/netlink/genetlink.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c
index aa4308a..e09e17a 100644
--- a/net/netlink/genetlink.c
+++ b/net/netlink/genetlink.c
@@ -303,6 +303,7 @@ int genl_register_ops(struct genl_family *family, struct genl_ops *ops)
errout:
return err;
}
+EXPORT_SYMBOL(genl_register_ops);
/**
* genl_unregister_ops - unregister generic netlink operations
@@ -337,6 +338,7 @@ int genl_unregister_ops(struct genl_family *family, struct genl_ops *ops)
return -ENOENT;
}
+EXPORT_SYMBOL(genl_unregister_ops);
/**
* genl_register_family - register a generic netlink family
@@ -405,6 +407,7 @@ errout_locked:
errout:
return err;
}
+EXPORT_SYMBOL(genl_register_family);
/**
* genl_register_family_with_ops - register a generic netlink family
@@ -485,6 +488,7 @@ int genl_unregister_family(struct genl_family *family)
return -ENOENT;
}
+EXPORT_SYMBOL(genl_unregister_family);
static int genl_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
{
@@ -899,11 +903,6 @@ problem:
subsys_initcall(genl_init);
-EXPORT_SYMBOL(genl_register_ops);
-EXPORT_SYMBOL(genl_unregister_ops);
-EXPORT_SYMBOL(genl_register_family);
-EXPORT_SYMBOL(genl_unregister_family);
-
static int genlmsg_mcast(struct sk_buff *skb, u32 pid, unsigned long group,
gfp_t flags)
{
^ permalink raw reply related
* Re: [PATCH net-next] drivers/net/qla3xxx.c: Checkpatch cleanups
From: David Miller @ 2010-07-26 5:03 UTC (permalink / raw)
To: joe; +Cc: ron.mercer, linux-driver, netdev, linux-kernel
In-Reply-To: <118c687d97762e235ba61733ef1610f6443ae1eb.1279848705.git.joe@perches.com>
From: Joe Perches <joe@perches.com>
Date: Thu, 22 Jul 2010 18:36:17 -0700
> Remove typedefs
> Indentation and spacing
> Use a temporary for a very long pointer variable
> More 80 column compatible
> Convert a switch to if/else if
>
> Compile tested only, depends on patch "Update logging message style"
>
> (old)
> $ scripts/checkpatch.pl -f drivers/net/qla3xxx.c | grep "^total:"
> total: 209 errors, 82 warnings, 3995 lines checked
>
> (new)
> $ scripts/checkpatch.pl -f drivers/net/qla3xxx.c | grep "^total:"
> total: 2 errors, 0 warnings, 3970 lines checked
>
> $ size drivers/net/qla3xxx.o.*
> text data bss dec hex filename
> 50413 212 13864 64489 fbe9 drivers/net/qla3xxx.o.old
> 49959 212 13728 63899 f99b drivers/net/qla3xxx.o.new
>
> Signed-off-by: Joe Perches <joe@perches.com>
Also applied, thanks Joe.
^ permalink raw reply
* Re: [PATCH net-next] drivers/net/qla3xxx.c: Update logging message style
From: David Miller @ 2010-07-26 5:03 UTC (permalink / raw)
To: joe; +Cc: ron.mercer, linux-driver, netdev, linux-kernel
In-Reply-To: <4057a685dc2c277e9e3137c4f0e01eeb389971a4.1279837596.git.joe@perches.com>
From: Joe Perches <joe@perches.com>
Date: Thu, 22 Jul 2010 15:33:31 -0700
> Use pr_<level>
> Use netdev_<level>
> Use netif_<level>
> Remove #define PFX
> Improve a couple of loops to avoid deep indentation.
>
> Compile tested only
>
> $ size drivers/net/qla3xxx.o.*
> text data bss dec hex filename
> 51603 212 13864 65679 1008f drivers/net/qla3xxx.o.old
> 50413 212 13864 64489 fbe9 drivers/net/qla3xxx.o.new
>
> Signed-off-by: Joe Perches <joe@perches.com>
Applied.
^ permalink raw reply
* Re: [net 0/2] Clean up netfilter cache on xmit-to-self.
From: David Miller @ 2010-07-26 5:01 UTC (permalink / raw)
To: greearb; +Cc: netdev
In-Reply-To: <20100725.215912.39197141.davem@davemloft.net>
From: David Miller <davem@davemloft.net>
Date: Sun, 25 Jul 2010 21:59:12 -0700 (PDT)
> From: Ben Greear <greearb@candelatech.com>
> Date: Thu, 22 Jul 2010 12:54:46 -0700
>
>> These patches are against 2.6.34.1. The first one may be
>> worth submitting to stable. The second one is less critical
>> and should probably just go in the development tree.
>
> I'll apply the first one to net-2.6 and queue up for -stable
>
> The second one will go to net-next-2.6
Actually it appears net-next-2.6 already has this change.
^ 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