* Re: [PATCH net-next-2.6] Fix a typo in datagram.c
From: Shan Wei @ 2010-12-02 1:35 UTC (permalink / raw)
To: David Shwatrz; +Cc: David S. Miller, netdev
In-Reply-To: <AANLkTin21SMZ8Oe5yagYkk+3ZZtfXF4iEyMnwaryFExa@mail.gmail.com>
David Shwatrz wrote, at 12/02/2010 03:46 AM:
> Hi,
> This path fixes a typo in net/core/datagram.c
This typo does not influence our reading. right?
And, you lost some ones.
$ grep -r corrent .
./net/core/datagram.c: * However, this function was corrent in any case. 8)
./net/sctp/socket.c: * However, this function was corrent in any case. 8)
./drivers/serial/max3107.c: /* if can't find the corrent config, use previous */
./drivers/gpu/drm/i915/intel_hdmi.c: /* XXX first guess at handling video port, is this corrent? */
--
Best Regards
-----
Shan Wei
>
> Regards,
> David Shwartz
>
> Signed-off-by: David Shwartz <dshwatrz@gmail.com>
^ permalink raw reply
* RE: [PATCH v16 14/17]Add a kconfig entry and make entry for mp device.
From: Xin, Xiaohui @ 2010-12-02 1:32 UTC (permalink / raw)
To: Randy Dunlap
Cc: netdev@vger.kernel.org, kvm@vger.kernel.org,
linux-kernel@vger.kernel.org, mst@redhat.com, mingo@elte.hu,
davem@davemloft.net, herbert@gondor.hengli.com.au,
jdike@linux.intel.com
In-Reply-To: <20101201095348.07421ee5.randy.dunlap@oracle.com>
>-----Original Message-----
>From: Randy Dunlap [mailto:randy.dunlap@oracle.com]
>Sent: Thursday, December 02, 2010 1:54 AM
>To: Xin, Xiaohui
>Cc: netdev@vger.kernel.org; kvm@vger.kernel.org; linux-kernel@vger.kernel.org;
>mst@redhat.com; mingo@elte.hu; davem@davemloft.net; herbert@gondor.hengli.com.au;
>jdike@linux.intel.com
>Subject: Re: [PATCH v16 14/17]Add a kconfig entry and make entry for mp device.
>
>On Wed, 1 Dec 2010 16:08:25 +0800 xiaohui.xin@intel.com wrote:
>
>> From: Xin Xiaohui <xiaohui.xin@intel.com>
>>
>> Signed-off-by: Xin Xiaohui <xiaohui.xin@intel.com>
>> Reviewed-by: Jeff Dike <jdike@linux.intel.com>
>> ---
>> drivers/vhost/Kconfig | 10 ++++++++++
>> drivers/vhost/Makefile | 2 ++
>> 2 files changed, 12 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/vhost/Kconfig b/drivers/vhost/Kconfig
>> index e4e2fd1..a6b8cbf 100644
>> --- a/drivers/vhost/Kconfig
>> +++ b/drivers/vhost/Kconfig
>> @@ -9,3 +9,13 @@ config VHOST_NET
>> To compile this driver as a module, choose M here: the module will
>> be called vhost_net.
>>
>> +config MEDIATE_PASSTHRU
>> + tristate "mediate passthru network driver (EXPERIMENTAL)"
>> + depends on VHOST_NET
>> + ---help---
>> + zerocopy network I/O support, we call it as mediate passthru to
>
> support; we call it "mediate passthru" to
>
>> + be distiguish with hardare passthru.
>
> distinguish it from hardware passthru.
>
Thanks. I will modify that.
Thanks
Xiaohui
>> +
>> + To compile this driver as a module, choose M here: the module will
>> + be called mpassthru.
>> +
>
>
>---
>~Randy
>*** Remember to use Documentation/SubmitChecklist when testing your code ***
^ permalink raw reply
* [PATCH 2/2] inetpeer: Fix incorrect comment about inetpeer struct size.
From: David Miller @ 2010-12-02 1:30 UTC (permalink / raw)
To: netdev
Now with ipv6 support it is no longer less than 64 bytes.
Signed-off-by: David S. Miller <davem@davemloft.net>
---
include/net/inetpeer.h | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h
index 5161bfd..599d96e 100644
--- a/include/net/inetpeer.h
+++ b/include/net/inetpeer.h
@@ -35,7 +35,6 @@ struct inet_peer {
* Once inet_peer is queued for deletion (refcnt == -1), following fields
* are not available: rid, ip_id_count, tcp_ts, tcp_ts_stamp
* We can share memory with rcu_head to keep inet_peer small
- * (less then 64 bytes)
*/
union {
struct {
--
1.7.3.2
^ permalink raw reply related
* [PATCH 1/2] inetpeer: Kill use of inet_peer_address_t typedef.
From: David Miller @ 2010-12-02 1:29 UTC (permalink / raw)
To: netdev
They are verboten these days.
Signed-off-by: David S. Miller <davem@davemloft.net>
---
include/net/inetpeer.h | 12 ++++++------
net/ipv4/inetpeer.c | 8 ++++----
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h
index fb8aeb1..5161bfd 100644
--- a/include/net/inetpeer.h
+++ b/include/net/inetpeer.h
@@ -14,18 +14,18 @@
#include <net/ipv6.h>
#include <asm/atomic.h>
-typedef struct {
+struct inetpeer_addr {
union {
__be32 a4;
__be32 a6[4];
};
__u16 family;
-} inet_peer_address_t;
+};
struct inet_peer {
/* group together avl_left,avl_right,v4daddr to speedup lookups */
struct inet_peer __rcu *avl_left, *avl_right;
- inet_peer_address_t daddr;
+ struct inetpeer_addr daddr;
__u32 avl_height;
struct list_head unused;
__u32 dtime; /* the time of last use of not
@@ -51,11 +51,11 @@ struct inet_peer {
void inet_initpeers(void) __init;
/* can be called with or without local BH being disabled */
-struct inet_peer *inet_getpeer(inet_peer_address_t *daddr, int create);
+struct inet_peer *inet_getpeer(struct inetpeer_addr *daddr, int create);
static inline struct inet_peer *inet_getpeer_v4(__be32 v4daddr, int create)
{
- inet_peer_address_t daddr;
+ struct inetpeer_addr daddr;
daddr.a4 = v4daddr;
daddr.family = AF_INET;
@@ -64,7 +64,7 @@ static inline struct inet_peer *inet_getpeer_v4(__be32 v4daddr, int create)
static inline struct inet_peer *inet_getpeer_v6(struct in6_addr *v6daddr, int create)
{
- inet_peer_address_t daddr;
+ struct inetpeer_addr daddr;
ipv6_addr_copy((struct in6_addr *)daddr.a6, v6daddr);
daddr.family = AF_INET6;
diff --git a/net/ipv4/inetpeer.c b/net/ipv4/inetpeer.c
index f95b89f..d9bc857 100644
--- a/net/ipv4/inetpeer.c
+++ b/net/ipv4/inetpeer.c
@@ -161,8 +161,8 @@ static void unlink_from_unused(struct inet_peer *p)
}
}
-static int addr_compare(const inet_peer_address_t *a,
- const inet_peer_address_t *b)
+static int addr_compare(const struct inetpeer_addr *a,
+ const struct inetpeer_addr *b)
{
int i, n = (a->family == AF_INET ? 1 : 4);
@@ -211,7 +211,7 @@ static int addr_compare(const inet_peer_address_t *a,
* But every pointer we follow is guaranteed to be valid thanks to RCU.
* We exit from this function if number of links exceeds PEER_MAXDEPTH
*/
-static struct inet_peer *lookup_rcu_bh(const inet_peer_address_t *daddr,
+static struct inet_peer *lookup_rcu_bh(const struct inetpeer_addr *daddr,
struct inet_peer_base *base)
{
struct inet_peer *u = rcu_dereference_bh(base->root);
@@ -472,7 +472,7 @@ static int cleanup_once(unsigned long ttl)
}
/* Called with or without local BH being disabled. */
-struct inet_peer *inet_getpeer(inet_peer_address_t *daddr, int create)
+struct inet_peer *inet_getpeer(struct inetpeer_addr *daddr, int create)
{
struct inet_peer __rcu **stack[PEER_MAXDEPTH], ***stackptr;
struct inet_peer_base *base = family_to_base(AF_INET);
--
1.7.3.2
^ permalink raw reply related
* [PATCH] ethtool : Allow ethtool to set interface in loopback mode.
From: Mahesh Bandewar @ 2010-12-02 0:57 UTC (permalink / raw)
To: Ben Hutchings, linux-netdev; +Cc: Tom Herbert, David Miller
This patch adds -L command-line option to enable/disable loopback mode
and -l option to display current loopback mode on a give interface.
Signed-off-by Mahesh Bandewar <maheshb@google.com>
ethtool-copy.h | 2 +
ethtool.c | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 66 insertions(+), 0 deletions(-)
---
diff --git a/ethtool-copy.h b/ethtool-copy.h
index 75c3ae7..297a042 100644
--- a/ethtool-copy.h
+++ b/ethtool-copy.h
@@ -584,6 +584,8 @@ struct ethtool_flash {
#define ETHTOOL_GSSET_INFO 0x00000037 /* Get string set info */
#define ETHTOOL_GRXFHINDIR 0x00000038 /* Get RX flow hash indir'n table */
#define ETHTOOL_SRXFHINDIR 0x00000039 /* Set RX flow hash indir'n table */
+#define ETHTOOL_SLOOPBACK 0x0000003a /* Enable / Disable loopback. */
+#define ETHTOOL_GLOOPBACK 0x0000003b /* Get loopback status. */
/* compatibility with older code */
#define SPARC_ETH_GSET ETHTOOL_GSET
diff --git a/ethtool.c b/ethtool.c
index 239912b..d3f7ffc 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -114,6 +114,8 @@ static int do_srxntuple(int fd, struct ifreq *ifr);
static int do_grxntuple(int fd, struct ifreq *ifr);
static int do_flash(int fd, struct ifreq *ifr);
static int do_permaddr(int fd, struct ifreq *ifr);
+static int do_sloopback(int fd, struct ifreq *ifr);
+static int do_gloopback(int fd, struct ifreq *ifr);
static int send_ioctl(int fd, struct ifreq *ifr);
@@ -145,6 +147,8 @@ static enum {
MODE_GNTUPLE,
MODE_FLASHDEV,
MODE_PERMADDR,
+ MODE_SLOOPBACK,
+ MODE_GLOOPBACK,
} mode = MODE_GSET;
static struct option {
@@ -266,6 +270,9 @@ static struct option {
"Get Rx ntuple filters and actions\n" },
{ "-P", "--show-permaddr", MODE_PERMADDR,
"Show permanent hardware address" },
+ { "-L", "--config-loopback", MODE_SLOOPBACK, "{En|Dis}able device
loopback",
+ " [ enable | disable ]\n"},
+ { "-l", "--show-loopback", MODE_GLOOPBACK, "Show device loopback mode",},
{ "-h", "--help", MODE_HELP, "Show this help" },
{}
};
@@ -407,6 +414,8 @@ static char *flash_file = NULL;
static int flash = -1;
static int flash_region = -1;
+static int loopback_enable = 0;
+
static int msglvl_changed;
static u32 msglvl_wanted = 0;
static u32 msglvl_mask = 0;
@@ -841,6 +850,8 @@ static void parse_cmdline(int argc, char **argp)
(mode == MODE_GNTUPLE) ||
(mode == MODE_PHYS_ID) ||
(mode == MODE_FLASHDEV) ||
+ (mode == MODE_SLOOPBACK) ||
+ (mode == MODE_GLOOPBACK) ||
(mode == MODE_PERMADDR)) {
devname = argp[i];
break;
@@ -1009,6 +1020,16 @@ static void parse_cmdline(int argc, char **argp)
}
break;
}
+ if (mode == MODE_SLOOPBACK) {
+ if (!strcmp(argp[i], "enable"))
+ loopback_enable = 1;
+ else if (!strcmp(argp[i], "disable"))
+ loopback_enable = 0;
+ else
+ show_usage(1);
+ i = argc;
+ break;
+ }
if (mode != MODE_SSET)
show_usage(1);
if (!strcmp(argp[i], "speed")) {
@@ -2019,6 +2040,10 @@ static int doit(void)
return do_flash(fd, &ifr);
} else if (mode == MODE_PERMADDR) {
return do_permaddr(fd, &ifr);
+ } else if (mode == MODE_SLOOPBACK) {
+ return do_sloopback(fd, &ifr);
+ } else if (mode == MODE_GLOOPBACK) {
+ return do_gloopback(fd, &ifr);
}
return 69;
@@ -3201,6 +3226,45 @@ static int do_grxntuple(int fd, struct ifreq *ifr)
return 0;
}
+static int do_sloopback(int fd, struct ifreq *ifr)
+{
+ int err;
+ struct ethtool_value edata;
+
+ edata.cmd = ETHTOOL_SLOOPBACK;
+ edata.data = loopback_enable;
+ ifr->ifr_data = (caddr_t)&edata;
+
+ err = send_ioctl(fd, ifr);
+ if (err < 0) {
+ char error[64];
+ sprintf(error, "Cannot %s loopback mode",
+ loopback_enable ? "enable" : "disable");
+ perror(error);
+ return 102;
+ }
+
+ return err;
+}
+
+static int do_gloopback(int fd, struct ifreq *ifr)
+{
+ int err;
+ struct ethtool_value edata;
+
+ edata.cmd = ETHTOOL_GLOOPBACK;
+ ifr->ifr_data = (caddr_t)&edata;
+
+ err = send_ioctl(fd, ifr);
+ if (err < 0) {
+ perror("Cannot get loopback status");
+ return 103;
+ }
+ printf("Loopback is %s\n", edata.data ? "enabled" : "disabled");
+
+ return err;
+}
+
static int send_ioctl(int fd, struct ifreq *ifr)
{
return ioctl(fd, SIOCETHTOOL, ifr);
^ permalink raw reply related
* Re: [PATCH v2] net: Fix too optimistic NETIF_F_HW_CSUM features
From: Jon Mason @ 2010-12-02 0:44 UTC (permalink / raw)
To: MichałMirosław
Cc: netdev@vger.kernel.org, Ben Hutchings, Jesse Gross,
Ramkrishna Vepa, Sivakumar Subramani, Sreenivasa Honnur
In-Reply-To: <20101130163057.29978.92721.stgit@rechot.qmqm.pl>
On Tue, Nov 30, 2010 at 08:38:00AM -0800, MichałMirosław wrote:
> NETIF_F_HW_CSUM is a superset of NETIF_F_IP_CSUM+NETIF_F_IPV6_CSUM, but
> some drivers miss the difference. Fix this and also fix UFO dependency
> on checksumming offload as it makes the same mistake in assumptions.
>
> Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
The vxge sections look sane to me.
Acked-by: Jon Mason <jon.mason@exar.com>
> ---
>
> Changes from v1:
> - fixed compilation of jme driver
> - enable vxge support for IPv6 checksum
> ---
> drivers/net/vxge/vxge-ethtool.c | 2 +-
> drivers/net/vxge/vxge-main.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c
> index 102567e..2754280 100644
> --- a/drivers/net/benet/be_main.c
> +++ b/drivers/net/benet/be_main.c
> @@ -2583,10 +2583,12 @@ static void be_netdev_init(struct net_device *netdev)
> int i;
>
> netdev->features |= NETIF_F_SG | NETIF_F_HW_VLAN_RX | NETIF_F_TSO |
> - NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_FILTER | NETIF_F_HW_CSUM |
> + NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_FILTER |
> + NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
> NETIF_F_GRO | NETIF_F_TSO6;
>
> - netdev->vlan_features |= NETIF_F_SG | NETIF_F_TSO | NETIF_F_HW_CSUM;
> + netdev->vlan_features |= NETIF_F_SG | NETIF_F_TSO |
> + NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;
>
> if (lancer_chip(adapter))
> netdev->vlan_features |= NETIF_F_TSO6;
> diff --git a/drivers/net/bnx2x/bnx2x_main.c b/drivers/net/bnx2x/bnx2x_main.c
> index f53edfd..40ce95a 100644
> --- a/drivers/net/bnx2x/bnx2x_main.c
> +++ b/drivers/net/bnx2x/bnx2x_main.c
> @@ -8761,7 +8761,7 @@ static int __devinit bnx2x_init_dev(struct pci_dev *pdev,
> dev->netdev_ops = &bnx2x_netdev_ops;
> bnx2x_set_ethtool_ops(dev);
> dev->features |= NETIF_F_SG;
> - dev->features |= NETIF_F_HW_CSUM;
> + dev->features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;
> if (bp->flags & USING_DAC_FLAG)
> dev->features |= NETIF_F_HIGHDMA;
> dev->features |= (NETIF_F_TSO | NETIF_F_TSO_ECN);
> @@ -8769,7 +8769,7 @@ static int __devinit bnx2x_init_dev(struct pci_dev *pdev,
> dev->features |= (NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX);
>
> dev->vlan_features |= NETIF_F_SG;
> - dev->vlan_features |= NETIF_F_HW_CSUM;
> + dev->vlan_features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;
> if (bp->flags & USING_DAC_FLAG)
> dev->vlan_features |= NETIF_F_HIGHDMA;
> dev->vlan_features |= (NETIF_F_TSO | NETIF_F_TSO_ECN);
> diff --git a/drivers/net/jme.c b/drivers/net/jme.c
> index c57d9a4..2411e72 100644
> --- a/drivers/net/jme.c
> +++ b/drivers/net/jme.c
> @@ -2076,12 +2076,11 @@ jme_change_mtu(struct net_device *netdev, int new_mtu)
> }
>
> if (new_mtu > 1900) {
> - netdev->features &= ~(NETIF_F_HW_CSUM |
> - NETIF_F_TSO |
> - NETIF_F_TSO6);
> + netdev->features &= ~(NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
> + NETIF_F_TSO | NETIF_F_TSO6);
> } else {
> if (test_bit(JME_FLAG_TXCSUM, &jme->flags))
> - netdev->features |= NETIF_F_HW_CSUM;
> + netdev->features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;
> if (test_bit(JME_FLAG_TSO, &jme->flags))
> netdev->features |= NETIF_F_TSO | NETIF_F_TSO6;
> }
> @@ -2514,10 +2513,12 @@ jme_set_tx_csum(struct net_device *netdev, u32 on)
> if (on) {
> set_bit(JME_FLAG_TXCSUM, &jme->flags);
> if (netdev->mtu <= 1900)
> - netdev->features |= NETIF_F_HW_CSUM;
> + netdev->features |=
> + NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;
> } else {
> clear_bit(JME_FLAG_TXCSUM, &jme->flags);
> - netdev->features &= ~NETIF_F_HW_CSUM;
> + netdev->features &=
> + ~(NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM);
> }
>
> return 0;
> @@ -2797,7 +2798,8 @@ jme_init_one(struct pci_dev *pdev,
> netdev->netdev_ops = &jme_netdev_ops;
> netdev->ethtool_ops = &jme_ethtool_ops;
> netdev->watchdog_timeo = TX_TIMEOUT;
> - netdev->features = NETIF_F_HW_CSUM |
> + netdev->features = NETIF_F_IP_CSUM |
> + NETIF_F_IPV6_CSUM |
> NETIF_F_SG |
> NETIF_F_TSO |
> NETIF_F_TSO6 |
> diff --git a/drivers/net/pch_gbe/pch_gbe_ethtool.c b/drivers/net/pch_gbe/pch_gbe_ethtool.c
> index c8cc32c..c8c873b 100644
> --- a/drivers/net/pch_gbe/pch_gbe_ethtool.c
> +++ b/drivers/net/pch_gbe/pch_gbe_ethtool.c
> @@ -469,18 +469,6 @@ static int pch_gbe_set_rx_csum(struct net_device *netdev, u32 data)
> }
>
> /**
> - * pch_gbe_get_tx_csum - Report whether transmit checksums are turned on or off
> - * @netdev: Network interface device structure
> - * Returns
> - * true(1): Checksum On
> - * false(0): Checksum Off
> - */
> -static u32 pch_gbe_get_tx_csum(struct net_device *netdev)
> -{
> - return (netdev->features & NETIF_F_HW_CSUM) != 0;
> -}
> -
> -/**
> * pch_gbe_set_tx_csum - Turn transmit checksums on or off
> * @netdev: Network interface device structure
> * @data: Checksum on[true] or off[false]
> @@ -493,11 +481,7 @@ static int pch_gbe_set_tx_csum(struct net_device *netdev, u32 data)
> struct pch_gbe_adapter *adapter = netdev_priv(netdev);
>
> adapter->tx_csum = data;
> - if (data)
> - netdev->features |= NETIF_F_HW_CSUM;
> - else
> - netdev->features &= ~NETIF_F_HW_CSUM;
> - return 0;
> + return ethtool_op_set_tx_ipv6_csum(netdev, data);
> }
>
> /**
> @@ -572,7 +556,6 @@ static const struct ethtool_ops pch_gbe_ethtool_ops = {
> .set_pauseparam = pch_gbe_set_pauseparam,
> .get_rx_csum = pch_gbe_get_rx_csum,
> .set_rx_csum = pch_gbe_set_rx_csum,
> - .get_tx_csum = pch_gbe_get_tx_csum,
> .set_tx_csum = pch_gbe_set_tx_csum,
> .get_strings = pch_gbe_get_strings,
> .get_ethtool_stats = pch_gbe_get_ethtool_stats,
> diff --git a/drivers/net/pch_gbe/pch_gbe_main.c b/drivers/net/pch_gbe/pch_gbe_main.c
> index afb7506..58e7903 100644
> --- a/drivers/net/pch_gbe/pch_gbe_main.c
> +++ b/drivers/net/pch_gbe/pch_gbe_main.c
> @@ -2319,7 +2319,7 @@ static int pch_gbe_probe(struct pci_dev *pdev,
> netdev->watchdog_timeo = PCH_GBE_WATCHDOG_PERIOD;
> netif_napi_add(netdev, &adapter->napi,
> pch_gbe_napi_poll, PCH_GBE_RX_WEIGHT);
> - netdev->features = NETIF_F_HW_CSUM | NETIF_F_GRO;
> + netdev->features = NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | NETIF_F_GRO;
> pch_gbe_set_ethtool_ops(netdev);
>
> pch_gbe_mac_reset_hw(&adapter->hw);
> @@ -2358,9 +2358,9 @@ static int pch_gbe_probe(struct pci_dev *pdev,
> pch_gbe_check_options(adapter);
>
> if (adapter->tx_csum)
> - netdev->features |= NETIF_F_HW_CSUM;
> + netdev->features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;
> else
> - netdev->features &= ~NETIF_F_HW_CSUM;
> + netdev->features &= ~(NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM);
>
> /* initialize the wol settings based on the eeprom settings */
> adapter->wake_up_evt = PCH_GBE_WL_INIT_SETTING;
> diff --git a/drivers/net/sc92031.c b/drivers/net/sc92031.c
> index 417adf3..76290a8 100644
> --- a/drivers/net/sc92031.c
> +++ b/drivers/net/sc92031.c
> @@ -1449,7 +1449,8 @@ static int __devinit sc92031_probe(struct pci_dev *pdev,
> dev->irq = pdev->irq;
>
> /* faked with skb_copy_and_csum_dev */
> - dev->features = NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_HIGHDMA;
> + dev->features = NETIF_F_SG | NETIF_F_HIGHDMA |
> + NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;
>
> dev->netdev_ops = &sc92031_netdev_ops;
> dev->watchdog_timeo = TX_TIMEOUT;
> diff --git a/drivers/net/stmmac/stmmac_ethtool.c b/drivers/net/stmmac/stmmac_ethtool.c
> index f2695fd..fd719ed 100644
> --- a/drivers/net/stmmac/stmmac_ethtool.c
> +++ b/drivers/net/stmmac/stmmac_ethtool.c
> @@ -197,16 +197,6 @@ static void stmmac_ethtool_gregs(struct net_device *dev,
> }
> }
>
> -static int stmmac_ethtool_set_tx_csum(struct net_device *netdev, u32 data)
> -{
> - if (data)
> - netdev->features |= NETIF_F_HW_CSUM;
> - else
> - netdev->features &= ~NETIF_F_HW_CSUM;
> -
> - return 0;
> -}
> -
> static u32 stmmac_ethtool_get_rx_csum(struct net_device *dev)
> {
> struct stmmac_priv *priv = netdev_priv(dev);
> @@ -370,7 +360,7 @@ static struct ethtool_ops stmmac_ethtool_ops = {
> .get_link = ethtool_op_get_link,
> .get_rx_csum = stmmac_ethtool_get_rx_csum,
> .get_tx_csum = ethtool_op_get_tx_csum,
> - .set_tx_csum = stmmac_ethtool_set_tx_csum,
> + .set_tx_csum = ethtool_op_set_tx_ipv6_csum,
> .get_sg = ethtool_op_get_sg,
> .set_sg = ethtool_op_set_sg,
> .get_pauseparam = stmmac_get_pauseparam,
> diff --git a/drivers/net/stmmac/stmmac_main.c b/drivers/net/stmmac/stmmac_main.c
> index 730a6fd..bfc2d12 100644
> --- a/drivers/net/stmmac/stmmac_main.c
> +++ b/drivers/net/stmmac/stmmac_main.c
> @@ -1494,7 +1494,8 @@ static int stmmac_probe(struct net_device *dev)
> dev->netdev_ops = &stmmac_netdev_ops;
> stmmac_set_ethtool_ops(dev);
>
> - dev->features |= (NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_HIGHDMA);
> + dev->features |= NETIF_F_SG | NETIF_F_HIGHDMA |
> + NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;
> dev->watchdog_timeo = msecs_to_jiffies(watchdog);
> #ifdef STMMAC_VLAN_TAG_USED
> /* Both mac100 and gmac support receive VLAN tag detection */
> @@ -1525,7 +1526,7 @@ static int stmmac_probe(struct net_device *dev)
>
> DBG(probe, DEBUG, "%s: Scatter/Gather: %s - HW checksums: %s\n",
> dev->name, (dev->features & NETIF_F_SG) ? "on" : "off",
> - (dev->features & NETIF_F_HW_CSUM) ? "on" : "off");
> + (dev->features & NETIF_F_IP_CSUM) ? "on" : "off");
>
> spin_lock_init(&priv->lock);
>
> diff --git a/drivers/net/vxge/vxge-ethtool.c b/drivers/net/vxge/vxge-ethtool.c
> index bc9bd10..1dd3a21 100644
> --- a/drivers/net/vxge/vxge-ethtool.c
> +++ b/drivers/net/vxge/vxge-ethtool.c
> @@ -1177,7 +1177,7 @@ static const struct ethtool_ops vxge_ethtool_ops = {
> .get_rx_csum = vxge_get_rx_csum,
> .set_rx_csum = vxge_set_rx_csum,
> .get_tx_csum = ethtool_op_get_tx_csum,
> - .set_tx_csum = ethtool_op_set_tx_hw_csum,
> + .set_tx_csum = ethtool_op_set_tx_ipv6_csum,
> .get_sg = ethtool_op_get_sg,
> .set_sg = ethtool_op_set_sg,
> .get_tso = ethtool_op_get_tso,
> diff --git a/drivers/net/vxge/vxge-main.c b/drivers/net/vxge/vxge-main.c
> index a21dae1..d339f5b 100644
> --- a/drivers/net/vxge/vxge-main.c
> +++ b/drivers/net/vxge/vxge-main.c
> @@ -3368,7 +3368,7 @@ static int __devinit vxge_device_register(struct __vxge_hw_device *hldev,
>
> ndev->features |= NETIF_F_SG;
>
> - ndev->features |= NETIF_F_HW_CSUM;
> + ndev->features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;
> vxge_debug_init(vxge_hw_device_trace_level_get(hldev),
> "%s : checksuming enabled", __func__);
>
> diff --git a/net/core/dev.c b/net/core/dev.c
> index 3259d2c..622f85a 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -5041,10 +5041,13 @@ unsigned long netdev_fix_features(unsigned long features, const char *name)
> }
>
> if (features & NETIF_F_UFO) {
> - if (!(features & NETIF_F_GEN_CSUM)) {
> + /* maybe split UFO into V4 and V6? */
> + if (!((features & NETIF_F_GEN_CSUM) ||
> + (features & (NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM))
> + == (NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM))) {
> if (name)
> printk(KERN_ERR "%s: Dropping NETIF_F_UFO "
> - "since no NETIF_F_HW_CSUM feature.\n",
> + "since no checksum offload features.\n",
> name);
> features &= ~NETIF_F_UFO;
> }
> diff --git a/net/core/ethtool.c b/net/core/ethtool.c
> index 956a9f4..d5bc2881 100644
> --- a/net/core/ethtool.c
> +++ b/net/core/ethtool.c
> @@ -1171,7 +1171,9 @@ static int ethtool_set_ufo(struct net_device *dev, char __user *useraddr)
> return -EFAULT;
> if (edata.data && !(dev->features & NETIF_F_SG))
> return -EINVAL;
> - if (edata.data && !(dev->features & NETIF_F_HW_CSUM))
> + if (edata.data && !((dev->features & NETIF_F_GEN_CSUM) ||
> + (dev->features & (NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM))
> + == (NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM)))
> return -EINVAL;
> return dev->ethtool_ops->set_ufo(dev, edata.data);
> }
>
The information and any attached documents contained in this message
may be confidential and/or legally privileged. The message is
intended solely for the addressee(s). If you are not the intended
recipient, you are hereby notified that any use, dissemination, or
reproduction is strictly prohibited and may be unlawful. If you are
not the intended recipient, please contact the sender immediately by
return e-mail and destroy all copies of the original message.
^ permalink raw reply
* Re: bridge netpoll support: mismatch between net core and bridge headers
From: David Miller @ 2010-12-02 0:33 UTC (permalink / raw)
To: vapier.adi; +Cc: herbert, netdev
In-Reply-To: <AANLkTi=hq6S_NvPEkTovkceUe9Orcitj_oHN1mVUW7+A@mail.gmail.com>
From: Mike Frysinger <vapier.adi@gmail.com>
Date: Wed, 1 Dec 2010 16:53:31 -0500
> can you post a patch i can try in my randconfig tree ?
Attached. Also please provide one of the failing ".config" files,
and please test if simply going "make oldconfig" unbreaks things.
It may be that randconfig allows configurations that the config
system normally does not allow.
>From 2212481a102ab53f485ddf76cb1be21e4ace5b7e Mon Sep 17 00:00:00 2001
From: David S. Miller <davem@davemloft.net>
Date: Wed, 1 Dec 2010 11:28:48 -0800
Subject: [PATCH] bridge: Fix randconfig builds.
Currently it is possible to turn on NET_POLL_CONTROLLER
without NETPOLL.
The bridging netpoll support code doesn't make any real
sense unless both options are enabled because the netdev's
->npinfo has to be present for the code to operate properly.
So for now just require that both config options are enabled.
Longer term it's probably a good idea to just get rid of
NET_POLL_CONTROLLER and have everything hinge upon just the
NETPOLL option.
Reported-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
net/bridge/br_device.c | 4 ++--
net/bridge/br_private.h | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c
index 17cb0b6..96ecb02 100644
--- a/net/bridge/br_device.c
+++ b/net/bridge/br_device.c
@@ -217,7 +217,7 @@ static int br_set_flags(struct net_device *netdev, u32 data)
return ethtool_op_set_flags(netdev, data, ETH_FLAG_TXVLAN);
}
-#ifdef CONFIG_NET_POLL_CONTROLLER
+#if defined(CONFIG_NETPOLL) && defined(CONFIG_NET_POLL_CONTROLLER)
static void br_poll_controller(struct net_device *br_dev)
{
}
@@ -321,7 +321,7 @@ static const struct net_device_ops br_netdev_ops = {
.ndo_set_multicast_list = br_dev_set_multicast_list,
.ndo_change_mtu = br_change_mtu,
.ndo_do_ioctl = br_dev_ioctl,
-#ifdef CONFIG_NET_POLL_CONTROLLER
+#if defined(CONFIG_NETPOLL) && defined(CONFIG_NET_POLL_CONTROLLER)
.ndo_netpoll_setup = br_netpoll_setup,
.ndo_netpoll_cleanup = br_netpoll_cleanup,
.ndo_poll_controller = br_poll_controller,
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
index 75c90ed..ad1bec6 100644
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -146,7 +146,7 @@ struct net_bridge_port
char sysfs_name[IFNAMSIZ];
#endif
-#ifdef CONFIG_NET_POLL_CONTROLLER
+#if defined(CONFIG_NETPOLL) && defined(CONFIG_NET_POLL_CONTROLLER)
struct netpoll *np;
#endif
};
@@ -287,7 +287,7 @@ static inline int br_is_root_bridge(const struct net_bridge *br)
extern void br_dev_setup(struct net_device *dev);
extern netdev_tx_t br_dev_xmit(struct sk_buff *skb,
struct net_device *dev);
-#ifdef CONFIG_NET_POLL_CONTROLLER
+#if defined(CONFIG_NETPOLL) && defined(CONFIG_NET_POLL_CONTROLLER)
static inline struct netpoll_info *br_netpoll_info(struct net_bridge *br)
{
return br->dev->npinfo;
--
1.7.3.2
^ permalink raw reply related
* Re: [PATCH] net/r8169: Remove the firmware of RTL8111D
From: Francois Romieu @ 2010-12-01 22:40 UTC (permalink / raw)
To: Stefan Lippers-Hollmann; +Cc: Hayes Wang, netdev, linux-kernel, Ben Hutchings
In-Reply-To: <201012011736.59625.s.L-H@gmx.de>
Stefan Lippers-Hollmann <s.L-H@gmx.de> :
[...]
> Therefore I'd think it's safe to just make some noise about missing
> firmware images and not cease operations completely for this chipset.
Ok, fine.
--
Ueimor
^ permalink raw reply
* Re: [Patch] net: kill an RCU warning in inet_fill_link_af()
From: Thomas Graf @ 2010-12-01 22:22 UTC (permalink / raw)
To: Eric Dumazet
Cc: Amerigo Wang, linux-kernel, David S. Miller, Alexey Kuznetsov,
Pekka Savola (ipv6), James Morris, Hideaki YOSHIFUJI,
Patrick McHardy, netdev
In-Reply-To: <1291224717.2856.1021.camel@edumazet-laptop>
On Wed, Dec 01, 2010 at 06:31:57PM +0100, Eric Dumazet wrote:
> Are you sure RTNL is not held while dumping ?
>
> Patrick did the change to hold RTNL while dumping too, 3.5 years ago.
> Check commits 6313c1e0992fea, 1c2d670f3660e9103 ([RTNETLINK]: Hold
> rtnl_mutex during netlink dump callbacks)
You are right, I only looked at netlink_dump_start() where the lock
is released after setting ->cb. We grab RTNL again in netlink_dump()
after allocating the skb.
^ permalink raw reply
* Re: bridge netpoll support: mismatch between net core and bridge headers
From: Mike Frysinger @ 2010-12-01 21:53 UTC (permalink / raw)
To: David Miller; +Cc: herbert, netdev
In-Reply-To: <20101201.114201.245392768.davem@davemloft.net>
On Wed, Dec 1, 2010 at 14:42, David Miller wrote:
> Mike Frysinger:
>> so in my randconfig builds, i'm now seeing frequent failures along the lines of:
>
> Mike, I cooked up a patch to "fix" this but I can't reproduce it
> in the current tree.
>
> No matter what I do, I can't get CONFIG_NETPOLL and
> CONFIG_NET_POLL_CONTROLLER to have different values.
>
> If I try to force it in my ".config" the subsequent "make oldconfig"
> forces them to be equal.
can you post a patch i can try in my randconfig tree ?
-mike
^ permalink raw reply
* Re: [PATCH] net/ipv6/sit.c: return unhandled skb to tunnel4_rcv
From: David Miller @ 2010-12-01 21:19 UTC (permalink / raw)
To: eric.dumazet; +Cc: david_mccullough, netdev
In-Reply-To: <1291097564.2725.15.camel@edumazet-laptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Tue, 30 Nov 2010 07:12:44 +0100
> Le mardi 30 novembre 2010 à 15:32 +1000, David McCullough a écrit :
>> Hi all,
>>
>> I found a problem using an IPv6 over IPv4 tunnel. When CONFIG_IPV6_SIT
>> was enabled, the packets would be rejected as net/ipv6/sit.c was catching
>> all IPPROTO_IPV6 packets and returning an ICMP port unreachable error.
>>
>> I think this patch fixes the problem cleanly. I believe the code in
>> net/ipv4/tunnel4.c:tunnel4_rcv takes care of it properly if none of the
>> handlers claim the skb.
>>
>> Patch is against 2.6.35, bit still applies to current.
>>
>> Cheers,
>> Davidm
>>
>> Signed-off-by: David McCullough <david_mccullough@mcafee.com>
...
> Good catch !
>
> Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH] ipv6: slightly simplify keeping IPv6 addresses on link down
From: Stephen Hemminger @ 2010-12-01 21:04 UTC (permalink / raw)
To: Lorenzo Colitti; +Cc: netdev, David Miller
In-Reply-To: <AANLkTin5f+BZnFEzuc6iPLC8Hp++V0Jam8aAU2jMvxQq@mail.gmail.com>
On Wed, 1 Dec 2010 12:52:42 -0800
Lorenzo Colitti <lorenzo@google.com> wrote:
> On Wed, Dec 1, 2010 at 12:22 PM, Stephen Hemminger
> <shemminger@vyatta.com> wrote:
> > > --- a/net/ipv6/addrconf.c
> > > +++ b/net/ipv6/addrconf.c
> > > @@ -2663,7 +2663,8 @@ static int addrconf_ifdown(struct net_device *dev, int how)
> > > {
> > > struct net *net = dev_net(dev);
> > > struct inet6_dev *idev;
> > > - struct inet6_ifaddr *ifa, *ifn;
> > > + struct inet6_ifaddr *ifa;
> > > + LIST_HEAD(keep_list);
> > > int state;
> >
> > Your patch is backwards? The existing code is:
>
> Oops, yes. Wrong order of arguments. Another one coming up.
>
> > Also, the addrconf_ifdown can race with other updates to idev->addr_list
> > from addrconf timers etc. Therefore even list_for_each_entry_safe is not safe.
>
> No, wait... The loop is protected by idev->lock, and the code just
> before it that clears the temporary address list is essentially
> identical (except it looks over tempaddr_list instead). Wouldn't that
> blow up as well?
The old code walked the list until it was empty. New code could
get confused if list changed by other changes during the
period when idev->lock is dropped and notifier is called.
--
^ permalink raw reply
* Re: [PATCH 3/3] vxge: update driver version
From: David Miller @ 2010-12-01 21:02 UTC (permalink / raw)
To: jon.mason; +Cc: netdev, sivakumar.subramani, sreenivasa.honnur, ram.vepa
In-Reply-To: <1291089767-18864-3-git-send-email-jon.mason@exar.com>
From: Jon Mason <jon.mason@exar.com>
Date: Mon, 29 Nov 2010 22:02:47 -0600
> Update vxge driver version
>
> Signed-off-by: Jon Mason <jon.mason@exar.com>
Applied to net-next-2.6
^ permalink raw reply
* Re: [PATCH 2/3] vxge: use strcpy for strings
From: David Miller @ 2010-12-01 21:02 UTC (permalink / raw)
To: jon.mason; +Cc: netdev, sivakumar.subramani, sreenivasa.honnur, ram.vepa
In-Reply-To: <1291089767-18864-2-git-send-email-jon.mason@exar.com>
From: Jon Mason <jon.mason@exar.com>
Date: Mon, 29 Nov 2010 22:02:46 -0600
> Use strncpy instead of memcpy when working on strings
>
> Signed-off-by: Jon Mason <jon.mason@exar.com>
Applied to net-next-2.6
^ permalink raw reply
* Re: [PATCH 1/3] vxge: remove unnecessary printks
From: David Miller @ 2010-12-01 21:02 UTC (permalink / raw)
To: jon.mason; +Cc: netdev, sivakumar.subramani, sreenivasa.honnur, ram.vepa
In-Reply-To: <1291089767-18864-1-git-send-email-jon.mason@exar.com>
From: Jon Mason <jon.mason@exar.com>
Date: Mon, 29 Nov 2010 22:02:45 -0600
> Remove printks for ring blocks, fifo blocks, and rx doorbell mode as
> they clutter the dmesg output during modprobe and provide no useful
> information.
>
> Signed-off-by: Jon Mason <jon.mason@exar.com>
Applied to net-next-2.6
^ permalink raw reply
* Re: [PATCH] ipv6: slightly simplify keeping IPv6 addresses on link down
From: Lorenzo Colitti @ 2010-12-01 20:54 UTC (permalink / raw)
To: netdev; +Cc: Lorenzo Colitti, David Miller, Stephen Hemminger
In-Reply-To: <20101201122253.2a8be2e0@nehalam>
ipv6: slightly simplify keeping IPv6 addresses on link down
When link goes down, all statically-configured (i.e.,
permanent and not link-local) IPv6 addresses are kept on
the interface. Instead of moving addresses to a temporary
keep list and then splicing that back on to the interface
address list, use list_for_each_entry_safe and delete the
ones we don't want.
Tested by configuring two static addresses on an interface
and verifying that pings from the addresses keep working
when bringing link down and up again and when disabling and
re-enabling IPv6 on the interface.
Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 23cc8e1..6dfd5c5 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -2663,8 +2663,7 @@ static int addrconf_ifdown(struct net_device *dev, int how)
{
struct net *net = dev_net(dev);
struct inet6_dev *idev;
- struct inet6_ifaddr *ifa;
- LIST_HEAD(keep_list);
+ struct inet6_ifaddr *ifa, *ifn;
int state;
ASSERT_RTNL();
@@ -2719,9 +2718,7 @@ static int addrconf_ifdown(struct net_device *dev, int how)
}
#endif
- while (!list_empty(&idev->addr_list)) {
- ifa = list_first_entry(&idev->addr_list,
- struct inet6_ifaddr, if_list);
+ list_for_each_entry_safe(ifa, ifn, &idev->addr_list, if_list) {
addrconf_del_timer(ifa);
/* If just doing link down, and address is permanent
@@ -2729,15 +2726,13 @@ static int addrconf_ifdown(struct net_device *dev, int how)
if (!how &&
(ifa->flags&IFA_F_PERMANENT) &&
!(ipv6_addr_type(&ifa->addr) & IPV6_ADDR_LINKLOCAL)) {
- list_move_tail(&ifa->if_list, &keep_list);
-
/* If not doing DAD on this address, just keep it. */
if ((dev->flags&(IFF_NOARP|IFF_LOOPBACK)) ||
idev->cnf.accept_dad <= 0 ||
(ifa->flags & IFA_F_NODAD))
continue;
- /* If it was tentative already, no need to notify */
+ /* If it was tentative already, dont do anything */
if (ifa->flags & IFA_F_TENTATIVE)
continue;
@@ -2769,8 +2764,6 @@ static int addrconf_ifdown(struct net_device *dev, int how)
}
}
- list_splice(&keep_list, &idev->addr_list);
-
write_unlock_bh(&idev->lock);
/* Step 5: Discard multicast list */
^ permalink raw reply related
* Re: [RFC PATCH v1] iproute2: add IFLA_TC support to 'ip link'
From: John Fastabend @ 2010-12-01 20:57 UTC (permalink / raw)
To: Stephen Hemminger
Cc: netdev@vger.kernel.org, tgraf@infradead.org,
eric.dumazet@gmail.com, davem@davemloft.net
In-Reply-To: <20101201103802.11464029@nehalam>
On 12/1/2010 10:38 AM, Stephen Hemminger wrote:
> On Wed, 01 Dec 2010 10:27:58 -0800
> John Fastabend <john.r.fastabend@intel.com> wrote:
>
>> Add support to return IFLA_TC qos settings to the 'ip link'
>> command. The following sets the number of traffic classes
>> supported in HW and builds a priority map.
>>
>> #ip link set eth3 tc num 8 map 0 1 2 3 4 5 6 7 0 0 0 0 0 0 0 0
>>
>> With the output from 'ip link' showing maps for interfaces with
>> the ability to use HW traffic classes.
>>
>> #ip link show
>> 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
>> link/loopback 00:00:00:00:00:00 brd00:00:00:00:00:00
>> 2: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
>> link/ether 00:30:48:f0:fc:88 brdff:ff:ff:ff:ff:ff
>> 3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
>> link/ether 00:30:48:f0:fc:89 brdff:ff:ff:ff:ff:ff
>> 6: eth2: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN qlen 1000
>> link/ether 00:1b:21:55:23:58 brdff:ff:ff:ff:ff:ff
>> tc 0:8
>> 7: eth3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
>> link/ether 00:1b:21:55:23:59 brdff:ff:ff:ff:ff:ff
>> tc 8:8 map: { 0 1 2 3 4 5 6 7 0 0 0 0 0 0 0 0 }
>> txqs: (0:8) (8:16) (16:24) (24:32) (32:40) (40:48) (48:56) (56:64)
>>
>> Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
>
> Ok. but will not be applied until after 2.6.38 (when kernel support
> is upstream).
>
>
Agreed. I wanted to send this out to illustrate the interface. I'll post a non-RFC patch after I get the corresponding kernel support accepted.
Thanks,
John
^ permalink raw reply
* Re: [PATCH net-next-2.6] sched: use xps information for qdisc NUMA affinity
From: Eric Dumazet @ 2010-12-01 20:55 UTC (permalink / raw)
To: David Miller; +Cc: therbert, netdev, bhutchings
In-Reply-To: <20101201.124925.200368461.davem@davemloft.net>
Le mercredi 01 décembre 2010 à 12:49 -0800, David Miller a écrit :
> I think this is good enough to cook in net-next-2.6
>
> Please use "net sched: " instead of just plain "sched: " in your
> commit header lines so that people don't confuse such changes
> with process scheduler ones :-)
Yes, I'll try to remember next time, thanks !
^ permalink raw reply
* Re: [PATCH] ipv6: slightly simplify keeping IPv6 addresses on link down
From: Lorenzo Colitti @ 2010-12-01 20:52 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev, David Miller
In-Reply-To: <20101201122253.2a8be2e0@nehalam>
On Wed, Dec 1, 2010 at 12:22 PM, Stephen Hemminger
<shemminger@vyatta.com> wrote:
> > --- a/net/ipv6/addrconf.c
> > +++ b/net/ipv6/addrconf.c
> > @@ -2663,7 +2663,8 @@ static int addrconf_ifdown(struct net_device *dev, int how)
> > {
> > struct net *net = dev_net(dev);
> > struct inet6_dev *idev;
> > - struct inet6_ifaddr *ifa, *ifn;
> > + struct inet6_ifaddr *ifa;
> > + LIST_HEAD(keep_list);
> > int state;
>
> Your patch is backwards? The existing code is:
Oops, yes. Wrong order of arguments. Another one coming up.
> Also, the addrconf_ifdown can race with other updates to idev->addr_list
> from addrconf timers etc. Therefore even list_for_each_entry_safe is not safe.
No, wait... The loop is protected by idev->lock, and the code just
before it that clears the temporary address list is essentially
identical (except it looks over tempaddr_list instead). Wouldn't that
blow up as well?
^ permalink raw reply
* Re: [PATCH 0/3] Tunneling minor patches
From: David Miller @ 2010-12-01 20:52 UTC (permalink / raw)
To: shemminger; +Cc: netdev
In-Reply-To: <20101129194746.724222156@vyatta.com>
I'll apply these to net-next-2.6, thanks Stephen.
^ permalink raw reply
* Re: [PATCH net-next-2.6] sched: use xps information for qdisc NUMA affinity
From: David Miller @ 2010-12-01 20:49 UTC (permalink / raw)
To: eric.dumazet; +Cc: therbert, netdev, bhutchings
In-Reply-To: <1291054477.3435.1302.camel@edumazet-laptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Mon, 29 Nov 2010 19:14:37 +0100
> [PATCH net-next-2.6] sched: use xps information for qdisc NUMA affinity
>
> Allocate qdisc memory according to NUMA properties of cpus included in
> xps map.
>
> To be effective, qdisc should be (re)setup after changes
> of /sys/class/net/eth<n>/queues/tx-<n>/xps_cpus
>
> I added a numa_node field in struct netdev_queue, containing NUMA node
> if all cpus included in xps_cpus share same node, else -1.
>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
I think this is good enough to cook in net-next-2.6
Please use "net sched: " instead of just plain "sched: " in your
commit header lines so that people don't confuse such changes
with process scheduler ones :-)
^ permalink raw reply
* [PATCH net-next-2.6] filter: add a security check at install time
From: Eric Dumazet @ 2010-12-01 20:45 UTC (permalink / raw)
To: David Miller; +Cc: hagen, xiaosuo, wirelesser, netdev, Dan Rosenberg
In-Reply-To: <20101201.122312.229751364.davem@davemloft.net>
Le mercredi 01 décembre 2010 à 12:23 -0800, David Miller a écrit :
> From: Eric Dumazet <eric.dumazet@gmail.com>
> Date: Wed, 01 Dec 2010 20:48:57 +0100
>
> > Le mercredi 01 décembre 2010 à 10:44 -0800, David Miller a écrit :
> >> From: Eric Dumazet <eric.dumazet@gmail.com>
> >> Date: Wed, 01 Dec 2010 19:24:53 +0100
> >>
> >> > A third work in progress (from my side) is to add a check in
> >> > sk_chk_filter() to remove the memvalid we added lately to protect the
> >> > LOAD M(K).
> >>
> >> I understand your idea, but the static checkers are still going to
> >> complain. So better add a huge comment in sk_run_filter() explaining
> >> why the checker's complaint should be ignored :-)
> >
> > Sure, here is the patch I plan to test ASAP
>
> Looks good to me.
Yes, it survives tests I did.
I submit the patch and Cc Dan Rosenberg, I would like him to double
check it if he likes.
Thanks
[PATCH net-next-2.6] filter: add a security check at install time
We added some security checks in commit 57fe93b374a6
(filter: make sure filters dont read uninitialized memory) to close a
potential leak of kernel information to user.
This added a potential extra cost at run time, while we can perform a
check of the filter itself, to make sure a malicious user doesnt try to
abuse us.
This patch adds a check_loads() function, whole unique purpose is to
make this check, allocating a temporary array of mask. We scan the
filter and propagate a bitmask information, telling us if a load M(K) is
allowed because a previous store M(K) is guaranteed. (So that
sk_run_filter() can possibly not read unitialized memory)
Note: this can uncover application bug, denying a filter attach,
previously allowed.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Dan Rosenberg <drosenberg@vsecurity.com>
---
net/core/filter.c | 70 ++++++++++++++++++++++++++++++++++++++------
1 file changed, 61 insertions(+), 9 deletions(-)
diff --git a/net/core/filter.c b/net/core/filter.c
index a44d27f..00a0d50 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -166,11 +166,9 @@ unsigned int sk_run_filter(struct sk_buff *skb, const struct sock_filter *fentry
u32 A = 0; /* Accumulator */
u32 X = 0; /* Index Register */
u32 mem[BPF_MEMWORDS]; /* Scratch Memory Store */
- unsigned long memvalid = 0;
u32 tmp;
int k;
- BUILD_BUG_ON(BPF_MEMWORDS > BITS_PER_LONG);
/*
* Process array of filter instructions.
*/
@@ -318,12 +316,10 @@ load_b:
X = K;
continue;
case BPF_S_LD_MEM:
- A = (memvalid & (1UL << K)) ?
- mem[K] : 0;
+ A = mem[K];
continue;
case BPF_S_LDX_MEM:
- X = (memvalid & (1UL << K)) ?
- mem[K] : 0;
+ X = mem[K];
continue;
case BPF_S_MISC_TAX:
X = A;
@@ -336,11 +332,9 @@ load_b:
case BPF_S_RET_A:
return A;
case BPF_S_ST:
- memvalid |= 1UL << K;
mem[K] = A;
continue;
case BPF_S_STX:
- memvalid |= 1UL << K;
mem[K] = X;
continue;
default:
@@ -419,6 +413,64 @@ load_b:
}
EXPORT_SYMBOL(sk_run_filter);
+/*
+ * Security :
+ * A BPF program is able to use 16 cells of memory to store intermediate
+ * values (check u32 mem[BPF_MEMWORDS] in sk_run_filter())
+ * As we dont want to clear mem[] array for each packet going through
+ * sk_run_filter(), we check that filter loaded by user never try to read
+ * a cell if not previously written, and we check all branches to be sure
+ * a malicious user doesnt try to abuse us.
+ */
+static int check_loads(struct sock_filter *filter, int flen)
+{
+ u16 *masks, memvalid = 0; /* one bit per cell, 16 cells */
+ int pc, ret = 0;
+
+ BUILD_BUG_ON(BPF_MEMWORDS > 16);
+ masks = kmalloc(flen * sizeof(*masks), GFP_KERNEL);
+ if (!masks)
+ return -ENOMEM;
+ memset(masks, 0xff, flen * sizeof(*masks));
+
+ for (pc = 0; pc < flen; pc++) {
+ memvalid &= masks[pc];
+
+ switch (filter[pc].code) {
+ case BPF_S_ST:
+ case BPF_S_STX:
+ memvalid |= (1 << filter[pc].k);
+ break;
+ case BPF_S_LD_MEM:
+ case BPF_S_LDX_MEM:
+ if (!(memvalid & (1 << filter[pc].k))) {
+ ret = -EINVAL;
+ goto error;
+ }
+ break;
+ case BPF_S_JMP_JA:
+ /* a jump must set masks on target */
+ masks[pc + 1 + filter[pc].k] &= memvalid;
+ break;
+ case BPF_S_JMP_JEQ_K:
+ case BPF_S_JMP_JEQ_X:
+ case BPF_S_JMP_JGE_K:
+ case BPF_S_JMP_JGE_X:
+ case BPF_S_JMP_JGT_K:
+ case BPF_S_JMP_JGT_X:
+ case BPF_S_JMP_JSET_X:
+ case BPF_S_JMP_JSET_K:
+ /* a jump must set masks on targets */
+ masks[pc + 1 + filter[pc].jt] &= memvalid;
+ masks[pc + 1 + filter[pc].jf] &= memvalid;
+ break;
+ }
+ }
+error:
+ kfree(masks);
+ return ret;
+}
+
/**
* sk_chk_filter - verify socket filter code
* @filter: filter to verify
@@ -547,7 +599,7 @@ int sk_chk_filter(struct sock_filter *filter, int flen)
switch (filter[flen - 1].code) {
case BPF_S_RET_K:
case BPF_S_RET_A:
- return 0;
+ return check_loads(filter, flen);
}
return -EINVAL;
}
^ permalink raw reply related
* Re: [PATCH 1/2] af_packet: use vmalloc_to_page() instead for the addresss returned by vmalloc()
From: Neil Horman @ 2010-12-01 20:44 UTC (permalink / raw)
To: Eric Dumazet; +Cc: Changli Gao, David S. Miller, Jiri Pirko, netdev
In-Reply-To: <1291216396.2856.861.camel@edumazet-laptop>
On Wed, Dec 01, 2010 at 04:13:16PM +0100, Eric Dumazet wrote:
> Le mercredi 01 décembre 2010 à 22:16 +0800, Changli Gao a écrit :
>
> > Even then, tpacket_fill_skb() is called for every skb, and
> > pgv_to_page() is used in it. We have to optimize pgv_to_page().
>
> With the __pure trick I gave, pgv_to_page() is _not_ called for the
> typical use case of af_packet : packet sniffing.
>
> Compiler is able to remove the call completely, since
>
> static inline void flush_dcache_page(struct page *page) { }
>
> The only remaining pgv_to_page() call is the one done in mmap packet
> send, since we have to do :
>
> page = pgv_to_page(data);
> get_page(page);
>
> I personally dont use this path, its known to be buggy...
>
> Optimize if you want, but make all this
> ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE conditional.
>
> Its not needed to maintain an array of 'struct page *' if its not needed
> at all.
>
+1 to this approach, its much cleaner than maintaing an array of struct pages to
do fast mappings. I just spent a few hours putting a test patch together to do
such a mapping, and it requires either doing a lengthly search of the ring
buffer, or passing around the struct pgv that the potentially vmalloced address
came from, which fans out quite alot and gets tricky in several places (the tx
paths skb desctructor for instance). At any rate, letting the compiler
eliminate code using __pure here seems much more efficient
Neil
> # vi +2448 block/blk-core.c
>
> #if ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE
> /**
> * rq_flush_dcache_pages - Helper function to flush all pages in a request
> * @rq: the request to be flushed
> *
> * Description:
> * Flush all pages in @rq.
> */
> void rq_flush_dcache_pages(struct request *rq)
> {
> struct req_iterator iter;
> struct bio_vec *bvec;
>
> rq_for_each_segment(bvec, rq, iter)
> flush_dcache_page(bvec->bv_page);
> }
> EXPORT_SYMBOL_GPL(rq_flush_dcache_pages);
> #endif
>
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply
* Re: [PATCH net-next] bnx2x: Add Nic partitioning mode (57712 devices)
From: David Miller @ 2010-12-01 20:40 UTC (permalink / raw)
To: dmitry; +Cc: netdev, eilong
In-Reply-To: <1290982177.6066.3.camel@lb-tlvb-dmitry>
From: "Dmitry Kravkov" <dmitry@broadcom.com>
Date: Mon, 29 Nov 2010 00:09:37 +0200
> NIC partitioning is another flavor of multi function - having few
> PCI functions share the same physical port. Unlike the currently
> supported mode of multi-function which depends on the switch
> configuration and uses outer-VLAN, the NPAR mode is switch independent
> and uses the MAC addresses to distribute incoming packets to the different
> functions. This patch adds the specific HW setting of the NPAR mode
> and some distinctions between switch dependent (SD) and
> switch independent (SI) multi-function (MF) modes where the configuration
> is not the same.
>
> Advance driver version to 1.60.00-6
>
> Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
> Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Applied to net-next-2.6, but I expect you to keep discussing the
naming and sysfs issues with Matt Domsch. :-)
^ permalink raw reply
* Re: [PATCH 2/3] net: snmp: fix the wrong ICMP_MIB_MAX value
From: David Miller @ 2010-12-01 20:36 UTC (permalink / raw)
To: shanwei; +Cc: netdev
In-Reply-To: <20101201.123550.15237244.davem@davemloft.net>
From: David Miller <davem@davemloft.net>
Date: Wed, 01 Dec 2010 12:35:50 -0800 (PST)
> From: Shan Wei <shanwei@cn.fujitsu.com>
> Date: Mon, 29 Nov 2010 14:53:55 +0800
>
>> @@ -60,8 +60,7 @@ struct ipstats_mib {
>> };
>>
>> /* ICMP */
>> -#define ICMP_MIB_MAX (__ICMP_MIB_MAX + 1)
>> -
>> +#define ICMP_MIB_MAX __ICMP_MIB_MAX
>> struct icmp_mib {
>
> In all of my trees there is an "ICMP_MIB_DUMMY" define here, and it's
> been there forever, I have no idea what you are patching against.
Nevermind I see that this depends upon your first patch.
Please resubmit all 3 patches once you've addressed the
feedback for patch #1.
^ 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