* Re: [PATCH -next] tcm_vhost: remove unused variable in vhost_scsi_allocate_cmd()
From: Nicholas A. Bellinger @ 2012-11-09 5:24 UTC (permalink / raw)
To: Wei Yongjun; +Cc: kvm, mst, netdev, virtualization, yongjun_wei, target-devel
In-Reply-To: <CAPgLHd81=dTwwSTgUtd9YbgWf8YLMfi3VJQ-76h71+0W_mx_2g@mail.gmail.com>
Hello Wei,
On Wed, 2012-11-07 at 20:53 +0800, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> The variable se_sess is initialized but never used
> otherwise, so remove the unused variable.
>
> dpatch engine is used to auto generate this patch.
> (https://github.com/weiyj/dpatch)
>
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> ---
> drivers/vhost/tcm_vhost.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/vhost/tcm_vhost.c b/drivers/vhost/tcm_vhost.c
> index 23c138f..551fff0 100644
> --- a/drivers/vhost/tcm_vhost.c
> +++ b/drivers/vhost/tcm_vhost.c
> @@ -415,14 +415,12 @@ static struct tcm_vhost_cmd *vhost_scsi_allocate_cmd(
> {
> struct tcm_vhost_cmd *tv_cmd;
> struct tcm_vhost_nexus *tv_nexus;
> - struct se_session *se_sess;
>
> tv_nexus = tv_tpg->tpg_nexus;
> if (!tv_nexus) {
> pr_err("Unable to locate active struct tcm_vhost_nexus\n");
> return ERR_PTR(-EIO);
> }
> - se_sess = tv_nexus->tvn_se_sess;
>
> tv_cmd = kzalloc(sizeof(struct tcm_vhost_cmd), GFP_ATOMIC);
> if (!tv_cmd) {
>
> --
Looks fine to me.
Reviewed-by + Acked-by: Nicholas Bellinger <nab@linux-iscsi.org>
Thanks!
^ permalink raw reply
* Re: SR-IOV problem with Intel 82599EB (not enough MMIO resources for SR-IOV)
From: Jason Gao @ 2012-11-09 3:59 UTC (permalink / raw)
To: Rose, Gregory V
Cc: Kirsher, Jeffrey T, linux-kernel, netdev, kvm,
e1000-devel@lists.sourceforge.net
In-Reply-To: <C5551D9AAB213A418B7FD5E4A6F30A072D565E76@ORSMSX106.amr.corp.intel.com>
> The BIOS in your machine doesn't support SR-IOV. You'll need to ask the manufacturer for a BIOS upgrade, if in fact one is available. Sometimes they're not.
very thanks Greg,my server Dell R710 with latest BIOS version and
option for SR-IOV(SR-IOV Global Enable->Enabled) opened,I'm confused
that Does R710 provide full support for SR-IOV, kernel or ixgbe
driver's bug? but I'm not sure where the problem lies,anyone has any
experience about this? .
^ permalink raw reply
* [PATCH net-next] virtio_net: use net_*_ratelimited() helpers
From: Cong Wang @ 2012-11-09 3:47 UTC (permalink / raw)
To: netdev; +Cc: Rusty Russell, Michael S. Tsirkin, David Miller, Cong Wang
These can be converted to net_*_ratelimited().
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: David Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <amwang@redhat.com>
---
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index cbf8b06..26c502e 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -212,8 +212,7 @@ static struct sk_buff *page_to_skb(struct virtnet_info *vi,
* the case of a broken device.
*/
if (unlikely(len > MAX_SKB_FRAGS * PAGE_SIZE)) {
- if (net_ratelimit())
- pr_debug("%s: too much data\n", skb->dev->name);
+ net_dbg_ratelimited("%s: too much data\n", skb->dev->name);
dev_kfree_skb(skb);
return NULL;
}
@@ -333,9 +332,8 @@ static void receive_buf(struct net_device *dev, void *buf, unsigned int len)
skb_shinfo(skb)->gso_type = SKB_GSO_TCPV6;
break;
default:
- if (net_ratelimit())
- printk(KERN_WARNING "%s: bad gso type %u.\n",
- dev->name, hdr->hdr.gso_type);
+ net_warn_ratelimited("%s: bad gso type %u.\n",
+ dev->name, hdr->hdr.gso_type);
goto frame_err;
}
@@ -344,9 +342,7 @@ static void receive_buf(struct net_device *dev, void *buf, unsigned int len)
skb_shinfo(skb)->gso_size = hdr->hdr.gso_size;
if (skb_shinfo(skb)->gso_size == 0) {
- if (net_ratelimit())
- printk(KERN_WARNING "%s: zero gso size.\n",
- dev->name);
+ net_warn_ratelimited("%s: zero gso size.\n", dev->name);
goto frame_err;
}
^ permalink raw reply related
* Re: [PATCH] tcp: Avoid infinite loop on recvmsg bug
From: Eric Dumazet @ 2012-11-09 3:29 UTC (permalink / raw)
To: Julius Werner
Cc: linux-kernel, netdev, Patrick McHardy, Hideaki YOSHIFUJI,
James Morris, Alexey Kuznetsov, David S. Miller, Dave Jones,
Sameer Nanda, Mandeep Singh Baines
In-Reply-To: <CAODwPW90mZuCDgYPZEJtYNOGGt752VpP=S_EYACUCGua_x=WjA@mail.gmail.com>
On Wed, 2012-11-07 at 18:25 -0800, Julius Werner wrote:
> > So you probably are fighting a bug we already fixed in upstream kernel.
> >
> > (commit c8628155ece363 "tcp: reduce out_of_order memory use" did not
> > played well with cloned skbs.)
> >
> > This issue was already discussed on netdev in the past.
>
> Thanks for the hint. Unfortunately, we have not pulled c8628 into our
> tree yet, so that's not it. Is there another point where the cloned
> skb or the faked truesize might make it break? We have been running
> this test with that hardware some 30 times in the last months and only
> seen it once, so it cannot be that common.
Update : Chrome OS current tree is based on 3.4 and really needed the
patch :
https://gerrit.chromium.org/gerrit/#/c/37666/
^ permalink raw reply
* Re: [PATCH net-next] netconsole: add oops_only module option
From: David Miller @ 2012-11-09 3:07 UTC (permalink / raw)
To: amwang; +Cc: netdev
In-Reply-To: <1352382158-3928-1-git-send-email-amwang@redhat.com>
From: Cong Wang <amwang@redhat.com>
Date: Thu, 8 Nov 2012 21:42:38 +0800
> Some people wants to log only oops messages via netconsole,
> (this is also why netoops was invented)
> so add a module option for netconsole. This can be tuned
> via /sys/module/netconsole/parameters/oops_only at run time
> as well.
>
> Cc: David Miller <davem@davemloft.net>
> Signed-off-by: Cong Wang <amwang@redhat.com>
Seems reasonable, applied, thanks.
^ permalink raw reply
* vlan sysfs 'type'
From: David Miller @ 2012-11-09 3:05 UTC (permalink / raw)
To: cardoe; +Cc: netdev
Ok, after some more careful consideration, I decided to apply
your patch after all to net-next.
Thanks.
^ permalink raw reply
* Re: [PATCH] ipv6: fix two typos in a comment in xfrm6_init()
From: RongQing Li @ 2012-11-09 3:04 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <20121108.213622.1170393152152755967.davem@davemloft.net>
2012/11/9 David Miller <davem@davemloft.net>:
> From: roy.qing.li@gmail.com
> Date: Thu, 8 Nov 2012 16:38:08 +0800
>
>> From: Li RongQing <roy.qing.li@gmail.com>
>>
>> Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
>
> As Steffen stated, this comment is largely obsolete.
Thanks, I will resend new patch to remove this comments
-Roy
^ permalink raw reply
* Re: [PATCH net-next] netconsole: add oops_only module option
From: Cong Wang @ 2012-11-09 3:02 UTC (permalink / raw)
To: Randy Dunlap; +Cc: netdev, David Miller
In-Reply-To: <509C0CCD.7020900@infradead.org>
On Thu, 2012-11-08 at 11:49 -0800, Randy Dunlap wrote:
> On 11/08/2012 05:42 AM, Cong Wang wrote:
>
> > Some people wants to log only oops messages via netconsole,
> > (this is also why netoops was invented)
> > so add a module option for netconsole. This can be tuned
> > via /sys/module/netconsole/parameters/oops_only at run time
> > as well.
> >
>
>
> Hi,
>
> What does this do with panics?
> Do they set oops_in_progress?
Yes, panic() calls bust_spinlocks(1).
^ permalink raw reply
* Re: [PATCH] xfrm: remove redundant replay_esn check
From: David Miller @ 2012-11-09 3:00 UTC (permalink / raw)
To: ulrich.weber; +Cc: steffen.klassert, netdev
In-Reply-To: <20121108101544.GA30309@uweber-WS>
From: Ulrich Weber <ulrich.weber@sophos.com>
Date: Thu, 8 Nov 2012 11:15:44 +0100
> x->replay_esn is already checked in if clause,
> so remove check and ident properly
>
> Signed-off-by: Ulrich Weber <ulrich.weber@sophos.com>
Steffen, I assume you'll pick this one up.
^ permalink raw reply
* Re: [PATCH 2/2] irda: sh-irda: Remove SH7377 support
From: David Miller @ 2012-11-09 2:59 UTC (permalink / raw)
To: nobuhiro.iwamatsu.yj; +Cc: netdev, samuel
In-Reply-To: <1352360667-9341-2-git-send-email-nobuhiro.iwamatsu.yj@renesas.com>
From: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Date: Thu, 8 Nov 2012 16:44:27 +0900
> The shmobile SH7377 already was removed from source tree.
> This remove SH7377 support for sh-irda.
>
> Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Applied.
^ permalink raw reply
* Re: [PATCH 1/2] irda: sh-irda: Remove SH7367 support
From: David Miller @ 2012-11-09 2:59 UTC (permalink / raw)
To: nobuhiro.iwamatsu.yj; +Cc: netdev, samuel
In-Reply-To: <1352360667-9341-1-git-send-email-nobuhiro.iwamatsu.yj@renesas.com>
From: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Date: Thu, 8 Nov 2012 16:44:26 +0900
> The shmobile SH7367 already was removed from source tree.
> This remove SH7367 support for sh-irda.
>
> Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Applied.
^ permalink raw reply
* Re: [PATCH 1/4 net-next] net: allow skb->head to be a page fragment
From: Li Yu @ 2012-11-09 2:50 UTC (permalink / raw)
To: Eric Dumazet; +Cc: Linux Netdev List
In-Reply-To: <1352428675.19779.490.camel@edumazet-glaptop>
于 2012年11月09日 10:37, Eric Dumazet 写道:
> On Fri, 2012-11-09 at 10:31 +0800, Li Yu wrote:
>
>> I think that adding skb->frag_head indeed is a better choice, this means
>> I have to rework some NIC drivers :(
>
> Not sure what you mean, since most (if not all) NIC drivers already use
> skb->frag_head in their RX path.
>
skb = build_skb(data, 0); in bnx2 and bnx2x ......
:)
Yu
^ permalink raw reply
* Re: gro vs vlan in myri10ge
From: Eric Dumazet @ 2012-11-09 2:41 UTC (permalink / raw)
To: Andrew Gallatin; +Cc: netdev
In-Reply-To: <509C6858.6010105@myri.com>
On Thu, 2012-11-08 at 21:20 -0500, Andrew Gallatin wrote:
> Hi,
>
> I've wanted to convert myri10ge from LRO to GRO for quite a while.
> The problem I'm facing is that the NIC cannot perform hardware vlan
> tag offload, so GRO performance is far below LRO performance when
> receiving vlan tagged TCP traffic.
>
> If a vlan tagged frame is passed to lro_receive_frags(), inet_lro will
> look at the encapsulated IPv4 frame and TCP aggregation will succeed.
> However, it appears that GRO will not do this. When I patch the
> driver to use GRO, and configure a vlan interface, I see high CPU
> utilization and poor bandwidth when I'm receiving a netperf TCP stream
> on the vlan interface. If I use LRO in an unpatched driver, then I
> see good receive performance in the same scenario.
>
> What is the best way to "fix" this?
>
> Unless I'm just using GRO wrong, it seems that the simplest thing for
> me to do is to claim NETIF_F_HW_VLAN_RX, but pop the tags in the
> driver so as to allow myri10ge to pass up a non-encapsulated frame the
> same way that (nearly?) every other 10GbE NIC does. I've got a quick
> and dirty patch that confirms doing the vtag pop in the driver gives
> me roughly the same performance with GRO as I used to have with LRO.
>
> Is this (popping vlan tags in the driver) acceptable, or is it
> too much of a layering violation?
Given GRO assumes NIC does hardware vlan offloading, I guess
I would chose to do that.
It seems unfortunate to add vlan decap in GRO path, already very
complex.
^ permalink raw reply
* Re: [PATCH 1/4 net-next] net: allow skb->head to be a page fragment
From: Eric Dumazet @ 2012-11-09 2:37 UTC (permalink / raw)
To: Li Yu; +Cc: Linux Netdev List
In-Reply-To: <509C6AEF.4020300@gmail.com>
On Fri, 2012-11-09 at 10:31 +0800, Li Yu wrote:
> I think that adding skb->frag_head indeed is a better choice, this means
> I have to rework some NIC drivers :(
Not sure what you mean, since most (if not all) NIC drivers already use
skb->frag_head in their RX path.
^ permalink raw reply
* Re: [PATCH] ipv6: fix two typos in a comment in xfrm6_init()
From: David Miller @ 2012-11-09 2:36 UTC (permalink / raw)
To: roy.qing.li; +Cc: netdev
In-Reply-To: <1352363888-14068-1-git-send-email-roy.qing.li@gmail.com>
From: roy.qing.li@gmail.com
Date: Thu, 8 Nov 2012 16:38:08 +0800
> From: Li RongQing <roy.qing.li@gmail.com>
>
> Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
As Steffen stated, this comment is largely obsolete.
^ permalink raw reply
* Re: [PATCH 1/4 net-next] net: allow skb->head to be a page fragment
From: Li Yu @ 2012-11-09 2:31 UTC (permalink / raw)
To: Eric Dumazet; +Cc: Linux Netdev List
In-Reply-To: <1352381449.19779.13.camel@edumazet-glaptop>
于 2012年11月08日 21:30, Eric Dumazet 写道:
> On Thu, 2012-11-08 at 15:46 +0800, Li Yu wrote:
>
>> I think that all kmalloced() objects are continuous on both virtual
>> and physical address space, so such page fragment converting should be
>> safe until we use slab allocator to free them.
>>
>
> Its not safe at all. Good luck with coping with SLAB, SLUB, SLOB, and
> various debugging facilities on top of them.
>
The slab class API semantic should not change among them. the debugging
facilities should only add or modify metadata around user bytes too.
However, I also decided giving up use kmalloced() objects since it is
hard to free them safely them without some extra efforts after doing
page fragmentation on them.
I think that adding skb->frag_head indeed is a better choice, this means
I have to rework some NIC drivers :(
>> I ask this question since I am working on a patch to try to directly
>> forward the data from rx queue of a socket to tx queue of another
>> socket. We noticed that the splice itself still has visible costs when
>> forwarding small messages, and hope such direct forwarding optimization
>> can improve this, this idea comes from TCP friends.
>
> If not using splice, you directly transfert one skb coming from one
> side, to the other side, so you dont care skb->head being a frag or not.
>
> If messages are small, there is probably no hope trying to coalesce them
> (or else fixing the application would be much easier)
>
This patch is hoped that can work well for big messages too, so I
selected moving page fragment, and I think this should be easier a bit
because I can directly reuse tcp_sendpage() interface or just need a bit
of changes on it :)
If it can work well, I will send it out.
Thans very much for your time, :)
Yu
>
>
>
^ permalink raw reply
* Re: [PATCH net-next] ipv6: remove rt6i_peer_genid from rt6_info and its handler
From: David Miller @ 2012-11-09 2:30 UTC (permalink / raw)
To: roy.qing.li; +Cc: netdev
In-Reply-To: <1352361393-4807-1-git-send-email-roy.qing.li@gmail.com>
From: roy.qing.li@gmail.com
Date: Thu, 8 Nov 2012 15:56:33 +0800
> From: Li RongQing <roy.qing.li@gmail.com>
>
> 6431cbc25f(Create a mechanism for upward inetpeer propagation into routes)
> introduces these codes, but this mechanism is never enabled since
> rt6i_peer_genid always is zero whether it is not assigned or assigned by
> rt6_peer_genid(). After 5943634fc5 (ipv4: Maintain redirect and PMTU info
> in struct rtable again), the ipv4 related codes of this mechanism has been
> removed, I think we maybe able to remove them now.
>
> Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
Applied, thanks.
^ permalink raw reply
* [PATCH v3 9/9] net: batman-adv: use per_cpu_add helper
From: Shan Wei @ 2012-11-09 2:22 UTC (permalink / raw)
To: lindner_marek-LWAfsSFWpa4, siwu-MaAgPAbsBIVS8oHt8HbXEIQuADTiUCJX,
ordex-GaUfNO9RBHfsrOwW+9ziJQ,
b.a.t.m.a.n-ZwoEplunGu2X36UT3dwllkB+6BGkLq7r, David Miller,
NetDev, Kernel-Maillist, Shan Wei, Christoph Lameter
From: Shan Wei <davidshan-1Nz4purKYjRBDgjK7y7TUQ@public.gmane.org>
this_cpu_add is an atomic operation.
and be more faster than per_cpu_ptr operation.
Signed-off-by: Shan Wei <davidshan-1Nz4purKYjRBDgjK7y7TUQ@public.gmane.org>
Reviewed-by: Christoph Lameter <cl-vYTEC60ixJUAvxtiuMwx3w@public.gmane.org>
---
v3: change commit message.
---
net/batman-adv/main.h | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/net/batman-adv/main.h b/net/batman-adv/main.h
index 897ba6a..3aef5b2 100644
--- a/net/batman-adv/main.h
+++ b/net/batman-adv/main.h
@@ -263,9 +263,7 @@ static inline bool batadv_has_timed_out(unsigned long timestamp,
static inline void batadv_add_counter(struct batadv_priv *bat_priv, size_t idx,
size_t count)
{
- int cpu = get_cpu();
- per_cpu_ptr(bat_priv->bat_counters, cpu)[idx] += count;
- put_cpu();
+ this_cpu_add(bat_priv->bat_counters[idx], count);
}
#define batadv_inc_counter(b, i) batadv_add_counter(b, i, 1)
--
1.7.1
^ permalink raw reply related
* [PATCH v3 4/9] net: openvswitch: use this_cpu_ptr per-cpu helper
From: Shan Wei @ 2012-11-09 2:21 UTC (permalink / raw)
To: jesse-l0M0P4e3n4LQT0dZR+AlfA, dev-yBygre7rU0TnMu66kgdUjQ, NetDev,
Kernel-Maillist, David Miller,
cl-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b, Shan Wei
From: Shan Wei <davidshan-1Nz4purKYjRBDgjK7y7TUQ@public.gmane.org>
just use more faster this_cpu_ptr instead of per_cpu_ptr(p, smp_processor_id());
Signed-off-by: Shan Wei <davidshan-1Nz4purKYjRBDgjK7y7TUQ@public.gmane.org>
---
no changes vs v2.
---
net/openvswitch/datapath.c | 4 ++--
net/openvswitch/vport.c | 5 ++---
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
index 4c4b62c..77d16a5 100644
--- a/net/openvswitch/datapath.c
+++ b/net/openvswitch/datapath.c
@@ -208,7 +208,7 @@ void ovs_dp_process_received_packet(struct vport *p, struct sk_buff *skb)
int error;
int key_len;
- stats = per_cpu_ptr(dp->stats_percpu, smp_processor_id());
+ stats = this_cpu_ptr(dp->stats_percpu);
/* Extract flow from 'skb' into 'key'. */
error = ovs_flow_extract(skb, p->port_no, &key, &key_len);
@@ -282,7 +282,7 @@ int ovs_dp_upcall(struct datapath *dp, struct sk_buff *skb,
return 0;
err:
- stats = per_cpu_ptr(dp->stats_percpu, smp_processor_id());
+ stats = this_cpu_ptr(dp->stats_percpu);
u64_stats_update_begin(&stats->sync);
stats->n_lost++;
diff --git a/net/openvswitch/vport.c b/net/openvswitch/vport.c
index 03779e8..70af0be 100644
--- a/net/openvswitch/vport.c
+++ b/net/openvswitch/vport.c
@@ -333,8 +333,7 @@ void ovs_vport_receive(struct vport *vport, struct sk_buff *skb)
{
struct vport_percpu_stats *stats;
- stats = per_cpu_ptr(vport->percpu_stats, smp_processor_id());
-
+ stats = this_cpu_ptr(vport->percpu_stats);
u64_stats_update_begin(&stats->sync);
stats->rx_packets++;
stats->rx_bytes += skb->len;
@@ -359,7 +358,7 @@ int ovs_vport_send(struct vport *vport, struct sk_buff *skb)
if (likely(sent)) {
struct vport_percpu_stats *stats;
- stats = per_cpu_ptr(vport->percpu_stats, smp_processor_id());
+ stats = this_cpu_ptr(vport->percpu_stats);
u64_stats_update_begin(&stats->sync);
stats->tx_packets++;
--
1.7.1
^ permalink raw reply related
* [PATCH v3 3/9] net: xfrm: use __this_cpu_read per-cpu helper
From: Shan Wei @ 2012-11-09 2:20 UTC (permalink / raw)
To: steffen.klassert, David Miller, NetDev, Herbert Xu,
Kernel-Maillist, cl, Shan Wei
From: Shan Wei <davidshan@tencent.com>
Signed-off-by: Shan Wei <davidshan@tencent.com>
---
v3 fix compile warning:
net/xfrm/xfrm_ipcomp.c: In function 'ipcomp_alloc_tfms':
net/xfrm/xfrm_ipcomp.c:285: warning: assignment from incompatible pointer type
---
net/xfrm/xfrm_ipcomp.c | 7 ++-----
1 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/net/xfrm/xfrm_ipcomp.c b/net/xfrm/xfrm_ipcomp.c
index e5246fb..898c899 100644
--- a/net/xfrm/xfrm_ipcomp.c
+++ b/net/xfrm/xfrm_ipcomp.c
@@ -276,18 +276,15 @@ static struct crypto_comp * __percpu *ipcomp_alloc_tfms(const char *alg_name)
struct crypto_comp * __percpu *tfms;
int cpu;
- /* This can be any valid CPU ID so we don't need locking. */
- cpu = raw_smp_processor_id();
list_for_each_entry(pos, &ipcomp_tfms_list, list) {
struct crypto_comp *tfm;
- tfms = pos->tfms;
- tfm = *per_cpu_ptr(tfms, cpu);
+ tfm = (struct crypto_comp *) __this_cpu_read(pos->tfms);
if (!strcmp(crypto_comp_name(tfm), alg_name)) {
pos->users++;
- return tfms;
+ return pos->tfms;
}
}
--
1.7.1
^ permalink raw reply related
* [PATCH v3 2/9] net: rds: use this_cpu_ptr per-cpu helper
From: Shan Wei @ 2012-11-09 2:20 UTC (permalink / raw)
To: venkat.x.venkatsubra, David Miller, rds-devel, NetDev,
Kernel-Maillist, cl, Shan Wei
From: Shan Wei <davidshan@tencent.com>
Signed-off-by: Shan Wei <davidshan@tencent.com>
Reviewed-by: Christoph Lameter <cl@linux.com>
---
no changes vs v2.
---
net/rds/ib_recv.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/rds/ib_recv.c b/net/rds/ib_recv.c
index 8d19491..a4a5064 100644
--- a/net/rds/ib_recv.c
+++ b/net/rds/ib_recv.c
@@ -423,7 +423,7 @@ static void rds_ib_recv_cache_put(struct list_head *new_item,
local_irq_save(flags);
- chp = per_cpu_ptr(cache->percpu, smp_processor_id());
+ chp = this_cpu_ptr(cache->percpu);
if (!chp->first)
INIT_LIST_HEAD(new_item);
else /* put on front */
--
1.7.1
^ permalink raw reply related
* [PATCH v3 1/9] net: core: use this_cpu_ptr per-cpu helper
From: Shan Wei @ 2012-11-09 2:20 UTC (permalink / raw)
To: David Miller, timo.teras, steffen.klassert, NetDev,
Kernel-Maillist, cl, Shan Wei
From: Shan Wei <davidshan@tencent.com>
flush_tasklet is a struct, not a pointer in percpu var.
so use this_cpu_ptr to get the member pointer.
Signed-off-by: Shan Wei <davidshan@tencent.com>
---
net/core/flow.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/net/core/flow.c b/net/core/flow.c
index e318c7e..b0901ee 100644
--- a/net/core/flow.c
+++ b/net/core/flow.c
@@ -327,11 +327,9 @@ static void flow_cache_flush_tasklet(unsigned long data)
static void flow_cache_flush_per_cpu(void *data)
{
struct flow_flush_info *info = data;
- int cpu;
struct tasklet_struct *tasklet;
- cpu = smp_processor_id();
- tasklet = &per_cpu_ptr(info->cache->percpu, cpu)->flush_tasklet;
+ tasklet = this_cpu_ptr(&info->cache->percpu->flush_tasklet);
tasklet->data = (unsigned long)info;
tasklet_schedule(tasklet);
}
--
1.7.1
^ permalink raw reply related
* gro vs vlan in myri10ge
From: Andrew Gallatin @ 2012-11-09 2:20 UTC (permalink / raw)
To: netdev
Hi,
I've wanted to convert myri10ge from LRO to GRO for quite a while.
The problem I'm facing is that the NIC cannot perform hardware vlan
tag offload, so GRO performance is far below LRO performance when
receiving vlan tagged TCP traffic.
If a vlan tagged frame is passed to lro_receive_frags(), inet_lro will
look at the encapsulated IPv4 frame and TCP aggregation will succeed.
However, it appears that GRO will not do this. When I patch the
driver to use GRO, and configure a vlan interface, I see high CPU
utilization and poor bandwidth when I'm receiving a netperf TCP stream
on the vlan interface. If I use LRO in an unpatched driver, then I
see good receive performance in the same scenario.
What is the best way to "fix" this?
Unless I'm just using GRO wrong, it seems that the simplest thing for
me to do is to claim NETIF_F_HW_VLAN_RX, but pop the tags in the
driver so as to allow myri10ge to pass up a non-encapsulated frame the
same way that (nearly?) every other 10GbE NIC does. I've got a quick
and dirty patch that confirms doing the vtag pop in the driver gives
me roughly the same performance with GRO as I used to have with LRO.
Is this (popping vlan tags in the driver) acceptable, or is it
too much of a layering violation?
Thanks,
Drew
^ permalink raw reply
* [PATCH 0/9 v3] use efficient this_cpu_* helper
From: Shan Wei @ 2012-11-09 2:20 UTC (permalink / raw)
To: cl, David Miller, NetDev, Kernel-Maillist, Shan Wei
this_cpu_ptr/this_cpu_read is faster than per_cpu_ptr(p, smp_processor_id())
and can reduce memory accesses.
The latter helper needs to find the offset for current cpu,
and needs more assembler instructions which objdump shows in following.
this_cpu_ptr relocates and address. this_cpu_read() relocates the address
and performs the fetch. If you want to operate on rda(defined as per_cpu)
then you can only use this_cpu_ptr. this_cpu_read() saves you more instructions
since it can do the relocation and the fetch in one instruction.
per_cpu_ptr(p, smp_processor_id()):
1e: 65 8b 04 25 00 00 00 00 mov %gs:0x0,%eax
26: 48 98 cltq
28: 31 f6 xor %esi,%esi
2a: 48 c7 c7 00 00 00 00 mov $0x0,%rdi
31: 48 8b 04 c5 00 00 00 00 mov 0x0(,%rax,8),%rax
39: c7 44 10 04 14 00 00 00 movl $0x14,0x4(%rax,%rdx,1)
this_cpu_ptr(p)
1e: 65 48 03 14 25 00 00 00 00 add %gs:0x0,%rdx
27: 31 f6 xor %esi,%esi
29: c7 42 04 14 00 00 00 movl $0x14,0x4(%rdx)
30: 48 c7 c7 00 00 00 00 mov $0x0,%rdi
Changelog V3:
1. use this_cpu_read directly read member of per-cpu variable,
so that droping the this_cpu_ptr operation.
2. for preemption off and bottom halves off case,
use __this_cpu_read instead of this_cpu_read.
Changelog V2:
1. Use this_cpu_read directly instead of ref to field of per-cpu variable.
2. Patch5 about ftrace is dropped from this series.
3. Add new patch9 to replace get_cpu;per_cpu_ptr;put_cpu with this_cpu_add opt.
4. For preemption disable case, use __this_cpu_read instead.
$ git diff --stat 7da716aee2532399e213a14f656d304098f67a11..
drivers/clocksource/arm_generic.c | 2 +-
kernel/padata.c | 5 ++---
kernel/rcutree.c | 2 +-
kernel/trace/blktrace.c | 2 +-
kernel/trace/trace.c | 5 +----
net/batman-adv/main.h | 4 +---
net/core/flow.c | 4 +---
net/openvswitch/datapath.c | 4 ++--
net/openvswitch/vport.c | 5 ++---
net/rds/ib_recv.c | 2 +-
net/xfrm/xfrm_ipcomp.c | 7 ++-----
11 files changed, 15 insertions(+), 27 deletions(-)
^ permalink raw reply
* [PATCH 3/3] ipgre: capture inner headers during encapsulation
From: Joseph Gasparakis @ 2012-11-09 2:18 UTC (permalink / raw)
To: davem, shemminger, chrisw
Cc: Joseph Gasparakis, netdev, linux-kernel, Peter P Waskiewicz Jr
In-Reply-To: <1352427483-4380-1-git-send-email-joseph.gasparakis@intel.com>
Populating the inner header pointers of skb for ipgre
This patch has been compile-tested only.
Signed-off-by: Joseph Gasparakis <joseph.gasparakis@intel.com>
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
---
net/ipv4/ip_gre.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index 7240f8e..ec3ebb1 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -766,6 +766,7 @@ static netdev_tx_t ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev
int gre_hlen;
__be32 dst;
int mtu;
+ unsigned int offset;
if (skb->ip_summed == CHECKSUM_PARTIAL &&
skb_checksum_help(skb))
@@ -902,6 +903,17 @@ static netdev_tx_t ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev
tunnel->err_count = 0;
}
+ offset = skb->data - skb->head;
+
+ skb_reset_inner_mac_header(skb);
+
+ if (skb->network_header)
+ skb_set_inner_network_header(skb, skb->network_header - offset);
+
+ if (skb->transport_header)
+ skb_set_inner_transport_header(skb, skb->transport_header -
+ offset);
+
max_headroom = LL_RESERVED_SPACE(tdev) + gre_hlen + rt->dst.header_len;
if (skb_headroom(skb) < max_headroom || skb_shared(skb)||
--
1.7.11.7
^ permalink raw reply related
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