* Re: [PATCH net-next 2/6] cnic: Finetune iSCSI connection reset.
From: David Miller @ 2010-02-26 10:11 UTC (permalink / raw)
To: mchan; +Cc: netdev
In-Reply-To: <1267058529-18454-2-git-send-email-mchan@broadcom.com>
From: "Michael Chan" <mchan@broadcom.com>
Date: Wed, 24 Feb 2010 16:42:05 -0800
> From: Eddie Wai <waie@broadcom.com>
>
> For bnx2 devices, always send notification to bnx2i to let it initiate
> the cleanup when RST is received.
>
> For bnx2x devices, add unsolicited RST_COMP handling to start the cleanup.
>
> Signed-off-by: Eddie Wai <waie@broadcom.com>
> Signed-off-by: Michael Chan <mchan@broadcom.com>
> Signed-off-by: Benjamin Li <benli@broadcom.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next 1/6] cnic: Finetune iSCSI connection set up.
From: David Miller @ 2010-02-26 10:11 UTC (permalink / raw)
To: mchan; +Cc: netdev
In-Reply-To: <1267058529-18454-1-git-send-email-mchan@broadcom.com>
From: "Michael Chan" <mchan@broadcom.com>
Date: Wed, 24 Feb 2010 16:42:04 -0800
> From: Eddie Wai <waie@broadcom.com>
>
> Initialize IP ID and handle some additional connection errors.
>
> Signed-off-by: Eddie Wai <waie@broadcom.com>
> Signed-off-by: Michael Chan <mchan@broadcom.com>
> Signed-off-by: Benjamin Li <benli@broadcom.com>
Applied.
^ permalink raw reply
* Re: [net-next-2.6 PATCH 3/3] ixgbe: Do not allocate too many netdev txqueues
From: David Miller @ 2010-02-26 10:10 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, gospo, john.r.fastabend
In-Reply-To: <20100226091519.19796.82441.stgit@localhost.localdomain>
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Fri, 26 Feb 2010 01:15:21 -0800
> From: John Fastabend <john.r.fastabend@intel.com>
>
> Instead of allocating 128 struct netdev_queue per device, use the
> minimum value between 128 and the number of possible txq's, to
> reduce ram usage and "tc -s -d class shod dev .." output.
>
> This patch fixes Eric Dumazet's patch to set the TX queues to
> the correct minimum.
>
> Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Applied.
^ permalink raw reply
* Re: [net-next-2.6 PATCH 2/3] ixgbe: do not stop tx queues in ixgbe_set_tso
From: David Miller @ 2010-02-26 10:10 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, gospo, john.r.fastabend, peter.p.waskiewicz.jr
In-Reply-To: <20100226091456.19796.53149.stgit@localhost.localdomain>
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Fri, 26 Feb 2010 01:14:58 -0800
> From: John Fastabend <john.r.fastabend@intel.com>
>
> Disabling TSO can cause the dev_watchdog timer to be triggered because
> when TSO is disabled netif_tx_stop_all_queues is called. If the watchdog
> timer fires while the queues are stopped and traffic has not recently been
> sent on a paticular queue this is falsly identified as a hang and
> ndo_tx_timeout() is called. This is ocossionally seen during testing.
>
> This removes the netif_tx_stop_all_queues() it is not needed. The scheduler
> submits skb's with dev_hard_start_xmit(), this checks if netif_needs_gso and
> if so it calls dev_gso_segment. Disabling TSO will cause dev_hard_start_xmit()
> to do the gso processing. However ixgbe does not use the features flags to
> determine if it needs to use tso or not instead it uses skb->gso_size so
> ixgbe will process these frames correctly regardless of the netdev features
> flag.
>
> Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
> Acked-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Applied.
^ permalink raw reply
* Re: [net-next-2.6 PATCH 1/3] ixgbe: Fix DMA mapping/unmapping issues when HWRSC is enabled on IOMMU enabled kernels
From: David Miller @ 2010-02-26 10:10 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, gospo, mallikarjuna.chilakala
In-Reply-To: <20100226091318.19796.70225.stgit@localhost.localdomain>
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Fri, 26 Feb 2010 01:14:37 -0800
> From: Mallikarjuna R Chilakala <mallikarjuna.chilakala@intel.com>
>
> Work around 82599 HW issue when HWRSC is enabled on IOMMU enabled
> kernels. 82599 HW is updating the header information after setting the
> descriptor to done, resulting DMA mapping/unmapping issues on IOMMU
> enabled systems. To work around the issue delay unmapping of first packet
> that carries the header information until end of packet is reached.
>
> Signed-off-by: Mallikarjuna R Chilakala <mallikarjuna.chilakala@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Applied.
^ permalink raw reply
* Re: [PATCH 5/5] net: sock_aio_write: set CMSG_MSG_COMPAT flag if is_compat_task
From: David Miller @ 2010-02-26 10:06 UTC (permalink / raw)
To: fw; +Cc: netdev, johannes
In-Reply-To: <20100226100305.GA16504@Chamillionaire.breakpoint.cc>
From: Florian Westphal <fw@strlen.de>
Date: Fri, 26 Feb 2010 11:03:05 +0100
> If its necessary to set MSG_CMSG_COMPAT properly for plain
> write() as well to have the patch set merged then
> I'll see about adding such a ->compat_write and will resubmit
> the entire set again once net-next opens again for 2.6.35.
If you can get the VFS folks to take the addition of the
->compat_write hook quickly, I can still merge your patch series for
2.6.34
^ permalink raw reply
* Re: [net-next-2.6 PATCH] net: convert multiple drivers to use netdev_for_each_mc_addr, part5 V2
From: David Miller @ 2010-02-26 10:03 UTC (permalink / raw)
To: jpirko; +Cc: netdev
In-Reply-To: <20100226.014953.203661752.davem@davemloft.net>
100 EURO says you didn't compile test this.
@@ -975,7 +968,7 @@ static void do_set_multicast_list(struct net_device *dev)
if(dev->flags&IFF_PROMISC)
ei_outb_p(E8390_RXCONFIG | 0x18, e8390_base + EN0_RXCR);
- else if(dev->flags&IFF_ALLMULTI || dev->mc_list)
+ else if (dev->flags & IFF_ALLMULTI || !netdev_mc_addr(dev))
ei_outb_p(E8390_RXCONFIG | 0x08, e8390_base + EN0_RXCR);
else
ei_outb_p(E8390_RXCONFIG, e8390_base + EN0_RXCR);
I'll fix it up, but you have to start getting proper build
coverage of your patches!
I really don't care how slow your netbook is, this case could have
been easily prevented.
^ permalink raw reply
* Re: [PATCH 5/5] net: sock_aio_write: set CMSG_MSG_COMPAT flag if is_compat_task
From: Florian Westphal @ 2010-02-26 10:03 UTC (permalink / raw)
To: David Miller; +Cc: netdev, johannes
In-Reply-To: <20100226.011646.257642830.davem@davemloft.net>
David Miller <davem@davemloft.net> wrote:
> From: Florian Westphal <fwestphal@astaro.com>
> Date: Fri, 19 Feb 2010 13:41:47 +0100
>
> > some programs (e.g. pluto ike daemon), send netlink data to the
> > kernel via write().
> >
> > So far, the CMSG_MSG_COMPAT flag is not set in this case, which
> > results in the kernel interpreting the netlink data the wrong way.
> >
> > An alternative solution is to switch userspace to sendmsg() when
> > using netlink sockets.
> >
> > Cc: Johannes Berg <johannes@sipsolutions.net>
> > Signed-off-by: Florian Westphal <fwestphal@astaro.com>
>
> I was about to apply this entire patch set, but thinking about this
> one patch we have to do it differently:
>
> > @@ -837,6 +837,10 @@ static ssize_t do_sock_write(struct msghdr *msg, struct kiocb *iocb,
> > msg->msg_iov = (struct iovec *)iov;
> > msg->msg_iovlen = nr_segs;
> > msg->msg_flags = (file->f_flags & O_NONBLOCK) ? MSG_DONTWAIT : 0;
> > +#ifdef CONFIG_COMPAT
> > + if (is_compat_task())
> > + msg->msg_flags |= MSG_CMSG_COMPAT;
> > +#endif
> > if (sock->type == SOCK_SEQPACKET)
> > msg->msg_flags |= MSG_EOR;
> >
>
> What if the kernel itself does a socket write, say from a software
> interrupt or to generate events in response to a user event,
> and the current process happens to be a compat task?
>
> I think this could even occur for NFS perhaps?
I do not know. But it certainly shows that this patch should not be
applied.
> Anyways, that isn't going to work properly.
>
> We might need to add ->compat_write to file operations to do
> it properly.
Fair enough.
If its necessary to set MSG_CMSG_COMPAT properly for plain
write() as well to have the patch set merged then
I'll see about adding such a ->compat_write and will resubmit
the entire set again once net-next opens again for 2.6.35.
Thanks,
Florian
^ permalink raw reply
* Re: [PATCH] greth: convert to netdev_tx_t
From: David Miller @ 2010-02-26 9:51 UTC (permalink / raw)
To: "kirjanov, kirjanov; +Cc: kristoffer, netdev
In-Reply-To: <20100224202533.GA4531@coldcone>
From: "Denis Kirjanov <kirjanov@gmail.com" <kirjanov@gmail.com>
Date: Wed, 24 Feb 2010 23:25:33 +0300
> Convert to netdev_tx_t
> Signed-off-by: Denis Kirjanov <kirjanov@gmail.com>
Applied.
^ permalink raw reply
* Re: [PATCH] sis190: handle DMA mapping errors
From: David Miller @ 2010-02-26 9:51 UTC (permalink / raw)
To: "kirjanov, kirjanov; +Cc: romieu, netdev
In-Reply-To: <20100224184118.GA4237@coldcone>
From: "Denis Kirjanov <kirjanov@gmail.com" <kirjanov@gmail.com>
Date: Wed, 24 Feb 2010 21:41:18 +0300
> Signed-off-by: Denis Kirjanov <kirjanov@gmail.com>
Applied.
^ permalink raw reply
* Re: [PATCH] tc35815: Fix double locking on NAPI
From: David Miller @ 2010-02-26 9:51 UTC (permalink / raw)
To: anemo; +Cc: netdev, ralf.roesch
In-Reply-To: <1267027234-7853-1-git-send-email-anemo@mba.ocn.ne.jp>
From: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Date: Thu, 25 Feb 2010 01:00:34 +0900
> Isolate spinlock for tx and rx to resolve double-locking.
>
> This is potential bug while this controller does not exist on any
> SMP platforms, but lockdep or rt-preempt reveals this bug.
>
> Reported-by: Ralf Roesch <ralf.roesch@rw-gmbh.de>
> Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Applied.
^ permalink raw reply
* Re: [PATCH] isa-skelton: Remove a wrong netif_wake_queue() call
From: David Miller @ 2010-02-26 9:51 UTC (permalink / raw)
To: anemo; +Cc: netdev
In-Reply-To: <1267027217-7812-1-git-send-email-anemo@mba.ocn.ne.jp>
From: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Date: Thu, 25 Feb 2010 01:00:17 +0900
> The netif_wake_queue() is called correctly (i.e. only on !txfull
> condition) from net_tx(). So Unconditional call to the
> netif_wake_queue() here is wrong. This might cause calling of
> start_xmit routine on txfull state and trigger tx-ring overflow.
>
> This fix is ported from commit 662a96bd6f020782dfbdc0d0bd177c7dbb556687.
>
> Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Applied.
Please reference commits by also making mention of the commit
log message header line. This way when a patch is backported
into another tree, people can still find it even if the
SHA1 ID is different. For exmaple, I fixed the above to
read:
This fix is ported from commit 662a96bd6f020782dfbdc0d0bd177c7dbb556687
("tc35815: Remove a wrong netif_wake_queue() call which triggers BUG_ON").
Thanks.
^ permalink raw reply
* Re: [net-next-2.6 PATCH] net: convert multiple drivers to use netdev_for_each_mc_addr, part6
From: David Miller @ 2010-02-26 9:50 UTC (permalink / raw)
To: jpirko; +Cc: netdev
In-Reply-To: <20100224091707.GB2663@psychotron.lab.eng.brq.redhat.com>
From: Jiri Pirko <jpirko@redhat.com>
Date: Wed, 24 Feb 2010 10:17:07 +0100
>
> [net-next-2.6 PATCH] net: convert multiple drivers to use netdev_for_each_mc_addr, part6
>
> Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Applied.
^ permalink raw reply
* Re: [net-next-2.6 PATCH] octeon: convert to use netdev_for_each_mc_addr
From: David Miller @ 2010-02-26 9:50 UTC (permalink / raw)
To: jpirko; +Cc: netdev
In-Reply-To: <20100223195457.GF2673@psychotron.redhat.com>
From: Jiri Pirko <jpirko@redhat.com>
Date: Tue, 23 Feb 2010 20:54:58 +0100
> Hmm so actually my original patch including this bit was correct,
> "list = list->next;" confused me :) - will send patch correcting that in a few.
>
> Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Applied.
^ permalink raw reply
* Re: [net-next-2.6 PATCH] net: convert multiple drivers to use netdev_for_each_mc_addr, part5 V2
From: David Miller @ 2010-02-26 9:49 UTC (permalink / raw)
To: jpirko; +Cc: netdev
In-Reply-To: <20100223191948.GE2673@psychotron.redhat.com>
From: Jiri Pirko <jpirko@redhat.com>
Date: Tue, 23 Feb 2010 20:19:49 +0100
> removed some needless checks and also corrected bug in lp486e (dmi was passed
> instead of dmi->dmi_addr)
>
> Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next-2.6] can: netlink support for bus-error reporting and counters
From: David Miller @ 2010-02-26 9:49 UTC (permalink / raw)
To: wg; +Cc: netdev, socketcan-core
In-Reply-To: <4B838FFD.5070302@grandegger.com>
From: Wolfgang Grandegger <wg@grandegger.com>
Date: Tue, 23 Feb 2010 09:21:17 +0100
> This patch makes the bus-error reporting configurable and allows to
> retrieve the CAN TX and RX bus error counters via netlink interface.
> I have added support for the SJA1000. The TX and RX bus error counters
> are also copied to the data fields 6..7 of error messages when state
> changes are reported.
>
> Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Applied.
^ permalink raw reply
* [PATCH] ipv6: Remove IPV6_ADDR_RESERVED
From: Ulrich Weber @ 2010-02-26 9:28 UTC (permalink / raw)
To: davem; +Cc: netdev
RFC 4291 section 2.4 states that all uncategorized addresses
should be considered as Global Unicast.
This will remove IPV6_ADDR_RESERVED completely
and return IPV6_ADDR_UNICAST in ipv6_addr_type() instead.
Signed-off-by: Ulrich Weber <uweber@astaro.com>
---
include/net/ipv6.h | 1 -
net/ipv6/addrconf.c | 3 +--
net/ipv6/addrconf_core.c | 2 +-
net/ipv6/route.c | 2 +-
4 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index ccab594..655e0b6 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -73,7 +73,6 @@
#define IPV6_ADDR_SCOPE_MASK 0x00f0U
#define IPV6_ADDR_MAPPED 0x1000U
-#define IPV6_ADDR_RESERVED 0x2000U /* reserved address space */
/*
* Addr scopes
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 143791d..1a5d2e2 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -992,8 +992,7 @@ struct ipv6_saddr_dst {
static inline int ipv6_saddr_preferred(int type)
{
- if (type & (IPV6_ADDR_MAPPED|IPV6_ADDR_COMPATv4|
- IPV6_ADDR_LOOPBACK|IPV6_ADDR_RESERVED))
+ if (type & (IPV6_ADDR_MAPPED|IPV6_ADDR_COMPATv4|IPV6_ADDR_LOOPBACK))
return 1;
return 0;
}
diff --git a/net/ipv6/addrconf_core.c b/net/ipv6/addrconf_core.c
index 3f82e95..6b03826 100644
--- a/net/ipv6/addrconf_core.c
+++ b/net/ipv6/addrconf_core.c
@@ -72,7 +72,7 @@ int __ipv6_addr_type(const struct in6_addr *addr)
IPV6_ADDR_SCOPE_TYPE(IPV6_ADDR_SCOPE_GLOBAL)); /* addr-select 3.3 */
}
- return (IPV6_ADDR_RESERVED |
+ return (IPV6_ADDR_UNICAST |
IPV6_ADDR_SCOPE_TYPE(IPV6_ADDR_SCOPE_GLOBAL)); /* addr-select 3.4 */
}
EXPORT_SYMBOL(__ipv6_addr_type);
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index c2bd74c..86e72d7 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -1873,7 +1873,7 @@ static int ip6_pkt_drop(struct sk_buff *skb, u8 code, int ipstats_mib_noroutes)
switch (ipstats_mib_noroutes) {
case IPSTATS_MIB_INNOROUTES:
type = ipv6_addr_type(&ipv6_hdr(skb)->daddr);
- if (type == IPV6_ADDR_ANY || type == IPV6_ADDR_RESERVED) {
+ if (type == IPV6_ADDR_ANY) {
IP6_INC_STATS(dev_net(dst->dev), ip6_dst_idev(dst),
IPSTATS_MIB_INADDRERRORS);
break;
--
1.6.3.3
^ permalink raw reply related
* [PATCH] ipv6: Use 1280 as min MTU for ipv6 forwarding
From: Ulrich Weber @ 2010-02-26 9:27 UTC (permalink / raw)
To: davem; +Cc: netdev
Clients will set their MTU to 1280 if they receive a
ICMPV6_PKT_TOOBIG message with an MTU less than 1280.
To allow encapsulating of packets over a 1280 link
we should always accept packets with a size of 1280
for forwarding even if the path has a lower MTU and
fragment the encapsulated packets afterwards.
In case a forwarded packet is not going to be encapsulated
a ICMPV6_PKT_TOOBIG msg will still be send by ip6_fragment()
with the correct MTU.
Signed-off-by: Ulrich Weber <uweber@astaro.com>
---
net/ipv6/ip6_output.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index eb6d097..8e19bfe 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -402,6 +402,7 @@ int ip6_forward(struct sk_buff *skb)
struct ipv6hdr *hdr = ipv6_hdr(skb);
struct inet6_skb_parm *opt = IP6CB(skb);
struct net *net = dev_net(dst->dev);
+ u32 mtu;
if (net->ipv6.devconf_all->forwarding == 0)
goto error;
@@ -509,10 +510,14 @@ int ip6_forward(struct sk_buff *skb)
}
}
- if (skb->len > dst_mtu(dst)) {
+ mtu = dst_mtu(dst);
+ if (mtu < IPV6_MIN_MTU)
+ mtu = IPV6_MIN_MTU;
+
+ if (skb->len > mtu) {
/* Again, force OUTPUT device used as source address */
skb->dev = dst->dev;
- icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, dst_mtu(dst), skb->dev);
+ icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu, skb->dev);
IP6_INC_STATS_BH(net,
ip6_dst_idev(dst), IPSTATS_MIB_INTOOBIGERRORS);
IP6_INC_STATS_BH(net,
@@ -622,8 +627,7 @@ static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *))
mtu = ip6_skb_dst_mtu(skb);
/* We must not fragment if the socket is set to force MTU discovery
- * or if the skb it not generated by a local socket. (This last
- * check should be redundant, but it's free.)
+ * or if the skb it not generated by a local socket.
*/
if (!skb->local_df) {
skb->dev = skb_dst(skb)->dev;
--
1.6.3.3
^ permalink raw reply related
* Re: [PATCH net-next 1/7] drivers/net/chelsio: Use pr_<level>, netif_msg_<type>
From: David Miller @ 2010-02-26 9:40 UTC (permalink / raw)
To: joe; +Cc: netdev, linux-kernel
In-Reply-To: <819e937a3feefb278c2816db2947eff95dd6740a.1266893507.git.joe@perches.com>
From: Joe Perches <joe@perches.com>
Date: Mon, 22 Feb 2010 18:56:57 -0800
> Convert CH_<level> and CH_DBG uses to pr_<level> and netif equivalents
> Remove CH_<level> and CH_DBG macro definitions
>
> Signed-off-by: Joe Perches <joe@perches.com>
Applied, thanks Joe.
BTW:
> @@ -734,8 +734,9 @@ int t1_elmer0_ext_intr_handler(adapter_t *adapter)
> break;
> case CHBT_BOARD_8000:
> case CHBT_BOARD_CHT110:
> - CH_DBG(adapter, INTR, "External interrupt cause 0x%x\n",
> - cause);
> + if (netif_msg_intr(adapter))
> + dev_dbg(&adapter->pdev->dev,
Trailing whitespace on that last line. I fixed it up when
adding the patch to my tree.
^ permalink raw reply
* Re: [PATCH net-next 2/7] drivers/net/myri10ge: Use pr_<level> and netdev_<level>
From: David Miller @ 2010-02-26 9:40 UTC (permalink / raw)
To: joe; +Cc: netdev, gallatin, brice, linux-kernel
In-Reply-To: <0a98bb59c8ba36ea37bac53137e2b594bbc984d8.1266893507.git.joe@perches.com>
From: Joe Perches <joe@perches.com>
Date: Mon, 22 Feb 2010 18:56:58 -0800
> Add #define pr_fmt(fmt)
> Convert logging messages to pr_<level> and netdev_<level>
>
> Signed-off-by: Joe Perches <joe@perches.com>
Applied.
^ permalink raw reply
* Re: [RFC PATCH] fix problems with NETIF_F_HIGHDMA in networking drivers
From: David Miller @ 2010-02-26 9:36 UTC (permalink / raw)
To: hancockrwd; +Cc: linux-kernel, netdev, linux-usb
In-Reply-To: <4B834159.7070105@gmail.com>
From: Robert Hancock <hancockrwd@gmail.com>
Date: Mon, 22 Feb 2010 20:45:45 -0600
> Many networking drivers have issues with the use of the NETIF_F_HIGHDMA flag.
> This flag actually indicates whether or not the device/driver can handle
> skbs located in high memory (as opposed to lowmem). However, many drivers
> incorrectly treat this flag as indicating that 64-bit DMA is supported, which
> has nothing to do with its actual function. It makes no sense to make setting
> NETIF_F_HIGHDMA conditional on whether a 64-bit DMA mask has been set, as many
> drivers do, since if highmem DMA is supported at all, it should work regardless
> of whether 64-bit DMA is supported. Failing to set NETIF_F_HIGHDMA when it
> should be can hurt performance on architectures which use highmem since it
> results in needless data copying.
>
> This fixes up the networking drivers which currently use NETIF_F_HIGHDMA to
> not do so conditionally on DMA mask settings.
>
> For the USB kaweth and usbnet drivers, this patch also uncomments and corrects
> some code to set NETIF_F_HIGHDMA based on the USB host controller's DMA mask.
> These drivers should be able to access highmem unless the host controller is
> non-DMA-capable, which is indicated by the DMA mask being null.
>
> Signed-off-by: Robert Hancock <hancockrwd@gmail.com>
Well, if the device isn't using 64-bit DMA addressing and the platform
uses direct (no-iommu) mapping of physical to DMA addresses , won't
your change break things? The device will get a >4GB DMA address or
the DMA mapping layer will signal an error.
That's really part of the what the issue is I think.
So, this trigger the check in check_addr() in
arch/x86/kernel/pci-nommu.c when such packets try to get mapped by the
driver, right?
That will make the DMA mapping call fail, and the packet will be
dropped permanently. And hey, on top of it, many of these drivers you
remove the setting from don't even check the mapping call return
values for errors.
So even bigger breakage. One example is drivers/net/8139cp.c,
it just does dma_map_single() and uses the result.
It really depends upon that NETIF_F_HIGHDMA setting for correct
operation.
And even if something like swiotlb is available, now we're going
to do bounce buffering which is largely equivalent to what
a lack of NETIF_F_HIGHDMA will do. Except that once NETIF_F_HIGHDMA
copies the packet to lowmem it will only do that once, whereas if
the packet goes to multiple devices swiotlb might copy the packet
to a bounce buffer multiple times.
We definitely can't apply your patch as-is.
^ permalink raw reply
* [PATCH V2] net: add accounting for socket backlog
From: Zhu Yi @ 2010-02-26 9:27 UTC (permalink / raw)
Cc: netdev, Zhu Yi, David Miller, Eric Dumazet
We got system OOM while running some UDP netperf testing on the loopback
device. The case is multiple senders sent stream UDP packets to a single
receiver via loopback on local host. Of course, the receiver is not able
to handle all the packets in time. But we surprisingly found that these
packets were not discarded due to the receiver's sk->sk_rcvbuf limit.
Instead, they are kept queuing to sk->sk_backlog and finally ate up all
the memory. We believe this is a secure hole that a none privileged user
can crash the system.
The root cause for this problem is, when the receiver is doing
__release_sock() (i.e. after userspace recv, kernel udp_recvmsg ->
skb_free_datagram_locked -> release_sock), it moves skbs from backlog to
sk_receive_queue with the softirq enabled. In the above case, multiple
busy senders will almost make it an endless loop. The skbs in the
backlog end up eat all the system memory.
The patch fixed this problem by adding accounting for the socket
backlog. So that the backlog size can be restricted by protocol's choice
(i.e. UDP).
Reported-by: Alex Shi <alex.shi@intel.com>
Cc: David Miller <davem@davemloft.net>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
---
V2: remove atomic operation for sk_backlog.len
limit UDP backlog size to 2*sk->sk_rcvbuf
diff --git a/include/net/sock.h b/include/net/sock.h
index 3f1a480..9f6893b 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -253,6 +253,7 @@ struct sock {
struct {
struct sk_buff *head;
struct sk_buff *tail;
+ int len;
} sk_backlog;
wait_queue_head_t *sk_sleep;
struct dst_entry *sk_dst_cache;
@@ -583,11 +584,22 @@ static inline void sk_add_backlog(struct sock *sk, struct sk_buff *skb)
sk->sk_backlog.tail->next = skb;
sk->sk_backlog.tail = skb;
}
+ sk->sk_backlog.len += skb->truesize;
skb->next = NULL;
}
+static inline int sk_add_backlog_limited(struct sock *sk, struct sk_buff *skb)
+{
+ if (sk->sk_backlog.len >= 2 * sk->sk_rcvbuf)
+ return -ENOBUFS;
+
+ sk_add_backlog(sk, skb);
+ return 0;
+}
+
static inline int sk_backlog_rcv(struct sock *sk, struct sk_buff *skb)
{
+ sk->sk_backlog.len -= skb->truesize;
return sk->sk_backlog_rcv(sk, skb);
}
diff --git a/net/core/sock.c b/net/core/sock.c
index e1f6f22..82228ef 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -1138,6 +1138,7 @@ struct sock *sk_clone(const struct sock *sk, const gfp_t priority)
sock_lock_init(newsk);
bh_lock_sock(newsk);
newsk->sk_backlog.head = newsk->sk_backlog.tail = NULL;
+ newsk->sk_backlog.len = 0;
atomic_set(&newsk->sk_rmem_alloc, 0);
/*
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index f0126fd..7bb4568 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -1372,8 +1372,10 @@ int udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
bh_lock_sock(sk);
if (!sock_owned_by_user(sk))
rc = __udp_queue_rcv_skb(sk, skb);
- else
- sk_add_backlog(sk, skb);
+ else if (sk_add_backlog_limited(sk, skb)) {
+ bh_unlock_sock(sk);
+ goto drop;
+ }
bh_unlock_sock(sk);
return rc;
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index 69ebdbe..e4a8645 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -584,16 +584,19 @@ static void flush_stack(struct sock **stack, unsigned int count,
bh_lock_sock(sk);
if (!sock_owned_by_user(sk))
udpv6_queue_rcv_skb(sk, skb1);
- else
- sk_add_backlog(sk, skb1);
+ else if (sk_add_backlog_limited(sk, skb1)) {
+ bh_unlock_sock(sk);
+ goto drop;
+ }
bh_unlock_sock(sk);
- } else {
- atomic_inc(&sk->sk_drops);
- UDP6_INC_STATS_BH(sock_net(sk),
- UDP_MIB_RCVBUFERRORS, IS_UDPLITE(sk));
- UDP6_INC_STATS_BH(sock_net(sk),
- UDP_MIB_INERRORS, IS_UDPLITE(sk));
+ continue;
}
+drop:
+ atomic_inc(&sk->sk_drops);
+ UDP6_INC_STATS_BH(sock_net(sk),
+ UDP_MIB_RCVBUFERRORS, IS_UDPLITE(sk));
+ UDP6_INC_STATS_BH(sock_net(sk),
+ UDP_MIB_INERRORS, IS_UDPLITE(sk));
}
}
/*
@@ -756,8 +759,11 @@ int __udp6_lib_rcv(struct sk_buff *skb, struct udp_table *udptable,
bh_lock_sock(sk);
if (!sock_owned_by_user(sk))
udpv6_queue_rcv_skb(sk, skb);
- else
- sk_add_backlog(sk, skb);
+ else if (sk_add_backlog_limited(sk, skb)) {
+ bh_unlock_sock(sk);
+ sock_put(sk);
+ goto discard;
+ }
bh_unlock_sock(sk);
sock_put(sk);
return 0;
^ permalink raw reply related
* Re: [PATCH 0/4] gigaset: patches for 2.6.34
From: David Miller @ 2010-02-26 9:24 UTC (permalink / raw)
To: tilman; +Cc: isdn, hjlipp, keil, isdn4linux, i4ldeveloper, netdev,
linux-kernel
In-Reply-To: <20100221-patch-gigaset-00.tilman@imap.cc>
From: Tilman Schmidt <tilman@imap.cc>
Date: Tue, 23 Feb 2010 00:08:21 +0100 (CET)
> following are four patches to the Gigaset driver I'd like you to
> forward for merging into kernel release 2.6.34.
All applied to net-next-2.6, thanks.
^ permalink raw reply
* Re: [PATCH net-next-2.6 v3 00/12] net-caif: introducing CAIF protocol stack
From: David Miller @ 2010-02-26 9:22 UTC (permalink / raw)
To: sjur.brandeland
Cc: marcel, netdev, daniel.martensson, kaber, stefano.babic,
randy.dunlap
In-Reply-To: <61D8D34BB13CFE408D154529C120E07903359AE7@eseldmw101.eemea.ericsson.se>
From: Sjur Brændeland <sjur.brandeland@stericsson.com>
Date: Tue, 23 Feb 2010 08:39:52 +0100
> Hi Marcel.
>>> CHANGE LOG:
>>> Based on review comments from David Miller and Marcel Holtmann on the
>>> previous patch set submitted the 16 February the following changes
>>> have been done:
>>> - Removed ifdef __cplusplus from caif_socket.h
>>> - Use socket level SOL_IP for socket options SO_PRIORITY and
>>> SO_BINDTODEVICE
>>
>> are you sure it is not better to use SOL_SOCKET here. At least
>> according to man 7 socket this would make a lot more sense. My point
>> in actually using SO_PRIORITY and SO_BINDTODEVICE is to use standard
>> socket options that are already used by everybody else. So they know
>> what to expect.
>>
> Yes, this makes sense. I'll update this.
Please fix this up and resubmit your patch series so I can add
it to the net-next-2.6 tree.
^ permalink raw reply
* Re: [PATCH][KS8695] Mark network interface as running on ifconfig up
From: David Miller @ 2010-02-26 9:20 UTC (permalink / raw)
To: yegor_sub1; +Cc: linux-arm-kernel, avictor.za, netdev
In-Reply-To: <4B82A72E.50508@visionsystems.de>
From: Yegor Yefremov <yegor_sub1@visionsystems.de>
Date: Mon, 22 Feb 2010 16:47:58 +0100
> [KS8695] Don't call netif_carrier_off() from ndo_stop()
>
> netif_carrier_on() and netif_carrier_off() should be called from
> link status interrupt handler
>
> Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Looks good, applied.
Please do not put text you want to make it into the
commit message header line in brackets "[]", those
get removed by automated tools that apply patches
because patches are usually posted as:
Subject: [PATCH N/M] xxxx
and the GIT tools kill all the text inside of the brackets
so that the commit header properly reads "xxx"
Thanks.
^ 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