* [net-next-2.6 PATCH 1/3] ixgbe: fix setting of promisc mode when using mac-vlans
From: Jeff Kirsher @ 2010-05-14 3:33 UTC (permalink / raw)
To: davem; +Cc: netdev, gospo, Emil Tantilov, Jeff Kirsher
From: Emil Tantilov <emil.s.tantilov@intel.com>
Introduce uc_set_promisc flag to fix enabling of promisc mode
when exceeding the number of supported RAR entries.
Issue discovered by Ben Greear when using mac-vlans.
Reported-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ixgbe/ixgbe_common.c | 5 ++++-
drivers/net/ixgbe/ixgbe_main.c | 6 +++---
drivers/net/ixgbe/ixgbe_type.h | 1 +
3 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ixgbe/ixgbe_common.c b/drivers/net/ixgbe/ixgbe_common.c
index 6eb5814..753f2ab 100644
--- a/drivers/net/ixgbe/ixgbe_common.c
+++ b/drivers/net/ixgbe/ixgbe_common.c
@@ -1392,14 +1392,17 @@ s32 ixgbe_update_uc_addr_list_generic(struct ixgbe_hw *hw,
fctrl = IXGBE_READ_REG(hw, IXGBE_FCTRL);
fctrl |= IXGBE_FCTRL_UPE;
IXGBE_WRITE_REG(hw, IXGBE_FCTRL, fctrl);
+ hw->addr_ctrl.uc_set_promisc = true;
}
} else {
/* only disable if set by overflow, not by user */
- if (old_promisc_setting && !hw->addr_ctrl.user_set_promisc) {
+ if ((old_promisc_setting && hw->addr_ctrl.uc_set_promisc) &&
+ !(hw->addr_ctrl.user_set_promisc)) {
hw_dbg(hw, " Leaving address overflow promisc mode\n");
fctrl = IXGBE_READ_REG(hw, IXGBE_FCTRL);
fctrl &= ~IXGBE_FCTRL_UPE;
IXGBE_WRITE_REG(hw, IXGBE_FCTRL, fctrl);
+ hw->addr_ctrl.uc_set_promisc = false;
}
}
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index d1a1868..15032c7 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -2952,7 +2952,7 @@ void ixgbe_set_rx_mode(struct net_device *netdev)
fctrl = IXGBE_READ_REG(hw, IXGBE_FCTRL);
if (netdev->flags & IFF_PROMISC) {
- hw->addr_ctrl.user_set_promisc = 1;
+ hw->addr_ctrl.user_set_promisc = true;
fctrl |= (IXGBE_FCTRL_UPE | IXGBE_FCTRL_MPE);
/* don't hardware filter vlans in promisc mode */
ixgbe_vlan_filter_disable(adapter);
@@ -2960,11 +2960,11 @@ void ixgbe_set_rx_mode(struct net_device *netdev)
if (netdev->flags & IFF_ALLMULTI) {
fctrl |= IXGBE_FCTRL_MPE;
fctrl &= ~IXGBE_FCTRL_UPE;
- } else {
+ } else if (!hw->addr_ctrl.uc_set_promisc) {
fctrl &= ~(IXGBE_FCTRL_UPE | IXGBE_FCTRL_MPE);
}
ixgbe_vlan_filter_enable(adapter);
- hw->addr_ctrl.user_set_promisc = 0;
+ hw->addr_ctrl.user_set_promisc = false;
}
IXGBE_WRITE_REG(hw, IXGBE_FCTRL, fctrl);
diff --git a/drivers/net/ixgbe/ixgbe_type.h b/drivers/net/ixgbe/ixgbe_type.h
index 4277cbb..8fc59ac 100644
--- a/drivers/net/ixgbe/ixgbe_type.h
+++ b/drivers/net/ixgbe/ixgbe_type.h
@@ -2268,6 +2268,7 @@ struct ixgbe_addr_filter_info {
u32 mc_addr_in_rar_count;
u32 mta_in_use;
u32 overflow_promisc;
+ bool uc_set_promisc;
bool user_set_promisc;
};
^ permalink raw reply related
* Re: [PATCH net-next] drivers/net: Remove unnecessary returns from void function()s
From: David Miller @ 2010-05-14 2:09 UTC (permalink / raw)
To: joe; +Cc: netdev
In-Reply-To: <1273769886.21514.72.camel@Joe-Laptop.home>
From: Joe Perches <joe@perches.com>
Date: Thu, 13 May 2010 09:58:06 -0700
> fyi: Patrick McHardy prefers null statement void functions to
> keep the return.
>
> There are some more removals of return like this in the patch.
> If a new patch should be generated, do tell.
Ok, please remake this patch with those cases removed.
Thanks Joe.
^ permalink raw reply
* Re: [PATCH 00/12] netfilter: netfilter update
From: David Miller @ 2010-05-14 2:07 UTC (permalink / raw)
To: kaber; +Cc: netfilter-devel, netdev
In-Reply-To: <1273767385-18225-1-git-send-email-kaber@trash.net>
From: kaber@trash.net
Date: Thu, 13 May 2010 18:16:13 +0200
> following is a second netfilter update, containing:
>
> - a compilation fix for ip_tables with CONFIG_NETFILTER_DEBUG=y, from Jan
>
> - a fix for an invalid return value in the multiport match introduced in
> the last series, from Jan
>
> - patches to combine the match and target parameters into a common structure,
> from Jan
>
> - Bart's patch to fix the NULL pointer dereference in bridge netfilter
> reported by Stephen
>
> - minor cleanups and improvements from Jan, Stephen and Joe
>
> Please apply or pull from:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/kaber/nf-next-2.6.git master
Pulled, thanks Patrick.
^ permalink raw reply
* [net-next-2.6 V7 PATCH 2/2] Add ndo_{set|get}_vf_port support for enic dynamic vnics
From: Scott Feldman @ 2010-05-14 1:35 UTC (permalink / raw)
To: davem; +Cc: netdev, chrisw, arnd, kaber
In-Reply-To: <20100514013144.1816.31191.stgit@savbu-pc100.cisco.com>
From: Scott Feldman <scofeldm@cisco.com>
Add enic ndo_{set|get}_vf_port ops to support setting/getting
port-profile for enic dynamic devices. Enic dynamic devices are just like
normal enic eth devices except dynamic enics require an extra configuration
step to assign a port-profile identifier to the interface before the
interface is useable. Once a port-profile is assigned, link comes up on the
interface and is ready for I/O. The port-profile is used to configure the
network port assigned to the interface. The network port configuration
includes VLAN membership, QoS policies, and port security settings typical
of a data center network.
A dynamic enic initially has a zero-mac address. Before a port-profile is
assigned, a valid non-zero unicast mac address should be assign to the
dynamic enic interface.
Signed-off-by: Scott Feldman <scofeldm@cisco.com>
Signed-off-by: Roopa Prabhu<roprabhu@cisco.com>
---
drivers/net/enic/Makefile | 2
drivers/net/enic/enic.h | 9 +
drivers/net/enic/enic_main.c | 344 +++++++++++++++++++++++++++++++++++++++---
drivers/net/enic/enic_res.c | 5 -
drivers/net/enic/enic_res.h | 1
drivers/net/enic/vnic_dev.c | 58 +++++++
drivers/net/enic/vnic_dev.h | 7 +
drivers/net/enic/vnic_vic.c | 73 +++++++++
drivers/net/enic/vnic_vic.h | 59 +++++++
9 files changed, 522 insertions(+), 36 deletions(-)
diff --git a/drivers/net/enic/Makefile b/drivers/net/enic/Makefile
index 391c3bc..e7b6c31 100644
--- a/drivers/net/enic/Makefile
+++ b/drivers/net/enic/Makefile
@@ -1,5 +1,5 @@
obj-$(CONFIG_ENIC) := enic.o
enic-y := enic_main.o vnic_cq.o vnic_intr.o vnic_wq.o \
- enic_res.o vnic_dev.o vnic_rq.o
+ enic_res.o vnic_dev.o vnic_rq.o vnic_vic.o
diff --git a/drivers/net/enic/enic.h b/drivers/net/enic/enic.h
index 5fa56f1..91088be 100644
--- a/drivers/net/enic/enic.h
+++ b/drivers/net/enic/enic.h
@@ -34,7 +34,7 @@
#define DRV_NAME "enic"
#define DRV_DESCRIPTION "Cisco VIC Ethernet NIC Driver"
-#define DRV_VERSION "1.3.1.1"
+#define DRV_VERSION "1.3.1.1-pp"
#define DRV_COPYRIGHT "Copyright 2008-2009 Cisco Systems, Inc"
#define PFX DRV_NAME ": "
@@ -74,6 +74,12 @@ struct enic_msix_entry {
void *devid;
};
+struct enic_port_profile {
+ char name[VF_PORT_PROFILE_MAX];
+ u8 instance_uuid[VF_PORT_UUID_MAX];
+ u8 host_uuid[VF_PORT_UUID_MAX];
+};
+
/* Per-instance private data structure */
struct enic {
struct net_device *netdev;
@@ -95,6 +101,7 @@ struct enic {
u32 port_mtu;
u32 rx_coalesce_usecs;
u32 tx_coalesce_usecs;
+ struct enic_port_profile pp;
/* work queue cache line section */
____cacheline_aligned struct vnic_wq wq[ENIC_WQ_MAX];
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index 1232887..97c8324 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -29,6 +29,7 @@
#include <linux/etherdevice.h>
#include <linux/if_ether.h>
#include <linux/if_vlan.h>
+#include <linux/if_link.h>
#include <linux/ethtool.h>
#include <linux/in.h>
#include <linux/ip.h>
@@ -40,6 +41,7 @@
#include "vnic_dev.h"
#include "vnic_intr.h"
#include "vnic_stats.h"
+#include "vnic_vic.h"
#include "enic_res.h"
#include "enic.h"
@@ -49,10 +51,12 @@
#define ENIC_DESC_MAX_SPLITS (MAX_TSO / WQ_ENET_MAX_DESC_LEN + 1)
#define PCI_DEVICE_ID_CISCO_VIC_ENET 0x0043 /* ethernet vnic */
+#define PCI_DEVICE_ID_CISCO_VIC_ENET_DYN 0x0044 /* enet dynamic vnic */
/* Supported devices */
static DEFINE_PCI_DEVICE_TABLE(enic_id_table) = {
{ PCI_VDEVICE(CISCO, PCI_DEVICE_ID_CISCO_VIC_ENET) },
+ { PCI_VDEVICE(CISCO, PCI_DEVICE_ID_CISCO_VIC_ENET_DYN) },
{ 0, } /* end of table */
};
@@ -113,6 +117,11 @@ static const struct enic_stat enic_rx_stats[] = {
static const unsigned int enic_n_tx_stats = ARRAY_SIZE(enic_tx_stats);
static const unsigned int enic_n_rx_stats = ARRAY_SIZE(enic_rx_stats);
+static int enic_is_dynamic(struct enic *enic)
+{
+ return enic->pdev->device == PCI_DEVICE_ID_CISCO_VIC_ENET_DYN;
+}
+
static int enic_get_settings(struct net_device *netdev,
struct ethtool_cmd *ecmd)
{
@@ -810,14 +819,78 @@ static void enic_reset_mcaddrs(struct enic *enic)
static int enic_set_mac_addr(struct net_device *netdev, char *addr)
{
- if (!is_valid_ether_addr(addr))
- return -EADDRNOTAVAIL;
+ struct enic *enic = netdev_priv(netdev);
+
+ if (enic_is_dynamic(enic)) {
+ if (!is_valid_ether_addr(addr) && !is_zero_ether_addr(addr))
+ return -EADDRNOTAVAIL;
+ } else {
+ if (!is_valid_ether_addr(addr))
+ return -EADDRNOTAVAIL;
+ }
memcpy(netdev->dev_addr, addr, netdev->addr_len);
return 0;
}
+static int enic_dev_add_station_addr(struct enic *enic)
+{
+ int err = 0;
+
+ if (is_valid_ether_addr(enic->netdev->dev_addr)) {
+ spin_lock(&enic->devcmd_lock);
+ err = vnic_dev_add_addr(enic->vdev, enic->netdev->dev_addr);
+ spin_unlock(&enic->devcmd_lock);
+ }
+
+ return err;
+}
+
+static int enic_dev_del_station_addr(struct enic *enic)
+{
+ int err = 0;
+
+ if (is_valid_ether_addr(enic->netdev->dev_addr)) {
+ spin_lock(&enic->devcmd_lock);
+ err = vnic_dev_del_addr(enic->vdev, enic->netdev->dev_addr);
+ spin_unlock(&enic->devcmd_lock);
+ }
+
+ return err;
+}
+
+static int enic_set_mac_address_dynamic(struct net_device *netdev, void *p)
+{
+ struct enic *enic = netdev_priv(netdev);
+ struct sockaddr *saddr = p;
+ char *addr = saddr->sa_data;
+ int err;
+
+ if (netif_running(enic->netdev)) {
+ err = enic_dev_del_station_addr(enic);
+ if (err)
+ return err;
+ }
+
+ err = enic_set_mac_addr(netdev, addr);
+ if (err)
+ return err;
+
+ if (netif_running(enic->netdev)) {
+ err = enic_dev_add_station_addr(enic);
+ if (err)
+ return err;
+ }
+
+ return err;
+}
+
+static int enic_set_mac_address(struct net_device *netdev, void *p)
+{
+ return -EOPNOTSUPP;
+}
+
/* netif_tx_lock held, BHs disabled */
static void enic_set_multicast_list(struct net_device *netdev)
{
@@ -922,6 +995,203 @@ static void enic_tx_timeout(struct net_device *netdev)
schedule_work(&enic->reset);
}
+static int enic_vnic_dev_deinit(struct enic *enic)
+{
+ int err;
+
+ spin_lock(&enic->devcmd_lock);
+ err = vnic_dev_deinit(enic->vdev);
+ spin_unlock(&enic->devcmd_lock);
+
+ return err;
+}
+
+static int enic_dev_init_prov(struct enic *enic, struct vic_provinfo *vp)
+{
+ int err;
+
+ spin_lock(&enic->devcmd_lock);
+ err = vnic_dev_init_prov(enic->vdev,
+ (u8 *)vp, vic_provinfo_size(vp));
+ spin_unlock(&enic->devcmd_lock);
+
+ return err;
+}
+
+static int enic_dev_init_done(struct enic *enic, int *done, int *error)
+{
+ int err;
+
+ spin_lock(&enic->devcmd_lock);
+ err = vnic_dev_init_done(enic->vdev, done, error);
+ spin_unlock(&enic->devcmd_lock);
+
+ return err;
+}
+
+static int enic_set_port_profile(struct enic *enic, int vf, u8 *mac,
+ char *name, u8 *instance_uuid, u8 *host_uuid)
+{
+ struct vic_provinfo *vp;
+ u8 oui[3] = VIC_PROVINFO_CISCO_OUI;
+ unsigned short *uuid;
+ char uuid_str[38];
+ static char *uuid_fmt = "%04X%04X-%04X-%04X-%04X-%04X%04X%04X";
+ int err;
+
+ if (!name)
+ return -EINVAL;
+
+ if (!is_valid_ether_addr(mac))
+ return -EADDRNOTAVAIL;
+
+ vp = vic_provinfo_alloc(GFP_KERNEL, oui, VIC_PROVINFO_LINUX_TYPE);
+ if (!vp)
+ return -ENOMEM;
+
+ vic_provinfo_add_tlv(vp,
+ VIC_LINUX_PROV_TLV_PORT_PROFILE_NAME_STR,
+ strlen(name) + 1, name);
+
+ vic_provinfo_add_tlv(vp,
+ VIC_LINUX_PROV_TLV_CLIENT_MAC_ADDR,
+ ETH_ALEN, mac);
+
+ if (instance_uuid) {
+ uuid = (unsigned short *)instance_uuid;
+ sprintf(uuid_str, uuid_fmt,
+ uuid[0], uuid[1], uuid[2], uuid[3],
+ uuid[4], uuid[5], uuid[6], uuid[7]);
+ vic_provinfo_add_tlv(vp,
+ VIC_LINUX_PROV_TLV_CLIENT_UUID_STR,
+ sizeof(uuid_str), uuid_str);
+ }
+
+ if (host_uuid) {
+ uuid = (unsigned short *)host_uuid;
+ sprintf(uuid_str, uuid_fmt,
+ uuid[0], uuid[1], uuid[2], uuid[3],
+ uuid[4], uuid[5], uuid[6], uuid[7]);
+ vic_provinfo_add_tlv(vp,
+ VIC_LINUX_PROV_TLV_HOST_UUID_STR,
+ sizeof(uuid_str), uuid_str);
+ }
+
+ err = enic_vnic_dev_deinit(enic);
+ if (err)
+ goto err_out;
+
+ memset(&enic->pp, 0, sizeof(enic->pp));
+
+ err = enic_dev_init_prov(enic, vp);
+ if (err)
+ goto err_out;
+
+ memcpy(enic->pp.name, name, VF_PORT_PROFILE_MAX);
+ if (instance_uuid)
+ memcpy(enic->pp.instance_uuid,
+ instance_uuid, VF_PORT_UUID_MAX);
+ if (host_uuid)
+ memcpy(enic->pp.host_uuid,
+ host_uuid, VF_PORT_UUID_MAX);
+
+err_out:
+ vic_provinfo_free(vp);
+
+ return err;
+}
+
+static int enic_unset_port_profile(struct enic *enic, int vf)
+{
+ memset(&enic->pp, 0, sizeof(enic->pp));
+ return enic_vnic_dev_deinit(enic);
+}
+
+static int enic_set_vf_port(struct net_device *netdev, int vf,
+ struct nlattr *vf_port[])
+{
+ struct enic *enic = netdev_priv(netdev);
+ char *name = NULL;
+ u8 *instance_uuid = NULL;
+ u8 *host_uuid = NULL;
+ u8 request = VF_PORT_REQUEST_DISASSOCIATE;
+
+ if (vf_port[IFLA_VF_PORT_REQUEST])
+ request = nla_get_u8(vf_port[IFLA_VF_PORT_REQUEST]);
+
+ switch (request) {
+ case VF_PORT_REQUEST_ASSOCIATE:
+
+ if (vf_port[IFLA_VF_PORT_PROFILE])
+ name = nla_data(vf_port[IFLA_VF_PORT_PROFILE]);
+
+ if (vf_port[IFLA_VF_PORT_INSTANCE_UUID])
+ instance_uuid =
+ nla_data(vf_port[IFLA_VF_PORT_INSTANCE_UUID]);
+
+ if (vf_port[IFLA_VF_PORT_HOST_UUID])
+ host_uuid = nla_data(vf_port[IFLA_VF_PORT_HOST_UUID]);
+
+ return enic_set_port_profile(enic, vf,
+ netdev->dev_addr, name,
+ instance_uuid, host_uuid);
+
+ case VF_PORT_REQUEST_DISASSOCIATE:
+
+ return enic_unset_port_profile(enic, vf);
+
+ default:
+ break;
+ }
+
+ return -EOPNOTSUPP;
+}
+
+static int enic_get_vf_port(struct net_device *netdev, int vf,
+ struct sk_buff *skb)
+{
+ struct enic *enic = netdev_priv(netdev);
+ int err, error, done;
+ u16 response = VF_PORT_PROFILE_RESPONSE_SUCCESS;
+
+ err = enic_dev_init_done(enic, &done, &error);
+
+ if (err)
+ return err;
+
+ switch (error) {
+ case ERR_SUCCESS:
+ if (!done)
+ response = VF_PORT_PROFILE_RESPONSE_INPROGRESS;
+ break;
+ case ERR_EINVAL:
+ response = VF_PORT_PROFILE_RESPONSE_INVALID;
+ break;
+ case ERR_EBADSTATE:
+ response = VF_PORT_PROFILE_RESPONSE_BADSTATE;
+ break;
+ case ERR_ENOMEM:
+ response = VF_PORT_PROFILE_RESPONSE_INSUFFICIENT_RESOURCES;
+ break;
+ default:
+ response = VF_PORT_PROFILE_RESPONSE_ERROR;
+ break;
+ }
+
+ NLA_PUT_U16(skb, IFLA_VF_PORT_RESPONSE, response);
+ NLA_PUT(skb, IFLA_VF_PORT_PROFILE, VF_PORT_PROFILE_MAX,
+ enic->pp.name);
+ NLA_PUT(skb, IFLA_VF_PORT_INSTANCE_UUID, VF_PORT_UUID_MAX,
+ enic->pp.instance_uuid);
+ NLA_PUT(skb, IFLA_VF_PORT_HOST_UUID, VF_PORT_UUID_MAX,
+ enic->pp.host_uuid);
+
+ return 0;
+
+nla_put_failure:
+ return -EMSGSIZE;
+}
+
static void enic_free_rq_buf(struct vnic_rq *rq, struct vnic_rq_buf *buf)
{
struct enic *enic = vnic_dev_priv(rq->vdev);
@@ -1440,9 +1710,7 @@ static int enic_open(struct net_device *netdev)
for (i = 0; i < enic->rq_count; i++)
vnic_rq_enable(&enic->rq[i]);
- spin_lock(&enic->devcmd_lock);
- enic_add_station_addr(enic);
- spin_unlock(&enic->devcmd_lock);
+ enic_dev_add_station_addr(enic);
enic_set_multicast_list(netdev);
netif_wake_queue(netdev);
@@ -1489,6 +1757,8 @@ static int enic_stop(struct net_device *netdev)
netif_carrier_off(netdev);
netif_tx_disable(netdev);
+ enic_dev_del_station_addr(enic);
+
for (i = 0; i < enic->wq_count; i++) {
err = vnic_wq_disable(&enic->wq[i]);
if (err)
@@ -1774,21 +2044,41 @@ static void enic_clear_intr_mode(struct enic *enic)
vnic_dev_set_intr_mode(enic->vdev, VNIC_DEV_INTR_MODE_UNKNOWN);
}
+static const struct net_device_ops enic_netdev_dynamic_ops = {
+ .ndo_open = enic_open,
+ .ndo_stop = enic_stop,
+ .ndo_start_xmit = enic_hard_start_xmit,
+ .ndo_get_stats = enic_get_stats,
+ .ndo_validate_addr = eth_validate_addr,
+ .ndo_set_multicast_list = enic_set_multicast_list,
+ .ndo_set_mac_address = enic_set_mac_address_dynamic,
+ .ndo_change_mtu = enic_change_mtu,
+ .ndo_vlan_rx_register = enic_vlan_rx_register,
+ .ndo_vlan_rx_add_vid = enic_vlan_rx_add_vid,
+ .ndo_vlan_rx_kill_vid = enic_vlan_rx_kill_vid,
+ .ndo_tx_timeout = enic_tx_timeout,
+ .ndo_set_vf_port = enic_set_vf_port,
+ .ndo_get_vf_port = enic_get_vf_port,
+#ifdef CONFIG_NET_POLL_CONTROLLER
+ .ndo_poll_controller = enic_poll_controller,
+#endif
+};
+
static const struct net_device_ops enic_netdev_ops = {
- .ndo_open = enic_open,
- .ndo_stop = enic_stop,
- .ndo_start_xmit = enic_hard_start_xmit,
- .ndo_get_stats = enic_get_stats,
- .ndo_validate_addr = eth_validate_addr,
- .ndo_set_mac_address = eth_mac_addr,
- .ndo_set_multicast_list = enic_set_multicast_list,
- .ndo_change_mtu = enic_change_mtu,
- .ndo_vlan_rx_register = enic_vlan_rx_register,
- .ndo_vlan_rx_add_vid = enic_vlan_rx_add_vid,
- .ndo_vlan_rx_kill_vid = enic_vlan_rx_kill_vid,
- .ndo_tx_timeout = enic_tx_timeout,
+ .ndo_open = enic_open,
+ .ndo_stop = enic_stop,
+ .ndo_start_xmit = enic_hard_start_xmit,
+ .ndo_get_stats = enic_get_stats,
+ .ndo_validate_addr = eth_validate_addr,
+ .ndo_set_multicast_list = enic_set_multicast_list,
+ .ndo_set_mac_address = enic_set_mac_address,
+ .ndo_change_mtu = enic_change_mtu,
+ .ndo_vlan_rx_register = enic_vlan_rx_register,
+ .ndo_vlan_rx_add_vid = enic_vlan_rx_add_vid,
+ .ndo_vlan_rx_kill_vid = enic_vlan_rx_kill_vid,
+ .ndo_tx_timeout = enic_tx_timeout,
#ifdef CONFIG_NET_POLL_CONTROLLER
- .ndo_poll_controller = enic_poll_controller,
+ .ndo_poll_controller = enic_poll_controller,
#endif
};
@@ -2010,11 +2300,13 @@ static int __devinit enic_probe(struct pci_dev *pdev,
netif_carrier_off(netdev);
- err = vnic_dev_init(enic->vdev, 0);
- if (err) {
- printk(KERN_ERR PFX
- "vNIC dev init failed, aborting.\n");
- goto err_out_dev_close;
+ if (!enic_is_dynamic(enic)) {
+ err = vnic_dev_init(enic->vdev, 0);
+ if (err) {
+ printk(KERN_ERR PFX
+ "vNIC dev init failed, aborting.\n");
+ goto err_out_dev_close;
+ }
}
err = enic_dev_init(enic);
@@ -2054,7 +2346,11 @@ static int __devinit enic_probe(struct pci_dev *pdev,
enic->tx_coalesce_usecs = enic->config.intr_timer_usec;
enic->rx_coalesce_usecs = enic->tx_coalesce_usecs;
- netdev->netdev_ops = &enic_netdev_ops;
+ if (enic_is_dynamic(enic))
+ netdev->netdev_ops = &enic_netdev_dynamic_ops;
+ else
+ netdev->netdev_ops = &enic_netdev_ops;
+
netdev->watchdog_timeo = 2 * HZ;
netdev->ethtool_ops = &enic_ethtool_ops;
diff --git a/drivers/net/enic/enic_res.c b/drivers/net/enic/enic_res.c
index 02839bf..9b18840 100644
--- a/drivers/net/enic/enic_res.c
+++ b/drivers/net/enic/enic_res.c
@@ -103,11 +103,6 @@ int enic_get_vnic_config(struct enic *enic)
return 0;
}
-void enic_add_station_addr(struct enic *enic)
-{
- vnic_dev_add_addr(enic->vdev, enic->mac_addr);
-}
-
void enic_add_multicast_addr(struct enic *enic, u8 *addr)
{
vnic_dev_add_addr(enic->vdev, addr);
diff --git a/drivers/net/enic/enic_res.h b/drivers/net/enic/enic_res.h
index abc1974..494664f 100644
--- a/drivers/net/enic/enic_res.h
+++ b/drivers/net/enic/enic_res.h
@@ -131,7 +131,6 @@ static inline void enic_queue_rq_desc(struct vnic_rq *rq,
struct enic;
int enic_get_vnic_config(struct enic *);
-void enic_add_station_addr(struct enic *enic);
void enic_add_multicast_addr(struct enic *enic, u8 *addr);
void enic_del_multicast_addr(struct enic *enic, u8 *addr);
void enic_add_vlan(struct enic *enic, u16 vlanid);
diff --git a/drivers/net/enic/vnic_dev.c b/drivers/net/enic/vnic_dev.c
index d43a9d4..2b3e16d 100644
--- a/drivers/net/enic/vnic_dev.c
+++ b/drivers/net/enic/vnic_dev.c
@@ -530,7 +530,7 @@ void vnic_dev_packet_filter(struct vnic_dev *vdev, int directed, int multicast,
printk(KERN_ERR "Can't set packet filter\n");
}
-void vnic_dev_add_addr(struct vnic_dev *vdev, u8 *addr)
+int vnic_dev_add_addr(struct vnic_dev *vdev, u8 *addr)
{
u64 a0 = 0, a1 = 0;
int wait = 1000;
@@ -543,9 +543,11 @@ void vnic_dev_add_addr(struct vnic_dev *vdev, u8 *addr)
err = vnic_dev_cmd(vdev, CMD_ADDR_ADD, &a0, &a1, wait);
if (err)
printk(KERN_ERR "Can't add addr [%pM], %d\n", addr, err);
+
+ return err;
}
-void vnic_dev_del_addr(struct vnic_dev *vdev, u8 *addr)
+int vnic_dev_del_addr(struct vnic_dev *vdev, u8 *addr)
{
u64 a0 = 0, a1 = 0;
int wait = 1000;
@@ -558,6 +560,8 @@ void vnic_dev_del_addr(struct vnic_dev *vdev, u8 *addr)
err = vnic_dev_cmd(vdev, CMD_ADDR_DEL, &a0, &a1, wait);
if (err)
printk(KERN_ERR "Can't del addr [%pM], %d\n", addr, err);
+
+ return err;
}
int vnic_dev_raise_intr(struct vnic_dev *vdev, u16 intr)
@@ -682,6 +686,56 @@ int vnic_dev_init(struct vnic_dev *vdev, int arg)
return r;
}
+int vnic_dev_init_done(struct vnic_dev *vdev, int *done, int *err)
+{
+ u64 a0 = 0, a1 = 0;
+ int wait = 1000;
+ int ret;
+
+ *done = 0;
+
+ ret = vnic_dev_cmd(vdev, CMD_INIT_STATUS, &a0, &a1, wait);
+ if (ret)
+ return ret;
+
+ *done = (a0 == 0);
+
+ *err = (a0 == 0) ? a1 : 0;
+
+ return 0;
+}
+
+int vnic_dev_init_prov(struct vnic_dev *vdev, u8 *buf, u32 len)
+{
+ u64 a0, a1 = len;
+ int wait = 1000;
+ u64 prov_pa;
+ void *prov_buf;
+ int ret;
+
+ prov_buf = pci_alloc_consistent(vdev->pdev, len, &prov_pa);
+ if (!prov_buf)
+ return -ENOMEM;
+
+ memcpy(prov_buf, buf, len);
+
+ a0 = prov_pa;
+
+ ret = vnic_dev_cmd(vdev, CMD_INIT_PROV_INFO, &a0, &a1, wait);
+
+ pci_free_consistent(vdev->pdev, len, prov_buf, prov_pa);
+
+ return ret;
+}
+
+int vnic_dev_deinit(struct vnic_dev *vdev)
+{
+ u64 a0 = 0, a1 = 0;
+ int wait = 1000;
+
+ return vnic_dev_cmd(vdev, CMD_DEINIT, &a0, &a1, wait);
+}
+
int vnic_dev_link_status(struct vnic_dev *vdev)
{
if (vdev->linkstatus)
diff --git a/drivers/net/enic/vnic_dev.h b/drivers/net/enic/vnic_dev.h
index f5be640..caccce3 100644
--- a/drivers/net/enic/vnic_dev.h
+++ b/drivers/net/enic/vnic_dev.h
@@ -103,8 +103,8 @@ int vnic_dev_stats_dump(struct vnic_dev *vdev, struct vnic_stats **stats);
int vnic_dev_hang_notify(struct vnic_dev *vdev);
void vnic_dev_packet_filter(struct vnic_dev *vdev, int directed, int multicast,
int broadcast, int promisc, int allmulti);
-void vnic_dev_add_addr(struct vnic_dev *vdev, u8 *addr);
-void vnic_dev_del_addr(struct vnic_dev *vdev, u8 *addr);
+int vnic_dev_add_addr(struct vnic_dev *vdev, u8 *addr);
+int vnic_dev_del_addr(struct vnic_dev *vdev, u8 *addr);
int vnic_dev_mac_addr(struct vnic_dev *vdev, u8 *mac_addr);
int vnic_dev_raise_intr(struct vnic_dev *vdev, u16 intr);
int vnic_dev_notify_setcmd(struct vnic_dev *vdev,
@@ -124,6 +124,9 @@ int vnic_dev_disable(struct vnic_dev *vdev);
int vnic_dev_open(struct vnic_dev *vdev, int arg);
int vnic_dev_open_done(struct vnic_dev *vdev, int *done);
int vnic_dev_init(struct vnic_dev *vdev, int arg);
+int vnic_dev_init_done(struct vnic_dev *vdev, int *done, int *err);
+int vnic_dev_init_prov(struct vnic_dev *vdev, u8 *buf, u32 len);
+int vnic_dev_deinit(struct vnic_dev *vdev);
int vnic_dev_soft_reset(struct vnic_dev *vdev, int arg);
int vnic_dev_soft_reset_done(struct vnic_dev *vdev, int *done);
void vnic_dev_set_intr_mode(struct vnic_dev *vdev,
diff --git a/drivers/net/enic/vnic_vic.c b/drivers/net/enic/vnic_vic.c
new file mode 100644
index 0000000..d769772
--- /dev/null
+++ b/drivers/net/enic/vnic_vic.c
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2010 Cisco Systems, Inc. All rights reserved.
+ *
+ * This program is free software; you may redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/errno.h>
+#include <linux/types.h>
+#include <linux/slab.h>
+
+#include "vnic_vic.h"
+
+struct vic_provinfo *vic_provinfo_alloc(gfp_t flags, u8 *oui, u8 type)
+{
+ struct vic_provinfo *vp = kzalloc(VIC_PROVINFO_MAX_DATA, flags);
+
+ if (!vp || !oui)
+ return NULL;
+
+ memcpy(vp->oui, oui, sizeof(vp->oui));
+ vp->type = type;
+ vp->length = htonl(sizeof(vp->num_tlvs));
+
+ return vp;
+}
+
+void vic_provinfo_free(struct vic_provinfo *vp)
+{
+ kfree(vp);
+}
+
+int vic_provinfo_add_tlv(struct vic_provinfo *vp, u16 type, u16 length,
+ void *value)
+{
+ struct vic_provinfo_tlv *tlv;
+
+ if (!vp || !value)
+ return -EINVAL;
+
+ if (ntohl(vp->length) + sizeof(*tlv) + length >
+ VIC_PROVINFO_MAX_TLV_DATA)
+ return -ENOMEM;
+
+ tlv = (struct vic_provinfo_tlv *)((u8 *)vp->tlv +
+ ntohl(vp->length) - sizeof(vp->num_tlvs));
+
+ tlv->type = htons(type);
+ tlv->length = htons(length);
+ memcpy(tlv->value, value, length);
+
+ vp->num_tlvs = htonl(ntohl(vp->num_tlvs) + 1);
+ vp->length = htonl(ntohl(vp->length) + sizeof(*tlv) + length);
+
+ return 0;
+}
+
+size_t vic_provinfo_size(struct vic_provinfo *vp)
+{
+ return vp ? ntohl(vp->length) + sizeof(*vp) - sizeof(vp->num_tlvs) : 0;
+}
diff --git a/drivers/net/enic/vnic_vic.h b/drivers/net/enic/vnic_vic.h
new file mode 100644
index 0000000..085c2a2
--- /dev/null
+++ b/drivers/net/enic/vnic_vic.h
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2010 Cisco Systems, Inc. All rights reserved.
+ *
+ * This program is free software; you may redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#ifndef _VNIC_VIC_H_
+#define _VNIC_VIC_H_
+
+/* Note: All integer fields in NETWORK byte order */
+
+/* Note: String field lengths include null char */
+
+#define VIC_PROVINFO_CISCO_OUI { 0x00, 0x00, 0x0c }
+#define VIC_PROVINFO_LINUX_TYPE 0x2
+
+enum vic_linux_prov_tlv_type {
+ VIC_LINUX_PROV_TLV_PORT_PROFILE_NAME_STR = 0,
+ VIC_LINUX_PROV_TLV_CLIENT_MAC_ADDR = 1, /* u8[6] */
+ VIC_LINUX_PROV_TLV_CLIENT_NAME_STR = 2,
+ VIC_LINUX_PROV_TLV_HOST_UUID_STR = 8,
+ VIC_LINUX_PROV_TLV_CLIENT_UUID_STR = 9,
+};
+
+struct vic_provinfo {
+ u8 oui[3]; /* OUI of data provider */
+ u8 type; /* provider-specific type */
+ u32 length; /* length of data below */
+ u32 num_tlvs; /* number of tlvs */
+ struct vic_provinfo_tlv {
+ u16 type;
+ u16 length;
+ u8 value[0];
+ } tlv[0];
+} __attribute__ ((packed));
+
+#define VIC_PROVINFO_MAX_DATA 1385
+#define VIC_PROVINFO_MAX_TLV_DATA (VIC_PROVINFO_MAX_DATA - \
+ sizeof(struct vic_provinfo))
+
+struct vic_provinfo *vic_provinfo_alloc(gfp_t flags, u8 *oui, u8 type);
+void vic_provinfo_free(struct vic_provinfo *vp);
+int vic_provinfo_add_tlv(struct vic_provinfo *vp, u16 type, u16 length,
+ void *value);
+size_t vic_provinfo_size(struct vic_provinfo *vp);
+
+#endif /* _VNIC_VIC_H_ */
^ permalink raw reply related
* [net-next-2.6 V7 PATCH 1/2] Add netlink support for virtual port management (was iovnl)
From: Scott Feldman @ 2010-05-14 1:35 UTC (permalink / raw)
To: davem; +Cc: netdev, chrisw, arnd, kaber
In-Reply-To: <20100514013144.1816.31191.stgit@savbu-pc100.cisco.com>
From: Scott Feldman <scofeldm@cisco.com>
Add new netdev ops ndo_{set|get}_vf_port to allow setting of
port-profile on a netdev interface. Extends netlink socket RTM_SETLINK/
RTM_GETLINK with new sub cmd called IFLA_VF_PORT (added to end of
IFLA_cmd list).
A port-profile is used to configure/enable the external switch virtual port
backing the netdev interface, not to configure the host-facing side of the
netdev. A port-profile is an identifier known to the switch. How port-
profiles are installed on the switch or how available port-profiles are
made know to the host is outside the scope of this patch.
There are two types of port-profiles specs in the netlink msg. The first spec
is for 802.1Qbg (pre-)standard, VDP protocol. The second spec is for devices
that run a similar protocol as VDP but in firmware, thus hiding the protocol
details. In either case, the specs have much in common and makes sense to
define the netlink msg as the union of the two specs. For example, both specs
have a notition of associating/deassociating a port-profile. And both specs
require some information from the hypervisor manager, such as client port
instance ID.
The general flow is the port-profile is applied to a host netdev interface
using RTM_SETLINK, the receiver of the RTM_SETLINK msg communicates with the
switch, and the switch virtual port backing the host netdev interface is
configured/enabled based on the settings defined by the port-profile. What
those settings comprise, and how those settings are managed is again
outside the scope of this patch, since this patch only deals with the
first step in the flow.
There is a RTM_GETLINK cmd to to return port-profile setting of an
interface and to also return the status of the last port-profile
association.
IFLA_VF_PORT is modeled after the existing IFLA_VF_* cmd where a
VF number is passed in to identify the virtual function (VF) of an SR-IOV-
capable device. In this case, the target of IFLA_VF_PORT msg is the
netdev physical function (PF) device. The PF will apply the port-profile
to the VF. IFLA_VF_PORT can also be used for devices that don't
adhere to SR-IOV and can apply the port-profile directly to the netdev
target. In this case, the VF number is ignored.
Passing in a NULL port-profile is used to delete the port-profile association.
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Scott Feldman <scofeldm@cisco.com>
Signed-off-by: Roopa Prabhu<roprabhu@cisco.com>
---
include/linux/if_link.h | 53 +++++++++++++++++++++
include/linux/netdevice.h | 10 ++++
net/core/rtnetlink.c | 116 +++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 178 insertions(+), 1 deletions(-)
diff --git a/include/linux/if_link.h b/include/linux/if_link.h
index cfd420b..5522055 100644
--- a/include/linux/if_link.h
+++ b/include/linux/if_link.h
@@ -116,6 +116,7 @@ enum {
IFLA_VF_TX_RATE, /* TX Bandwidth Allocation */
IFLA_VFINFO,
IFLA_STATS64,
+ IFLA_VF_PORT,
__IFLA_MAX
};
@@ -259,4 +260,56 @@ struct ifla_vf_info {
__u32 qos;
__u32 tx_rate;
};
+
+/* VF Port management section */
+
+enum {
+ IFLA_VF_PORT_UNSPEC,
+ IFLA_VF_PORT_VF, /* __u32 */
+ IFLA_VF_PORT_PROFILE, /* string */
+ IFLA_VF_PORT_VSI_TYPE, /* 802.1Qbg (pre-)standard VDP */
+ IFLA_VF_PORT_INSTANCE_UUID, /* binary UUID */
+ IFLA_VF_PORT_HOST_UUID, /* binary UUID */
+ IFLA_VF_PORT_REQUEST, /* __u8 */
+ IFLA_VF_PORT_RESPONSE, /* __u16, output only */
+ __IFLA_VF_PORT_MAX,
+};
+
+#define IFLA_VF_PORT_MAX (__IFLA_VF_PORT_MAX - 1)
+
+#define VF_PORT_PROFILE_MAX 40
+#define VF_PORT_UUID_MAX 16
+#define VF_PORT_VF_NOT_USED -1
+
+enum {
+ VF_PORT_REQUEST_PREASSOCIATE = 0,
+ VF_PORT_REQUEST_PREASSOCIATE_RR,
+ VF_PORT_REQUEST_ASSOCIATE,
+ VF_PORT_REQUEST_DISASSOCIATE,
+};
+
+enum {
+ VF_PORT_VDP_RESPONSE_SUCCESS = 0,
+ VF_PORT_VDP_RESPONSE_INVALID_FORMAT,
+ VF_PORT_VDP_RESPONSE_INSUFFICIENT_RESOURCES,
+ VF_PORT_VDP_RESPONSE_UNUSED_VTID,
+ VF_PORT_VDP_RESPONSE_VTID_VIOLATION,
+ VF_PORT_VDP_RESPONSE_VTID_VERSION_VIOALTION,
+ VF_PORT_VDP_RESPONSE_OUT_OF_SYNC,
+ /* 0x08-0xFF reserved for future VDP use */
+ VF_PORT_PROFILE_RESPONSE_SUCCESS = 0x100,
+ VF_PORT_PROFILE_RESPONSE_INPROGRESS,
+ VF_PORT_PROFILE_RESPONSE_INVALID,
+ VF_PORT_PROFILE_RESPONSE_BADSTATE,
+ VF_PORT_PROFILE_RESPONSE_INSUFFICIENT_RESOURCES,
+ VF_PORT_PROFILE_RESPONSE_ERROR,
+};
+
+struct ifla_vf_port_vsi {
+ __u8 vsi_mgr_id;
+ __u8 vsi_type_id[3];
+ __u8 vsi_type_version;
+ __u8 pad[3];
+};
+
#endif /* _LINUX_IF_LINK_H */
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 69022d4..c2ba8d4 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -686,6 +686,10 @@ struct netdev_rx_queue {
* int (*ndo_set_vf_tx_rate)(struct net_device *dev, int vf, int rate);
* int (*ndo_get_vf_config)(struct net_device *dev,
* int vf, struct ifla_vf_info *ivf);
+ * int (*ndo_set_vf_port)(struct net_device *dev, int vf,
+ * struct nlattr *vf_port[]);
+ * int (*ndo_get_vf_port)(struct net_device *dev, int vf,
+ * struct sk_buff *skb);
*/
#define HAVE_NET_DEVICE_OPS
struct net_device_ops {
@@ -735,6 +739,12 @@ struct net_device_ops {
int (*ndo_get_vf_config)(struct net_device *dev,
int vf,
struct ifla_vf_info *ivf);
+ int (*ndo_set_vf_port)(struct net_device *dev,
+ int vf,
+ struct nlattr *vf_port[]);
+ int (*ndo_get_vf_port)(struct net_device *dev,
+ int vf,
+ struct sk_buff *skb);
#if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE)
int (*ndo_fcoe_enable)(struct net_device *dev);
int (*ndo_fcoe_disable)(struct net_device *dev);
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 23a71cb..1e9a896 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -653,6 +653,26 @@ static inline int rtnl_vfinfo_size(const struct net_device *dev)
return 0;
}
+static size_t rtnl_vf_port_size(const struct net_device *dev)
+{
+ size_t vf_port_size = nla_total_size(sizeof(struct nlattr))
+ /* VF_PORT_VF */
+ + nla_total_size(VF_PORT_PROFILE_MAX)/* VF_PORT_PROFILE */
+ + nla_total_size(sizeof(struct ifla_vf_port_vsi))
+ /* VF_PORT_VSI_TYPE */
+ + nla_total_size(VF_PORT_UUID_MAX) /* VF_PORT_VSI_INSTANCE */
+ + nla_total_size(VF_PORT_UUID_MAX) /* VF_PORT_HOST_UUID */
+ + nla_total_size(1) /* VF_PROT_VDP_REQUEST */
+ + nla_total_size(2); /* VF_PORT_VDP_RESPONSE */
+
+ if (!dev->netdev_ops->ndo_get_vf_port || !dev->dev.parent)
+ return 0;
+ if (dev_num_vf(dev->dev.parent))
+ return vf_port_size * dev_num_vf(dev->dev.parent);
+ else
+ return vf_port_size;
+}
+
static inline size_t if_nlmsg_size(const struct net_device *dev)
{
return NLMSG_ALIGN(sizeof(struct ifinfomsg))
@@ -673,9 +693,61 @@ static inline size_t if_nlmsg_size(const struct net_device *dev)
+ nla_total_size(1) /* IFLA_LINKMODE */
+ nla_total_size(4) /* IFLA_NUM_VF */
+ nla_total_size(rtnl_vfinfo_size(dev)) /* IFLA_VFINFO */
+ + rtnl_vf_port_size(dev) /* IFLA_VF_PORT */
+ rtnl_link_get_size(dev); /* IFLA_LINKINFO */
}
+static int rtnl_vf_port_fill_nest(struct sk_buff *skb, struct net_device *dev,
+ int vf)
+{
+ struct nlattr *data;
+ int err;
+
+ data = nla_nest_start(skb, IFLA_VF_PORT);
+ if (!data)
+ return -EMSGSIZE;
+
+ if (vf != VF_PORT_VF_NOT_USED)
+ nla_put_u32(skb, IFLA_VF_PORT_VF, vf);
+
+ err = dev->netdev_ops->ndo_get_vf_port(dev, vf, skb);
+ if (err) {
+ nla_nest_cancel(skb, data);
+ return err;
+ }
+
+ nla_nest_end(skb, data);
+
+ return 0;
+}
+
+static int rtnl_vf_port_fill(struct sk_buff *skb, struct net_device *dev)
+{
+ int num_vf;
+ int err;
+
+ if (!dev->netdev_ops->ndo_get_vf_port || !dev->dev.parent)
+ return 0;
+
+ num_vf = dev_num_vf(dev->dev.parent);
+
+ if (num_vf) {
+ int i;
+
+ for (i = 0; i < num_vf; i++) {
+ err = rtnl_vf_port_fill_nest(skb, dev, i);
+ if (err)
+ return err;
+ }
+ } else {
+ err = rtnl_vf_port_fill_nest(skb, dev, VF_PORT_VF_NOT_USED);
+ if (err)
+ return err;
+ }
+
+ return 0;
+}
+
static int rtnl_fill_ifinfo(struct sk_buff *skb, struct net_device *dev,
int type, u32 pid, u32 seq, u32 change,
unsigned int flags)
@@ -747,17 +819,23 @@ static int rtnl_fill_ifinfo(struct sk_buff *skb, struct net_device *dev,
goto nla_put_failure;
copy_rtnl_link_stats64(nla_data(attr), stats);
+ if (dev->dev.parent)
+ NLA_PUT_U32(skb, IFLA_NUM_VF, dev_num_vf(dev->dev.parent));
+
if (dev->netdev_ops->ndo_get_vf_config && dev->dev.parent) {
int i;
struct ifla_vf_info ivi;
- NLA_PUT_U32(skb, IFLA_NUM_VF, dev_num_vf(dev->dev.parent));
for (i = 0; i < dev_num_vf(dev->dev.parent); i++) {
if (dev->netdev_ops->ndo_get_vf_config(dev, i, &ivi))
break;
NLA_PUT(skb, IFLA_VFINFO, sizeof(ivi), &ivi);
}
}
+
+ if (rtnl_vf_port_fill(skb, dev))
+ goto nla_put_failure;
+
if (dev->rtnl_link_ops) {
if (rtnl_link_fill(skb, dev) < 0)
goto nla_put_failure;
@@ -824,6 +902,7 @@ const struct nla_policy ifla_policy[IFLA_MAX+1] = {
.len = sizeof(struct ifla_vf_vlan) },
[IFLA_VF_TX_RATE] = { .type = NLA_BINARY,
.len = sizeof(struct ifla_vf_tx_rate) },
+ [IFLA_VF_PORT] = { .type = NLA_NESTED },
};
EXPORT_SYMBOL(ifla_policy);
@@ -832,6 +911,20 @@ static const struct nla_policy ifla_info_policy[IFLA_INFO_MAX+1] = {
[IFLA_INFO_DATA] = { .type = NLA_NESTED },
};
+static const struct nla_policy ifla_vf_port_policy[IFLA_VF_PORT_MAX+1] = {
+ [IFLA_VF_PORT_VF] = { .type = NLA_U32 },
+ [IFLA_VF_PORT_PROFILE] = { .type = NLA_STRING,
+ .len = VF_PORT_PROFILE_MAX },
+ [IFLA_VF_PORT_VSI_TYPE] = { .type = NLA_BINARY,
+ .len = sizeof(struct ifla_vf_port_vsi)},
+ [IFLA_VF_PORT_INSTANCE_UUID]= { .type = NLA_BINARY,
+ .len = VF_PORT_UUID_MAX },
+ [IFLA_VF_PORT_HOST_UUID] = { .type = NLA_STRING,
+ .len = VF_PORT_UUID_MAX },
+ [IFLA_VF_PORT_REQUEST] = { .type = NLA_U8, },
+ [IFLA_VF_PORT_RESPONSE] = { .type = NLA_U16, },
+};
+
struct net *rtnl_link_get_net(struct net *src_net, struct nlattr *tb[])
{
struct net *net;
@@ -1028,6 +1121,27 @@ static int do_setlink(struct net_device *dev, struct ifinfomsg *ifm,
}
err = 0;
+ if (tb[IFLA_VF_PORT]) {
+ struct nlattr *vf_port[IFLA_VF_PORT_MAX+1];
+ int vf = VF_PORT_VF_NOT_USED;
+
+ err = nla_parse_nested(vf_port, IFLA_VF_PORT_MAX,
+ tb[IFLA_VF_PORT], ifla_vf_port_policy);
+ if (err < 0)
+ goto errout;
+
+ if (vf_port[IFLA_VF_PORT_VF])
+ vf = nla_get_u32(vf_port[IFLA_VF_PORT_VF]);
+
+ err = -EOPNOTSUPP;
+ if (ops->ndo_set_vf_port)
+ err = ops->ndo_set_vf_port(dev, vf, vf_port);
+ if (err < 0)
+ goto errout;
+ modified = 1;
+ }
+ err = 0;
+
errout:
if (err < 0 && modified && net_ratelimit())
printk(KERN_WARNING "A link change request failed with "
^ permalink raw reply related
* [net-next-2.6 V7 PATCH 0/2] Add virtual port netlink support
From: Scott Feldman @ 2010-05-14 1:35 UTC (permalink / raw)
To: davem; +Cc: netdev, chrisw, arnd, kaber
[resend with fixes for these items from Patrick McHardy: 1) add #define to
ignore VF num, 2) whitespace cleanup of IFLA_VF_PORT policy list, 3) clean
up err handling for ndo_get_vf_port call]
The following series adds virtual port netlink support and adds an
implementation to Cisco's enic netdev driver:
1/2: Adds virtual netlink RTM_SETLINK/RTM_GETLINK support, and
adds matching netdev ops net_{set|get}_vf_port.
2/2: Adds enic support for net_{set|get}_vf_port for enic
dynamic devices.
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Scott Feldman <scofeldm@cisco.com>
Signed-off-by: Roopa Prabhu<roprabhu@cisco.com>
^ permalink raw reply
* [net-next-2.6 PATCH 3/3] ixgb and e1000: Use new function for copybreak tests
From: Jeff Kirsher @ 2010-05-14 1:26 UTC (permalink / raw)
To: davem; +Cc: netdev, gospo, Joe Perches, Jeff Kirsher
In-Reply-To: <20100514012425.30457.23799.stgit@localhost.localdomain>
From: Joe Perches <joe@perches.com>
There appears to be an off-by-1 defect in the maximum packet size
copied when copybreak is speified in these modules.
The copybreak module params are specified as:
"Maximum size of packet that is copied to a new buffer on receive"
The tests are changed from "< copybreak" to "<= copybreak"
and moved into new static functions for readability.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/e1000/e1000_main.c | 47 +++++++++++++++++++++---------------
drivers/net/ixgb/ixgb_main.c | 52 ++++++++++++++++++++++++----------------
2 files changed, 58 insertions(+), 41 deletions(-)
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index e9b19f7..b56eda0 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -3787,6 +3787,31 @@ next_desc:
return cleaned;
}
+/*
+ * this should improve performance for small packets with large amounts
+ * of reassembly being done in the stack
+ */
+static void e1000_check_copybreak(struct net_device *netdev,
+ struct e1000_buffer *buffer_info,
+ u32 length, struct sk_buff **skb)
+{
+ struct sk_buff *new_skb;
+
+ if (length > copybreak)
+ return;
+
+ new_skb = netdev_alloc_skb_ip_align(netdev, length);
+ if (!new_skb)
+ return;
+
+ skb_copy_to_linear_data_offset(new_skb, -NET_IP_ALIGN,
+ (*skb)->data - NET_IP_ALIGN,
+ length + NET_IP_ALIGN);
+ /* save the skb in buffer_info as good */
+ buffer_info->skb = *skb;
+ *skb = new_skb;
+}
+
/**
* e1000_clean_rx_irq - Send received data up the network stack; legacy
* @adapter: board private structure
@@ -3885,26 +3910,8 @@ static bool e1000_clean_rx_irq(struct e1000_adapter *adapter,
total_rx_bytes += length;
total_rx_packets++;
- /* code added for copybreak, this should improve
- * performance for small packets with large amounts
- * of reassembly being done in the stack */
- if (length < copybreak) {
- struct sk_buff *new_skb =
- netdev_alloc_skb_ip_align(netdev, length);
- if (new_skb) {
- skb_copy_to_linear_data_offset(new_skb,
- -NET_IP_ALIGN,
- (skb->data -
- NET_IP_ALIGN),
- (length +
- NET_IP_ALIGN));
- /* save the skb in buffer_info as good */
- buffer_info->skb = skb;
- skb = new_skb;
- }
- /* else just continue with the old one */
- }
- /* end copybreak code */
+ e1000_check_copybreak(netdev, buffer_info, length, &skb);
+
skb_put(skb, length);
/* Receive Checksum Offload */
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
index d58ca6b..c6b75c8 100644
--- a/drivers/net/ixgb/ixgb_main.c
+++ b/drivers/net/ixgb/ixgb_main.c
@@ -1921,6 +1921,31 @@ ixgb_rx_checksum(struct ixgb_adapter *adapter,
}
}
+/*
+ * this should improve performance for small packets with large amounts
+ * of reassembly being done in the stack
+ */
+static void ixgb_check_copybreak(struct net_device *netdev,
+ struct ixgb_buffer *buffer_info,
+ u32 length, struct sk_buff **skb)
+{
+ struct sk_buff *new_skb;
+
+ if (length > copybreak)
+ return;
+
+ new_skb = netdev_alloc_skb_ip_align(netdev, length);
+ if (!new_skb)
+ return;
+
+ skb_copy_to_linear_data_offset(new_skb, -NET_IP_ALIGN,
+ (*skb)->data - NET_IP_ALIGN,
+ length + NET_IP_ALIGN);
+ /* save the skb in buffer_info as good */
+ buffer_info->skb = *skb;
+ *skb = new_skb;
+}
+
/**
* ixgb_clean_rx_irq - Send received data up the network stack,
* @adapter: board private structure
@@ -1957,11 +1982,14 @@ ixgb_clean_rx_irq(struct ixgb_adapter *adapter, int *work_done, int work_to_do)
prefetch(skb->data - NET_IP_ALIGN);
- if (++i == rx_ring->count) i = 0;
+ if (++i == rx_ring->count)
+ i = 0;
next_rxd = IXGB_RX_DESC(*rx_ring, i);
prefetch(next_rxd);
- if ((j = i + 1) == rx_ring->count) j = 0;
+ j = i + 1;
+ if (j == rx_ring->count)
+ j = 0;
next2_buffer = &rx_ring->buffer_info[j];
prefetch(next2_buffer);
@@ -1997,25 +2025,7 @@ ixgb_clean_rx_irq(struct ixgb_adapter *adapter, int *work_done, int work_to_do)
goto rxdesc_done;
}
- /* code added for copybreak, this should improve
- * performance for small packets with large amounts
- * of reassembly being done in the stack */
- if (length < copybreak) {
- struct sk_buff *new_skb =
- netdev_alloc_skb_ip_align(netdev, length);
- if (new_skb) {
- skb_copy_to_linear_data_offset(new_skb,
- -NET_IP_ALIGN,
- (skb->data -
- NET_IP_ALIGN),
- (length +
- NET_IP_ALIGN));
- /* save the skb in buffer_info as good */
- buffer_info->skb = skb;
- skb = new_skb;
- }
- }
- /* end copybreak code */
+ ixgb_check_copybreak(netdev, buffer_info, length, &skb);
/* Good Receive */
skb_put(skb, length);
^ permalink raw reply related
* [net-next-2.6 PATCH 2/3] e1000: cleanup unused parameters
From: Jeff Kirsher @ 2010-05-14 1:25 UTC (permalink / raw)
To: davem; +Cc: netdev, gospo, Jesse Brandeburg, Jeff Kirsher
In-Reply-To: <20100514012425.30457.23799.stgit@localhost.localdomain>
From: Jesse Brandeburg <jesse.brandeburg@intel.com>
During the cleanup pass after the removal of e1000e hardware from e1000 some
parameters were missed. Remove them because it is just dead code.
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/e1000/e1000_param.c | 8 --------
1 files changed, 0 insertions(+), 8 deletions(-)
diff --git a/drivers/net/e1000/e1000_param.c b/drivers/net/e1000/e1000_param.c
index 9fbb562..10d8d98 100644
--- a/drivers/net/e1000/e1000_param.c
+++ b/drivers/net/e1000/e1000_param.c
@@ -188,14 +188,6 @@ E1000_PARAM(InterruptThrottleRate, "Interrupt Throttling Rate");
*/
E1000_PARAM(SmartPowerDownEnable, "Enable PHY smart power down");
-/* Enable Kumeran Lock Loss workaround
- *
- * Valid Range: 0, 1
- *
- * Default Value: 1 (enabled)
- */
-E1000_PARAM(KumeranLockLoss, "Enable Kumeran lock loss workaround");
-
struct e1000_option {
enum { enable_option, range_option, list_option } type;
const char *name;
^ permalink raw reply related
* [net-next-2.6 PATCH 1/3] e1000: fix WARN_ON with mac-vlan
From: Jeff Kirsher @ 2010-05-14 1:25 UTC (permalink / raw)
To: davem; +Cc: netdev, gospo, Jiri Pirko, Jesse Brandeburg, Jeff Kirsher
From: Jesse Brandeburg <jesse.brandeburg@intel.com>
When adding more than 14 mac-vlan adapters on e1000 the driver
would fire a WARN_ON when adding the 15th. The WARN_ON in this
case is completely un-necessary, as the code below the WARN_ON is
directly handling the value the WARN_ON triggered on.
CC: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/e1000/e1000_main.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 4dd2c23..e9b19f7 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -2161,8 +2161,6 @@ static void e1000_set_rx_mode(struct net_device *netdev)
e1000_rar_set(hw, ha->addr, i++);
}
- WARN_ON(i == rar_entries);
-
netdev_for_each_mc_addr(ha, netdev) {
if (i == rar_entries) {
/* load any remaining addresses into the hash table */
^ permalink raw reply related
* PF_PACKET + bind() to proto + outbound packets
From: Paul LeoNerd Evans @ 2010-05-14 1:14 UTC (permalink / raw)
To: netdev
[-- Attachment #1: Type: text/plain, Size: 868 bytes --]
I'm writing a small traffic watching program, to capture IPv4 packets.
If I have a PF_PACKET socket bound to no particular protocol it sees
both inbound and outbound packets; I can then apply a BPF filter for
just one protocol (i.e. IPv4).
But if instead I bind the socket to the IPv4 protocol specifically, it
no longer sees any outbound packets created by the machine, only inbound
ones.
Is there perhaps some ioctl or sockopt I could enable, to see these
outbound packets too?
Further, would there actually be much difference in practice, in terms
of performance, abilities, etc... even if this were an option turned on?
What's the preferred method of snooping on all of the machine's, for
example, IPv4 traffic?
--
Paul "LeoNerd" Evans
leonerd@leonerd.org.uk
ICQ# 4135350 | Registered Linux# 179460
http://www.leonerd.org.uk/
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 190 bytes --]
^ permalink raw reply
* Re: Question about vlans, bonding, etc.
From: Stephen Hemminger @ 2010-05-14 1:12 UTC (permalink / raw)
To: George B.; +Cc: Eric Dumazet, netdev
In-Reply-To: <AANLkTikVJqN6m5nsJsFSNHS_HbOFyt0hGr_8MHu6tWDR@mail.gmail.com>
On Thu, 13 May 2010 18:10:33 -0700
"George B." <georgeb@gmail.com> wrote:
> vlan5 on the second interface, vconfig balks that it already exists.
vconfig is stupid. use 'ip link'
--
^ permalink raw reply
* Re: Question about vlans, bonding, etc.
From: George B. @ 2010-05-14 1:10 UTC (permalink / raw)
To: Eric Dumazet; +Cc: netdev
In-Reply-To: <1272948506.2407.174.camel@edumazet-laptop>
On Mon, May 3, 2010 at 9:48 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> Le lundi 03 mai 2010 à 17:06 -0700, George B. a écrit :
>> Watching the "Receive issues with bonding and vlans" thread brought a
>> question to mind. In what order should things be done for best
>> performance?
>>
>> For example, say I have a pair of ethernet interfaces. Do I slave the
>> ethernet interfaces to the bond device and then make the vlans on the
>> bond devices?
>> Or do I make the vlans on the ethernet devices and then bond the vlan
>> interfaces?
>>
>> In the first case I would have:
>>
>>
>>
>> bond0.3--| |------eth0
>> bond0
>> bond0.5--| |------eth1
>>
>> The second case would be:
>>
>> |------------------eth0.5-----|
>> | |-------eth0.3---eth0
>> bond0 bond1
>> | |-------eth1.3---eth1
>> |------------------eth1.5-----|
>>
>> I am using he first method currently as it seemed more intuitive to me
>> at the time to bond the ethernets and then put the vlans on the bonds
>> but it seems life might be easier for the vlan driver if it is bound
>> directly to the hardware. I am using Intel NICs (igb driver) with 4
>> queues per NIC.
>>
>> Would there be a performance difference expected between the two
>> configurations? Can the vlan driver "see through" the bond interface
>> to the
>> hardware and take advantage of multiple queues if the hardware
>> supports it in the first configuration?
>
> Unfortunatly, first combination is not multiqueue aware yet.
>
> You'll need to patch bonding driver like this if your nics have 4
> queues :
>
> diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
> index 85e813c..98cc3c0 100644
> --- a/drivers/net/bonding/bond_main.c
> +++ b/drivers/net/bonding/bond_main.c
> @@ -4915,8 +4915,8 @@ int bond_create(struct net *net, const char *name)
>
> rtnl_lock();
>
> - bond_dev = alloc_netdev(sizeof(struct bonding), name ? name : "",
> - bond_setup);
> + bond_dev = alloc_netdev_mq(sizeof(struct bonding), name ? name : "",
> + bond_setup, 4);
> if (!bond_dev) {
> pr_err("%s: eek! can't alloc netdev!\n", name);
> rtnl_unlock();
>
>
>
I just got around to fooling with this some. It would seem to me that
I should be able to get better performance if I could create the vlans
on the ethernet interfaces and then bond them together. For example,
it seems intuitive that I should be able to create vlan eth0.5 and
eth1.5 and then enslave them. Problem is that when I try to create
vlan5 on the second interface, vconfig balks that it already exists.
Yes, I know it exists, but I want vlan5 on two interfaces and I want
to use ifenslave to bond them together into a bond interface. So if I
have 10 vlans, I would have 10 vlans on each ethernet interface and 10
bond interfaces. The way it seems I am forced to do it now is bond
the two NICs together and add all the vlans to the single bond
interface. It seems that the bond interface would then become a
bottleneck for all the vlans.
Is there some physical reason why it is not possible to create the
same vlan on multiple interfaces as long as the naming convention
keeps them named separately so they can be distinguished from each
other?
^ permalink raw reply
* RE: does the broadcom bnx2x support RSS/multi queue
From: Jon Zhou @ 2010-05-14 1:03 UTC (permalink / raw)
To: eilong@broadcom.com; +Cc: Eric Dumazet, netdev@vger.kernel.org
In-Reply-To: <1273750340.1423.2.camel@lb-tlvb-eilong.il.broadcom.com>
hi eilon:
I got these log when applied debug=0x20,why " MSI is not attainable"?
thanks
May 13 18:53:26 ibm-bc-53 kernel: Broadcom NetXtreme II 5771x 10Gigabit Ethernet
Driver bnx2x 1.52.12 ($DateTime: 2009/12/17 12:14:50 $)
May 13 18:53:26 ibm-bc-53 kernel: bnx2x 0000:15:00.0: PCI INT A -> GSI 24 (level
, low) -> IRQ 24
May 13 18:53:26 ibm-bc-53 kernel: bnx2x 0000:15:00.0: setting latency timer to 6
4
May 13 18:53:26 ibm-bc-53 kernel: bnx2x: part number 394D4342-31373735-31314131-
473033
May 13 18:53:26 ibm-bc-53 kernel: eth2: Broadcom NetXtreme II BCM57711 XGb (A0)
PCI-E x8 5GHz (Gen2) found at mem a0000000, IRQ 24, node addr ffff8801db9b0210
May 13 18:53:26 ibm-bc-53 kernel: bnx2x 0000:15:00.1: PCI INT B -> GSI 34 (level
, low) -> IRQ 34
May 13 18:53:26 ibm-bc-53 kernel: bnx2x 0000:15:00.1: setting latency timer to 6
4
May 13 18:53:26 ibm-bc-53 kernel: eth2 renamed to eth3 by udevd [30749]
May 13 18:53:26 ibm-bc-53 kernel: bnx2x: part number 394D4342-31373735-31314131-
473033
May 13 18:53:26 ibm-bc-53 kernel: udev: renamed network interface eth2 to eth3
May 13 18:53:26 ibm-bc-53 ifup: eth3 device: Broadcom Corporation NetXt
reme II BCM57711 10Gigabit PCIe
May 13 18:53:26 ibm-bc-53 SuSEfirewall2: SuSEfirewall2 not active
May 13 18:53:26 ibm-bc-53 kernel: eth2: Broadcom NetXtreme II BCM57711 XGb (A0)
PCI-E x8 5GHz (Gen2) found at mem a0800000, IRQ 34, node addr ffff8801db9a8210
May 13 18:53:26 ibm-bc-53 kernel: bnx2x 0000:1a:00.0: PCI INT A -> GSI 26 (level
, low) -> IRQ 26
May 13 18:53:26 ibm-bc-53 kernel: bnx2x 0000:1a:00.0: setting latency timer to 6
4
May 13 18:53:26 ibm-bc-53 kernel: eth2 renamed to eth5 by udevd [30822]
May 13 18:53:26 ibm-bc-53 kernel: bnx2x: part number 394D4342-31373735-31314131-
473033
May 13 18:53:26 ibm-bc-53 kernel: udev: renamed network interface eth2 to eth5
May 13 18:53:27 ibm-bc-53 ifup: eth5 device: Broadcom Corporation NetXt
reme II BCM57711 10Gigabit PCIe
May 13 18:53:27 ibm-bc-53 ifup: eth5 Startmode is 'off'
May 13 18:53:27 ibm-bc-53 kernel: eth2: Broadcom NetXtreme II BCM57711 XGb (A0)
PCI-E x8 5GHz (Gen2) found at mem 9a000000, IRQ 26, node addr ffff880203c18210
May 13 18:53:27 ibm-bc-53 kernel: bnx2x 0000:1a:00.1: PCI INT B -> GSI 25 (level
, low) -> IRQ 25
May 13 18:53:27 ibm-bc-53 kernel: bnx2x 0000:1a:00.1: setting latency timer to 6
4
May 13 18:53:27 ibm-bc-53 kernel: bnx2x: part number 394D4342-31373735-31314131-
473033
May 13 18:53:27 ibm-bc-53 ifup: eth2 device: Broadcom Corporation NetXt
reme II BCM57711 10Gigabit PCIe
May 13 18:53:27 ibm-bc-53 SuSEfirewall2: SuSEfirewall2 not active
May 13 18:53:27 ibm-bc-53 kernel: eth4: Broadcom NetXtreme II BCM57711 XGb (A0)
PCI-E x8 5GHz (Gen2) found at mem 9a800000, IRQ 25, node addr ffff8801f7940210
May 13 18:53:27 ibm-bc-53 ifup: eth4 device: Broadcom Corporation NetXt
reme II BCM57711 10Gigabit PCIe
May 13 18:53:27 ibm-bc-53 SuSEfirewall2: SuSEfirewall2 not active
May 13 18:54:05 ibm-bc-53 kernel: [bnx2x_set_num_queues:8134(eth5)]set number of queues to 4
May 13 18:54:05 ibm-bc-53 kernel: [bnx2x_enable_msix:7625(eth5)]msix_table[0].entry = 0 (slowpath)
May 13 18:54:05 ibm-bc-53 kernel: [bnx2x_enable_msix:7630(eth5)]msix_table[1].entry = 1 (CNIC)
May 13 18:54:05 ibm-bc-53 kernel: [bnx2x_enable_msix:7637(eth5)]msix_table[2].entry = 2 (fastpath #0)
May 13 18:54:05 ibm-bc-53 kernel: [bnx2x_enable_msix:7637(eth5)]msix_table[3].entry = 3 (fastpath #1)
May 13 18:54:05 ibm-bc-53 kernel: [bnx2x_enable_msix:7637(eth5)]msix_table[4].entry = 4 (fastpath #2)
May 13 18:54:05 ibm-bc-53 kernel: [bnx2x_enable_msix:7637(eth5)]msix_table[5].entry = 5 (fastpath #3)
May 13 18:54:05 ibm-bc-53 kernel: [bnx2x_enable_msix:7667(eth5)]MSI-X is not attainable rc -28
May 13 18:54:05 ibm-bc-53 kernel: [bnx2x_enable_msi:7726(eth5)]MSI is not attainable
May 13 18:54:05 ibm-bc-53 kernel: [bnx2x_nic_init:6148(eth5)]queue[0]: bnx2x_init_sb(ffff8801db9a8780,ffff8801d70fc000) cl_id 0 sb 1 cos 0
May 13 18:54:05 ibm-bc-53 kernel: [bnx2x_init_rx_rings:5386(eth5)]mtu 1500 rx_buf_size 1650
May 13 18:54:05 ibm-bc-53 kernel: [bnx2x_set_storm_rx_mode:5753(eth5)]rx mode 0 mask 0x1
May 13 18:54:05 ibm-bc-53 kernel: [bnx2x_init_internal_func:6061(eth5)]All MIN values are zeroes fairness will be disabled
May 13 18:54:05 ibm-bc-53 kernel: [bnx2x_init_ind_table:5688(eth5)]Initializing indirection table multi_mode 1
May 13 18:54:06 ibm-bc-53 kernel: [bnx2x_wait_ramrod:7941(eth5)]waiting for state to become 3000 on IDX [0]
May 13 18:54:06 ibm-bc-53 kernel: [bnx2x_sp_event:1191(eth5)]got setup ramrod
May 13 18:54:06 ibm-bc-53 kernel: [bnx2x_set_mac_addr_e1h_gen:7927(eth5)]setting MAC (001a:6476:0367) E1HOV 0 CLID mask 1
May 13 18:54:06 ibm-bc-53 kernel: [bnx2x_wait_ramrod:7941(eth5)]waiting for state to become 0 on IDX [0]
May 13 18:54:06 ibm-bc-53 kernel: [bnx2x_sp_event:1215(eth5)]got set mac ramrod
May 13 18:54:06 ibm-bc-53 kernel: [bnx2x_set_rx_mode:12833(eth5)]dev->flags = 1002
May 13 18:54:06 ibm-bc-53 kernel: [bnx2x_set_storm_rx_mode:5753(eth5)]rx mode 1 mask 0x1
May 13 18:54:06 ibm-bc-53 kernel: [bnx2x_set_rx_mode:12833(eth5)]dev->flags = 1003
May 13 18:54:06 ibm-bc-53 kernel: [bnx2x_set_storm_rx_mode:5753(eth5)]rx mode 1 mask 0x1
May 13 18:54:06 ibm-bc-53 kernel: [bnx2x_set_rx_mode:12833(eth5)]dev->flags = 1003
May 13 18:54:06 ibm-bc-53 kernel: [bnx2x_set_rx_mode:12927(eth5)]Adding mcast MAC: ffff8803f58a4c08
May 13 18:54:06 ibm-bc-53 kernel: [bnx2x_set_storm_rx_mode:5753(eth5)]rx mode 1 mask 0x1
May 13 18:54:06 ibm-bc-53 kernel: [bnx2x_set_rx_mode:12833(eth5)]dev->flags = 1003
May 13 18:54:06 ibm-bc-53 kernel: [bnx2x_set_rx_mode:12927(eth5)]Adding mcast MAC: ffff8803f58a4c08
May 13 18:54:06 ibm-bc-53 kernel: [bnx2x_set_storm_rx_mode:5753(eth5)]rx mode 1 mask 0x1
May 13 18:54:06 ibm-bc-53 kernel: bnx2x: eth5 NIC Link is Up, 10000 Mbps full duplex, receive & transmit flow control ON
-----Original Message-----
From: Eilon Greenstein [mailto:eilong@broadcom.com]
Sent: Thursday, May 13, 2010 7:32 PM
To: Jon Zhou
Cc: Eric Dumazet; netdev@vger.kernel.org
Subject: RE: does the broadcom bnx2x support RSS/multi queue
On Thu, 2010-05-13 at 02:44 -0700, Jon Zhou wrote:
> insmod ./PF_RING/drivers/broadcom/netxtreme2-5.2.50/bnx2x-1.52.12/src/bnx2x.ko multi_mode=1 num_queues=4 int_mode=3 debug=1
There is no need to set multi_mode or int_mode - you are using the
default values. However, I need more information on why you are using
INTA and not MSI-X, so please set the debug to 0x20
> but seems MSI not enabled:
> 34: 26 0 0 0 0 0 0 0 0 0 0 0 49470611 63427140 0 0 IO-APIC-fasteoi eth5
Indeed, you are using INT# - this is why you do not have multi-queue.
Eilon
^ permalink raw reply
* [PATCH] sctp: fix append error cause to ERROR chunk correctly
From: Wei Yongjun @ 2010-05-14 0:37 UTC (permalink / raw)
To: David Miller
Cc: Vlad Yasevich, Neil Horman, linux-sctp, Eugene Teo,
netdev@vger.kernel.org
In-Reply-To: <4BEC00B2.6000705@hp.com>
commit 5fa782c2f5ef6c2e4f04d3e228412c9b4a4c8809
sctp: Fix skb_over_panic resulting from multiple invalid \
parameter errors (CVE-2010-1173) (v4)
cause 'error cause' never be add the the ERROR chunk due to
some typo when check valid length in sctp_init_cause_fixed().
Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Reviewed-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Vlad Yasevich <vladislav.yasevich@hp.com>
---
net/sctp/sm_make_chunk.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index 30c1767..70d6c10 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -141,7 +141,7 @@ int sctp_init_cause_fixed(struct sctp_chunk *chunk, __be16 cause_code,
len = sizeof(sctp_errhdr_t) + paylen;
err.length = htons(len);
- if (skb_tailroom(chunk->skb) > len)
+ if (skb_tailroom(chunk->skb) < len)
return -ENOSPC;
chunk->subh.err_hdr = sctp_addto_chunk_fixed(chunk,
sizeof(sctp_errhdr_t),
@@ -1421,7 +1421,7 @@ void *sctp_addto_chunk(struct sctp_chunk *chunk, int len, const void *data)
void *sctp_addto_chunk_fixed(struct sctp_chunk *chunk,
int len, const void *data)
{
- if (skb_tailroom(chunk->skb) > len)
+ if (skb_tailroom(chunk->skb) >= len)
return sctp_addto_chunk(chunk, len, data);
else
return NULL;
--
1.6.5.2
^ permalink raw reply related
* [PATCH] netfilter: Remove skb_is_nonlinear check from nf_conntrack_sip
From: Jason Gunthorpe @ 2010-05-14 0:38 UTC (permalink / raw)
To: netfilter-devel, netdev
At least the XEN net front driver always produces non linear skbs,
so the SIP module does nothing at all when used with that NIC.
Copy the hacky technique for accessing SKB data from the ftp conntrack,
better than nothing..
Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
---
net/netfilter/nf_conntrack_sip.c | 21 ++++++++++++++-------
1 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/net/netfilter/nf_conntrack_sip.c b/net/netfilter/nf_conntrack_sip.c
index 4b57216..37dd7a4 100644
--- a/net/netfilter/nf_conntrack_sip.c
+++ b/net/netfilter/nf_conntrack_sip.c
@@ -30,6 +30,10 @@ MODULE_DESCRIPTION("SIP connection tracking helper");
MODULE_ALIAS("ip_conntrack_sip");
MODULE_ALIAS_NFCT_HELPER("sip");
+/* This is slow, but it's simple. --RR */
+static char *sip_buffer;
+static DEFINE_SPINLOCK(nf_sip_lock);
+
#define MAX_PORTS 8
static unsigned short ports[MAX_PORTS];
static unsigned int ports_c;
@@ -1275,17 +1279,14 @@ static int sip_help(struct sk_buff *skb,
nf_ct_refresh(ct, skb, sip_timeout * HZ);
- if (!skb_is_nonlinear(skb))
- dptr = skb->data + dataoff;
- else {
- pr_debug("Copy of skbuff not supported yet.\n");
- return NF_ACCEPT;
- }
-
datalen = skb->len - dataoff;
if (datalen < strlen("SIP/2.0 200"))
return NF_ACCEPT;
+ spin_lock_bh(&nf_sip_lock);
+ dptr = skb_header_pointer(skb, dataoff, datalen, sip_buffer);
+ BUG_ON(dptr == NULL);
+
if (strnicmp(dptr, "SIP/2.0 ", strlen("SIP/2.0 ")) != 0)
ret = process_sip_request(skb, &dptr, &datalen);
else
@@ -1297,6 +1298,7 @@ static int sip_help(struct sk_buff *skb,
ret = NF_DROP;
}
+ spin_unlock_bh(&nf_sip_lock);
return ret;
}
@@ -1329,6 +1331,7 @@ static void nf_conntrack_sip_fini(void)
nf_conntrack_helper_unregister(&sip[i][j]);
}
}
+ kfree(sip_buffer);
}
static int __init nf_conntrack_sip_init(void)
@@ -1336,6 +1339,10 @@ static int __init nf_conntrack_sip_init(void)
int i, j, ret;
char *tmpname;
+ sip_buffer = kmalloc(65536, GFP_KERNEL);
+ if (!sip_buffer)
+ return -ENOMEM;
+
if (ports_c == 0)
ports[ports_c++] = SIP_PORT;
--
1.6.0.4
^ permalink raw reply related
* Re: [PATCH 2/2] ioat2,3: convert to producer/consumer locking
From: Dan Williams @ 2010-05-13 23:42 UTC (permalink / raw)
To: David Howells
Cc: linux-kernel, linux-raid, netdev, Paul E. McKenney,
Maciej Sosnowski
In-Reply-To: <31229.1273653365@redhat.com>
On Wed, May 12, 2010 at 1:36 AM, David Howells <dhowells@redhat.com> wrote:
>
> Out of interest, does it make the code smaller if you mark
> ioat2_get_ring_ent() and ioat2_ring_mask() with __attribute_const__?
>
> I'm not sure whether it'll affect how long gcc is willing to cache these, but
> once computed, I would guess they won't change within the calling function.
Unfortunately, it does not make a difference, but I'll keep this in
mind if ioat2_get_ring_ent() ever gets more complicated (which it
might in the future).
> Also, is the device you're driving watching the ring and its indices? If so,
> does it modify the indices? If that is the case, you might need to use
> read_barrier_depends() rather than smp_read_barrier_depends().
The device does not observe the indices directly. Instead we
increment a free running 'count' register by the distance between
ioat->pending and ioat->head.
>
>> + prefetch(ioat2_get_ring_ent(ioat, idx + i + 1));
>> + desc = ioat2_get_ring_ent(ioat, idx + i);
>> dump_desc_dbg(ioat, desc);
>> tx = &desc->txd;
>> if (tx->cookie) {
>
> Is this right, I wonder? You're prefetching [i+1] before reading [i]? Doesn't
> this mean that you might have to wait for [i+1] to be retrieved from RAM before
> [i] can be read? Should you instead read tx->cookie before issuing the
> prefetch? Admittedly, this is only likely to affect the reading of the head of
> the queue - subsequent reads in the same loop will, of course, have been
> prefetched.
Yes, it should be the other way around.
Thanks!
--
Dan
^ permalink raw reply
* RE: [PATCH 2.6.34-rc6] net: Improve ks8851 snl transmit performance
From: Arce, Abraham @ 2010-05-13 23:39 UTC (permalink / raw)
To: Ha, Tristram, Ben Dooks
Cc: David Miller, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, Jan, Sebastien
In-Reply-To: <14385191E87B904DBD836449AA30269D021A66@MORGANITE.micrel.com>
Tristram,
> The latest nuttcp default size for UDP is 1500 bytes, rather than 8192 bytes.
> In my case, the transmit performance improves from 10 Mbps to 11. Have you
> tried TCP?
>
Not yet... one point to highlight before:
- SPI controller clock rate is 24 MHz, unable to set ~40 MHz,
Now testing in 2.6.34 rc7 using now TCP, nuttcp version 6.1.2:
Before the patch
# /testsuites/ethernet/bin/nuttcp -i -Ri50m 10.87.231.229
1.1460 MB / 1.00 sec = 9.6134 Mbps
1.1858 MB / 1.00 sec = 9.9473 Mbps
1.2258 MB / 1.00 sec = 10.2828 Mbps
1.1996 MB / 1.00 sec = 10.0628 Mbps
1.2203 MB / 1.00 sec = 10.2365 Mbps
1.2258 MB / 1.00 sec = 10.2828 Mbps
1.2134 MB / 1.00 sec = 10.1786 Mbps
1.2235 MB / 1.00 sec = 10.2636 Mbps
1.2134 MB / 1.00 sec = 10.1785 Mbps
1.2120 MB / 1.00 sec = 10.1670 Mbps
12.6250 MB / 10.46 sec = 10.1240 Mbps 2 %TX 0 %RX 0 retrans 7.91 msRTT
# /testsuites/ethernet/bin/nuttcp 10.87.231.229
12.9319 MB / 10.58 sec = 10.2553 Mbps 1 %TX 0 %RX 0 retrans 7.90 msRTT
After the patch
# /testsuites/ethernet/bin/nuttcp -i -Ri50m 10.87.231.229
1.1671 MB / 1.00 sec = 9.7902 Mbps
1.2169 MB / 1.00 sec = 10.2077 Mbps
1.2175 MB / 1.00 sec = 10.2134 Mbps
1.2396 MB / 1.00 sec = 10.3986 Mbps
1.2396 MB / 1.00 sec = 10.3987 Mbps
1.2387 MB / 1.00 sec = 10.3910 Mbps
1.2410 MB / 1.00 sec = 10.4102 Mbps
1.2203 MB / 1.00 sec = 10.2365 Mbps
1.2382 MB / 1.00 sec = 10.3871 Mbps
1.2369 MB / 1.00 sec = 10.3755 Mbps
12.8125 MB / 10.45 sec = 10.2820 Mbps 2 %TX 0 %RX 0 retrans 7.90 msRTT
# /testsuites/ethernet/bin/nuttcp 10.87.231.229
13.0808 MB / 10.64 sec = 10.3123 Mbps 1 %TX 0 %RX 0 retrans 7.90 msRTT
Best Regards
Abraham
^ permalink raw reply
* [PATCH 1/6] sky2: Restore multicast after restart
From: Stephen Hemminger @ 2010-05-13 16:12 UTC (permalink / raw)
To: David Miller, Mike McCormack; +Cc: netdev
In-Reply-To: <20100513161247.833356588@vyatta.com>
[-- Attachment #1: sky2-mike2.patch --]
[-- Type: text/plain, Size: 744 bytes --]
From: Mike McCormack <mikem@ring3k.org>
Multicast settings will be lost on reset, so restore them.
Signed-off-by: Mike McCormack <mikem@ring3k.org>
Acked-by: Stephen Hemminger <shemminger@vyatta.com>
---
This regression was introduced in 2.6.34 by
commit 8a0c9228f110218f443d9ef8f9ab629251959733
sky2: Avoid down and up during sky2_reset
So please apply to -net as well.
drivers/net/sky2.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
--- a/drivers/net/sky2.c 2010-05-13 09:02:37.756960274 -0700
+++ b/drivers/net/sky2.c 2010-05-13 09:02:53.528209351 -0700
@@ -3347,6 +3347,7 @@ static void sky2_restart(struct work_str
continue;
sky2_hw_up(sky2);
+ sky2_set_multicast(dev);
netif_wake_queue(dev);
}
^ permalink raw reply
* [PATCH 0/6] sky2: update
From: Stephen Hemminger @ 2010-05-13 16:12 UTC (permalink / raw)
To: David Miller, Mike McCormack; +Cc: netdev
Bunch of patches from Mike, with some additional comments.
^ permalink raw reply
* [PATCH 5/6] sky2: Avoid allocating memory in sky2_resume
From: Stephen Hemminger @ 2010-05-13 16:12 UTC (permalink / raw)
To: David Miller, Mike McCormack; +Cc: netdev
In-Reply-To: <20100513161247.833356588@vyatta.com>
[-- Attachment #1: sky2-mike5.patch --]
[-- Type: text/plain, Size: 1988 bytes --]
From: Mike McCormack <mikem@ring3k.org>
Allocating memory can fail, and since we have the memory we need
in sky2_resume when sky2_suspend is called, just stop the hardware
without freeing the memory it's using.
This avoids the possibility of failing because we can't allocate
memory in sky2_resume(), and allows sharing code with sky2_restart().
Signed-off-by: Mike McCormack <mikem@ring3k.org>
Acked-by: Stephen Hemminger <shemminger@vyatta.com>
---
Not a regression
drivers/net/sky2.c | 20 +++++---------------
1 files changed, 5 insertions(+), 15 deletions(-)
--- a/drivers/net/sky2.c 2010-05-13 08:57:33.337275609 -0700
+++ b/drivers/net/sky2.c 2010-05-13 08:57:33.907302370 -0700
@@ -4926,12 +4926,12 @@ static int sky2_suspend(struct pci_dev *
cancel_work_sync(&hw->restart_work);
rtnl_lock();
+
+ sky2_all_down(hw);
for (i = 0; i < hw->ports; i++) {
struct net_device *dev = hw->dev[i];
struct sky2_port *sky2 = netdev_priv(dev);
- sky2_detach(dev);
-
if (sky2->wol)
sky2_wol_init(sky2);
@@ -4940,8 +4940,6 @@ static int sky2_suspend(struct pci_dev *
device_set_wakeup_enable(&pdev->dev, wol != 0);
- sky2_write32(hw, B0_IMSK, 0);
- napi_disable(&hw->napi);
sky2_power_aux(hw);
rtnl_unlock();
@@ -4956,12 +4954,11 @@ static int sky2_suspend(struct pci_dev *
static int sky2_resume(struct pci_dev *pdev)
{
struct sky2_hw *hw = pci_get_drvdata(pdev);
- int i, err;
+ int err;
if (!hw)
return 0;
- rtnl_lock();
err = pci_set_power_state(pdev, PCI_D0);
if (err)
goto out;
@@ -4979,20 +4976,13 @@ static int sky2_resume(struct pci_dev *p
goto out;
}
+ rtnl_lock();
sky2_reset(hw);
- sky2_write32(hw, B0_IMSK, Y2_IS_BASE);
- napi_enable(&hw->napi);
-
- for (i = 0; i < hw->ports; i++) {
- err = sky2_reattach(hw->dev[i]);
- if (err)
- goto out;
- }
+ sky2_all_up(hw);
rtnl_unlock();
return 0;
out:
- rtnl_unlock();
dev_err(&pdev->dev, "resume failed (%d)\n", err);
pci_disable_device(pdev);
^ permalink raw reply
* [PATCH 3/6] sky2: Shut off interrupts before NAPI
From: Stephen Hemminger @ 2010-05-13 16:12 UTC (permalink / raw)
To: David Miller, Mike McCormack; +Cc: netdev
In-Reply-To: <20100513161247.833356588@vyatta.com>
[-- Attachment #1: sky2-mike3.patch --]
[-- Type: text/plain, Size: 749 bytes --]
From: Mike McCormack <mikem@ring3k.org>
Interrupts should be masked, then synchronized, and
finally NAPI should be disabled.
Signed-off-by: Mike McCormack <mikem@ring3k.org>
Acked-by: Stephen Hemminger <shemminger@vyatta.com>
---
Not a regression, only apply to -next
--- a/drivers/net/sky2.c 2010-05-13 08:57:31.127627401 -0700
+++ b/drivers/net/sky2.c 2010-05-13 08:57:32.736962641 -0700
@@ -3320,10 +3320,10 @@ static void sky2_restart(struct work_str
rtnl_lock();
- napi_disable(&hw->napi);
- synchronize_irq(hw->pdev->irq);
imask = sky2_read32(hw, B0_IMSK);
sky2_write32(hw, B0_IMSK, 0);
+ synchronize_irq(hw->pdev->irq);
+ napi_disable(&hw->napi);
for (i = 0; i < hw->ports; i++) {
struct net_device *dev = hw->dev[i];
^ permalink raw reply
* [PATCH 2/6] sky2: Avoid race in sky2_change_mtu
From: Stephen Hemminger @ 2010-05-13 16:12 UTC (permalink / raw)
To: David Miller, Mike McCormack; +Cc: netdev
In-Reply-To: <20100513161247.833356588@vyatta.com>
[-- Attachment #1: sky2-mike1.patch --]
[-- Type: text/plain, Size: 888 bytes --]
From: Mike McCormack <mikem@ring3k.org>
netif_stop_queue does not ensure all in-progress transmits are complete,
so use netif_tx_disable() instead.
Secondly, make sure NAPI polls are disabled before stopping the tx queue,
otherwise sky2_status_intr might trigger a TX queue wakeup between when
we stop the queue and NAPI is disabled.
Signed-off-by: Mike McCormack <mikem@ring3k.org>
Acked-by: Stephen Hemminger <shemminger@vyatta.com>
---
This is not a regression, so only apply to -next
--- a/drivers/net/sky2.c 2010-05-13 08:57:20.186332415 -0700
+++ b/drivers/net/sky2.c 2010-05-13 08:57:22.526983099 -0700
@@ -2275,8 +2275,8 @@ static int sky2_change_mtu(struct net_de
sky2_write32(hw, B0_IMSK, 0);
dev->trans_start = jiffies; /* prevent tx timeout */
- netif_stop_queue(dev);
napi_disable(&hw->napi);
+ netif_tx_disable(dev);
synchronize_irq(hw->pdev->irq);
^ permalink raw reply
* [PATCH 4/6] sky2: Refactor down/up code out of sky2_restart()
From: Stephen Hemminger @ 2010-05-13 16:12 UTC (permalink / raw)
To: David Miller, Mike McCormack; +Cc: netdev
In-Reply-To: <20100513161247.833356588@vyatta.com>
[-- Attachment #1: sky2-mike4.patch --]
[-- Type: text/plain, Size: 1894 bytes --]
From: Mike McCormack <mikem@ring3k.org>
Code to bring down all sky2 interfaces and bring it up
again can be reused in sky2_suspend and sky2_resume.
Factor the code to bring the interfaces down into
sky2_all_down and the up code into sky2_all_up.
Signed-off-by: Mike McCormack <mikem@ring3k.org>
Acked-by: Stephen Hemminger <shemminger@vyatta.com>
---
Not a regression.
drivers/net/sky2.c | 26 +++++++++++++++++++-------
1 files changed, 19 insertions(+), 7 deletions(-)
--- a/drivers/net/sky2.c 2010-05-13 08:57:32.736962641 -0700
+++ b/drivers/net/sky2.c 2010-05-13 08:57:33.337275609 -0700
@@ -3312,15 +3312,11 @@ static int sky2_reattach(struct net_devi
return err;
}
-static void sky2_restart(struct work_struct *work)
+static void sky2_all_down(struct sky2_hw *hw)
{
- struct sky2_hw *hw = container_of(work, struct sky2_hw, restart_work);
- u32 imask;
int i;
- rtnl_lock();
-
- imask = sky2_read32(hw, B0_IMSK);
+ sky2_read32(hw, B0_IMSK);
sky2_write32(hw, B0_IMSK, 0);
synchronize_irq(hw->pdev->irq);
napi_disable(&hw->napi);
@@ -3336,8 +3332,12 @@ static void sky2_restart(struct work_str
netif_tx_disable(dev);
sky2_hw_down(sky2);
}
+}
- sky2_reset(hw);
+static void sky2_all_up(struct sky2_hw *hw)
+{
+ u32 imask = Y2_IS_BASE;
+ int i;
for (i = 0; i < hw->ports; i++) {
struct net_device *dev = hw->dev[i];
@@ -3348,6 +3348,7 @@ static void sky2_restart(struct work_str
sky2_hw_up(sky2);
sky2_set_multicast(dev);
+ imask |= portirq_msk[i];
netif_wake_queue(dev);
}
@@ -3356,6 +3357,17 @@ static void sky2_restart(struct work_str
sky2_read32(hw, B0_Y2_SP_LISR);
napi_enable(&hw->napi);
+}
+
+static void sky2_restart(struct work_struct *work)
+{
+ struct sky2_hw *hw = container_of(work, struct sky2_hw, restart_work);
+
+ rtnl_lock();
+
+ sky2_all_down(hw);
+ sky2_reset(hw);
+ sky2_all_up(hw);
rtnl_unlock();
}
^ permalink raw reply
* [PATCH 6/6] sky2: version 1.28
From: Stephen Hemminger @ 2010-05-13 16:12 UTC (permalink / raw)
To: David Miller, Mike McCormack; +Cc: netdev
In-Reply-To: <20100513161247.833356588@vyatta.com>
[-- Attachment #1: sky2-1.28.patch --]
[-- Type: text/plain, Size: 401 bytes --]
Version 1.28
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
--- a/drivers/net/sky2.c 2010-05-13 09:11:26.947584759 -0700
+++ b/drivers/net/sky2.c 2010-05-13 09:11:35.827269492 -0700
@@ -53,7 +53,7 @@
#include "sky2.h"
#define DRV_NAME "sky2"
-#define DRV_VERSION "1.27"
+#define DRV_VERSION "1.28"
/*
* The Yukon II chipset takes 64 bit command blocks (called list elements)
^ permalink raw reply
* Re: mmotm 2010-05-11 - dies in pm_qos_update_request()
From: Rafael J. Wysocki @ 2010-05-13 22:32 UTC (permalink / raw)
To: Valdis.Kletnieks
Cc: Mark Gross, e1000-devel, netdev, linux-kernel, Andrew Morton,
David S. Miller
In-Reply-To: <4793.1273761278@localhost>
On Thursday 13 May 2010, Valdis.Kletnieks@vt.edu wrote:
> On Wed, 12 May 2010 23:07:20 +0200, "Rafael J. Wysocki" said:
> > On Wednesday 12 May 2010, Valdis.Kletnieks@vt.edu wrote:
> > > On Tue, 11 May 2010 18:21:22 PDT, akpm@linux-foundation.org said:
> > > > The mm-of-the-moment snapshot 2010-05-11-18-20 has been uploaded to
> > > >
> > > > http://userweb.kernel.org/~akpm/mmotm/
> > >
> > > Dell Latitude E6500, x86_64 kernel.
> > >
> > > Died a horrid death at boot in the e1000e driver. Seems to be
> > > something in linux-next.patch. Didn't get a netconsole trace for obvious
> > > reasons...
> > >
> > > Copied-by-hand traceback:
> > > pm_qos_update_request()+0x22
> > > e1000_configure+0x478
> > > e1000_open_device+0xee
> > > ? _raw_notifier_call_chain+0xf
> > > __dev_open+0xec
> > > dev_open+0x1b
> > > netpoll_setup+0x28b
> > > init_netconsole+0xbc
> > >
> > > I suspect this commit:
> > >
> > > commit 23606cf5d1192c2b17912cb2ef6e62f9b11de133
> > > Author: Rafael J. Wysocki <rjw@sisk.pl>
> > > Date: Sun Mar 14 14:35:17 2010 +0000
> > >
> > > e1000e / PCI / PM: Add basic runtime PM support (rev. 4)
> >
> > No, I don't think so. I'm running -rc6 with this patch applied on a box with
> > e1000e and it works just fine.
> >
> > Please try to revert this one instead:
> >
> > http://git.kernel.org/?p=linux/kernel/git/rafael/suspend-2.6.git;a=patch;h=ed77134bfccf5e75b6cbadab268e559dbe6a4ebb
>
> Confirming - reverting that patch and doing the build fixup results in a
> kernel that doesn't blow up in the e1000e driver...
Can you try the tree at:
git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6.git linux-next
without the other linux-next changes, please?
I'm not seeing the problem you're reporting on my test box with e1000e.
Rafael
------------------------------------------------------------------------------
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
^ permalink raw reply
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