* Re: [PATCHv3 net-next 2/5] {IPv4,xfrm} Add ESN support for AH ingress part
From: Fan Du @ 2014-01-14 10:41 UTC (permalink / raw)
To: Steffen Klassert; +Cc: davem, netdev
In-Reply-To: <20140114103426.GJ31491@secunet.com>
On 2014年01月14日 18:34, Steffen Klassert wrote:
> On Tue, Jan 14, 2014 at 06:17:26PM +0800, Fan Du wrote:
>>
>>
>> On 2014年01月14日 18:09, Steffen Klassert wrote:
>>> On Tue, Jan 14, 2014 at 06:01:32PM +0800, Fan Du wrote:
>>>>
>>>>
>>>> On 2014年01月14日 17:54, Steffen Klassert wrote:
>>>>> On Tue, Jan 14, 2014 at 09:39:09AM +0800, Fan Du wrote:
>>>>>> @@ -381,7 +393,14 @@ static int ah_input(struct xfrm_state *x, struct sk_buff *skb)
>>>>>> sg_init_table(sg, nfrags);
>>>>>> skb_to_sgvec(skb, sg, 0, skb->len);
>>>>>>
>>>>>> - ahash_request_set_crypt(req, sg, icv, skb->len);
>>>>>> + if (x->props.flags& XFRM_STATE_ESN) {
>>>>>> + sg_unmark_end(&sg[nfrags - 1]);
>>>>>> + /* Attach seqhi sg right after packet payload */
>>>>>> + *seqhi = htonl(XFRM_SKB_CB(skb)->seq.output.hi);
>>>>>
>>>>> This is ah_input(), so you should use the high bits of the input
>>>>> sequence number here. The ipv6 patch has the same problem.
>>>>
>>>> ok, I will fix this.
>>>>
>>>>>
>>>>>> + sg_init_table(seqhisg, sglists);
>>>>>
>>>>> Why do you add a separate SG table for this?
>>>>
>>>> It just initialize a single seqhisg, which is actually followed behind packet payload sg table.
>>>> initialized seqhisg actually mark itself as the end of sg list.
>>>>
>>>
>>> Why don't you just add this entry to the existing SG table?
>>>
>>
>> Do you mean scatterwalk_crypto_chain ?
>
> No, I mean something like:
>
> sg_init_table(sg, nfrags + sglists)
>
> if (x->props.flags& XFRM_STATE_ESN) {
> *seqhi = XFRM_SKB_CB(skb)->seq.input.hi;
> sg_set_buf(sg + nfrags, seqhi, seqhi_len);
> }
>
hehe, it's the same as the option this patch used.
Anyway, I will make it as you suggested in the next round review.
--
浮沉随浪只记今朝笑
--fan
^ permalink raw reply
* Re: [PATCH net-next v2 0/2] bonding: ensure that the TSO being set on bond master
From: Ding Tianhong @ 2014-01-14 10:38 UTC (permalink / raw)
To: Veaceslav Falico; +Cc: Jay Vosburgh, Eric Dumazet, David S. Miller, Netdev
In-Reply-To: <20140114094741.GB20066@redhat.com>
On 2014/1/14 17:47, Veaceslav Falico wrote:
> On Tue, Jan 14, 2014 at 05:00:07PM +0800, Ding Tianhong wrote:
>> The commit b0ce3508(bonding: allow TSO being set on bonding master)
>> has make the TSO being set for bond dev, but in some situation, if
>> the slave did not have the NETIF_F_SG features, the bond master will
>> miss the TSO features in netdev_fix_features because the TSO is
>> depended on SG. So I have to add SG and TSO features on bond master
>> together.
>>
>> The function netdev_add_tso_features() was only be used for bonding,
>> so no need to export it in netdevice.h, remove it and add it to bonding.
>>
>> v2: If the slave hw did not support SG features, the SG should not
>> be forced open on master, otherwise error will occur, so modify it.
>> Some slave may support SG but not open it yet, so the bond master
>> could try to open it when adding the salve and make sure the TSO
>> could be open on master.
>
> So you're forcibly enabling SG on a slave? Usually SG is always enabled,
> unless there's a very specific reason for that - like a bug in hw/sw/fw,
> like performance improvement on specific use-cases etc. etc.
>
> So that's a wrong thing to do - to try to enable it, if it was disabled.
>
I don't think it is a wrong thing, just a slight changes of use, but your word
is reasonable, I will miss it.
> Nacked-by: Veaceslav Falico <vfalico@redhat.com>
>
>>
>> Ding Tianhong (2):
>> bonding: move the netdev_add_tso_features() to bonding
>> bonding: try to enable SG features when adding a new slave
>>
>> drivers/net/bonding/bond_main.c | 27 ++++++++++++++++++++++++++-
>> include/linux/netdevice.h | 10 ----------
>> 2 files changed, 26 insertions(+), 11 deletions(-)
>>
>> --
>> 1.8.0
>>
>>
>
>
^ permalink raw reply
* Re: [PATCHv3 net-next 2/5] {IPv4,xfrm} Add ESN support for AH ingress part
From: Steffen Klassert @ 2014-01-14 10:34 UTC (permalink / raw)
To: Fan Du; +Cc: davem, netdev
In-Reply-To: <52D50EB6.3010301@windriver.com>
On Tue, Jan 14, 2014 at 06:17:26PM +0800, Fan Du wrote:
>
>
> On 2014年01月14日 18:09, Steffen Klassert wrote:
> >On Tue, Jan 14, 2014 at 06:01:32PM +0800, Fan Du wrote:
> >>
> >>
> >>On 2014年01月14日 17:54, Steffen Klassert wrote:
> >>>On Tue, Jan 14, 2014 at 09:39:09AM +0800, Fan Du wrote:
> >>>>@@ -381,7 +393,14 @@ static int ah_input(struct xfrm_state *x, struct sk_buff *skb)
> >>>> sg_init_table(sg, nfrags);
> >>>> skb_to_sgvec(skb, sg, 0, skb->len);
> >>>>
> >>>>- ahash_request_set_crypt(req, sg, icv, skb->len);
> >>>>+ if (x->props.flags& XFRM_STATE_ESN) {
> >>>>+ sg_unmark_end(&sg[nfrags - 1]);
> >>>>+ /* Attach seqhi sg right after packet payload */
> >>>>+ *seqhi = htonl(XFRM_SKB_CB(skb)->seq.output.hi);
> >>>
> >>>This is ah_input(), so you should use the high bits of the input
> >>>sequence number here. The ipv6 patch has the same problem.
> >>
> >>ok, I will fix this.
> >>
> >>>
> >>>>+ sg_init_table(seqhisg, sglists);
> >>>
> >>>Why do you add a separate SG table for this?
> >>
> >>It just initialize a single seqhisg, which is actually followed behind packet payload sg table.
> >>initialized seqhisg actually mark itself as the end of sg list.
> >>
> >
> >Why don't you just add this entry to the existing SG table?
> >
>
> Do you mean scatterwalk_crypto_chain ?
No, I mean something like:
sg_init_table(sg, nfrags + sglists)
if (x->props.flags & XFRM_STATE_ESN) {
*seqhi = XFRM_SKB_CB(skb)->seq.input.hi;
sg_set_buf(sg + nfrags, seqhi, seqhi_len);
}
^ permalink raw reply
* Re: [PATCH RESEND net-next v2 0/3] bonding: fix primary problem for bonding
From: Ding Tianhong @ 2014-01-14 10:26 UTC (permalink / raw)
To: Veaceslav Falico; +Cc: Jay Vosburgh, Netdev, David S. Miller
In-Reply-To: <20140114093720.GA20066@redhat.com>
On 2014/1/14 17:37, Veaceslav Falico wrote:
> On Tue, Jan 14, 2014 at 05:08:18PM +0800, Ding Tianhong wrote:
>> If the slave's name changed, and the bond params primary is exist,
>> the bond should deal with the situation in two ways:
>>
>> 1) If the slave was the primary slave yet, clean the primary slave
>> and reselect active slave.
>> 2) If the slave's new name is as same as bond primary, set the slave
>> as primary slave and reselect active slave.
>>
>> If the new primary is not matching any slave in the bond, the bond should
>> record it to params, clean the primary slave and select a new active slave.
>>
>> Update bonding.txt for primary description.
>
> You didn't even take into accoung my previous messages.
>
> Nacked-by: Veaceslav Falico <vfalico@redhat.com>
>
Yes, miss it, sorry about that, add and resend later.
>>
>> Ding Tianhong (3):
>> bonding: update the primary slave when changing slave's name
>> bonding: clean the primary slave if there is no slave matching new
>> primary
>> bonding: update bonding.txt for primary description.
>>
>> Documentation/networking/bonding.txt | 3 ++-
>> drivers/net/bonding/bond_main.c | 24 ++++++++++++++++++++++--
>> drivers/net/bonding/bond_options.c | 6 ++++++
>> 3 files changed, 30 insertions(+), 3 deletions(-)
>>
>> --
>> 1.8.0
>>
>>
>>
>
>
^ permalink raw reply
* Re: [PATCHv3 net-next 2/5] {IPv4,xfrm} Add ESN support for AH ingress part
From: Fan Du @ 2014-01-14 10:17 UTC (permalink / raw)
To: Steffen Klassert; +Cc: davem, netdev
In-Reply-To: <20140114100900.GI31491@secunet.com>
On 2014年01月14日 18:09, Steffen Klassert wrote:
> On Tue, Jan 14, 2014 at 06:01:32PM +0800, Fan Du wrote:
>>
>>
>> On 2014年01月14日 17:54, Steffen Klassert wrote:
>>> On Tue, Jan 14, 2014 at 09:39:09AM +0800, Fan Du wrote:
>>>> @@ -381,7 +393,14 @@ static int ah_input(struct xfrm_state *x, struct sk_buff *skb)
>>>> sg_init_table(sg, nfrags);
>>>> skb_to_sgvec(skb, sg, 0, skb->len);
>>>>
>>>> - ahash_request_set_crypt(req, sg, icv, skb->len);
>>>> + if (x->props.flags& XFRM_STATE_ESN) {
>>>> + sg_unmark_end(&sg[nfrags - 1]);
>>>> + /* Attach seqhi sg right after packet payload */
>>>> + *seqhi = htonl(XFRM_SKB_CB(skb)->seq.output.hi);
>>>
>>> This is ah_input(), so you should use the high bits of the input
>>> sequence number here. The ipv6 patch has the same problem.
>>
>> ok, I will fix this.
>>
>>>
>>>> + sg_init_table(seqhisg, sglists);
>>>
>>> Why do you add a separate SG table for this?
>>
>> It just initialize a single seqhisg, which is actually followed behind packet payload sg table.
>> initialized seqhisg actually mark itself as the end of sg list.
>>
>
> Why don't you just add this entry to the existing SG table?
>
Do you mean scatterwalk_crypto_chain ?
--
浮沉随浪只记今朝笑
--fan
^ permalink raw reply
* Re: [PATCHv3 net-next 2/5] {IPv4,xfrm} Add ESN support for AH ingress part
From: Steffen Klassert @ 2014-01-14 10:09 UTC (permalink / raw)
To: Fan Du; +Cc: davem, netdev
In-Reply-To: <52D50AFC.6030302@windriver.com>
On Tue, Jan 14, 2014 at 06:01:32PM +0800, Fan Du wrote:
>
>
> On 2014年01月14日 17:54, Steffen Klassert wrote:
> >On Tue, Jan 14, 2014 at 09:39:09AM +0800, Fan Du wrote:
> >>@@ -381,7 +393,14 @@ static int ah_input(struct xfrm_state *x, struct sk_buff *skb)
> >> sg_init_table(sg, nfrags);
> >> skb_to_sgvec(skb, sg, 0, skb->len);
> >>
> >>- ahash_request_set_crypt(req, sg, icv, skb->len);
> >>+ if (x->props.flags& XFRM_STATE_ESN) {
> >>+ sg_unmark_end(&sg[nfrags - 1]);
> >>+ /* Attach seqhi sg right after packet payload */
> >>+ *seqhi = htonl(XFRM_SKB_CB(skb)->seq.output.hi);
> >
> >This is ah_input(), so you should use the high bits of the input
> >sequence number here. The ipv6 patch has the same problem.
>
> ok, I will fix this.
>
> >
> >>+ sg_init_table(seqhisg, sglists);
> >
> >Why do you add a separate SG table for this?
>
> It just initialize a single seqhisg, which is actually followed behind packet payload sg table.
> initialized seqhisg actually mark itself as the end of sg list.
>
Why don't you just add this entry to the existing SG table?
^ permalink raw reply
* Re: [PATCH RFC 0/9]net: stmmac PM related fixes.
From: srinivas kandagatla @ 2014-01-14 10:05 UTC (permalink / raw)
To: srinivas.kandagatla, Giuseppe Cavallaro, David Miller
Cc: netdev, linux-kernel
In-Reply-To: <1384774256-10039-1-git-send-email-srinivas.kandagatla@st.com>
Hi Dave/Peppe,
Do you have any plans to take this series?
Peppe already Acked these series.
Please let me know if you want me to rebase these patches to a
particular branch.
Thanks,
srini
On 18/11/13 11:30, srinivas.kandagatla@st.com wrote:
> From: Srinivas Kandagatla <srinivas.kandagatla@st.com>
>
> Hi Peppe,
>
> During PM_SUSPEND_FREEZE testing, I have noticed that PM support in STMMAC is
> partly broken. I had to re-arrange the code to do PM correctly. There were lot
> of things I did not like personally and some bits did not work in the first
> place. I thought this is the nice opportunity to clean the mess up.
>
> Here is what I did:
> any
> 1> Test PM suspend freeeze via pm_test
> It did not work for following reasons.
> - If the power to gmac is removed when it enters in low power state.
> stmmac_resume could not cope up with such behaviour, it was expecting the ip
> register contents to be still same as before entering low power, This
> assumption is wrong. So I started to add some code to do Hardware
> initialization, thats when I started to re-arrange the code. stmmac_open
> contains both resource and memory allocations and hardware initialization. I
> had to separate these two things in two different functions.
>
> These two patches do that
> net: stmmac: move dma allocation to new function
> net: stmmac: move hardware setup for stmmac_open to new function
>
> And rest of the other patches are fixing the loose ends, things like mdio
> reset, which might be necessary in cases likes hibernation(I did not test).
>
> In hibernation cases the driver was just unregistering with subsystems and
> releasing resources which I did not like and its not necessary to do this as
> part of PM. So using the same stmmac_suspend/resume made more sense for
> hibernation cases than using stmmac_open/release.
> Also fixed a NULL pointer dereference bug too.
>
> 2> Test WOL via PM_SUSPEND_FREEZE
> Did get an wakeup interrupt, but could not wakeup a freeze system.
> So I had to add pm_wakeup_event to the driver.
> net: stmmac: notify the PM core of a wakeup event. patch.
>
> Also few patches like
> net: stmmac: make stmmac_mdio_reset non-static
> net: stmmac: restore pinstate in pm resume.
> helps the resume function to reset the phy and put back the pins in default
> state.
>
> Comments?
>
> Thanks,
> srini
>
> Srinivas Kandagatla (9):
> net: stmmac: support max-speed device tree property
> net: stmmac: mdio: remove reset gpio free
> net: stmmac: move dma allocation to new function
> net: stmmac: move hardware setup for stmmac_open to new function
> net: stmmac: make stmmac_mdio_reset non-static
> net: stmmac: fix power mangement suspend-resume case
> net: stmmac: use suspend functions for hibernation
> net: stmmac: restore pinstate in pm resume.
> net: stmmac: notify the PM core of a wakeup event.
>
> drivers/net/ethernet/stmicro/stmmac/stmmac.h | 4 +-
> drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 360 ++++++++++----------
> drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c | 3 +-
> .../net/ethernet/stmicro/stmmac/stmmac_platform.c | 51 +--
> include/linux/stmmac.h | 1 +
> 5 files changed, 209 insertions(+), 210 deletions(-)
>
^ permalink raw reply
* Re: [PATCHv3 net-next 2/5] {IPv4,xfrm} Add ESN support for AH ingress part
From: Fan Du @ 2014-01-14 10:01 UTC (permalink / raw)
To: Steffen Klassert; +Cc: davem, netdev
In-Reply-To: <20140114095425.GH31491@secunet.com>
On 2014年01月14日 17:54, Steffen Klassert wrote:
> On Tue, Jan 14, 2014 at 09:39:09AM +0800, Fan Du wrote:
>> @@ -381,7 +393,14 @@ static int ah_input(struct xfrm_state *x, struct sk_buff *skb)
>> sg_init_table(sg, nfrags);
>> skb_to_sgvec(skb, sg, 0, skb->len);
>>
>> - ahash_request_set_crypt(req, sg, icv, skb->len);
>> + if (x->props.flags& XFRM_STATE_ESN) {
>> + sg_unmark_end(&sg[nfrags - 1]);
>> + /* Attach seqhi sg right after packet payload */
>> + *seqhi = htonl(XFRM_SKB_CB(skb)->seq.output.hi);
>
> This is ah_input(), so you should use the high bits of the input
> sequence number here. The ipv6 patch has the same problem.
ok, I will fix this.
>
>> + sg_init_table(seqhisg, sglists);
>
> Why do you add a separate SG table for this?
It just initialize a single seqhisg, which is actually followed behind packet payload sg table.
initialized seqhisg actually mark itself as the end of sg list.
--
浮沉随浪只记今朝笑
--fan
^ permalink raw reply
* Re: [PATCHv3 net-next 2/5] {IPv4,xfrm} Add ESN support for AH ingress part
From: Steffen Klassert @ 2014-01-14 9:54 UTC (permalink / raw)
To: Fan Du; +Cc: davem, netdev
In-Reply-To: <1389663552-29638-3-git-send-email-fan.du@windriver.com>
On Tue, Jan 14, 2014 at 09:39:09AM +0800, Fan Du wrote:
> @@ -381,7 +393,14 @@ static int ah_input(struct xfrm_state *x, struct sk_buff *skb)
> sg_init_table(sg, nfrags);
> skb_to_sgvec(skb, sg, 0, skb->len);
>
> - ahash_request_set_crypt(req, sg, icv, skb->len);
> + if (x->props.flags & XFRM_STATE_ESN) {
> + sg_unmark_end(&sg[nfrags - 1]);
> + /* Attach seqhi sg right after packet payload */
> + *seqhi = htonl(XFRM_SKB_CB(skb)->seq.output.hi);
This is ah_input(), so you should use the high bits of the input
sequence number here. The ipv6 patch has the same problem.
> + sg_init_table(seqhisg, sglists);
Why do you add a separate SG table for this?
^ permalink raw reply
* Re: [PATCH net-next] tun/macvtap: limit the packets queued through rcvbuf
From: Michael S. Tsirkin @ 2014-01-14 9:52 UTC (permalink / raw)
To: Jason Wang
Cc: davem, netdev, linux-kernel, Vlad Yasevich, John Fastabend,
Stephen Hemminger, Herbert Xu
In-Reply-To: <52D4F924.2040502@redhat.com>
On Tue, Jan 14, 2014 at 04:45:24PM +0800, Jason Wang wrote:
> On 01/14/2014 04:25 PM, Michael S. Tsirkin wrote:
> > On Tue, Jan 14, 2014 at 02:53:07PM +0800, Jason Wang wrote:
> >> We used to limit the number of packets queued through tx_queue_length. This
> >> has several issues:
> >>
> >> - tx_queue_length is the control of qdisc queue length, simply reusing it
> >> to control the packets queued by device may cause confusion.
> >> - After commit 6acf54f1cf0a6747bac9fea26f34cfc5a9029523 ("macvtap: Add
> >> support of packet capture on macvtap device."), an unexpected qdisc
> >> caused by non-zero tx_queue_length will lead qdisc lock contention for
> >> multiqueue deivce.
> >> - What we really want is to limit the total amount of memory occupied not
> >> the number of packets.
> >>
> >> So this patch tries to solve the above issues by using socket rcvbuf to
> >> limit the packets could be queued for tun/macvtap. This was done by using
> >> sock_queue_rcv_skb() instead of a direct call to skb_queue_tail(). Also two
> >> new ioctl() were introduced for userspace to change the rcvbuf like what we
> >> have done for sndbuf.
> >>
> >> With this fix, we can safely change the tx_queue_len of macvtap to
> >> zero. This will make multiqueue works without extra lock contention.
> >>
> >> Cc: Vlad Yasevich <vyasevic@redhat.com>
> >> Cc: Michael S. Tsirkin <mst@redhat.com>
> >> Cc: John Fastabend <john.r.fastabend@intel.com>
> >> Cc: Stephen Hemminger <stephen@networkplumber.org>
> >> Cc: Herbert Xu <herbert@gondor.apana.org.au>
> >> Signed-off-by: Jason Wang <jasowang@redhat.com>
> > No, I don't think we can change userspace-visible behaviour like that.
> >
> > This will break any existing user that tries to control
> > queue length through sysfs,netlink or device ioctl.
>
> But it looks like a buggy API, since tx_queue_len should be for qdisc
> queue length instead of device itself.
Probably, but it's been like this since 2.6.x time.
Also, qdisc queue is unused for tun so it seemed kind of
reasonable to override tx_queue_len.
> If we really want to preserve the
> behaviour, how about using a new feature flag and change the behaviour
> only when the device is created (TUNSETIFF) with the new flag?
OK this addresses the issue partially, but there's also an issue
of permissions: tx_queue_len can only be changed if
capable(CAP_NET_ADMIN). OTOH in your patch a regular user
can change the amount of memory consumed per queue
by calling TUNSETRCVBUF.
> >
> > Take a look at my patch in msg ID 20140109071721.GD19559@redhat.com
> > which gives one way to set tx_queue_len to zero without
> > breaking userspace.
>
> If I read the patch correctly, it will make no way for the user who
> really want to change the qdisc queue length for tun.
Why would this matter? As far as I can see qdisc queue is currently unused.
> >
> >
> >> ---
> >> drivers/net/macvtap.c | 31 ++++++++++++++++++++---------
> >> drivers/net/tun.c | 48 +++++++++++++++++++++++++++++++++------------
> >> include/uapi/linux/if_tun.h | 3 +++
> >> 3 files changed, 60 insertions(+), 22 deletions(-)
> >>
> >> diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c
> >> index a2c3a89..c429c56 100644
> >> --- a/drivers/net/macvtap.c
> >> +++ b/drivers/net/macvtap.c
> >> @@ -292,9 +292,6 @@ static rx_handler_result_t macvtap_handle_frame(struct sk_buff **pskb)
> >> if (!q)
> >> return RX_HANDLER_PASS;
> >>
> >> - if (skb_queue_len(&q->sk.sk_receive_queue) >= dev->tx_queue_len)
> >> - goto drop;
> >> -
> >> skb_push(skb, ETH_HLEN);
> >>
> >> /* Apply the forward feature mask so that we perform segmentation
> >> @@ -310,8 +307,10 @@ static rx_handler_result_t macvtap_handle_frame(struct sk_buff **pskb)
> >> goto drop;
> >>
> >> if (!segs) {
> >> - skb_queue_tail(&q->sk.sk_receive_queue, skb);
> >> - goto wake_up;
> >> + if (sock_queue_rcv_skb(&q->sk, skb))
> >> + goto drop;
> >> + else
> >> + goto wake_up;
> >> }
> >>
> >> kfree_skb(skb);
> >> @@ -319,11 +318,17 @@ static rx_handler_result_t macvtap_handle_frame(struct sk_buff **pskb)
> >> struct sk_buff *nskb = segs->next;
> >>
> >> segs->next = NULL;
> >> - skb_queue_tail(&q->sk.sk_receive_queue, segs);
> >> + if (sock_queue_rcv_skb(&q->sk, segs)) {
> >> + skb = segs;
> >> + skb->next = nskb;
> >> + goto drop;
> >> + }
> >> +
> >> segs = nskb;
> >> }
> >> } else {
> >> - skb_queue_tail(&q->sk.sk_receive_queue, skb);
> >> + if (sock_queue_rcv_skb(&q->sk, skb))
> >> + goto drop;
> >> }
> >>
> >> wake_up:
> >> @@ -333,7 +338,7 @@ wake_up:
> >> drop:
> >> /* Count errors/drops only here, thus don't care about args. */
> >> macvlan_count_rx(vlan, 0, 0, 0);
> >> - kfree_skb(skb);
> >> + kfree_skb_list(skb);
> >> return RX_HANDLER_CONSUMED;
> >> }
> >>
> >> @@ -414,7 +419,7 @@ static void macvtap_dellink(struct net_device *dev,
> >> static void macvtap_setup(struct net_device *dev)
> >> {
> >> macvlan_common_setup(dev);
> >> - dev->tx_queue_len = TUN_READQ_SIZE;
> >> + dev->tx_queue_len = 0;
> >> }
> >>
> >> static struct rtnl_link_ops macvtap_link_ops __read_mostly = {
> >> @@ -469,6 +474,7 @@ static int macvtap_open(struct inode *inode, struct file *file)
> >> sock_init_data(&q->sock, &q->sk);
> >> q->sk.sk_write_space = macvtap_sock_write_space;
> >> q->sk.sk_destruct = macvtap_sock_destruct;
> >> + q->sk.sk_rcvbuf = TUN_RCVBUF;
> >> q->flags = IFF_VNET_HDR | IFF_NO_PI | IFF_TAP;
> >> q->vnet_hdr_sz = sizeof(struct virtio_net_hdr);
> >>
> >> @@ -1040,6 +1046,13 @@ static long macvtap_ioctl(struct file *file, unsigned int cmd,
> >> q->sk.sk_sndbuf = u;
> >> return 0;
> >>
> >> + case TUNSETRCVBUF:
> >> + if (get_user(u, up))
> >> + return -EFAULT;
> >> +
> >> + q->sk.sk_rcvbuf = u;
> >> + return 0;
> >> +
> >> case TUNGETVNETHDRSZ:
> >> s = q->vnet_hdr_sz;
> >> if (put_user(s, sp))
> >> diff --git a/drivers/net/tun.c b/drivers/net/tun.c
> >> index 09f6662..7a08fa3 100644
> >> --- a/drivers/net/tun.c
> >> +++ b/drivers/net/tun.c
> >> @@ -177,6 +177,7 @@ struct tun_struct {
> >>
> >> int vnet_hdr_sz;
> >> int sndbuf;
> >> + int rcvbuf;
> >> struct tap_filter txflt;
> >> struct sock_fprog fprog;
> >> /* protected by rtnl lock */
> >> @@ -771,17 +772,6 @@ static netdev_tx_t tun_net_xmit(struct sk_buff *skb, struct net_device *dev)
> >> if (!check_filter(&tun->txflt, skb))
> >> goto drop;
> >>
> >> - if (tfile->socket.sk->sk_filter &&
> >> - sk_filter(tfile->socket.sk, skb))
> >> - goto drop;
> >> -
> >> - /* Limit the number of packets queued by dividing txq length with the
> >> - * number of queues.
> >> - */
> >> - if (skb_queue_len(&tfile->socket.sk->sk_receive_queue)
> >> - >= dev->tx_queue_len / tun->numqueues)
> >> - goto drop;
> >> -
> >> if (unlikely(skb_orphan_frags(skb, GFP_ATOMIC)))
> >> goto drop;
> >>
> >> @@ -798,7 +788,8 @@ static netdev_tx_t tun_net_xmit(struct sk_buff *skb, struct net_device *dev)
> >> nf_reset(skb);
> >>
> >> /* Enqueue packet */
> >> - skb_queue_tail(&tfile->socket.sk->sk_receive_queue, skb);
> >> + if (sock_queue_rcv_skb(tfile->socket.sk, skb))
> >> + goto drop;
> >>
> >> /* Notify and wake up reader process */
> >> if (tfile->flags & TUN_FASYNC)
> >> @@ -1668,6 +1659,7 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
> >>
> >> tun->filter_attached = false;
> >> tun->sndbuf = tfile->socket.sk->sk_sndbuf;
> >> + tun->rcvbuf = tfile->socket.sk->sk_rcvbuf;
> >>
> >> spin_lock_init(&tun->lock);
> >>
> >> @@ -1837,6 +1829,17 @@ static void tun_set_sndbuf(struct tun_struct *tun)
> >> }
> >> }
> >>
> >> +static void tun_set_rcvbuf(struct tun_struct *tun)
> >> +{
> >> + struct tun_file *tfile;
> >> + int i;
> >> +
> >> + for (i = 0; i < tun->numqueues; i++) {
> >> + tfile = rtnl_dereference(tun->tfiles[i]);
> >> + tfile->socket.sk->sk_sndbuf = tun->sndbuf;
> >> + }
> >> +}
> >> +
> >> static int tun_set_queue(struct file *file, struct ifreq *ifr)
> >> {
> >> struct tun_file *tfile = file->private_data;
> >> @@ -1878,7 +1881,7 @@ static long __tun_chr_ioctl(struct file *file, unsigned int cmd,
> >> struct ifreq ifr;
> >> kuid_t owner;
> >> kgid_t group;
> >> - int sndbuf;
> >> + int sndbuf, rcvbuf;
> >> int vnet_hdr_sz;
> >> unsigned int ifindex;
> >> int ret;
> >> @@ -2061,6 +2064,22 @@ static long __tun_chr_ioctl(struct file *file, unsigned int cmd,
> >> tun_set_sndbuf(tun);
> >> break;
> >>
> >> + case TUNGETRCVBUF:
> >> + rcvbuf = tfile->socket.sk->sk_rcvbuf;
> >> + if (copy_to_user(argp, &rcvbuf, sizeof(rcvbuf)))
> >> + ret = -EFAULT;
> >> + break;
> >> +
> >> + case TUNSETRCVBUF:
> >> + if (copy_from_user(&rcvbuf, argp, sizeof(rcvbuf))) {
> >> + ret = -EFAULT;
> >> + break;
> >> + }
> >> +
> >> + tun->rcvbuf = rcvbuf;
> >> + tun_set_rcvbuf(tun);
> >> + break;
> >> +
> >> case TUNGETVNETHDRSZ:
> >> vnet_hdr_sz = tun->vnet_hdr_sz;
> >> if (copy_to_user(argp, &vnet_hdr_sz, sizeof(vnet_hdr_sz)))
> >> @@ -2139,6 +2158,8 @@ static long tun_chr_compat_ioctl(struct file *file,
> >> case TUNSETTXFILTER:
> >> case TUNGETSNDBUF:
> >> case TUNSETSNDBUF:
> >> + case TUNGETRCVBUF:
> >> + case TUNSETRCVBUF:
> >> case SIOCGIFHWADDR:
> >> case SIOCSIFHWADDR:
> >> arg = (unsigned long)compat_ptr(arg);
> >> @@ -2204,6 +2225,7 @@ static int tun_chr_open(struct inode *inode, struct file * file)
> >>
> >> tfile->sk.sk_write_space = tun_sock_write_space;
> >> tfile->sk.sk_sndbuf = INT_MAX;
> >> + tfile->sk.sk_rcvbuf = TUN_RCVBUF;
> >>
> >> file->private_data = tfile;
> >> set_bit(SOCK_EXTERNALLY_ALLOCATED, &tfile->socket.flags);
> >> diff --git a/include/uapi/linux/if_tun.h b/include/uapi/linux/if_tun.h
> >> index e9502dd..8e04657 100644
> >> --- a/include/uapi/linux/if_tun.h
> >> +++ b/include/uapi/linux/if_tun.h
> >> @@ -22,6 +22,7 @@
> >>
> >> /* Read queue size */
> >> #define TUN_READQ_SIZE 500
> >> +#define TUN_RCVBUF (512 * PAGE_SIZE)
> >>
> >> /* TUN device flags */
> >> #define TUN_TUN_DEV 0x0001
> > That's about 16x less than we were able to queue previously
> > by default.
> > How can you be sure this won't break any applications?
> >
>
> Ok, we can change it back to 500 * 65535, but I'm not sure whether this
> or not this value (about 32M) is too big for a single socket.
> >> @@ -58,6 +59,8 @@
> >> #define TUNSETQUEUE _IOW('T', 217, int)
> >> #define TUNSETIFINDEX _IOW('T', 218, unsigned int)
> >> #define TUNGETFILTER _IOR('T', 219, struct sock_fprog)
> >> +#define TUNGETRCVBUF _IOR('T', 220, int)
> >> +#define TUNSETRCVBUF _IOW('T', 221, int)
> >>
> >> /* TUNSETIFF ifr flags */
> >> #define IFF_TUN 0x0001
> >> --
> >> 1.8.3.2
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
> > Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply
* Re: [PATCH net-next v2 0/2] bonding: ensure that the TSO being set on bond master
From: Veaceslav Falico @ 2014-01-14 9:47 UTC (permalink / raw)
To: Ding Tianhong; +Cc: Jay Vosburgh, Eric Dumazet, David S. Miller, Netdev
In-Reply-To: <52D4FC97.8020301@huawei.com>
On Tue, Jan 14, 2014 at 05:00:07PM +0800, Ding Tianhong wrote:
>The commit b0ce3508(bonding: allow TSO being set on bonding master)
>has make the TSO being set for bond dev, but in some situation, if
>the slave did not have the NETIF_F_SG features, the bond master will
>miss the TSO features in netdev_fix_features because the TSO is
>depended on SG. So I have to add SG and TSO features on bond master
>together.
>
>The function netdev_add_tso_features() was only be used for bonding,
>so no need to export it in netdevice.h, remove it and add it to bonding.
>
>v2: If the slave hw did not support SG features, the SG should not
> be forced open on master, otherwise error will occur, so modify it.
> Some slave may support SG but not open it yet, so the bond master
> could try to open it when adding the salve and make sure the TSO
> could be open on master.
So you're forcibly enabling SG on a slave? Usually SG is always enabled,
unless there's a very specific reason for that - like a bug in hw/sw/fw,
like performance improvement on specific use-cases etc. etc.
So that's a wrong thing to do - to try to enable it, if it was disabled.
Nacked-by: Veaceslav Falico <vfalico@redhat.com>
>
>Ding Tianhong (2):
> bonding: move the netdev_add_tso_features() to bonding
> bonding: try to enable SG features when adding a new slave
>
> drivers/net/bonding/bond_main.c | 27 ++++++++++++++++++++++++++-
> include/linux/netdevice.h | 10 ----------
> 2 files changed, 26 insertions(+), 11 deletions(-)
>
>--
>1.8.0
>
>
^ permalink raw reply
* Re: [GIT net-next] Open vSwitch
From: Thomas Graf @ 2014-01-14 9:46 UTC (permalink / raw)
To: Jesse Gross, Zoltan Kiss
Cc: dev-yBygre7rU0TnMu66kgdUjQ@public.gmane.org, netdev, David Miller
In-Reply-To: <CAEP_g=8nG6AHV9Y+5=48nPhkf5Oe=mG8EiyaKSqN4omnmGhv4A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On 01/14/2014 02:30 AM, Jesse Gross wrote:
>> And it works. I guess the last one causing the problem. Might be an
>> important factor, I'm using 32 bit Dom0.
>
> I think you're probably right. Thomas - can you take a look?
>
> We shouldn't be doing any zerocopy in this situation but it looks to
> me like we don't do any padding at all, even in situations where we
> are copying the data.
I'm looking into this now. The zerocopy method should only be attempted
if user space has announced the ability to received unaligned messages.
@Zoltan: I assume you are using an unmodified OVS 1.9.3?
^ permalink raw reply
* Re: [PATCH RESEND net-next v2 0/3] bonding: fix primary problem for bonding
From: Veaceslav Falico @ 2014-01-14 9:37 UTC (permalink / raw)
To: Ding Tianhong; +Cc: Jay Vosburgh, Netdev, David S. Miller
In-Reply-To: <52D4FE82.8020507@huawei.com>
On Tue, Jan 14, 2014 at 05:08:18PM +0800, Ding Tianhong wrote:
>If the slave's name changed, and the bond params primary is exist,
>the bond should deal with the situation in two ways:
>
>1) If the slave was the primary slave yet, clean the primary slave
> and reselect active slave.
>2) If the slave's new name is as same as bond primary, set the slave
> as primary slave and reselect active slave.
>
>If the new primary is not matching any slave in the bond, the bond should
>record it to params, clean the primary slave and select a new active slave.
>
>Update bonding.txt for primary description.
You didn't even take into accoung my previous messages.
Nacked-by: Veaceslav Falico <vfalico@redhat.com>
>
>Ding Tianhong (3):
> bonding: update the primary slave when changing slave's name
> bonding: clean the primary slave if there is no slave matching new
> primary
> bonding: update bonding.txt for primary description.
>
> Documentation/networking/bonding.txt | 3 ++-
> drivers/net/bonding/bond_main.c | 24 ++++++++++++++++++++++--
> drivers/net/bonding/bond_options.c | 6 ++++++
> 3 files changed, 30 insertions(+), 3 deletions(-)
>
>--
>1.8.0
>
>
>
^ permalink raw reply
* Re: [Xen-devel] [PATCH net-next v2 3/3] xen-netfront: use new skb_checksum_setup function
From: Ian Campbell @ 2014-01-14 9:33 UTC (permalink / raw)
To: David Miller
Cc: paul.durrant, netdev, boris.ostrovsky, david.vrabel, xen-devel
In-Reply-To: <20140113.112720.2236966361404094251.davem@davemloft.net>
On Mon, 2014-01-13 at 11:27 -0800, David Miller wrote:
> From: Paul Durrant <paul.durrant@citrix.com>
> Date: Thu, 9 Jan 2014 10:02:48 +0000
>
> > Use skb_checksum_setup to set up partial checksum offsets rather
> > then a private implementation.
> >
> > Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
>
> This patch really needs review by a netfront expert before I can apply
> this series.
I think in combination with 1/3 it is basically code motion. So although
I'm not not netfront maintainer:
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Ian.
^ permalink raw reply
* [PATCH RESEND net-next v2 3/3] bonding: update bonding.txt for primary description
From: Ding Tianhong @ 2014-01-14 9:08 UTC (permalink / raw)
To: Jay Vosburgh, Veaceslav Falico, David S. Miller, Netdev
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
---
Documentation/networking/bonding.txt | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Documentation/networking/bonding.txt b/Documentation/networking/bonding.txt
index a4d925e..5cdb229 100644
--- a/Documentation/networking/bonding.txt
+++ b/Documentation/networking/bonding.txt
@@ -657,7 +657,8 @@ primary
one slave is preferred over another, e.g., when one slave has
higher throughput than another.
- The primary option is only valid for active-backup mode.
+ The primary option is only valid for active-backup(1),
+ balance-tlb (5) and balance-alb (6) mode.
primary_reselect
--
1.8.0
^ permalink raw reply related
* Re: [PATCH net-next v2 1/3] [PATCH 1/3] bonding: update the primary slave when changing slave's name
From: Ding Tianhong @ 2014-01-14 9:07 UTC (permalink / raw)
To: Jay Vosburgh, Veaceslav Falico, David S. Miller, Netdev
In-Reply-To: <52D4F845.6070106@huawei.com>
On 2014/1/14 16:41, Ding Tianhong wrote:
> If the slave's name changed, and the bond params primary is exist,
> the bond should deal with the situation in two ways:
>
> 1) If the slave was the primary slave yet, clean the primary slave
> and reselect active slave.
> 2) If the slave's new name is as same as bond primary, set the slave
> as primary slave and reselect active slave.
>
> Thanks for Veaceslav's suggestion.
>
> Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
Someting wrong in format, miss it, sorry.
Ding
> ---
> drivers/net/bonding/bond_main.c | 24 ++++++++++++++++++++++--
> 1 file changed, 22 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
> index e06c445..64e25d5 100644
> --- a/drivers/net/bonding/bond_main.c
> +++ b/drivers/net/bonding/bond_main.c
> @@ -2860,9 +2860,29 @@ static int bond_slave_netdev_event(unsigned long event,
> */
> break;
> case NETDEV_CHANGENAME:
> - /*
> - * TODO: handle changing the primary's name
> + /* Handle changing the slave's name:
> + * 1) If the slave was primary slave,
> + * clean the primary slave and reselect
> + * active slave.
> + * 2) If the slave's new name is same as
> + * bond primary, set the slave as primary
> + * slave and reselect active slave.
> */
> + if (slave == bond->primary_slave ||
> + !strcmp(bond->params.primary, slave_dev->name)) {
> + if (bond->primary_slave) {
> + pr_info("%s: Setting primary slave to None.\n",
> + bond->dev->name);
> + bond->primary_slave = NULL;
> + } else {
> + pr_info("%s: Setting %s as primary slave.\n",
> + bond->dev->name, slave_dev->name);
> + bond->primary_slave = slave;
> + }
> + write_lock_bh(&bond->curr_slave_lock);
> + bond_select_active_slave(bond);
> + write_unlock_bh(&bond->curr_slave_lock);
> + }
> break;
> case NETDEV_FEAT_CHANGE:
> bond_compute_features(bond);
>
^ permalink raw reply
* [PATCH RESEND net-next v2 0/3] bonding: fix primary problem for bonding
From: Ding Tianhong @ 2014-01-14 9:08 UTC (permalink / raw)
To: Jay Vosburgh, Veaceslav Falico, Netdev, David S. Miller
If the slave's name changed, and the bond params primary is exist,
the bond should deal with the situation in two ways:
1) If the slave was the primary slave yet, clean the primary slave
and reselect active slave.
2) If the slave's new name is as same as bond primary, set the slave
as primary slave and reselect active slave.
If the new primary is not matching any slave in the bond, the bond should
record it to params, clean the primary slave and select a new active slave.
Update bonding.txt for primary description.
Ding Tianhong (3):
bonding: update the primary slave when changing slave's name
bonding: clean the primary slave if there is no slave matching new
primary
bonding: update bonding.txt for primary description.
Documentation/networking/bonding.txt | 3 ++-
drivers/net/bonding/bond_main.c | 24 ++++++++++++++++++++++--
drivers/net/bonding/bond_options.c | 6 ++++++
3 files changed, 30 insertions(+), 3 deletions(-)
--
1.8.0
^ permalink raw reply
* [PATCH RESEND net-next v2 1/3] bonding: update the primary slave when changing slave's name
From: Ding Tianhong @ 2014-01-14 9:08 UTC (permalink / raw)
To: Jay Vosburgh, Veaceslav Falico, David S. Miller, Netdev
If the slave's name changed, and the bond params primary is exist,
the bond should deal with the situation in two ways:
1) If the slave was the primary slave yet, clean the primary slave
and reselect active slave.
2) If the slave's new name is as same as bond primary, set the slave
as primary slave and reselect active slave.
Thanks for Veaceslav's suggestion.
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
---
drivers/net/bonding/bond_main.c | 24 ++++++++++++++++++++++--
1 file changed, 22 insertions(+), 2 deletions(-)
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index e06c445..64e25d5 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -2860,9 +2860,29 @@ static int bond_slave_netdev_event(unsigned long event,
*/
break;
case NETDEV_CHANGENAME:
- /*
- * TODO: handle changing the primary's name
+ /* Handle changing the slave's name:
+ * 1) If the slave was primary slave,
+ * clean the primary slave and reselect
+ * active slave.
+ * 2) If the slave's new name is same as
+ * bond primary, set the slave as primary
+ * slave and reselect active slave.
*/
+ if (slave == bond->primary_slave ||
+ !strcmp(bond->params.primary, slave_dev->name)) {
+ if (bond->primary_slave) {
+ pr_info("%s: Setting primary slave to None.\n",
+ bond->dev->name);
+ bond->primary_slave = NULL;
+ } else {
+ pr_info("%s: Setting %s as primary slave.\n",
+ bond->dev->name, slave_dev->name);
+ bond->primary_slave = slave;
+ }
+ write_lock_bh(&bond->curr_slave_lock);
+ bond_select_active_slave(bond);
+ write_unlock_bh(&bond->curr_slave_lock);
+ }
break;
case NETDEV_FEAT_CHANGE:
bond_compute_features(bond);
--
1.8.0
^ permalink raw reply related
* [PATCH RESEND net-next v2 2/3] bonding: clean the primary slave if there is no slave matching new primary
From: Ding Tianhong @ 2014-01-14 9:08 UTC (permalink / raw)
To: Jay Vosburgh, Veaceslav Falico, David S. Miller, Netdev
If the new primay is not matching any slave in the bond, the bond should
record it to params, clean the primary slave and select a new active slave.
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
---
drivers/net/bonding/bond_options.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/bonding/bond_options.c b/drivers/net/bonding/bond_options.c
index 945a666..0ee0bfe 100644
--- a/drivers/net/bonding/bond_options.c
+++ b/drivers/net/bonding/bond_options.c
@@ -512,6 +512,12 @@ int bond_option_primary_set(struct bonding *bond, const char *primary)
}
}
+ if (bond->primary_slave) {
+ pr_info("%s: Setting primary slave to None.\n",
+ bond->dev->name);
+ bond->primary_slave = NULL;
+ bond_select_active_slave(bond);
+ }
strncpy(bond->params.primary, primary, IFNAMSIZ);
bond->params.primary[IFNAMSIZ - 1] = 0;
--
1.8.0
^ permalink raw reply related
* [PATCH net-next v2 2/2] bonding: try to enable SG features when adding a new, slave
From: Ding Tianhong @ 2014-01-14 9:00 UTC (permalink / raw)
To: Jay Vosburgh, Veaceslav Falico, David S. Miller, Eric Dumazet,
Netdev
The commit b0ce3508(bonding: allow TSO being set on bonding master)
has make the TSO being set for bond dev, but in some situation, if
the slave did not set the NETIF_F_SG features yet, the bond master
will miss the TSO features in netdev_fix_features because the TSO is
depended on SG.
If the slave hw support SG features, but not set yet, I will try to
open it when enslave the dev, better for performance.
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
---
drivers/net/bonding/bond_main.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 4cfe14e..e1044ac 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1083,6 +1083,19 @@ static netdev_features_t bond_fix_features(struct net_device *dev,
return features;
}
+/* If the slave support SG, but not being used yet,
+ * enable the SG features for this slave.
+ */
+static void bond_update_slave_features(struct net_device *dev)
+{
+ if (dev->hw_features & ~dev->features & NETIF_F_SG) {
+ pr_debug("The new dev %s support SG, but not being used yet, enable it\n",
+ dev->name);
+ dev->wanted_features |= NETIF_F_SG;
+ netdev_update_features(dev);
+ }
+}
+
#define BOND_VLAN_FEATURES (NETIF_F_ALL_CSUM | NETIF_F_SG | \
NETIF_F_FRAGLIST | NETIF_F_ALL_TSO | \
NETIF_F_HIGHDMA | NETIF_F_LRO)
@@ -1587,6 +1600,8 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
}
bond->slave_cnt++;
+ /* Try to enable the SG features for slave dev. */
+ bond_update_slave_features(slave_dev);
bond_compute_features(bond);
bond_set_carrier(bond);
--
1.8.0
^ permalink raw reply related
* [PATCH net-next v2 0/2] bonding: ensure that the TSO being set on bond master
From: Ding Tianhong @ 2014-01-14 9:00 UTC (permalink / raw)
To: Jay Vosburgh, Veaceslav Falico, Eric Dumazet, David S. Miller,
Netdev
The commit b0ce3508(bonding: allow TSO being set on bonding master)
has make the TSO being set for bond dev, but in some situation, if
the slave did not have the NETIF_F_SG features, the bond master will
miss the TSO features in netdev_fix_features because the TSO is
depended on SG. So I have to add SG and TSO features on bond master
together.
The function netdev_add_tso_features() was only be used for bonding,
so no need to export it in netdevice.h, remove it and add it to bonding.
v2: If the slave hw did not support SG features, the SG should not
be forced open on master, otherwise error will occur, so modify it.
Some slave may support SG but not open it yet, so the bond master
could try to open it when adding the salve and make sure the TSO
could be open on master.
Ding Tianhong (2):
bonding: move the netdev_add_tso_features() to bonding
bonding: try to enable SG features when adding a new slave
drivers/net/bonding/bond_main.c | 27 ++++++++++++++++++++++++++-
include/linux/netdevice.h | 10 ----------
2 files changed, 26 insertions(+), 11 deletions(-)
--
1.8.0
^ permalink raw reply
* [PATCH net-next v2 1/2] bonding: move the netdev_add_tso_features() to bonding module
From: Ding Tianhong @ 2014-01-14 9:00 UTC (permalink / raw)
To: Jay Vosburgh, Veaceslav Falico, Eric Dumazet, David S. Miller,
Netdev
The function netdev_add_tso_features() was only be used for bonding,
so no need to export it in netdevice.h, move it to bonding module.
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
---
drivers/net/bonding/bond_main.c | 12 +++++++++++-
include/linux/netdevice.h | 10 ----------
2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index e06c445..4cfe14e 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1045,6 +1045,16 @@ static void bond_netpoll_cleanup(struct net_device *bond_dev)
/*---------------------------------- IOCTL ----------------------------------*/
+/* Allow TSO being used on stacked device:
+ * Performing the GSO segmentation before last device
+ * is a performance improvement.
+ */
+static netdev_features_t bond_add_tso_features(netdev_features_t features,
+ netdev_features_t mask)
+{
+ return netdev_increment_features(features, NETIF_F_ALL_TSO, mask);
+}
+
static netdev_features_t bond_fix_features(struct net_device *dev,
netdev_features_t features)
{
@@ -1068,7 +1078,7 @@ static netdev_features_t bond_fix_features(struct net_device *dev,
slave->dev->features,
mask);
}
- features = netdev_add_tso_features(features, mask);
+ features = bond_add_tso_features(features, mask);
return features;
}
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index a2a70cc..1be74ea 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -3010,16 +3010,6 @@ static inline netdev_features_t netdev_get_wanted_features(
netdev_features_t netdev_increment_features(netdev_features_t all,
netdev_features_t one, netdev_features_t mask);
-/* Allow TSO being used on stacked device :
- * Performing the GSO segmentation before last device
- * is a performance improvement.
- */
-static inline netdev_features_t netdev_add_tso_features(netdev_features_t features,
- netdev_features_t mask)
-{
- return netdev_increment_features(features, NETIF_F_ALL_TSO, mask);
-}
-
int __netdev_update_features(struct net_device *dev);
void netdev_update_features(struct net_device *dev);
void netdev_change_features(struct net_device *dev);
--
1.8.0
^ permalink raw reply related
* [net-next 6/6] i40e: Bump version number
From: Aaron Brown @ 2014-01-14 8:49 UTC (permalink / raw)
To: davem
Cc: Catherine Sullivan, netdev, gospo, sassmann, Jesse Brandeburg,
Aaron Brown
In-Reply-To: <1389689394-22369-1-git-send-email-aaron.f.brown@intel.com>
From: Catherine Sullivan <catherine.sullivan@intel.com>
Update the driver version to 0.3.30-k.
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Aaron Brown <aaron.f.brown@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 6a5d4ca..62418ee 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -38,7 +38,7 @@ static const char i40e_driver_string[] =
#define DRV_VERSION_MAJOR 0
#define DRV_VERSION_MINOR 3
-#define DRV_VERSION_BUILD 28
+#define DRV_VERSION_BUILD 30
#define DRV_VERSION __stringify(DRV_VERSION_MAJOR) "." \
__stringify(DRV_VERSION_MINOR) "." \
__stringify(DRV_VERSION_BUILD) DRV_KERN
--
1.8.5.GIT
^ permalink raw reply related
* [net-next 5/6] i40e: trivial cleanup
From: Aaron Brown @ 2014-01-14 8:49 UTC (permalink / raw)
To: davem; +Cc: Jesse Brandeburg, netdev, gospo, sassmann, Aaron Brown
In-Reply-To: <1389689394-22369-1-git-send-email-aaron.f.brown@intel.com>
From: Jesse Brandeburg <jesse.brandeburg@intel.com>
Remove some un-necessary parenthesis.
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Aaron Brown <aaron.f.brown@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_lan_hmc.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_lan_hmc.c b/drivers/net/ethernet/intel/i40e/i40e_lan_hmc.c
index 101ed41..d5d98fe 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_lan_hmc.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_lan_hmc.c
@@ -485,8 +485,7 @@ i40e_status i40e_configure_lan_hmc(struct i40e_hw *hw,
/* Make one big object, a single SD */
info.count = 1;
ret_code = i40e_create_lan_hmc_object(hw, &info);
- if ((ret_code) &&
- (model == I40E_HMC_MODEL_DIRECT_PREFERRED))
+ if (ret_code && (model == I40E_HMC_MODEL_DIRECT_PREFERRED))
goto try_type_paged;
else if (ret_code)
goto configure_lan_hmc_out;
--
1.8.5.GIT
^ permalink raw reply related
* [net-next 4/6] i40e: whitespace fixes
From: Aaron Brown @ 2014-01-14 8:49 UTC (permalink / raw)
To: davem; +Cc: Jesse Brandeburg, netdev, gospo, sassmann, Aaron Brown
In-Reply-To: <1389689394-22369-1-git-send-email-aaron.f.brown@intel.com>
From: Jesse Brandeburg <jesse.brandeburg@intel.com>
Fix some whitespace and comment issues.
Change-ID: I1587599e50ce66fd389965720e86f9e331d86643
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Aaron Brown <aaron.f.brown@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e.h | 1 -
drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h | 4 ++--
drivers/net/ethernet/intel/i40e/i40e_common.c | 1 -
drivers/net/ethernet/intel/i40e/i40e_main.c | 3 +--
drivers/net/ethernet/intel/i40e/i40e_txrx.c | 4 ++--
5 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h
index c05984d..91b0052 100644
--- a/drivers/net/ethernet/intel/i40e/i40e.h
+++ b/drivers/net/ethernet/intel/i40e/i40e.h
@@ -93,7 +93,6 @@
#define I40E_CURRENT_NVM_VERSION_HI 0x2
#define I40E_CURRENT_NVM_VERSION_LO 0x30
-
/* magic for getting defines into strings */
#define STRINGIFY(foo) #foo
#define XSTRINGIFY(bar) STRINGIFY(bar)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h b/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h
index c009eb4..be61a47 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h
@@ -1195,8 +1195,8 @@ struct i40e_aqc_add_remove_cloud_filters_element_data {
} v4;
struct {
u8 data[16];
- } v6;
- } ipaddr;
+ } v6;
+ } ipaddr;
__le16 flags;
#define I40E_AQC_ADD_CLOUD_FILTER_SHIFT 0
#define I40E_AQC_ADD_CLOUD_FILTER_MASK (0x3F << \
diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c
index 0b5a75c..aedc71b 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_common.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_common.c
@@ -162,7 +162,6 @@ i40e_status i40e_aq_queue_shutdown(struct i40e_hw *hw,
return status;
}
-
/**
* i40e_init_shared_code - Initialize the shared code
* @hw: pointer to hardware structure
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 14e4f4a..6a5d4ca 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -356,7 +356,6 @@ static struct rtnl_link_stats64 *i40e_get_netdev_stats_struct(
struct rtnl_link_stats64 *vsi_stats = i40e_get_vsi_stats_struct(vsi);
int i;
-
if (test_bit(__I40E_DOWN, &vsi->state))
return stats;
@@ -3603,7 +3602,7 @@ static int i40e_vsi_get_bw_info(struct i40e_vsi *vsi)
/* Get the VSI level BW configuration per TC */
aq_ret = i40e_aq_query_vsi_ets_sla_config(hw, vsi->seid, &bw_ets_config,
- NULL);
+ NULL);
if (aq_ret) {
dev_info(&pf->pdev->dev,
"couldn't get pf vsi ets bw config, err %d, aq_err %d\n",
diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
index a089ac1..f57a8f8 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
@@ -977,8 +977,8 @@ static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget)
rx_desc = I40E_RX_DESC(rx_ring, i);
qword = le64_to_cpu(rx_desc->wb.qword1.status_error_len);
- rx_status = (qword & I40E_RXD_QW1_STATUS_MASK)
- >> I40E_RXD_QW1_STATUS_SHIFT;
+ rx_status = (qword & I40E_RXD_QW1_STATUS_MASK) >>
+ I40E_RXD_QW1_STATUS_SHIFT;
while (rx_status & (1 << I40E_RX_DESC_STATUS_DD_SHIFT)) {
union i40e_rx_desc *next_rxd;
--
1.8.5.GIT
^ 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