* 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 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] 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] 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: 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: 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: [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: 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 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
* [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
* [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 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
* 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
* 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 net-next-2.6] filter: add a security check at install time
From: Changli Gao @ 2010-12-02 2:30 UTC (permalink / raw)
To: Eric Dumazet; +Cc: David Miller, hagen, wirelesser, netdev, Dan Rosenberg
In-Reply-To: <1291236342.2856.1057.camel@edumazet-laptop>
On Thu, Dec 2, 2010 at 4:45 AM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> 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];
> +
It seems wrong. Think about the following instructions:
/* m[1] isn't set */
jeq jt jf
jt:
st m[1]
jmp ja
jf:
jmp ja2 /* m[1] is invalidated by masks */
ja:
ld m[1] /* -EINVAL is returned */
ja2:
So you need to search all the possible branches to validate the instructions.
> + 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;
> }
>
>
>
--
Regards,
Changli Gao(xiaosuo@gmail.com)
^ permalink raw reply
* Re: [Patch] bonding: clean up netpoll code
From: Cong Wang @ 2010-12-02 3:14 UTC (permalink / raw)
To: Stephen Hemminger
Cc: linux-kernel, Jiri Pirko, Neil Horman, netdev, David S. Miller,
Eric W. Biederman, Herbert Xu, bonding-devel, Jay Vosburgh
In-Reply-To: <20101201081457.23102445@nehalam>
On 12/02/10 00:14, Stephen Hemminger wrote:
> On Wed, 1 Dec 2010 02:45:45 -0500
> Amerigo Wang<amwang@redhat.com> wrote:
>
>> + if ((slave_dev->npinfo = bond_netpoll_info(bond))) {
>
> Split assignment and conditional into two lines
>
Ok, will change this in the next update.
Thanks!
^ permalink raw reply
* Re: [Patch] net: kill an RCU warning in inet_fill_link_af()
From: Cong Wang @ 2010-12-02 3:14 UTC (permalink / raw)
To: Eric Dumazet
Cc: linux-kernel, David S. Miller, Alexey Kuznetsov,
Pekka Savola (ipv6), James Morris, Hideaki YOSHIFUJI,
Patrick McHardy, netdev, Thomas Graf
In-Reply-To: <1291219386.2856.924.camel@edumazet-laptop>
On 12/02/10 00:03, Eric Dumazet wrote:
> Le mercredi 01 décembre 2010 à 19:14 +0800, Amerigo Wang a écrit :
>> From: WANG Cong<amwang@redhat.com>
>>
>> The latest net-next-2.6 triggers an RCU warning during boot,
>> lockdep complains that in inet_fill_link_af() we call rcu_dereference_check()
>> without rcu_read_lock() protection.
>>
>> This patch fixes it by replacing __in_dev_get_rcu() with in_dev_get().
>
> Here is a better version, thanks a lot for your report and initial
> patch.
>
>
> [PATCH net-next-2.6] net: kill an RCU warning in inet_fill_link_af()
>
> commits 9f0f7272 (ipv4: AF_INET link address family) and cf7afbfeb8c
> (rtnl: make link af-specific updates atomic) used incorrect
> __in_dev_get_rcu() in RTNL protected contexts, triggering PROVE_RCU
> warnings.
>
> Switch to __in_dev_get_rtnl(), wich is more appropriate, since we hold
> RTNL.
>
> Based on a report and initial patch from Amerigo Wang.
>
Alright, thanks for fixing it.
Reviewed-by: WANG Cong <amwang@redhat.com>
^ permalink raw reply
* jme: UDP checksum error, and lots of them
From: Jan Engelhardt @ 2010-12-02 3:39 UTC (permalink / raw)
To: netdev; +Cc: Guo-Fu Tseng
On 2.6.36-rc8 (somewhat older, but the message is still there in recent
kernels), for almost all UDP packets transmitted/receive, I get a kernel
warning
Dec 2 04:30:52 localhost kernel: [ 495.235252] jme 0000:02:00.5: eth0:
UDP Checksum error.
Apparently this has something to do with the "vpnc" connector program
I am using, given tcpdump reports this too.
Other than that nothing seems wrong; the VPN connection works as
expected.
04:31:30.700682 IP (tos 0x0, ttl 64, id 1981, offset 0, flags [DF], proto UDP
(17), length 128)
192.168.13.39.4500 > 134.76.22.1.4500: [bad udp cksum 9510!] UDP-encap:
ESP(spi=0xf531cf9c,seq=0x6545), length 100
0x0000: 4500 0080 07bd 4000 4011 c893 c0a8 0d27 E.....@.@......'
0x0010: 864c 1601 1194 1194 006c 6a9a f531 cf9c .L.......lj..1..
0x0020: 0000 6545 6b65 ec1a 5cad 484d 96ae a596 ..eEke..\.HM....
0x0030: 5db7 1e93 0c15 c4d4 510b 7206 e821 1d56 ].......Q.r..!.V
0x0040: c91b 1710 a8b9 6181 046a 210e 7804 c2fa ......a..j!.x...
0x0050: 6319 756c 1909 27be 4086 c1d2 01eb 241a c.ul..'.@.....$.
0x0060: 41c9 0548 dea7 2496 c633 abde a601 3253 A..H..$..3....2S
0x0070: 7585 7b75 b587 c008 ee05 880a dc4b a3e7 u.{u.........K..
04:31:30.721666 IP (tos 0x0, ttl 62, id 28480, offset 0, flags [DF], proto UDP
(17), length 1488)
134.76.22.1.4500 > 192.168.13.39.4500: [no cksum] UDP-encap:
ESP(spi=0x9d511170,seq=0x77eb), length 1460
0x0000: 4500 05d0 6f40 4000 3e11 5dc0 864c 1601 E...o@@.>.]..L..
0x0010: c0a8 0d27 1194 1194 05bc 0000 9d51 1170 ...'.........Q.p
Why does the JME driver care so much about this that it needs to print
this for every packet? It does not look like it has any offloading
features.
# ethtool eth0
Settings for eth0:
Supported ports: [ TP MII ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Advertised auto-negotiation: Yes
Speed: 100Mb/s
Duplex: Full
Port: MII
PHYAD: 1
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: pg
Wake-on: g
Current message level: 0x000020c6 (8390)
Link detected: yes
# lspci
02:00.5 Ethernet controller: JMicron Technology Corp. JMC260 PCI
Express Fast Ethernet Controller (rev 02)
02:00.5 0200: 197b:0260 (rev 02)
^ permalink raw reply
* Re: jme: UDP checksum error, and lots of them
From: Guo-Fu Tseng @ 2010-12-02 3:53 UTC (permalink / raw)
To: Jan Engelhardt, netdev
In-Reply-To: <alpine.LNX.2.01.1012020430190.4157@obet.zrqbmnf.qr>
On Thu, 2 Dec 2010 04:39:34 +0100 (CET), Jan Engelhardt wrote
> On 2.6.36-rc8 (somewhat older, but the message is still there in
> recent kernels), for almost all UDP packets transmitted/receive, I get
> a kernel warning
>
> Dec 2 04:30:52 localhost kernel: [ 495.235252] jme 0000:02:00.5:
> eth0: UDP Checksum error.
>
> Apparently this has something to do with the "vpnc" connector program
> I am using, given tcpdump reports this too.
> Other than that nothing seems wrong; the VPN connection works as
> expected.
>
> 04:31:30.700682 IP (tos 0x0, ttl 64, id 1981, offset 0, flags [DF],
> proto UDP
> (17), length 128) 192.168.13.39.4500 > 134.76.22.1.4500: [bad udp
> cksum 9510!] UDP-encap: ESP(spi=0xf531cf9c,seq=0x6545), length 100
> 0x0000: 4500 0080 07bd 4000 4011 c893 c0a8 0d27 E.....@.@......'
> 0x0010: 864c 1601 1194 1194 006c 6a9a f531 cf9c
> .L.......lj..1.. 0x0020: 0000 6545 6b65 ec1a 5cad 484d 96ae
> a596 ..eEke..\.HM.... 0x0030: 5db7 1e93 0c15 c4d4 510b 7206
> e821 1d56 ].......Q.r..!.V 0x0040: c91b 1710 a8b9 6181 046a
> 210e 7804 c2fa ......a..j!.x... 0x0050: 6319 756c 1909 27be
> 4086 c1d2 01eb 241a c.ul..'.@.....$. 0x0060: 41c9 0548 dea7
> 2496 c633 abde a601 3253 A..H..$..3....2S 0x0070: 7585 7b75
> b587 c008 ee05 880a dc4b a3e7 u.{u.........K..
> 04:31:30.721666 IP (tos 0x0, ttl 62, id 28480, offset 0, flags [DF],
> proto UDP
> (17), length 1488) 134.76.22.1.4500 > 192.168.13.39.4500: [no
> cksum] UDP-encap: ESP(spi=0x9d511170,seq=0x77eb), length 1460
> 0x0000: 4500 05d0 6f40 4000 3e11 5dc0 864c 1601 E...o@@.>.]..L..
> 0x0010: c0a8 0d27 1194 1194 05bc 0000 9d51 1170 ...'.........Q.p
>
> Why does the JME driver care so much about this that it needs to print
> this for every packet? It does not look like it has any offloading
> features.
I thought the error should be printed out due to it shouldn't be
happen in normal case.
It can be removed if not wanted, or change the printing to different
msglvl.
How does the Linux world prefer?
Guo-Fu Tseng
^ permalink raw reply
* [PATCH v2 1/4] net: snmp: fix the wrong ICMP_MIB_MAX value
From: Shan Wei @ 2010-12-02 4:04 UTC (permalink / raw)
To: David Miller; +Cc: Network-Maillist, Shan Wei
__ICMP_MIB_MAX is equal to the total number of icmp mib,
So no need to add 1. This wastes 4/8 bytes memory.
Change it to be same as ICMP6_MIB_MAX, TCP_MIB_MAX, UDP_MIB_MAX.
Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
---
include/net/snmp.h | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/include/net/snmp.h b/include/net/snmp.h
index a0e6180..aebb553 100644
--- a/include/net/snmp.h
+++ b/include/net/snmp.h
@@ -61,8 +61,7 @@ struct ipstats_mib {
/* ICMP */
#define ICMP_MIB_DUMMY __ICMP_MIB_MAX
-#define ICMP_MIB_MAX (__ICMP_MIB_MAX + 1)
-
+#define ICMP_MIB_MAX __ICMP_MIB_MAX
struct icmp_mib {
unsigned long mibs[ICMP_MIB_MAX];
};
--
1.6.3.3
^ permalink raw reply related
* [PATCH v2 2/4] tcp: use TCP_BASE_MSS to set basic mss value
From: Shan Wei @ 2010-12-02 4:04 UTC (permalink / raw)
To: David Miller, jheffner; +Cc: Network-Maillist, Shan Wei
TCP_BASE_MSS is defined, but not used.
commit 5d424d5a introduce this macro, so use
it to initial sysctl_tcp_base_mss.
commit 5d424d5a674f782d0659a3b66d951f412901faee
Author: John Heffner <jheffner@psc.edu>
Date: Mon Mar 20 17:53:41 2006 -0800
[TCP]: MTU probing
Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
---
net/ipv4/tcp_output.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index bb8f547..7f65ce6 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -55,7 +55,7 @@ int sysctl_tcp_workaround_signed_windows __read_mostly = 0;
int sysctl_tcp_tso_win_divisor __read_mostly = 3;
int sysctl_tcp_mtu_probing __read_mostly = 0;
-int sysctl_tcp_base_mss __read_mostly = 512;
+int sysctl_tcp_base_mss __read_mostly = TCP_BASE_MSS;
/* By default, RFC2861 behavior. */
int sysctl_tcp_slow_start_after_idle __read_mostly = 1;
--
1.6.3.3
^ permalink raw reply related
* [PATCH v2 3/4] ipv6: use ND_REACHABLE_TIME and ND_RETRANS_TIMER instead of magic number
From: Shan Wei @ 2010-12-02 4:05 UTC (permalink / raw)
To: David Miller, Network-Maillist,
yoshfuji@linux-ipv6.org >> YOSHIFUJI Hideaki
Cc: Shan Wei
ND_REACHABLE_TIME and ND_RETRANS_TIMER have defined
since v2.6.12-rc2, but never been used.
So use them instead of magic number.
This patch also changes original code style to read comfortably .
Thank YOSHIFUJI Hideaki for pointing it out.
Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
---
net/ipv6/ndisc.c | 24 ++++++++++++------------
1 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index 998d6d2..e18f841 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -141,18 +141,18 @@ struct neigh_table nd_tbl = {
.proxy_redo = pndisc_redo,
.id = "ndisc_cache",
.parms = {
- .tbl = &nd_tbl,
- .base_reachable_time = 30 * HZ,
- .retrans_time = 1 * HZ,
- .gc_staletime = 60 * HZ,
- .reachable_time = 30 * HZ,
- .delay_probe_time = 5 * HZ,
- .queue_len = 3,
- .ucast_probes = 3,
- .mcast_probes = 3,
- .anycast_delay = 1 * HZ,
- .proxy_delay = (8 * HZ) / 10,
- .proxy_qlen = 64,
+ .tbl = &nd_tbl,
+ .base_reachable_time = ND_REACHABLE_TIME,
+ .retrans_time = ND_RETRANS_TIMER,
+ .gc_staletime = 60 * HZ,
+ .reachable_time = ND_REACHABLE_TIME,
+ .delay_probe_time = 5 * HZ,
+ .queue_len = 3,
+ .ucast_probes = 3,
+ .mcast_probes = 3,
+ .anycast_delay = 1 * HZ,
+ .proxy_delay = (8 * HZ) / 10,
+ .proxy_qlen = 64,
},
.gc_interval = 30 * HZ,
.gc_thresh1 = 128,
--
1.6.3.3
^ permalink raw reply related
* [PATCH v2 4/4] net: kill unused macros from head file
From: Shan Wei @ 2010-12-02 4:05 UTC (permalink / raw)
To: David Miller, yoshfuji@linux-ipv6.org >> YOSHIFUJI Hideaki
Cc: Network-Maillist, Shan Wei
These macros have been defined for several years since v2.6.12-rc2(tracing by git),
but never be used. So remove them.
Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
---
To yoshifuji-san:
I can't find any magic number in net/ipv6/addrconf.c
can be replaced by RETRANS_TIMER.
---
include/net/addrconf.h | 2 --
include/net/ip6_route.h | 1 -
include/net/ndisc.h | 3 ---
include/net/snmp.h | 1 -
include/net/sock.h | 3 ---
include/net/tcp.h | 6 ------
6 files changed, 0 insertions(+), 16 deletions(-)
diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index a944124..23710aa 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -1,8 +1,6 @@
#ifndef _ADDRCONF_H
#define _ADDRCONF_H
-#define RETRANS_TIMER HZ
-
#define MAX_RTR_SOLICITATIONS 3
#define RTR_SOLICITATION_INTERVAL (4*HZ)
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h
index 278312c..52c0550 100644
--- a/include/net/ip6_route.h
+++ b/include/net/ip6_route.h
@@ -3,7 +3,6 @@
#define IP6_RT_PRIO_USER 1024
#define IP6_RT_PRIO_ADDRCONF 256
-#define IP6_RT_PRIO_KERN 512
struct route_info {
__u8 type;
diff --git a/include/net/ndisc.h b/include/net/ndisc.h
index 895997b..e0e594f 100644
--- a/include/net/ndisc.h
+++ b/include/net/ndisc.h
@@ -42,9 +42,6 @@ enum {
#define ND_REACHABLE_TIME (30*HZ)
#define ND_RETRANS_TIMER HZ
-#define ND_MIN_RANDOM_FACTOR (1/2)
-#define ND_MAX_RANDOM_FACTOR (3/2)
-
#ifdef __KERNEL__
#include <linux/compiler.h>
diff --git a/include/net/snmp.h b/include/net/snmp.h
index aebb553..762e2ab 100644
--- a/include/net/snmp.h
+++ b/include/net/snmp.h
@@ -60,7 +60,6 @@ struct ipstats_mib {
};
/* ICMP */
-#define ICMP_MIB_DUMMY __ICMP_MIB_MAX
#define ICMP_MIB_MAX __ICMP_MIB_MAX
struct icmp_mib {
unsigned long mibs[ICMP_MIB_MAX];
diff --git a/include/net/sock.h b/include/net/sock.h
index 5557dfb..717cfbf 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -516,9 +516,6 @@ static __inline__ void sk_add_bind_node(struct sock *sk,
#define sk_nulls_for_each_from(__sk, node) \
if (__sk && ({ node = &(__sk)->sk_nulls_node; 1; })) \
hlist_nulls_for_each_entry_from(__sk, node, sk_nulls_node)
-#define sk_for_each_continue(__sk, node) \
- if (__sk && ({ node = &(__sk)->sk_node; 1; })) \
- hlist_for_each_entry_continue(__sk, node, sk_node)
#define sk_for_each_safe(__sk, node, tmp, list) \
hlist_for_each_entry_safe(__sk, node, tmp, list, sk_node)
#define sk_for_each_bound(__sk, node, list) \
diff --git a/include/net/tcp.h b/include/net/tcp.h
index e36c874..ea819cc 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -100,12 +100,6 @@ extern void tcp_time_wait(struct sock *sk, int state, int timeo);
#define TCP_SYNACK_RETRIES 5 /* number of times to retry passive opening a
* connection: ~180sec is RFC minimum */
-
-#define TCP_ORPHAN_RETRIES 7 /* number of times to retry on an orphaned
- * socket. 7 is ~50sec-16min.
- */
-
-
#define TCP_TIMEWAIT_LEN (60*HZ) /* how long to wait to destroy TIME-WAIT
* state, about 60 seconds */
#define TCP_FIN_TIMEOUT TCP_TIMEWAIT_LEN
--
1.6.3.3
^ permalink raw reply related
* Re: jme: UDP checksum error, and lots of them
From: David Miller @ 2010-12-02 4:09 UTC (permalink / raw)
To: jengelh; +Cc: netdev, cooldavid
In-Reply-To: <alpine.LNX.2.01.1012020430190.4157@obet.zrqbmnf.qr>
From: Jan Engelhardt <jengelh@medozas.de>
Date: Thu, 2 Dec 2010 04:39:34 +0100 (CET)
> Why does the JME driver care so much about this that it needs to print
> this for every packet? It does not look like it has any offloading
> features.
Well I'm glad it let us know about the bad checksum which would otherwise
have been unnoticed.
Please try to pinpoint why the checksum is bad, because it seems that
tcpdump agrees with the driver. Perhaps it's some side effect of how
vpnc uses TUN/TAP, or something like that.
Seeing the bad checksum even in tcpdump, and then seeing proper replies
going back, that is very suspicious and should be looked into.
^ permalink raw reply
* Re: jme: UDP checksum error, and lots of them
From: Guo-Fu Tseng @ 2010-12-02 4:33 UTC (permalink / raw)
To: David Miller, jengelh; +Cc: netdev
In-Reply-To: <20101201.200935.71110482.davem@davemloft.net>
On Wed, 01 Dec 2010 20:09:35 -0800 (PST), David Miller wrote
> From: Jan Engelhardt <jengelh@medozas.de>
> Date: Thu, 2 Dec 2010 04:39:34 +0100 (CET)
>
> > Why does the JME driver care so much about this that it needs to print
> > this for every packet? It does not look like it has any offloading
> > features.
>
> Well I'm glad it let us know about the bad checksum which would otherwise
> have been unnoticed.
>
> Please try to pinpoint why the checksum is bad, because it seems that
> tcpdump agrees with the driver. Perhaps it's some side effect of how
> vpnc uses TUN/TAP, or something like that.
>
> Seeing the bad checksum even in tcpdump, and then seeing proper replies
> going back, that is very suspicious and should be looked into.
> --
> 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
Indeed... It is suspicious to reply proper response against the packet
with bad checksum.
Jan: Would you try to turn off the rx-checksum offloading with ethtool
and see how it goes?
I suspect that there might be some the HW-Checksum behavior error.
ex: Replaced the UDP checksum field while it's all zero(no need to checksum)
Guo-Fu Tseng
^ 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