* Re: [RFC PATCH net-next 0/3 V4] net-tcp: TCP/IP stack bypass for loopback connections
From: David Miller @ 2012-12-10 21:02 UTC (permalink / raw)
To: wpan; +Cc: netdev, brutus
In-Reply-To: <cover.1354674151.git.wpan@redhat.com>
From: Weiping Pan <wpan@redhat.com>
Date: Wed, 5 Dec 2012 10:54:16 +0800
> Friends VS AF__UNIX
> Their call path are almost the same, but AF_UNIX uses its own send/recv codes
> with proper locks,
> so AF_UNIX's performance is much better than Friends.
While I understand the other portions of your analysis, this one
mystifies me.
In both cases, the sender has to queue the SKB onto the receiver's
queue. And in both cases, the sender takes the lock on that queue.
So the locking contention really ought to be similar if not identical.
The only difference is that AF_UNIX takes the unix_sk()->lock of the
remote socket around these operations.
If that is enough of a synchronizer to "fix" the contention or reduce
it, then this would be very easy to test by adding a friend lock to
tcp_sk().
^ permalink raw reply
* Re: [PATCH v2 06/10] net: 8390: use io{read,write}*_rep accessors
From: David Miller @ 2012-12-10 20:47 UTC (permalink / raw)
To: will.deacon
Cc: linux-kernel, linux-arch, benh, arnd, james.hogan, matthew,
netdev
In-Reply-To: <1355166762-15133-7-git-send-email-will.deacon@arm.com>
From: Will Deacon <will.deacon@arm.com>
Date: Mon, 10 Dec 2012 19:12:38 +0000
> From: Matthew Leach <matthew@mattleach.net>
>
> The {read,write}s{b,w,l} operations are not defined by all
> architectures and are being removed from the asm-generic/io.h
> interface.
>
> This patch replaces the usage of these string functions in the 8390
> accessors with io{read,write}{8,16,32}_rep calls instead.
>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Ben Herrenschmidt <benh@kernel.crashing.org>
> Cc: David Miller <davem@davemloft.net>
> Cc: netdev@vger.kernel.org
> Signed-off-by: Matthew Leach <matthew@mattleach.net>
> Signed-off-by: Will Deacon <will.deacon@arm.com>
Applied.
^ permalink raw reply
* Re: [PATCH v2 05/10] net: dm9000: use io{read,write}*_rep accessors
From: David Miller @ 2012-12-10 20:47 UTC (permalink / raw)
To: will.deacon
Cc: linux-kernel, linux-arch, benh, arnd, james.hogan, matthew,
netdev
In-Reply-To: <1355166762-15133-6-git-send-email-will.deacon@arm.com>
From: Will Deacon <will.deacon@arm.com>
Date: Mon, 10 Dec 2012 19:12:37 +0000
> From: Matthew Leach <matthew@mattleach.net>
>
> The {read,write}s{b,w,l} operations are not defined by all
> architectures and are being removed from the asm-generic/io.h
> interface.
>
> This patch replaces the usage of these string functions in the default
> DM9000 accessors with io{read,write}{8,16,32}_rep calls instead. This
> is required as the dm9000 driver is in use by the blackfin
> architecture which uses the asm-generic io accessors.
>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Ben Herrenschmidt <benh@kernel.crashing.org>
> Cc: David Miller <davem@davemloft.net>
> Cc: netdev@vger.kernel.org
> Signed-off-by: Matthew Leach <matthew@mattleach.net>
> Signed-off-by: Will Deacon <will.deacon@arm.com>
Applied.
^ permalink raw reply
* Re: [PATCH v2 03/10] net: smc91x: use io{read,write}*_rep accessors instead of string functions
From: David Miller @ 2012-12-10 20:47 UTC (permalink / raw)
To: will.deacon
Cc: linux-kernel, linux-arch, benh, arnd, james.hogan, nico, netdev
In-Reply-To: <1355166762-15133-4-git-send-email-will.deacon@arm.com>
From: Will Deacon <will.deacon@arm.com>
Date: Mon, 10 Dec 2012 19:12:35 +0000
> The {read,write}s{b,w,l} operations are not defined by all architectures
> and are being removed from the asm-generic/io.h interface.
>
> This patch replaces the usage of these string functions in the default
> SMC accessors with io{read,write}{8,16,32}_rep calls instead, which are
> defined for all architectures.
>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Ben Herrenschmidt <benh@kernel.crashing.org>
> Cc: Nicolas Pitre <nico@fluxnic.net>
> Cc: netdev@vger.kernel.org
> Signed-off-by: Will Deacon <will.deacon@arm.com>
Applied.
^ permalink raw reply
* Re: [PATCH v2 04/10] net: smc911x: use io{read,write}*_rep accessors
From: David Miller @ 2012-12-10 20:47 UTC (permalink / raw)
To: will.deacon
Cc: linux-kernel, linux-arch, benh, arnd, james.hogan, matthew,
netdev
In-Reply-To: <1355166762-15133-5-git-send-email-will.deacon@arm.com>
From: Will Deacon <will.deacon@arm.com>
Date: Mon, 10 Dec 2012 19:12:36 +0000
> From: Matthew Leach <matthew@mattleach.net>
>
> The {read,write}s{b,w,l} operations are not defined by all
> architectures and are being removed from the asm-generic/io.h
> interface.
>
> This patch replaces the usage of these string functions in the smc911x
> accessors with io{read,write}{8,16,32}_rep calls instead.
>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Ben Herrenschmidt <benh@kernel.crashing.org>
> Cc: netdev@vger.kernel.org
> Signed-off-by: Matthew Leach <matthew@mattleach.net>
> Signed-off-by: Will Deacon <will.deacon@arm.com>
This misses the two uses in smsc911x_tx_writefifo and
smsc911x_rx_readfifo.
^ permalink raw reply
* Re: [PATCH] tcp: Avoid infinite loop on recvmsg bug
From: David Miller @ 2012-12-10 20:23 UTC (permalink / raw)
To: jwerner
Cc: davej, linux-kernel, netdev, kaber, yoshfuji, jmorris, kuznet,
eric.dumazet, snanda, msb
In-Reply-To: <CAODwPW_P_UNGV8rRC7hFC+PBrWeu64ODu5mTby=9GCqMnyDtdQ@mail.gmail.com>
I've tossed these two patches under the carpet, so you'll need to
repost whichever one you want me to consider.
Basically, discussing old patches is pretty useless without a resend
to get it back into the fore-front of the patchwork queue. So please
don't reference old stale patches without an associated repost like
this.
Thanks.
^ permalink raw reply
* netfilter question
From: Sri Ram Vemulpali @ 2012-12-10 20:12 UTC (permalink / raw)
To: linux-netdev, linux-kernel-mail, linux-newbie
Hi Guys,
I am writing a netfilter hooks module for applying kernel rules on
incoming packets. I am implementing hook at NF_IP_PRE_ROUTING.
>From my understanding, after sk_buff passing NF_IP_PRE_ROUTING hook
enters into ip_forward (routing) path, which will determine whether
packet is for local host, if not for local host, then routes to
destination host based on IP header destination info through local
host interface.
My question is, if I modify sk_buff packet ip header info at
NF_IP_PRE_ROUTING hook, with values of external host ip (destination
host), therefore I think this packet will be routed to destination
host from right source interface. Instead passing it to local host.
Please correct my assumption. Or is anything more I should be doing.
Because I am building a system to route the packets applying kernel
rules.
thanks in advance.
--
Regards,
Sri.
^ permalink raw reply
* Re: [PATCH net-next] rps: overflow prevention for saturated cpus
From: Willem de Bruijn @ 2012-12-10 20:09 UTC (permalink / raw)
To: David Miller, Ben Hutchings, Rick Jones; +Cc: netdev
In-Reply-To: <20121207.142004.1330913822593924898.davem@davemloft.net>
On Fri, Dec 7, 2012 at 2:20 PM, David Miller <davem@davemloft.net> wrote:
> From: Willem de Bruijn <willemb@google.com>
> Date: Thu, 6 Dec 2012 15:36:34 -0500
>
>> This patch maintains flow affinity in normal conditions, but
>> trades it for throughput when a cpu becomes saturated. Then, packets
>> destined to that cpu (only) are redirected to the lightest loaded cpu
>> in the rxqueue's rps_map. This breaks flow affinity under high load
>> for some flows, in favor of processing packets up to the capacity
>> of the complete rps_map cpuset in all circumstances.
>
> We specifically built-in very strict checks to make sure we never
> deliver packets out-of-order. Those mechanisms must be used and
> enforced in any change of this nature.
Okay. I'm working on a table-based revision to redirect flows consistently
when backlogged and to drop flows that are too big for any cpu to handle.
Revising and testing will take some time. If results are good, I'll post
a v2 soon. Thanks for all feedback so far.
Flow redirection when backlogged should improve resilience against
unbalanced load (such as synfloods) for all rps/rfs applications, not
just middleboxes. For that case, I'd like to be able to spray packets
instead of drop them when a single flow exceeds cpu capacity, but
that's a separate issue.
^ permalink raw reply
* RE: [PATCH v4 1/5] net: Add support for hardware-offloaded encapsulation
From: Dmitry Kravkov @ 2012-12-10 19:58 UTC (permalink / raw)
To: saeed bishara, Joseph Gasparakis
Cc: davem@davemloft.net, shemminger@vyatta.com, chrisw@sous-sol.org,
gospo@redhat.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, bhutchings@solarflare.com,
Peter P Waskiewicz Jr, Alexander Duyck
In-Reply-To: <CAMAG_ee6xW4EnzPFt=_5+NL2+LuyUjxd52Xc242inYm2+Yhg7g@mail.gmail.com>
> -----Original Message-----
> From: saeed bishara [mailto:saeed.bishara@gmail.com]
> Sent: Monday, December 10, 2012 12:04 PM
> To: Joseph Gasparakis
> Cc: davem@davemloft.net; shemminger@vyatta.com; chrisw@sous-sol.org;
> gospo@redhat.com; netdev@vger.kernel.org; linux-kernel@vger.kernel.org;
> Dmitry Kravkov; bhutchings@solarflare.com; Peter P Waskiewicz Jr; Alexander
> Duyck
> Subject: Re: [PATCH v4 1/5] net: Add support for hardware-offloaded
> encapsulation
>
> > +static inline struct iphdr *inner_ip_hdr(const struct sk_buff *skb)
> > +{
> > + return (struct iphdr *)skb_inner_network_header(skb);
> > +}
>
> Hi,
> I'm a little bit bothered because of those inner_ functions, what
> about the following approach:
> 1. the skb will have a new state, that state can be outer (normal
> mode) and inner.
> 2. when you change the state to inner, all the helper functions such
> as ip_hdr will return the innter header.
>
> that's ofcourse the API side. the implementation may still use the
> fields you added to the skb.
>
> what you think?
> saeed
Some drivers will probably need both inner_ and other_ in same flow, switching between two states will consume cpu cycles.
^ permalink raw reply
* Re: [PATCH] tcp: Avoid infinite loop on recvmsg bug
From: Julius Werner @ 2012-12-10 19:33 UTC (permalink / raw)
To: Dave Jones
Cc: linux-kernel, netdev, Patrick McHardy, Hideaki YOSHIFUJI,
James Morris, Alexey Kuznetsov, Eric Dumazet, David S. Miller,
Sameer Nanda, Mandeep Singh Baines
In-Reply-To: <1352431796.19779.536.camel@edumazet-glaptop>
Hi Dave,
Have you thought about picking up one of the patches to tcp_recvmsg I
proposed in this thread? We consider the underlying bug in Chromium OS
that led mere here to be fixed now, but I bet this will not be the
last time someone hits this code path and has to deal with the bad
error handling.
I understand that not everyone here agrees on what the best solution
is, but I think both of them are far better than the inconsistent and
potentially hard-disk-filling way that the current kernel does it.
On Wed, 2012-11-07 at 11:33 -0800, Julius Werner wrote:
> tcp_recvmsg contains a sanity check that WARNs when there is a gap
> between the socket's copied_seq and the first buffer in the
> sk_receive_queue. In theory, the TCP stack makes sure that This Should
> Never Happen (TM)... however, practice shows that there are still a few
> bug reports from it out there (and one in my inbox).
>
> Unfortunately, when it does happen for whatever reason, the situation
> is not handled very well: the kernel logs a warning and breaks out of
> the loop that walks the receive queue. It proceeds to find nothing else
> to do on the socket and hits sk_wait_data, which cannot block because
> the receive queue is not empty. As no data was read, the outer while
> loop repeats (logging the same warning again) ad infinitum until the
> system's syslog exhausts all available hard drive capacity.
>
> This patch addresses that issue by closing the socket outright and
> throwing EBADFD to userspace (which seems most appropriate to me at this
> point). As the underlying bug condition is "impossible" and therefore by
> definition unrecoverable, this is the only sensible action other than a
> full panic.
>
> Signed-off-by: Julius Werner <jwerner@chromium.org>
> ---
> net/ipv4/tcp.c | 7 ++++++-
> 1 files changed, 6 insertions(+), 1 deletions(-)
>
> diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
> index 197c000..d612308 100644
> --- a/net/ipv4/tcp.c
> +++ b/net/ipv4/tcp.c
> @@ -1628,7 +1628,7 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
> "recvmsg bug: copied %X seq %X rcvnxt %X fl %X\n",
> *seq, TCP_SKB_CB(skb)->seq, tp->rcv_nxt,
> flags))
> - break;
> + goto selfdestruct;
>
> offset = *seq - TCP_SKB_CB(skb)->seq;
> if (tcp_hdr(skb)->syn)
> @@ -1936,6 +1936,11 @@ recv_urg:
> recv_sndq:
> err = tcp_peek_sndq(sk, msg, len);
> goto out;
> +
> +selfdestruct:
> + err = -EBADFD;
> + tcp_done(sk);
> + goto out;
> }
> EXPORT_SYMBOL(tcp_recvmsg);
>
On Tue, Nov 06, 2012 at 04:15:35PM -0800, Julius Werner wrote:
> tcp_recvmsg contains a sanity check that WARNs when there is a gap
> between the socket's copied_seq and the first buffer in the
> sk_receive_queue. In theory, the TCP stack makes sure that This Should
> Never Happen (TM)... however, practice shows that there are still a few
> bug reports from it out there (and one in my inbox).
>
> Unfortunately, when it does happen for whatever reason, the situation
> is not handled very well: the kernel logs a warning and breaks out of
> the loop that walks the receive queue. It proceeds to find nothing else
> to do on the socket and hits sk_wait_data, which cannot block because
> the receive queue is not empty. As no data was read, the outer while
> loop repeats (logging the same warning again) ad infinitum until the
> system's syslog exhausts all available hard drive capacity.
>
> This patch improves that behavior by going straight to a proper kernel
> crash. The cause of the error can be identified right away and the
> system's hard drive is not unnecessarily strained.
>
> Signed-off-by: Julius Werner <jwerner@chromium.org>
> ---
> net/ipv4/tcp.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
> index 197c000..fcb0927 100644
> --- a/net/ipv4/tcp.c
> +++ b/net/ipv4/tcp.c
> @@ -1628,7 +1628,7 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
> "recvmsg bug: copied %X seq %X rcvnxt %X fl %X\n",
> *seq, TCP_SKB_CB(skb)->seq, tp->rcv_nxt,
> flags))
> - break;
> + BUG();
>
> offset = *seq - TCP_SKB_CB(skb)->seq;
> if (tcp_hdr(skb)->syn)
^ permalink raw reply
* RE: ipgre rss is broken since gro
From: Dmitry Kravkov @ 2012-12-10 19:20 UTC (permalink / raw)
To: Eric Dumazet; +Cc: Eric Dumazet, netdev@vger.kernel.org
In-Reply-To: <1355158471.27891.44.camel@edumazet-glaptop>
> -----Original Message-----
> From: Eric Dumazet [mailto:eric.dumazet@gmail.com]
> Sent: Monday, December 10, 2012 6:55 PM
> To: Dmitry Kravkov
> Cc: Eric Dumazet; netdev@vger.kernel.org
> Subject: RE: ipgre rss is broken since gro
>
> On Mon, 2012-12-10 at 11:32 +0000, Dmitry Kravkov wrote:
>
>
> dropped:51610 so obviously one cpu is fully loaded.
Link partner continued pushing data overnight
>
> I believe performance problem might come from the
> skb_set_queue_mapping(skb, 0); in __skb_tunnel_rx()
>
> So all packets are queued into a single GRO queue, instead of being
> split as intended in multiple queues.
>
> I cant find why we must clear queue_mapping, so could you try :
>
>
> diff --git a/include/net/dst.h b/include/net/dst.h
> index 9a78810..4cb27df 100644
> --- a/include/net/dst.h
> +++ b/include/net/dst.h
> @@ -329,7 +329,6 @@ static inline void __skb_tunnel_rx(struct sk_buff *skb,
> struct net_device *dev)
> */
> if (!skb->l4_rxhash)
> skb->rxhash = 0;
> - skb_set_queue_mapping(skb, 0);
> skb_dst_drop(skb);
> nf_reset(skb);
> }
>
Yep, this resolved the issue - Interface is functional after 3 and 100 TCP connections. Thanks
^ permalink raw reply
* [PATCH v2 06/10] net: 8390: use io{read,write}*_rep accessors
From: Will Deacon @ 2012-12-10 19:12 UTC (permalink / raw)
To: linux-kernel
Cc: linux-arch, benh, arnd, james.hogan, Matthew Leach, David Miller,
netdev, Will Deacon
In-Reply-To: <1355166762-15133-1-git-send-email-will.deacon@arm.com>
From: Matthew Leach <matthew@mattleach.net>
The {read,write}s{b,w,l} operations are not defined by all
architectures and are being removed from the asm-generic/io.h
interface.
This patch replaces the usage of these string functions in the 8390
accessors with io{read,write}{8,16,32}_rep calls instead.
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Ben Herrenschmidt <benh@kernel.crashing.org>
Cc: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Signed-off-by: Matthew Leach <matthew@mattleach.net>
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
drivers/net/ethernet/8390/ax88796.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ethernet/8390/ax88796.c b/drivers/net/ethernet/8390/ax88796.c
index 203ff9d..0338352 100644
--- a/drivers/net/ethernet/8390/ax88796.c
+++ b/drivers/net/ethernet/8390/ax88796.c
@@ -191,11 +191,11 @@ static void ax_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr,
ei_outb(E8390_RREAD+E8390_START, nic_base + NE_CMD);
if (ei_local->word16)
- readsw(nic_base + NE_DATAPORT, hdr,
- sizeof(struct e8390_pkt_hdr) >> 1);
+ ioread16_rep(nic_base + NE_DATAPORT, hdr,
+ sizeof(struct e8390_pkt_hdr) >> 1);
else
- readsb(nic_base + NE_DATAPORT, hdr,
- sizeof(struct e8390_pkt_hdr));
+ ioread8_rep(nic_base + NE_DATAPORT, hdr,
+ sizeof(struct e8390_pkt_hdr));
ei_outb(ENISR_RDC, nic_base + EN0_ISR); /* Ack intr. */
ei_local->dmaing &= ~0x01;
@@ -237,12 +237,12 @@ static void ax_block_input(struct net_device *dev, int count,
ei_outb(E8390_RREAD+E8390_START, nic_base + NE_CMD);
if (ei_local->word16) {
- readsw(nic_base + NE_DATAPORT, buf, count >> 1);
+ ioread16_rep(nic_base + NE_DATAPORT, buf, count >> 1);
if (count & 0x01)
buf[count-1] = ei_inb(nic_base + NE_DATAPORT);
} else {
- readsb(nic_base + NE_DATAPORT, buf, count);
+ ioread8_rep(nic_base + NE_DATAPORT, buf, count);
}
ei_local->dmaing &= ~1;
@@ -286,9 +286,9 @@ static void ax_block_output(struct net_device *dev, int count,
ei_outb(E8390_RWRITE+E8390_START, nic_base + NE_CMD);
if (ei_local->word16)
- writesw(nic_base + NE_DATAPORT, buf, count >> 1);
+ iowrite16_rep(nic_base + NE_DATAPORT, buf, count >> 1);
else
- writesb(nic_base + NE_DATAPORT, buf, count);
+ iowrite8_rep(nic_base + NE_DATAPORT, buf, count);
dma_start = jiffies;
--
1.8.0
^ permalink raw reply related
* [PATCH v2 05/10] net: dm9000: use io{read,write}*_rep accessors
From: Will Deacon @ 2012-12-10 19:12 UTC (permalink / raw)
To: linux-kernel
Cc: linux-arch, benh, arnd, james.hogan, Matthew Leach, David Miller,
netdev, Will Deacon
In-Reply-To: <1355166762-15133-1-git-send-email-will.deacon@arm.com>
From: Matthew Leach <matthew@mattleach.net>
The {read,write}s{b,w,l} operations are not defined by all
architectures and are being removed from the asm-generic/io.h
interface.
This patch replaces the usage of these string functions in the default
DM9000 accessors with io{read,write}{8,16,32}_rep calls instead. This
is required as the dm9000 driver is in use by the blackfin
architecture which uses the asm-generic io accessors.
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Ben Herrenschmidt <benh@kernel.crashing.org>
Cc: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Signed-off-by: Matthew Leach <matthew@mattleach.net>
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
drivers/net/ethernet/davicom/dm9000.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/davicom/dm9000.c b/drivers/net/ethernet/davicom/dm9000.c
index 36499d5..61648a6 100644
--- a/drivers/net/ethernet/davicom/dm9000.c
+++ b/drivers/net/ethernet/davicom/dm9000.c
@@ -193,35 +193,35 @@ iow(board_info_t * db, int reg, int value)
static void dm9000_outblk_8bit(void __iomem *reg, void *data, int count)
{
- writesb(reg, data, count);
+ iowrite8_rep(reg, data, count);
}
static void dm9000_outblk_16bit(void __iomem *reg, void *data, int count)
{
- writesw(reg, data, (count+1) >> 1);
+ iowrite16_rep(reg, data, (count+1) >> 1);
}
static void dm9000_outblk_32bit(void __iomem *reg, void *data, int count)
{
- writesl(reg, data, (count+3) >> 2);
+ iowrite32_rep(reg, data, (count+3) >> 2);
}
/* input block from chip to memory */
static void dm9000_inblk_8bit(void __iomem *reg, void *data, int count)
{
- readsb(reg, data, count);
+ ioread8_rep(reg, data, count);
}
static void dm9000_inblk_16bit(void __iomem *reg, void *data, int count)
{
- readsw(reg, data, (count+1) >> 1);
+ ioread16_rep(reg, data, (count+1) >> 1);
}
static void dm9000_inblk_32bit(void __iomem *reg, void *data, int count)
{
- readsl(reg, data, (count+3) >> 2);
+ ioread32_rep(reg, data, (count+3) >> 2);
}
/* dump block from chip to null */
--
1.8.0
^ permalink raw reply related
* [PATCH v2 04/10] net: smc911x: use io{read,write}*_rep accessors
From: Will Deacon @ 2012-12-10 19:12 UTC (permalink / raw)
To: linux-kernel
Cc: linux-arch, benh, arnd, james.hogan, Matthew Leach, netdev,
Will Deacon
In-Reply-To: <1355166762-15133-1-git-send-email-will.deacon@arm.com>
From: Matthew Leach <matthew@mattleach.net>
The {read,write}s{b,w,l} operations are not defined by all
architectures and are being removed from the asm-generic/io.h
interface.
This patch replaces the usage of these string functions in the smc911x
accessors with io{read,write}{8,16,32}_rep calls instead.
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Ben Herrenschmidt <benh@kernel.crashing.org>
Cc: netdev@vger.kernel.org
Signed-off-by: Matthew Leach <matthew@mattleach.net>
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
drivers/net/ethernet/smsc/smc911x.h | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ethernet/smsc/smc911x.h b/drivers/net/ethernet/smsc/smc911x.h
index 3269292..d51261b 100644
--- a/drivers/net/ethernet/smsc/smc911x.h
+++ b/drivers/net/ethernet/smsc/smc911x.h
@@ -159,12 +159,12 @@ static inline void SMC_insl(struct smc911x_local *lp, int reg,
void __iomem *ioaddr = lp->base + reg;
if (lp->cfg.flags & SMC911X_USE_32BIT) {
- readsl(ioaddr, addr, count);
+ ioread32_rep(ioaddr, addr, count);
return;
}
if (lp->cfg.flags & SMC911X_USE_16BIT) {
- readsw(ioaddr, addr, count * 2);
+ ioread16_rep(ioaddr, addr, count * 2);
return;
}
@@ -177,12 +177,12 @@ static inline void SMC_outsl(struct smc911x_local *lp, int reg,
void __iomem *ioaddr = lp->base + reg;
if (lp->cfg.flags & SMC911X_USE_32BIT) {
- writesl(ioaddr, addr, count);
+ iowrite32_rep(ioaddr, addr, count);
return;
}
if (lp->cfg.flags & SMC911X_USE_16BIT) {
- writesw(ioaddr, addr, count * 2);
+ iowrite16_rep(ioaddr, addr, count * 2);
return;
}
@@ -196,14 +196,14 @@ static inline void SMC_outsl(struct smc911x_local *lp, int reg,
writew(v & 0xFFFF, (lp)->base + (r)); \
writew(v >> 16, (lp)->base + (r) + 2); \
} while (0)
-#define SMC_insl(lp, r, p, l) readsw((short*)((lp)->base + (r)), p, l*2)
-#define SMC_outsl(lp, r, p, l) writesw((short*)((lp)->base + (r)), p, l*2)
+#define SMC_insl(lp, r, p, l) ioread16_rep((short*)((lp)->base + (r)), p, l*2)
+#define SMC_outsl(lp, r, p, l) iowrite16_rep((short*)((lp)->base + (r)), p, l*2)
#elif SMC_USE_32BIT
#define SMC_inl(lp, r) readl((lp)->base + (r))
#define SMC_outl(v, lp, r) writel(v, (lp)->base + (r))
-#define SMC_insl(lp, r, p, l) readsl((int*)((lp)->base + (r)), p, l)
-#define SMC_outsl(lp, r, p, l) writesl((int*)((lp)->base + (r)), p, l)
+#define SMC_insl(lp, r, p, l) ioread32_rep((int*)((lp)->base + (r)), p, l)
+#define SMC_outsl(lp, r, p, l) iowrite32_rep((int*)((lp)->base + (r)), p, l)
#endif /* SMC_USE_16BIT */
#endif /* SMC_DYNAMIC_BUS_CONFIG */
--
1.8.0
^ permalink raw reply related
* [PATCH v2 03/10] net: smc91x: use io{read,write}*_rep accessors instead of string functions
From: Will Deacon @ 2012-12-10 19:12 UTC (permalink / raw)
To: linux-kernel
Cc: linux-arch, benh, arnd, james.hogan, Will Deacon, Nicolas Pitre,
netdev
In-Reply-To: <1355166762-15133-1-git-send-email-will.deacon@arm.com>
The {read,write}s{b,w,l} operations are not defined by all architectures
and are being removed from the asm-generic/io.h interface.
This patch replaces the usage of these string functions in the default
SMC accessors with io{read,write}{8,16,32}_rep calls instead, which are
defined for all architectures.
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Ben Herrenschmidt <benh@kernel.crashing.org>
Cc: Nicolas Pitre <nico@fluxnic.net>
Cc: netdev@vger.kernel.org
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
drivers/net/ethernet/smsc/smc91x.h | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/net/ethernet/smsc/smc91x.h b/drivers/net/ethernet/smsc/smc91x.h
index 5f53fbb..370e13d 100644
--- a/drivers/net/ethernet/smsc/smc91x.h
+++ b/drivers/net/ethernet/smsc/smc91x.h
@@ -286,16 +286,16 @@ static inline void mcf_outsw(void *a, unsigned char *p, int l)
#define SMC_IO_SHIFT (lp->io_shift)
-#define SMC_inb(a, r) readb((a) + (r))
-#define SMC_inw(a, r) readw((a) + (r))
-#define SMC_inl(a, r) readl((a) + (r))
-#define SMC_outb(v, a, r) writeb(v, (a) + (r))
-#define SMC_outw(v, a, r) writew(v, (a) + (r))
-#define SMC_outl(v, a, r) writel(v, (a) + (r))
-#define SMC_insw(a, r, p, l) readsw((a) + (r), p, l)
-#define SMC_outsw(a, r, p, l) writesw((a) + (r), p, l)
-#define SMC_insl(a, r, p, l) readsl((a) + (r), p, l)
-#define SMC_outsl(a, r, p, l) writesl((a) + (r), p, l)
+#define SMC_inb(a, r) ioread8((a) + (r))
+#define SMC_inw(a, r) ioread16((a) + (r))
+#define SMC_inl(a, r) ioread32((a) + (r))
+#define SMC_outb(v, a, r) iowrite8(v, (a) + (r))
+#define SMC_outw(v, a, r) iowrite16(v, (a) + (r))
+#define SMC_outl(v, a, r) iowrite32(v, (a) + (r))
+#define SMC_insw(a, r, p, l) ioread16_rep((a) + (r), p, l)
+#define SMC_outsw(a, r, p, l) iowrite16_rep((a) + (r), p, l)
+#define SMC_insl(a, r, p, l) ioread32_rep((a) + (r), p, l)
+#define SMC_outsl(a, r, p, l) iowrite32_rep((a) + (r), p, l)
#define RPC_LSA_DEFAULT RPC_LED_100_10
#define RPC_LSB_DEFAULT RPC_LED_TX_RX
--
1.8.0
^ permalink raw reply related
* Re: [PATCH 2/2] smsc95xx: fix async register writes on big endian platforms
From: David Miller @ 2012-12-10 19:10 UTC (permalink / raw)
To: steve.glendinning; +Cc: netdev
In-Reply-To: <1355137388-2938-2-git-send-email-steve.glendinning@shawell.net>
From: Steve Glendinning <steve.glendinning@shawell.net>
Date: Mon, 10 Dec 2012 11:03:08 +0000
> This patch fixes a missing endian conversion which results in the
> interface failing to come up on BE platforms.
>
> It also removes an unnecessary pointer dereference from this
> function.
>
> Signed-off-by: Steve Glendinning <steve.glendinning@shawell.net>
Applied.
^ permalink raw reply
* Re: [PATCH 1/2] smsc95xx: fix register dump of last register
From: David Miller @ 2012-12-10 19:10 UTC (permalink / raw)
To: steve.glendinning; +Cc: netdev
In-Reply-To: <1355137388-2938-1-git-send-email-steve.glendinning@shawell.net>
From: Steve Glendinning <steve.glendinning@shawell.net>
Date: Mon, 10 Dec 2012 11:03:07 +0000
> This patch fixes the ethtool register dump for smsc95xx to dump
> all 4 bytes of the final register (COE_CR) instead of just the
> first byte.
>
> Signed-off-by: Steve Glendinning <steve.glendinning@shawell.net>
Applied.
^ permalink raw reply
* Re: [PATCH] smsc75xx: only set mac address once on bind
From: David Miller @ 2012-12-10 19:10 UTC (permalink / raw)
To: steve.glendinning; +Cc: netdev, bjorn, dcbw
In-Reply-To: <1355137279-2695-1-git-send-email-steve.glendinning@shawell.net>
From: Steve Glendinning <steve.glendinning@shawell.net>
Date: Mon, 10 Dec 2012 11:01:19 +0000
> This patch changes when we decide what the device's MAC address
> is from per ifconfig up to once when the device is connected.
>
> Without this patch, a manually forced device MAC is overwritten
> on ifconfig down/up. Also devices that have no EEPROM are
> assigned a new random address on ifconfig down/up instead of
> persisting the same one.
>
> Signed-off-by: Steve Glendinning <steve.glendinning@shawell.net>
> Reported-by: Robert Cunningham <rcunningham@nsmsurveillance.com>
Applied.
^ permalink raw reply
* Re: [PATCH RESEND] net: remove obsolete simple_strto<foo>
From: David Miller @ 2012-12-10 19:10 UTC (permalink / raw)
To: abhi.c.pawar
Cc: pablo, kaber, kuznet, jmorris, yoshfuji, linville, johannes,
amwang, edumazet, nhorman, joe, netdev, linux-kernel,
netfilter-devel, netfilter, coreteam, linux-wireless
In-Reply-To: <1355130748-7828-1-git-send-email-abhi.c.pawar@gmail.com>
From: Abhijit Pawar <abhi.c.pawar@gmail.com>
Date: Mon, 10 Dec 2012 14:42:28 +0530
> This patch replace the obsolete simple_strto<foo> with kstrto<foo>
>
> Signed-off-by: Abhijit Pawar <abhi.c.pawar@gmail.com>
Applied.
^ permalink raw reply
* Re: [PATCH] net: Allow DCBnl to use other namespaces besides init_net
From: David Miller @ 2012-12-10 19:09 UTC (permalink / raw)
To: john.fastabend; +Cc: netdev, ebiederm
In-Reply-To: <20121210064813.10883.88194.stgit@nitbit.x32>
From: John Fastabend <john.fastabend@gmail.com>
Date: Sun, 09 Dec 2012 22:48:13 -0800
> Allow DCB and net namespace to work together. This is useful if you
> have containers that are bound to 'phys' interfaces that want to
> also manage their DCB attributes.
>
> The net namespace is taken from sock_net(skb->sk) of the netlink skb.
>
> CC: "Eric W. Biederman" <ebiederm@xmission.com>
> Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Applied.
^ permalink raw reply
* Re: ipgre rss is broken since gro
From: David Miller @ 2012-12-10 19:02 UTC (permalink / raw)
To: eric.dumazet; +Cc: dmitry, edumazet, netdev, therbert
In-Reply-To: <1355158471.27891.44.camel@edumazet-glaptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Mon, 10 Dec 2012 08:54:31 -0800
> I believe performance problem might come from the
> skb_set_queue_mapping(skb, 0); in __skb_tunnel_rx()
>
> So all packets are queued into a single GRO queue, instead of being
> split as intended in multiple queues.
>
> I cant find why we must clear queue_mapping, so could you try :
Tom says:
commit 693019e90ca45d881109d32c0c6d29adf03f6447
Author: Tom Herbert <therbert@google.com>
Date: Thu Sep 23 11:19:54 2010 +0000
net: reset skb queue mapping when rx'ing over tunnel
Reset queue mapping when an skb is reentering the stack via a tunnel.
On second pass, the queue mapping from the original device is no
longer valid.
Signed-off-by: Tom Herbert <therbert@google.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
diff --git a/include/net/dst.h b/include/net/dst.h
index 81d1413..0238650 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -242,6 +242,7 @@ static inline void skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev)
dev->stats.rx_packets++;
dev->stats.rx_bytes += skb->len;
skb->rxhash = 0;
+ skb_set_queue_mapping(skb, 0);
skb_dst_drop(skb);
nf_reset(skb);
}
^ permalink raw reply related
* Re: [PATCH net-next v3 01/22] bnx2x: Support probing and removing of VF device
From: Joe Perches @ 2012-12-10 18:50 UTC (permalink / raw)
To: David Miller; +Cc: ariele, netdev, eilong
In-Reply-To: <20121210.133519.2048543022289027034.davem@davemloft.net>
On Mon, 2012-12-10 at 13:35 -0500, David Miller wrote:
> From: "Ariel Elior" <ariele@broadcom.com>
> Date: Mon, 10 Dec 2012 17:46:25 +0200
[]
> > @@ -12023,85 +12057,115 @@ static int bnx2x_get_num_non_def_sbs(struct pci_dev *pdev,
> > * If MSI-X is not supported - return number of SBs needed to support
> > * one fast path queue: one FP queue + SB for CNIC
> > */
> > - if (!pos)
> > + if (!pos) {
> > + pr_info("no msix capability found");
[]
> Use dev_info(), netdev_info(), or similar, rather than plain
> pr_info().
Also, please add terminating newlines to avoid
dmesg message interleaving.
^ permalink raw reply
* Re: [PATCH] ipv4: ip_check_defrag must not modify skb before unsharing
From: David Miller @ 2012-12-10 18:50 UTC (permalink / raw)
To: johannes-cdvu00un1VgdHxzADdlk8Q
Cc: eric-EVVnsjFE0OfYtjvyW6yDsg, netdev-u79uwXL29TY76Z2rM5mHXA,
linux-wireless-u79uwXL29TY76Z2rM5mHXA,
linville-2XuSBdqkA4R54TAoqtyWWQ,
eric.dumazet-Re5JQEeQqe8AvxtiuMwx3w
In-Reply-To: <1355165152.8083.4.camel-8Nb76shvtaUJvtFkdXX2HixXY32XiHfO@public.gmane.org>
From: Johannes Berg <johannes-cdvu00un1VgdHxzADdlk8Q@public.gmane.org>
Date: Mon, 10 Dec 2012 19:45:52 +0100
> On Mon, 2012-12-10 at 13:41 -0500, David Miller wrote:
>> So the bug is that ip_check_defrag() has a precondition which is met
>> properly by all callers except AF_PACKET.
>>
>> If this is the case, remind me why are we changing ip_check_defrag()
>> rather than the violator of the precondition?
>
> I don't think this is the case.
>
> If you're referring to my note about af_packet: the kernels where this
> goes into af_packet.c are the kernels that don't even have
> ip_check_defrag() because macvlan didn't exist/didn't have ip defrag
> support and af_packet had this code there -- see commit bc416d9768a.
>
> If you're not referring to my note about af_packet: both callers (there
> are only two) of ip_check_defrag() have this bug as far as I can tell
> because they're both in the part of the RX path where shared SKBs might
> happen.
You're right, I misinterpreted what's happening here.
My misunderstanding was that this was a situation where normal IPV4
input processing makes sure the SKB is unshared, and we had special
code paths that didn't make sure that was the case.
Rather, here, we have a special entrypoint for macvlan and AF_PACKET
which is supposed to take care of such issues since it is known to
execute in a different kind of environment.
I'm pretty sure I'll apply this, after I check a few more things,
thanks Johannes!
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [Patch net-next] virtio_net: fix a typo in virtnet_alloc_queues()
From: David Miller @ 2012-12-10 18:46 UTC (permalink / raw)
To: amwang; +Cc: netdev, jasowang
In-Reply-To: <1355142248-19987-1-git-send-email-amwang@redhat.com>
From: Cong Wang <amwang@redhat.com>
Date: Mon, 10 Dec 2012 20:24:08 +0800
> Obviously it should check !vi->rq.
>
> Reported-by: Fengguang Wu <fengguang.wu@intel.com>
> Cc: Jason Wang <jasowang@redhat.com>
> Cc: David S. Miller <davem@davemloft.net>
> Signed-off-by: Cong Wang <amwang@redhat.com>
Applied, thanks.
^ permalink raw reply
* Re: [Patch net-next] bridge: fix seq check in br_mdb_dump()
From: David Miller @ 2012-12-10 18:46 UTC (permalink / raw)
To: amwang; +Cc: netdev, herbert, shemminger, tgraf, brouer
In-Reply-To: <1355141735-19576-1-git-send-email-amwang@redhat.com>
From: Cong Wang <amwang@redhat.com>
Date: Mon, 10 Dec 2012 20:15:35 +0800
> From: Cong Wang <amwang@redhat.com>
>
> In case of rehashing, introduce a global variable 'br_mdb_rehash_seq'
> which gets increased every time when rehashing, and assign
> net->dev_base_seq + br_mdb_rehash_seq to cb->seq.
>
> In theory cb->seq could be wrapped to zero, but this is not
> easy to fix, as net->dev_base_seq is not visible inside
> br_mdb_rehash(). In practice, this is rare.
>
> Cc: Herbert Xu <herbert@gondor.apana.org.au>
> Cc: Stephen Hemminger <shemminger@vyatta.com>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: Thomas Graf <tgraf@suug.ch>
> Cc: Jesper Dangaard Brouer <brouer@redhat.com>
> Signed-off-by: Cong Wang <amwang@redhat.com>
No synchronization at all is applied to this variable, I can't
see how this is OK.
^ 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