* Re: [patch] wimax: wimax_msg_alloc() returns ERR_PTR not null
From: David Miller @ 2010-04-22 22:56 UTC (permalink / raw)
To: inaky; +Cc: error27, netdev, andre.goddard, kernel-janitors, wimax,
linux-wimax
In-Reply-To: <1271973596.2867.3.camel@localhost.localdomain>
From: Inaky Perez-Gonzalez <inaky@linux.intel.com>
Date: Thu, 22 Apr 2010 14:59:56 -0700
> On Thu, 2010-04-22 at 11:46 +0200, Dan Carpenter wrote:
>> wimax_msg_alloc() returns an ERR_PTR and not null. I changed it to test
>> for ERR_PTR instead of null. I also added a check in front of the
>> kfree() because kfree() can handle null but not ERR_PTR.
>>
>> Signed-off-by: Dan Carpenter <error27@gmail.com>
>
> Good catch thank you!
>
> Will merge ASAP in preparation for the next push
There was another wimax fix from Dan, subject:
[patch] wimax: checking ERR_PTR vs null
make sure you integrate that one too.
^ permalink raw reply
* Re: [patch] rtnetlink: potential ERR_PTR dereference
From: David Miller @ 2010-04-22 22:57 UTC (permalink / raw)
To: error27
Cc: netdev, eric.dumazet, kaber, ebiederm, mitch.a.williams,
kernel-janitors
In-Reply-To: <20100422095327.GP29647@bicker>
From: Dan Carpenter <error27@gmail.com>
Date: Thu, 22 Apr 2010 11:53:27 +0200
> In the original code, if rtnl_create_link() returned an ERR_PTR then that
> would get passed to rtnl_configure_link() which dereferences it.
>
> Signed-off-by: Dan Carpenter <error27@gmail.com>
Applied.
^ permalink raw reply
* Re: [patch] rdma: potential ERR_PTR dereference
From: David Miller @ 2010-04-22 22:57 UTC (permalink / raw)
To: error27; +Cc: andy.grover, rds-devel, netdev, kernel-janitors
In-Reply-To: <20100422095527.GQ29647@bicker>
From: Dan Carpenter <error27@gmail.com>
Date: Thu, 22 Apr 2010 11:55:27 +0200
> In the original code, the "goto out" calls "rdma_destroy_id(cm_id);"
> That isn't needed here and would cause problems because "cm_id" is an
> ERR_PTR. The new code just returns directly.
>
> Signed-off-by: Dan Carpenter <error27@gmail.com>
Applied.
^ permalink raw reply
* Re: [patch] wimax: checking ERR_PTR vs null
From: Inaky Perez-Gonzalez @ 2010-04-22 22:56 UTC (permalink / raw)
To: Dan Carpenter
Cc: netdev@vger.kernel.org, wimax@linuxwimax.org,
kernel-janitors@vger.kernel.org, David S. Miller,
Paulius Zaleckas, Alexey Dobriyan
In-Reply-To: <20100422095010.GN29647@bicker>
On Thu, 2010-04-22 at 02:50 -0700, Dan Carpenter wrote:
> stch_skb is allocated with wimax_gnl_re_state_change_alloc(). That
> function returns ERR_PTRs on failure and doesn't return NULL.
>
> Signed-off-by: Dan Carpenter <error27@gmail.com>
ACK, thanks [and thanks to davem for reminding me]
^ permalink raw reply
* Re: [PATCH v2] tcp: fix outsegs stat for TSO segments
From: David Miller @ 2010-04-22 23:00 UTC (permalink / raw)
To: therbert; +Cc: netdev
In-Reply-To: <alpine.DEB.1.00.1004220956080.28813@pokey.mtv.corp.google.com>
From: Tom Herbert <therbert@google.com>
Date: Thu, 22 Apr 2010 10:00:24 -0700 (PDT)
> Account for TSO segments of an skb in TCP_MIB_OUTSEGS counter. Without
> doing this, the counter can be off by orders of magnitude from the
> actual number of segments sent.
>
> Signed-off-by: Tom Herbert <therbert@google.com>
Applied to net-next-2.6, thanks Tom.
^ permalink raw reply
* Re: [net-next PATCH 1/2] add iovnl netlink support
From: David Miller @ 2010-04-22 23:04 UTC (permalink / raw)
To: scofeldm; +Cc: netdev, chrisw
In-Reply-To: <C7F60C62.2AC93%scofeldm@cisco.com>
From: Scott Feldman <scofeldm@cisco.com>
Date: Thu, 22 Apr 2010 14:23:30 -0700
> On 4/21/10 11:48 PM, "David Miller" <davem@davemloft.net> wrote:
>
>> From: Scott Feldman <scofeldm@cisco.com>
>> Date: Mon, 19 Apr 2010 12:18:07 -0700
>>
>>> +#define IOVNL_PROTO_VERSION 1
>>> +
>>
>> Please delete this in the final version, the macro isn't even used by
>> the code.
>>
>> We don't do protocol versioning in netlink. Instead we get the base
>> stuff solid from the beginning, and then if something needs fixing up
>> we handle this using new attributes in a way which is both backward
>> and forward compatible.
>
> Sounds good to me, was a cut-and-paste from dcbnl.h. How about:
This is perfectly fine except it got whitespace damanged by your
email client and needs a proper commit message and signoff :-)
^ permalink raw reply
* Re: [PATCHv2] Socket filter ancilliary data access for skb->dev->type
From: David Miller @ 2010-04-22 23:06 UTC (permalink / raw)
To: leonerd; +Cc: netdev
In-Reply-To: <20100422133222.GU19334@cel.leo>
From: Paul LeoNerd Evans <leonerd@leonerd.org.uk>
Date: Thu, 22 Apr 2010 14:32:22 +0100
> Add an SKF_AD_HATYPE field to the packet ancilliary data area, giving
> access to skb->dev->type, as reported in the sll_hatype field.
>
> When capturing packets on a PF_PACKET/SOCK_RAW socket bound to all
> interfaces, there doesn't appear to be a way for the filter program to
> actually find out the underlying hardware type the packet was captured
> on. This patch adds such ability.
>
> This patch also handles the case where skb->dev can be NULL, such as on
> netlink sockets.
>
> Signed-off-by: Paul Evans <leonerd@leonerd.org.uk>
Looks good, applied to net-next-2.6, thanks!
^ permalink raw reply
* Re: which stable usb wlan device
From: maximilian attems @ 2010-04-22 22:39 UTC (permalink / raw)
To: Markus Feldmann; +Cc: netdev
In-Reply-To: <hqqilh$7rd$1@dough.gmane.org>
On Fri, Apr 23, 2010 at 12:30:09AM +0200, Markus Feldmann wrote:
>
> i am searching for a wlan device. This should work as AP on Debian
> Lenny(current kernel 2.6.32.11). So here are my requirements for this
> device:
Lenny is our current stable release with 2.6.26, Squeeze the upcoming
has 2.6.32. good that you are already running it. :)
^ permalink raw reply
* Re: [PATCH net-next-2.6] dst: rcu check refinement
From: David Miller @ 2010-04-22 23:07 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev
In-Reply-To: <1271971818.7895.6547.camel@edumazet-laptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Thu, 22 Apr 2010 23:30:18 +0200
> __sk_dst_get() might be called from softirq, with socket lock held.
>
...
>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Applied, thanks Eric.
^ permalink raw reply
* Re: [PATCHv2 1/7] X25: Add if_x25.h and x25 to device identifiers
From: David Miller @ 2010-04-22 23:13 UTC (permalink / raw)
To: andrew.hendry; +Cc: netdev
In-Reply-To: <20100420.163558.83598373.davem@davemloft.net>
From: David Miller <davem@davemloft.net>
Date: Tue, 20 Apr 2010 16:35:58 -0700 (PDT)
> From: Andrew Hendry <andrew.hendry@gmail.com>
> Date: Tue, 20 Apr 2010 09:28:37 +1000
>
>> diff --git a/include/linux/if_x25.h b/include/linux/if_x25.h
>> new file mode 100644
>> index 0000000..897765f
>> --- /dev/null
>> +++ b/include/linux/if_x25.h
>> @@ -0,0 +1,26 @@
>> +/*
>> + * Linux X.25 packet to device interface
>
> Headers meant to be used by userspace must be added
> to the include/linux/Kbuild file.
I got tired of waiting days for you to get to this so I
took care of it myself.
All 7 patches applied to net-next-2.6
^ permalink raw reply
* eSwitch management
From: Anirban Chakraborty @ 2010-04-22 23:16 UTC (permalink / raw)
To: David Miller
Cc: netdev@vger.kernel.org, Scott Feldman, chrisw@redhat.com,
Arnd Bergmann, Ameen Rahman, Amit Salecha, Rajesh Borundia
In-Reply-To: <C7F60C62.2AC93%scofeldm@cisco.com>
Hi All,
I am following the discussions on iovnl patch closely. While it is going to take some time for iovnl patch to be reviewed and accepted, what would be the interim approach to manage the eswitch in NIC? We need to add support in qlcnic driver to configure the eswitch in our 10G NIC. Some of the things that we need to set to the switch are setting a port's VLAN, tx bandwidth etc. We would like to set these parameters for a bunch of ports at the start of the day and set it to the eswitch.
Can we expose sysfs nodes to manage the eswitch or should we have a netlink/ioctl support put in the driver? Not sure if we can do it via sysfs in a clean way. Netlink seems to be the ideal candidate for this. What is an acceptable solution? Any suggesstion, advice will be highly appreciated.
thanks much,
Anirban Chakraborty
^ permalink raw reply
* Re: Subject: re-submit4 [ANNOUNCEMENT] NET: usb: sierra_net.c driver
From: Elina Pasheva @ 2010-04-22 23:16 UTC (permalink / raw)
To: Greg KH
Cc: Dan Williams,
dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org, Rory Filer,
linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
In-Reply-To: <20100422222723.GB3187-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
On Thu, 2010-04-22 at 15:27 -0700, Greg KH wrote:
> > > > +
> > > > + status = usb_control_msg(dev->udev, usb_sndctrlpipe(dev->udev, 0),
> > > > + USB_CDC_SEND_ENCAPSULATED_COMMAND,
> > > > + USB_DIR_OUT|USB_TYPE_CLASS|USB_RECIP_INTERFACE, 0,
> > > > + priv->ifnum, cmd, cmdlen, 0);
> > >
> > > No timeout?
Good catch. Will fix.
> > > No timeout?
Will fix.
> > >
> > > > + if (unlikely(len < 0)) {
> > > > + netdev_err(dev->net,
> > > > + "usb_control_msg failed, status %d\n", len);
> > >
> > > You don't need "unlikely", this is an extreemly slow path here.
Will fix.
> Well, if the return value is less than what you expect it to be,
> something went wrong and you should error out. Some of the calls handle
> this properly in this driver, some do not. Consistency is key :)
Good point. Thanks. Will check for consistency and resubmit.
Elina
--
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: DDoS attack causing bad effect on conntrack searches
From: David Miller @ 2010-04-22 23:44 UTC (permalink / raw)
To: eric.dumazet; +Cc: hawk, paulmck, kaber, xiaosuo, hawk, netdev, netfilter-devel
In-Reply-To: <1271970893.7895.6507.camel@edumazet-laptop>
Eric, I wonder if we run into some kind of issue on 32-bit systems
because we always lose a bit of the conntrack hash value when we store
it into the 'nulls' area?
Wouldn't that make the "get_nulls_value(n) != hash" fail?
^ permalink raw reply
* [PATCH 1/2] sky2: size status ring based on Tx/Rx ring
From: Stephen Hemminger @ 2010-04-22 23:42 UTC (permalink / raw)
To: davem; +Cc: netdev
In-Reply-To: <20100422234255.150547953@vyatta.com>
[-- Attachment #1: sky2-st-size.patch --]
[-- Type: text/plain, Size: 4674 bytes --]
Sky2 status ring must be big enough to handle worst case number
of status messages. It was being oversized (to handle dual port cards),
and excessive number of tx ring entries were allowed. This patch reduces
the footprint and makes sure the value is enough.
Later patch to add RSS increases the number of possible Rx status elements.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
---
drivers/net/sky2.c | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++--
drivers/net/sky2.h | 23 ++++++++++++++++
2 files changed, 96 insertions(+), 2 deletions(-)
--- a/drivers/net/sky2.c 2010-04-22 16:06:33.045312097 -0700
+++ b/drivers/net/sky2.c 2010-04-22 16:07:57.696228946 -0700
@@ -70,18 +70,15 @@
VLAN:GSO + CKSUM + Data + skb_frags * DMA */
#define MAX_SKB_TX_LE (2 + (sizeof(dma_addr_t)/sizeof(u32))*(MAX_SKB_FRAGS+1))
#define TX_MIN_PENDING (MAX_SKB_TX_LE+1)
-#define TX_MAX_PENDING 4096
+#define TX_MAX_PENDING 1024
#define TX_DEF_PENDING 127
-#define STATUS_RING_SIZE 2048 /* 2 ports * (TX + 2*RX) */
-#define STATUS_LE_BYTES (STATUS_RING_SIZE*sizeof(struct sky2_status_le))
#define TX_WATCHDOG (5 * HZ)
#define NAPI_WEIGHT 64
#define PHY_RETRIES 1000
#define SKY2_EEPROM_MAGIC 0x9955aabb
-
#define RING_NEXT(x,s) (((x)+1) & ((s)-1))
static const u32 default_msg =
@@ -2558,7 +2555,7 @@ static int sky2_status_intr(struct sky2_
if (!(opcode & HW_OWNER))
break;
- hw->st_idx = RING_NEXT(hw->st_idx, STATUS_RING_SIZE);
+ hw->st_idx = RING_NEXT(hw->st_idx, hw->st_size);
port = le->css & CSS_LINK_BIT;
dev = hw->dev[port];
@@ -3198,7 +3195,7 @@ static void sky2_reset(struct sky2_hw *h
for (i = 0; i < hw->ports; i++)
sky2_gmac_reset(hw, i);
- memset(hw->st_le, 0, STATUS_LE_BYTES);
+ memset(hw->st_le, 0, hw->st_size * sizeof(struct sky2_status_le));
hw->st_idx = 0;
sky2_write32(hw, STAT_CTRL, SC_STAT_RST_SET);
@@ -3208,7 +3205,7 @@ static void sky2_reset(struct sky2_hw *h
sky2_write32(hw, STAT_LIST_ADDR_HI, (u64) hw->st_dma >> 32);
/* Set the list last index */
- sky2_write16(hw, STAT_LAST_IDX, STATUS_RING_SIZE - 1);
+ sky2_write16(hw, STAT_LAST_IDX, hw->st_size - 1);
sky2_write16(hw, STAT_TX_IDX_TH, 10);
sky2_write8(hw, STAT_FIFO_WM, 16);
@@ -4256,12 +4253,13 @@ static int sky2_debug_show(struct seq_fi
napi_disable(&hw->napi);
last = sky2_read16(hw, STAT_PUT_IDX);
+ seq_printf(seq, "Status ring %u\n", hw->st_size);
if (hw->st_idx == last)
seq_puts(seq, "Status ring (empty)\n");
else {
seq_puts(seq, "Status ring\n");
- for (idx = hw->st_idx; idx != last && idx < STATUS_RING_SIZE;
- idx = RING_NEXT(idx, STATUS_RING_SIZE)) {
+ for (idx = hw->st_idx; idx != last && idx < hw->st_size;
+ idx = RING_NEXT(idx, hw->st_size)) {
const struct sky2_status_le *le = hw->st_le + idx;
seq_printf(seq, "[%d] %#x %d %#x\n",
idx, le->opcode, le->length, le->status);
@@ -4689,15 +4687,17 @@ static int __devinit sky2_probe(struct p
goto err_out_free_hw;
}
- /* ring for status responses */
- hw->st_le = pci_alloc_consistent(pdev, STATUS_LE_BYTES, &hw->st_dma);
- if (!hw->st_le)
- goto err_out_iounmap;
-
err = sky2_init(hw);
if (err)
goto err_out_iounmap;
+ /* ring for status responses */
+ hw->st_size = hw->ports * roundup_pow_of_two(2*RX_MAX_PENDING + TX_MAX_PENDING);
+ hw->st_le = pci_alloc_consistent(pdev, hw->st_size * sizeof(struct sky2_status_le),
+ &hw->st_dma);
+ if (!hw->st_le)
+ goto err_out_reset;
+
dev_info(&pdev->dev, "Yukon-2 %s chip revision %d\n",
sky2_name(hw->chip_id, buf1, sizeof(buf1)), hw->chip_rev);
@@ -4771,8 +4771,10 @@ err_out_unregister:
err_out_free_netdev:
free_netdev(dev);
err_out_free_pci:
+ pci_free_consistent(pdev, hw->st_size * sizeof(struct sky2_status_le),
+ hw->st_le, hw->st_dma);
+err_out_reset:
sky2_write8(hw, B0_CTST, CS_RST_SET);
- pci_free_consistent(pdev, STATUS_LE_BYTES, hw->st_le, hw->st_dma);
err_out_iounmap:
iounmap(hw->regs);
err_out_free_hw:
@@ -4810,7 +4812,8 @@ static void __devexit sky2_remove(struct
free_irq(pdev->irq, hw);
if (hw->flags & SKY2_HW_USE_MSI)
pci_disable_msi(pdev);
- pci_free_consistent(pdev, STATUS_LE_BYTES, hw->st_le, hw->st_dma);
+ pci_free_consistent(pdev, hw->st_size * sizeof(struct sky2_status_le),
+ hw->st_le, hw->st_dma);
pci_release_regions(pdev);
pci_disable_device(pdev);
--- a/drivers/net/sky2.h 2010-04-22 16:06:33.035329633 -0700
+++ b/drivers/net/sky2.h 2010-04-22 16:06:34.555022422 -0700
@@ -2268,6 +2268,7 @@ struct sky2_hw {
u8 ports;
struct sky2_status_le *st_le;
+ u32 st_size;
u32 st_idx;
dma_addr_t st_dma;
--
^ permalink raw reply
* [PATCH 2/2] sky2: add support for receive hashing
From: Stephen Hemminger @ 2010-04-22 23:42 UTC (permalink / raw)
To: davem; +Cc: netdev
In-Reply-To: <20100422234255.150547953@vyatta.com>
[-- Attachment #1: sky2-rxhash.patch --]
[-- Type: text/plain, Size: 6229 bytes --]
Sky2 hardware supports hardware receive hash calculation.
This enables it unless the chip is probably broken. The list of broken
devices is derived from vendor sk98lin which has fragments of code
for RSS support but never uses it. Setup information for this in the
chip documention is incomplete, so some of this is just best guess.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
---
drivers/net/sky2.c | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++--
drivers/net/sky2.h | 23 ++++++++++++++++
2 files changed, 96 insertions(+), 2 deletions(-)
--- a/drivers/net/sky2.c 2010-04-22 16:27:35.936207387 -0700
+++ b/drivers/net/sky2.c 2010-04-22 16:29:15.955269083 -0700
@@ -1193,6 +1193,39 @@ static void rx_set_checksum(struct sky2_
? BMU_ENA_RX_CHKSUM : BMU_DIS_RX_CHKSUM);
}
+/* Enable/disable receive hash calculation (RSS) */
+static void rx_set_rss(struct net_device *dev)
+{
+ struct sky2_port *sky2 = netdev_priv(dev);
+ struct sky2_hw *hw = sky2->hw;
+ int i, nkeys = 4;
+
+ /* Supports IPv6 and other modes */
+ if (hw->flags & SKY2_HW_NEW_LE) {
+ nkeys = 10;
+ sky2_write32(hw, SK_REG(sky2->port, RSS_CFG), HASH_ALL);
+ }
+
+ /* Program RSS initial values */
+ if (dev->features & NETIF_F_RXHASH) {
+ u32 key[nkeys];
+
+ get_random_bytes(key, nkeys * sizeof(u32));
+ for (i = 0; i < nkeys; i++)
+ sky2_write32(hw, SK_REG(sky2->port, RSS_KEY + i * 4),
+ key[i]);
+
+ /* Need to turn on (undocumented) flag to make hashing work */
+ sky2_write32(hw, SK_REG(sky2->port, RX_GMF_CTRL_T),
+ RX_STFW_ENA);
+
+ sky2_write32(hw, Q_ADDR(rxqaddr[sky2->port], Q_CSR),
+ BMU_ENA_RX_RSS_HASH);
+ } else
+ sky2_write32(hw, Q_ADDR(rxqaddr[sky2->port], Q_CSR),
+ BMU_DIS_RX_RSS_HASH);
+}
+
/*
* The RX Stop command will not work for Yukon-2 if the BMU does not
* reach the end of packet and since we can't make sure that we have
@@ -1425,6 +1458,9 @@ static void sky2_rx_start(struct sky2_po
if (!(hw->flags & SKY2_HW_NEW_LE))
rx_set_checksum(sky2);
+ if (!(hw->flags & SKY2_HW_RSS_BROKEN))
+ rx_set_rss(sky2->netdev);
+
/* submit Rx ring */
for (i = 0; i < sky2->rx_pending; i++) {
re = sky2->rx_ring + i;
@@ -2534,6 +2570,14 @@ static void sky2_rx_checksum(struct sky2
}
}
+static void sky2_rx_hash(struct sky2_port *sky2, u32 status)
+{
+ struct sk_buff *skb;
+
+ skb = sky2->rx_ring[sky2->rx_next].skb;
+ skb->rxhash = le32_to_cpu(status);
+}
+
/* Process status response ring */
static int sky2_status_intr(struct sky2_hw *hw, int to_do, u16 idx)
{
@@ -2606,6 +2650,10 @@ static int sky2_status_intr(struct sky2_
sky2_rx_checksum(sky2, status);
break;
+ case OP_RSS_HASH:
+ sky2_rx_hash(sky2, status);
+ break;
+
case OP_TXINDEXLE:
/* TX index reports status for both ports */
sky2_tx_done(hw->dev[0], status & 0xfff);
@@ -2960,6 +3008,8 @@ static int __devinit sky2_init(struct sk
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)
+ hw->flags |= SKY2_HW_RSS_BROKEN;
break;
case CHIP_ID_YUKON_EC_U:
@@ -2985,10 +3035,11 @@ static int __devinit sky2_init(struct sk
dev_err(&hw->pdev->dev, "unsupported revision Yukon-EC rev A1\n");
return -EOPNOTSUPP;
}
- hw->flags = SKY2_HW_GIGABIT;
+ hw->flags = SKY2_HW_GIGABIT | SKY2_HW_RSS_BROKEN;
break;
case CHIP_ID_YUKON_FE:
+ hw->flags = SKY2_HW_RSS_BROKEN;
break;
case CHIP_ID_YUKON_FE_P:
@@ -4112,6 +4163,28 @@ static int sky2_set_eeprom(struct net_de
return sky2_vpd_write(sky2->hw, cap, data, eeprom->offset, eeprom->len);
}
+static int sky2_set_flags(struct net_device *dev, u32 data)
+{
+ struct sky2_port *sky2 = netdev_priv(dev);
+
+ if (data & ETH_FLAG_LRO)
+ return -EOPNOTSUPP;
+
+ if (data & ETH_FLAG_NTUPLE)
+ return -EOPNOTSUPP;
+
+ if (data & ETH_FLAG_RXHASH) {
+ if (sky2->hw->flags & SKY2_HW_RSS_BROKEN)
+ return -EINVAL;
+
+ dev->features |= NETIF_F_RXHASH;
+ } else
+ dev->features &= ~NETIF_F_RXHASH;
+
+ rx_set_rss(dev);
+
+ return 0;
+}
static const struct ethtool_ops sky2_ethtool_ops = {
.get_settings = sky2_get_settings,
@@ -4143,6 +4216,7 @@ static const struct ethtool_ops sky2_eth
.phys_id = sky2_phys_id,
.get_sset_count = sky2_get_sset_count,
.get_ethtool_stats = sky2_get_ethtool_stats,
+ .set_flags = sky2_set_flags,
};
#ifdef CONFIG_SKY2_DEBUG
@@ -4491,6 +4565,11 @@ static __devinit struct net_device *sky2
if (highmem)
dev->features |= NETIF_F_HIGHDMA;
+#ifdef CONFIG_RPS
+ if (!(hw->flags & SKY2_HW_RSS_BROKEN))
+ dev->features |= NETIF_F_RXHASH;
+#endif
+
#ifdef SKY2_VLAN_TAG_USED
/* The workaround for FE+ status conflicts with VLAN tag detection. */
if (!(sky2->hw->chip_id == CHIP_ID_YUKON_FE_P &&
@@ -4687,7 +4766,7 @@ static int __devinit sky2_probe(struct p
goto err_out_iounmap;
/* ring for status responses */
- hw->st_size = hw->ports * roundup_pow_of_two(2*RX_MAX_PENDING + TX_MAX_PENDING);
+ hw->st_size = hw->ports * roundup_pow_of_two(3*RX_MAX_PENDING + TX_MAX_PENDING);
hw->st_le = pci_alloc_consistent(pdev, hw->st_size * sizeof(struct sky2_status_le),
&hw->st_dma);
if (!hw->st_le)
--- a/drivers/net/sky2.h 2010-04-22 16:26:46.076521722 -0700
+++ b/drivers/net/sky2.h 2010-04-22 16:29:15.965276892 -0700
@@ -694,8 +694,21 @@ enum {
TXA_CTRL = 0x0210,/* 8 bit Tx Arbiter Control Register */
TXA_TEST = 0x0211,/* 8 bit Tx Arbiter Test Register */
TXA_STAT = 0x0212,/* 8 bit Tx Arbiter Status Register */
+
+ RSS_KEY = 0x0220, /* RSS Key setup */
+ RSS_CFG = 0x0248, /* RSS Configuration */
};
+enum {
+ HASH_TCP_IPV6_EX_CTRL = 1<<5,
+ HASH_IPV6_EX_CTRL = 1<<4,
+ HASH_TCP_IPV6_CTRL = 1<<3,
+ HASH_IPV6_CTRL = 1<<2,
+ HASH_TCP_IPV4_CTRL = 1<<1,
+ HASH_IPV4_CTRL = 1<<0,
+
+ HASH_ALL = 0x3f,
+};
enum {
B6_EXT_REG = 0x0300,/* External registers (GENESIS only) */
@@ -2261,6 +2274,7 @@ struct sky2_hw {
#define SKY2_HW_NEW_LE 0x00000020 /* new LSOv2 format */
#define SKY2_HW_AUTO_TX_SUM 0x00000040 /* new IP decode for Tx */
#define SKY2_HW_ADV_POWER_CTL 0x00000080 /* additional PHY power regs */
+#define SKY2_HW_RSS_BROKEN 0x00000100
u8 chip_id;
u8 chip_rev;
--
^ permalink raw reply
* Re: [PATCH 2/2] sky2: add support for receive hashing
From: David Miller @ 2010-04-23 0:02 UTC (permalink / raw)
To: shemminger; +Cc: netdev
In-Reply-To: <20100422234319.149785036@vyatta.com>
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Thu, 22 Apr 2010 16:42:57 -0700
> @@ -4491,6 +4565,11 @@ static __devinit struct net_device *sky2
> if (highmem)
> dev->features |= NETIF_F_HIGHDMA;
>
> +#ifdef CONFIG_RPS
> + if (!(hw->flags & SKY2_HW_RSS_BROKEN))
> + dev->features |= NETIF_F_RXHASH;
> +#endif
> +
> #ifdef SKY2_VLAN_TAG_USED
Stephen, I asked you to drop this CONFIG_RPS check.
Please do it and resubmit.
^ permalink raw reply
* [net-next-2.6 PATCH] remove DCB_PROTO_VERSION as we don't do netlink versioning
From: Scott Feldman @ 2010-04-23 0:38 UTC (permalink / raw)
To: davem; +Cc: netdev, lucy.liu
From: Scott Feldman <scofeldm@cisco.com>
remove DCB_PROTO_VERSION as we don't do netlink versioning
Signed-off-by: Scott Feldman <scofeldm@cisco.com>
---
include/linux/dcbnl.h | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/include/linux/dcbnl.h b/include/linux/dcbnl.h
index b7cdbb4..8723491 100644
--- a/include/linux/dcbnl.h
+++ b/include/linux/dcbnl.h
@@ -22,8 +22,6 @@
#include <linux/types.h>
-#define DCB_PROTO_VERSION 1
-
struct dcbmsg {
__u8 dcb_family;
__u8 cmd;
^ permalink raw reply related
* Re: eSwitch management
From: Scott Feldman @ 2010-04-23 0:47 UTC (permalink / raw)
To: Anirban Chakraborty, David Miller
Cc: netdev@vger.kernel.org, chrisw@redhat.com, Arnd Bergmann,
Ameen Rahman, Amit Salecha, Rajesh Borundia
In-Reply-To: <0B579583-F3D8-4C64-A844-34D69C1760D6@qlogic.com>
On 4/22/10 4:16 PM, "Anirban Chakraborty" <anirban.chakraborty@qlogic.com>
wrote:
> I am following the discussions on iovnl patch closely. While it is going to
> take some time for iovnl patch to be reviewed and accepted, what would be the
> interim approach to manage the eswitch in NIC? We need to add support in
> qlcnic driver to configure the eswitch in our 10G NIC. Some of the things that
> we need to set to the switch are setting a port's VLAN, tx bandwidth etc. We
> would like to set these parameters for a bunch of ports at the start of the
> day and set it to the eswitch.
Are any of these settings covered in DCB? (net/dcb/dcbnl.c). Maybe you can
get a start there? Not sure not knowing your device requirements.
-scott
^ permalink raw reply
* Re: [PATCHv2 1/7] X25: Add if_x25.h and x25 to device identifiers
From: andrew hendry @ 2010-04-23 1:02 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <20100422.161342.60085636.davem@davemloft.net>
Thanks!
Sorry for the delay, kernel is a spare time task at the moment.
On Fri, Apr 23, 2010 at 9:13 AM, David Miller <davem@davemloft.net> wrote:
> From: David Miller <davem@davemloft.net>
> Date: Tue, 20 Apr 2010 16:35:58 -0700 (PDT)
>
>> From: Andrew Hendry <andrew.hendry@gmail.com>
>> Date: Tue, 20 Apr 2010 09:28:37 +1000
>>
>>> diff --git a/include/linux/if_x25.h b/include/linux/if_x25.h
>>> new file mode 100644
>>> index 0000000..897765f
>>> --- /dev/null
>>> +++ b/include/linux/if_x25.h
>>> @@ -0,0 +1,26 @@
>>> +/*
>>> + * Linux X.25 packet to device interface
>>
>> Headers meant to be used by userspace must be added
>> to the include/linux/Kbuild file.
>
> I got tired of waiting days for you to get to this so I
> took care of it myself.
>
> All 7 patches applied to net-next-2.6
>
^ permalink raw reply
* Re: eSwitch management
From: Scott Feldman @ 2010-04-23 1:29 UTC (permalink / raw)
To: Scott Feldman, Anirban Chakraborty, David Miller
Cc: netdev@vger.kernel.org, chrisw@redhat.com, Arnd Bergmann,
Ameen Rahman, Amit Salecha, Rajesh Borundia
In-Reply-To: <C7F63C44.2ADAE%scofeldm@cisco.com>
On 4/22/10 5:47 PM, "Scott Feldman" <scofeldm@cisco.com> wrote:
> On 4/22/10 4:16 PM, "Anirban Chakraborty" <anirban.chakraborty@qlogic.com>
> wrote:
>
>> I am following the discussions on iovnl patch closely. While it is going to
>> take some time for iovnl patch to be reviewed and accepted, what would be the
>> interim approach to manage the eswitch in NIC? We need to add support in
>> qlcnic driver to configure the eswitch in our 10G NIC. Some of the things
>> that
>> we need to set to the switch are setting a port's VLAN, tx bandwidth etc. We
>> would like to set these parameters for a bunch of ports at the start of the
>> day and set it to the eswitch.
>
> Are any of these settings covered in DCB? (net/dcb/dcbnl.c). Maybe you can
> get a start there? Not sure not knowing your device requirements.
Or maybe the RTM_SETLINK IFLA_VF_* ops in include/linux/if_link.h? Those
seem like what you're looking for. I'm looking at moving iovnl here as well
for port-profile.
-scott
^ permalink raw reply
* Re: [PATCH 2/2] sky2: add support for receive hashing
From: Jeff Garzik @ 2010-04-23 1:32 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: davem, netdev
In-Reply-To: <20100422234319.149785036@vyatta.com>
On 04/22/2010 07:42 PM, Stephen Hemminger wrote:
> +static int sky2_set_flags(struct net_device *dev, u32 data)
> +{
> + struct sky2_port *sky2 = netdev_priv(dev);
> +
> + if (data& ETH_FLAG_LRO)
> + return -EOPNOTSUPP;
> +
> + if (data& ETH_FLAG_NTUPLE)
> + return -EOPNOTSUPP;
Minor nit: you don't need separate tests for each bit.
Jeff
^ permalink raw reply
* Re: [PATCH 1/2] sky2: size status ring based on Tx/Rx ring
From: David Miller @ 2010-04-23 1:33 UTC (permalink / raw)
To: shemminger; +Cc: netdev
In-Reply-To: <20100422234319.066617080@vyatta.com>
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Thu, 22 Apr 2010 16:42:56 -0700
> Sky2 status ring must be big enough to handle worst case number
> of status messages. It was being oversized (to handle dual port cards),
> and excessive number of tx ring entries were allowed. This patch reduces
> the footprint and makes sure the value is enough.
>
> Later patch to add RSS increases the number of possible Rx status elements.
>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Applied to net-next-2.6
^ permalink raw reply
* Re: [net-next-2.6 PATCH] remove DCB_PROTO_VERSION as we don't do netlink versioning
From: David Miller @ 2010-04-23 1:33 UTC (permalink / raw)
To: scofeldm; +Cc: netdev, lucy.liu
In-Reply-To: <20100423003802.29068.29465.stgit@savbu-pc100.cisco.com>
From: Scott Feldman <scofeldm@cisco.com>
Date: Thu, 22 Apr 2010 17:38:03 -0700
> From: Scott Feldman <scofeldm@cisco.com>
>
> remove DCB_PROTO_VERSION as we don't do netlink versioning
>
> Signed-off-by: Scott Feldman <scofeldm@cisco.com>
Applied to net-next-2.6, thanks.
^ permalink raw reply
* Re: IPv6: race condition in __ipv6_ifa_notify() and dst_free() ?
From: David Miller @ 2010-04-23 1:54 UTC (permalink / raw)
To: jbohac; +Cc: herbert, yoshfuji, netdev, shemminger
In-Reply-To: <20100422154908.GA31568@midget.suse.cz>
From: Jiri Bohac <jbohac@suse.cz>
Date: Thu, 22 Apr 2010 17:49:08 +0200
> I still don't see why __ipv6_ifa_notify() needs to call
> dst_free(). Shouldn't that be dst_release() instead, to drop the
> reference obtained by dst_hold(&ifp->rt->u.dst)?
It likely wants to do both.
Just doing dst_release() doesn't mark the 'dst' object as obsolete,
and therefore it won't get force garbage collected.
That's why the dst_free() is necessary, to really get rid of it when
the refcount does hit zero.
Actually, what's really interesting is that at the top of the
linux-2.6-history tree this code reads:
dst_hold(&ifp->rt->u.dst);
if (ip6_del_rt(ifp->rt, NULL, NULL))
dst_free(&ifp->rt->u.dst);
else
dst_release(&ifp->rt->u.dst);
and in Linus's initial GIT import, it reads this way too.
Where did it change to the current form that lacks the
else block?
Aha! Here it is:
commit 4641e7a334adf6856300a98e7296dfc886c446af
Author: Herbert Xu <herbert@gondor.apana.org.au>
Date: Thu Feb 2 16:55:45 2006 -0800
[IPV6]: Don't hold extra ref count in ipv6_ifa_notify
Currently the logic in ipv6_ifa_notify is to hold an extra reference
count for addrconf dst's that get added to the routing table. Thus,
when addrconf dst entries are taken out of the routing table, we need
to drop that dst. However, addrconf dst entries may be removed from
the routing table by means other than __ipv6_ifa_notify.
So we're faced with the choice of either fixing up all places where
addrconf dst entries are removed, or dropping the extra reference count
altogether.
I chose the latter because the ifp itself always holds a dst reference
count of 1 while it's alive. This is dropped just before we kfree the
ifp object. Therefore we know that in __ipv6_ifa_notify we will always
hold that count.
This bug was found by Eric W. Biederman.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index d328d59..1db5048 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -3321,9 +3321,7 @@ static void __ipv6_ifa_notify(int event, struct inet6_ifaddr *ifp)
switch (event) {
case RTM_NEWADDR:
- dst_hold(&ifp->rt->u.dst);
- if (ip6_ins_rt(ifp->rt, NULL, NULL, NULL))
- dst_release(&ifp->rt->u.dst);
+ ip6_ins_rt(ifp->rt, NULL, NULL, NULL);
if (ifp->idev->cnf.forwarding)
addrconf_join_anycast(ifp);
break;
@@ -3334,8 +3332,6 @@ static void __ipv6_ifa_notify(int event, struct inet6_ifaddr *ifp)
dst_hold(&ifp->rt->u.dst);
if (ip6_del_rt(ifp->rt, NULL, NULL, NULL))
dst_free(&ifp->rt->u.dst);
- else
- dst_release(&ifp->rt->u.dst);
break;
}
}
^ permalink raw reply related
* Re: PROBLEM: Linux kernel 2.6.31 IPv4 TCP fails to open huge amount of outgoing connections (unable to bind ... )
From: David Miller @ 2010-04-23 2:06 UTC (permalink / raw)
To: zbr; +Cc: eric.dumazet, greearb, gasparch, netdev
In-Reply-To: <20100421200802.GA25130@ioremap.net>
From: Evgeniy Polyakov <zbr@ioremap.net>
Date: Thu, 22 Apr 2010 00:08:02 +0400
> On Wed, Apr 21, 2010 at 09:26:15PM +0200, Eric Dumazet (eric.dumazet@gmail.com) wrote:
>> Le mercredi 21 avril 2010 à 22:58 +0400, Evgeniy Polyakov a écrit :
>>
>> > Damn it, I tried multiple times :)
>> > You are right of course!
>> >
>>
>> Here is a formal patch then :)
>
> Ack. Thank you Eric!
This code is way too complex :-)
Applied, thanks everyone!
^ 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