* [PATCH rfc 1/4] net-timestamp: pull headers for SOCK_STREAM
From: Willem de Bruijn @ 2014-11-25 17:58 UTC (permalink / raw)
To: netdev; +Cc: davem, luto, richardcochran, Willem de Bruijn
In-Reply-To: <1416938286-14147-1-git-send-email-willemb@google.com>
From: Willem de Bruijn <willemb@google.com>
When returning timestamped packets on the error queue, only return
the data that the application initially sent: not the protocol
headers.
This changes the ABI. The TCP interface is new enough that it should
be safe to do so. The UDP interface could be changed analogously with
+ else if (sk->sk_protocol == IPPROTO_UDP)
+ skb_pull(skb, skb_transport_offset(skb) + sizeof(struct udphdr));
Tested with Documentation/networking/timestamping/txtimestamp -l 60 -x
Signed-off-by: Willem de Bruijn <willemb@google.com>
---
net/core/skbuff.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 92116df..70a8596 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -3580,6 +3580,7 @@ static void __skb_complete_tx_timestamp(struct sk_buff *skb,
int tstype)
{
struct sock_exterr_skb *serr;
+ bool is_tcp = sk->sk_protocol == IPPROTO_TCP;
int err;
serr = SKB_EXT_ERR(skb);
@@ -3589,10 +3590,13 @@ static void __skb_complete_tx_timestamp(struct sk_buff *skb,
serr->ee.ee_info = tstype;
if (sk->sk_tsflags & SOF_TIMESTAMPING_OPT_ID) {
serr->ee.ee_data = skb_shinfo(skb)->tskey;
- if (sk->sk_protocol == IPPROTO_TCP)
+ if (is_tcp)
serr->ee.ee_data -= sk->sk_tskey;
}
+ if (is_tcp)
+ skb_pull(skb, skb_transport_offset(skb) + tcp_hdrlen(skb));
+
err = sock_queue_err_skb(sk, skb);
if (err)
--
2.1.0.rc2.206.gedb03e5
^ permalink raw reply related
* [PATCH rfc 0/4] timestamping updates
From: Willem de Bruijn @ 2014-11-25 17:58 UTC (permalink / raw)
To: netdev; +Cc: davem, luto, richardcochran, Willem de Bruijn
From: Willem de Bruijn <willemb@google.com>
The main goal for this patchset is to allow correlating timestamps
with the egress interface. That change requires a few others:
1/4: TCP sockets should not loop L2/L3/L4 headers
2/4: main feature
3/4: bugfix: TCP sockets should call the family specific .._recv_error
4/4: revise the test to verify these changes
Willem de Bruijn (4):
net-timestamp: pull headers for SOCK_STREAM
net-errqueue: add IP(V6)_PKTINFO support
net-timestamp: tcp sockets return v6 errors on v6 sockets
net-timestamp: expand txtimestamp test with payload and PKTINFO
.../networking/timestamping/txtimestamp.c | 89 +++++++++++++++++++---
net/core/skbuff.c | 6 +-
net/ipv4/ip_sockglue.c | 15 ++++
net/ipv4/tcp.c | 8 +-
net/ipv6/datagram.c | 22 ++++++
5 files changed, 125 insertions(+), 15 deletions(-)
--
2.1.0.rc2.206.gedb03e5
^ permalink raw reply
* Re: [PATCH net-next] gre: Set inner mac header in gro complete
From: Eric Dumazet @ 2014-11-25 17:57 UTC (permalink / raw)
To: Tom Herbert; +Cc: davem, linux, netdev
In-Reply-To: <1416936611-22702-1-git-send-email-therbert@google.com>
On Tue, 2014-11-25 at 09:30 -0800, Tom Herbert wrote:
> Set the inner mac header to point to the GRE payload when
> doing GRO. This is needed if we proceed to send the packet
> through GRE GSO which now uses the inner mac header instead
> of inner network header to determine the length of encapsulation
> headers.
>
> Reported-by: Wolfgang Walter <linux@stwm.de>
> Signed-off-by: Tom Herbert <therbert@google.com>
> ---
Please Tom, add in your bug fixes something to ease backports.
Fixes: 14051f0452a2 ("gre: Use inner mac length when computing tunnel length")
^ permalink raw reply
* Re: [patch net-next v3 07/17] rocker: introduce rocker switch driver
From: Andy Gospodarek @ 2014-11-25 17:51 UTC (permalink / raw)
To: Jiri Pirko
Cc: David Miller, jhs, netdev, nhorman, andy, tgraf, dborkman,
ogerlitz, jesse, pshelar, azhou, ben, stephen, jeffrey.t.kirsher,
vyasevic, xiyou.wangcong, john.r.fastabend, edumazet, sfeldma,
f.fainelli, roopa, linville, jasowang, ebiederm, nicolas.dichtel,
ryazanov.s.a, buytenh, aviadr, nbd, alexei.starovoitov,
Neil.Jerram, ronye, simon.horman, alexander.h.duyck, john.ronciak,
mleitner, shrijeet, bcrl
In-Reply-To: <20141125171514.GN1971@nanopsycho.orion>
On Tue, Nov 25, 2014 at 06:15:14PM +0100, Jiri Pirko wrote:
> Tue, Nov 25, 2014 at 06:10:19PM CET, davem@davemloft.net wrote:
> >From: Jamal Hadi Salim <jhs@mojatatu.com>
> >Date: Tue, 25 Nov 2014 10:57:57 -0500
> >
> >> On 11/25/14 05:28, Jiri Pirko wrote:
> >>> This patch introduces the first driver to benefit from the switchdev
> >>> infrastructure and to implement newly introduced switch ndos. This is
> >>> a
> >>> driver for emulated switch chip implemented in qemu:
> >>> https://github.com/sfeldma/qemu-rocker/
> >>>
> >>> This patch is a result of joint work with Scott Feldman.
> >>>
> >>> Signed-off-by: Scott Feldman <sfeldma@gmail.com>
> >>> Signed-off-by: Jiri Pirko <jiri@resnulli.us>
> >>> Reviewed-by: Thomas Graf <tgraf@suug.ch>
> >>> Reviewed-by: John Fastabend <john.r.fastabend@intel.com>
> >>
> >> Users should be a different patch set for easier review.
> >> I think you should separate rocker to be another patch series.
> >
> >I want to see how the new infrastructure is used in the same patch
> >series as the changes that add that infrastructure.
>
> Yep. For easier review, I will move the rocker patches to the tail and
> leave the other ones on head.
I appreciate that. I do plan to *try* and review those, but due to
their length have not done that.
^ permalink raw reply
* Re: [patch net-next v3 16/17] bridge: add brport flags to dflt bridge_getlink
From: Andy Gospodarek @ 2014-11-25 17:48 UTC (permalink / raw)
To: Jiri Pirko
Cc: netdev, davem, nhorman, andy, tgraf, dborkman, ogerlitz, jesse,
pshelar, azhou, ben, stephen, jeffrey.t.kirsher, vyasevic,
xiyou.wangcong, john.r.fastabend, edumazet, jhs, sfeldma,
f.fainelli, roopa, linville, jasowang, ebiederm, nicolas.dichtel,
ryazanov.s.a, buytenh, aviadr, nbd, alexei.starovoitov,
Neil.Jerram, ronye, simon.horman, alexander.h.duyck, john.ronciak,
mleitner, shrijeet, bcrl
In-Reply-To: <1416911328-10979-17-git-send-email-jiri@resnulli.us>
On Tue, Nov 25, 2014 at 11:28:47AM +0100, Jiri Pirko wrote:
> From: Scott Feldman <sfeldma@gmail.com>
>
> To allow brport device to return current brport flags set on port. Add
> returned flags to nested IFLA_PROTINFO netlink msg built in dflt getlink.
> With this change, netlink msg returned for bridge_getlink contains the port's
> offloaded flag settings (the port's SELF settings).
>
> Signed-off-by: Scott Feldman <sfeldma@gmail.com>
> Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Seems fine.
Acked-by: Andy Gospodarek <gospo@cumulusnetworks.com>
> ---
> new in v3
> ---
> drivers/net/ethernet/emulex/benet/be_main.c | 3 ++-
> drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 2 +-
> include/linux/rtnetlink.h | 3 ++-
> net/core/rtnetlink.c | 39 ++++++++++++++++++++++++++-
> 4 files changed, 43 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
> index 9070b98..6510ec8 100644
> --- a/drivers/net/ethernet/emulex/benet/be_main.c
> +++ b/drivers/net/ethernet/emulex/benet/be_main.c
> @@ -4362,7 +4362,8 @@ static int be_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
>
> return ndo_dflt_bridge_getlink(skb, pid, seq, dev,
> hsw_mode == PORT_FWD_TYPE_VEPA ?
> - BRIDGE_MODE_VEPA : BRIDGE_MODE_VEB);
> + BRIDGE_MODE_VEPA : BRIDGE_MODE_VEB,
> + 0, 0);
> }
>
> #ifdef CONFIG_BE2NET_VXLAN
> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
> index 1bad9f4..eb2a04b 100644
> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
> @@ -7773,7 +7773,7 @@ static int ixgbe_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
> else
> mode = BRIDGE_MODE_VEPA;
>
> - return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode);
> + return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode, 0, 0);
> }
>
> static void *ixgbe_fwd_add(struct net_device *pdev, struct net_device *vdev)
> diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
> index 063f0f5..3b04190 100644
> --- a/include/linux/rtnetlink.h
> +++ b/include/linux/rtnetlink.h
> @@ -103,5 +103,6 @@ extern int ndo_dflt_fdb_del(struct ndmsg *ndm,
> u16 vid);
>
> extern int ndo_dflt_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
> - struct net_device *dev, u16 mode);
> + struct net_device *dev, u16 mode,
> + u32 flags, u32 mask);
> #endif /* __LINUX_RTNETLINK_H */
> diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
> index bd5e783..91e5368 100644
> --- a/net/core/rtnetlink.c
> +++ b/net/core/rtnetlink.c
> @@ -2687,12 +2687,22 @@ static int rtnl_fdb_dump(struct sk_buff *skb, struct netlink_callback *cb)
> return skb->len;
> }
>
> +static int brport_nla_put_flag(struct sk_buff *skb, u32 flags, u32 mask,
> + unsigned int attrnum, unsigned int flag)
> +{
> + if (mask & flag)
> + return nla_put_u8(skb, attrnum, !!(flags & flag));
> + return 0;
> +}
> +
> int ndo_dflt_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
> - struct net_device *dev, u16 mode)
> + struct net_device *dev, u16 mode,
> + u32 flags, u32 mask)
> {
> struct nlmsghdr *nlh;
> struct ifinfomsg *ifm;
> struct nlattr *br_afspec;
> + struct nlattr *protinfo;
> u8 operstate = netif_running(dev) ? dev->operstate : IF_OPER_DOWN;
> struct net_device *br_dev = netdev_master_upper_dev_get(dev);
>
> @@ -2731,6 +2741,33 @@ int ndo_dflt_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
> }
> nla_nest_end(skb, br_afspec);
>
> + protinfo = nla_nest_start(skb, IFLA_PROTINFO | NLA_F_NESTED);
> + if (!protinfo)
> + goto nla_put_failure;
> +
> + if (brport_nla_put_flag(skb, flags, mask,
> + IFLA_BRPORT_MODE, BR_HAIRPIN_MODE) ||
> + brport_nla_put_flag(skb, flags, mask,
> + IFLA_BRPORT_GUARD, BR_BPDU_GUARD) ||
> + brport_nla_put_flag(skb, flags, mask,
> + IFLA_BRPORT_FAST_LEAVE,
> + BR_MULTICAST_FAST_LEAVE) ||
> + brport_nla_put_flag(skb, flags, mask,
> + IFLA_BRPORT_PROTECT, BR_ROOT_BLOCK) ||
> + brport_nla_put_flag(skb, flags, mask,
> + IFLA_BRPORT_LEARNING, BR_LEARNING) ||
> + brport_nla_put_flag(skb, flags, mask,
> + IFLA_BRPORT_LEARNING_SYNC, BR_LEARNING_SYNC) ||
> + brport_nla_put_flag(skb, flags, mask,
> + IFLA_BRPORT_UNICAST_FLOOD, BR_FLOOD) ||
> + brport_nla_put_flag(skb, flags, mask,
> + IFLA_BRPORT_PROXYARP, BR_PROXYARP)) {
> + nla_nest_cancel(skb, protinfo);
> + goto nla_put_failure;
> + }
> +
> + nla_nest_end(skb, protinfo);
> +
> return nlmsg_end(skb, nlh);
> nla_put_failure:
> nlmsg_cancel(skb, nlh);
> --
> 1.9.3
>
^ permalink raw reply
* [PATCH net-next] gre: Set inner mac header in gro complete
From: Tom Herbert @ 2014-11-25 17:30 UTC (permalink / raw)
To: davem, linux, netdev
Set the inner mac header to point to the GRE payload when
doing GRO. This is needed if we proceed to send the packet
through GRE GSO which now uses the inner mac header instead
of inner network header to determine the length of encapsulation
headers.
Reported-by: Wolfgang Walter <linux@stwm.de>
Signed-off-by: Tom Herbert <therbert@google.com>
---
net/ipv4/gre_offload.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/net/ipv4/gre_offload.c b/net/ipv4/gre_offload.c
index bb5947b..51973dd 100644
--- a/net/ipv4/gre_offload.c
+++ b/net/ipv4/gre_offload.c
@@ -247,6 +247,9 @@ static int gre_gro_complete(struct sk_buff *skb, int nhoff)
err = ptype->callbacks.gro_complete(skb, nhoff + grehlen);
rcu_read_unlock();
+
+ skb_set_inner_mac_header(skb, nhoff + grehlen);
+
return err;
}
--
2.1.0.rc2.206.gedb03e5
^ permalink raw reply related
* Re: Patch to fix scheduling while atomic splat
From: Greg Kroah-Hartman @ 2014-11-25 17:23 UTC (permalink / raw)
To: Larry Finger; +Cc: netdev@vger.kernel.org >> netdev
In-Reply-To: <5474B234.9090701@lwfinger.net>
On Tue, Nov 25, 2014 at 10:45:40AM -0600, Larry Finger wrote:
> Greg,
>
> On Nov. 12, I sent a patch for kernel 3.18 with the subject "[PATCH for
> 3.18] staging: r8188eu: Fix scheduling while atomic error introduced in
> commit fadbe0cd". To date, this fix does not seem to have appeared in
> mainline. Did it get missed?
No, it's in my queue of 500+ other staging patches to be reviewed,
sorry. Hope to get to that queue soon.
greg k-h
^ permalink raw reply
* Re: [patch net-next v3 07/17] rocker: introduce rocker switch driver
From: Jamal Hadi Salim @ 2014-11-25 17:15 UTC (permalink / raw)
To: Jiri Pirko, David Miller
Cc: netdev, nhorman, andy, tgraf, dborkman, ogerlitz, jesse, pshelar,
azhou, ben, stephen, jeffrey.t.kirsher, vyasevic, xiyou.wangcong,
john.r.fastabend, edumazet, sfeldma, f.fainelli, roopa, linville,
jasowang, ebiederm, nicolas.dichtel, ryazanov.s.a, buytenh,
aviadr, nbd, alexei.starovoitov, Neil.Jerram, ronye, simon.horman,
alexander.h.duyck, john.ronciak, mleitner, shrijeet, gospo, bcrl
In-Reply-To: <20141125171514.GN1971@nanopsycho.orion>
On 11/25/14 12:15, Jiri Pirko wrote:
> Yep. For easier review, I will move the rocker patches to the tail and
> leave the other ones on head.
Sounds reasonable.
cheers,
jamal
^ permalink raw reply
* Re: [patch net-next v3 07/17] rocker: introduce rocker switch driver
From: Jiri Pirko @ 2014-11-25 17:15 UTC (permalink / raw)
To: David Miller
Cc: jhs, netdev, nhorman, andy, tgraf, dborkman, ogerlitz, jesse,
pshelar, azhou, ben, stephen, jeffrey.t.kirsher, vyasevic,
xiyou.wangcong, john.r.fastabend, edumazet, sfeldma, f.fainelli,
roopa, linville, jasowang, ebiederm, nicolas.dichtel,
ryazanov.s.a, buytenh, aviadr, nbd, alexei.starovoitov,
Neil.Jerram, ronye, simon.horman, alexander.h.duyck, john.ronciak,
mleitner, shrijeet, gospo, bcrl
In-Reply-To: <20141125.121019.465267851168750694.davem@davemloft.net>
Tue, Nov 25, 2014 at 06:10:19PM CET, davem@davemloft.net wrote:
>From: Jamal Hadi Salim <jhs@mojatatu.com>
>Date: Tue, 25 Nov 2014 10:57:57 -0500
>
>> On 11/25/14 05:28, Jiri Pirko wrote:
>>> This patch introduces the first driver to benefit from the switchdev
>>> infrastructure and to implement newly introduced switch ndos. This is
>>> a
>>> driver for emulated switch chip implemented in qemu:
>>> https://github.com/sfeldma/qemu-rocker/
>>>
>>> This patch is a result of joint work with Scott Feldman.
>>>
>>> Signed-off-by: Scott Feldman <sfeldma@gmail.com>
>>> Signed-off-by: Jiri Pirko <jiri@resnulli.us>
>>> Reviewed-by: Thomas Graf <tgraf@suug.ch>
>>> Reviewed-by: John Fastabend <john.r.fastabend@intel.com>
>>
>> Users should be a different patch set for easier review.
>> I think you should separate rocker to be another patch series.
>
>I want to see how the new infrastructure is used in the same patch
>series as the changes that add that infrastructure.
Yep. For easier review, I will move the rocker patches to the tail and
leave the other ones on head.
^ permalink raw reply
* Re: [PATCH v4 0/7] kernel tinification: optionally compile out splice family of syscalls (splice, vmsplice, tee and sendfile)
From: David Miller @ 2014-11-25 17:13 UTC (permalink / raw)
To: rdunlap-wEGCiKHe2LqWVfeAwA7xHQ
Cc: pieter-qeJ+1H9vRZbz+pZb47iToQ, josh-iaAMLnmF4UmaiuxdJuQwMA,
alexander.h.duyck-ral2JQCrhuEAvxtiuMwx3w,
viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn, ast-uqk4Ao+rVK5Wk0Htik3J/w,
akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b,
beber-2YnHqweIUXrk1uMJSBkQmQ,
catalina.mocanu-Re5JQEeQqe8AvxtiuMwx3w,
dborkman-H+wXaHxf7aLQT0dZR+AlfA, edumazet-hpIqsD4AKlfQT0dZR+AlfA,
ebiederm-aS9lmoZGLiVWk0Htik3J/w, fabf-AgBVmzD5pcezQB+pC5nmwQ,
fuse-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
geert-Td1EMuHUCqxL1ZNQvxDV9g, hughd-hpIqsD4AKlfQT0dZR+AlfA,
iulia.manda21-Re5JQEeQqe8AvxtiuMwx3w, JBeulich-IBi9RG/b67k,
bfields-uC3wQj2KruNg9hUCZPvPmw, jlayton-vpEMnDpepFuMZCB2o+C8xQ,
linux-api-u79uwXL29TY76Z2rM5mHXA,
linux-fsdevel-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-nfs-u79uwXL29TY76Z2rM5mHXA, mcgrof-IBi9RG/b67k,
mattst88-Re5JQEeQqe8AvxtiuMwx3w, mgorman-l3A5Bk7waGM,
mst-H+wXaHxf7aLQT0dZR+AlfA, miklos-sUDqSbJrdHQHWmgEVkV9KA,
netdev-u79uwXL29TY76Z2rM5mHXA, oleg-H+wXaHxf7aLQT0dZR+AlfA,
Paul.Durrant-Sxgqhf6Nn4DQT0dZR+AlfA,
paulmck-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8,
pefoley2-lY0TAiDIAFlBDgjK7y7TUQ, tgraf-G/eBtMaohhA,
therbert-hpIqsD4AKlfQT0dZR+AlfA,
trond.myklebust-7I+n7zu2hftEKMMhf/gKZA,
willemb-hpIqsD4AKlfQT0dZR+AlfA,
xiaoguangrong-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8, zhe
In-Reply-To: <5474ABB6.3030400-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
From: Randy Dunlap <rdunlap-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
Date: Tue, 25 Nov 2014 08:17:58 -0800
> Is the splice family of syscalls the only one that tiny has identified
> for optional building or can we expect similar treatment for other
> syscalls?
>
> Why will many embedded systems not need these syscalls? You know
> exactly what apps they run and you are positive that those apps do
> not use splice?
I think starting to compile out system calls is a very slippery
slope we should not begin the journey down.
This changes the forward facing interface to userspace.
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" 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 v3 11/17] rocker: implement L2 bridge offloading
From: David Miller @ 2014-11-25 17:11 UTC (permalink / raw)
To: jhs
Cc: jiri, netdev, nhorman, andy, tgraf, dborkman, ogerlitz, jesse,
pshelar, azhou, ben, stephen, jeffrey.t.kirsher, vyasevic,
xiyou.wangcong, john.r.fastabend, edumazet, sfeldma, f.fainelli,
roopa, linville, jasowang, ebiederm, nicolas.dichtel,
ryazanov.s.a, buytenh, aviadr, nbd, alexei.starovoitov,
Neil.Jerram, ronye, simon.horman, alexander.h.duyck, john.ronciak,
mleitner, shrijeet, gospo, bcrl
In-Reply-To: <5474A879.4030807@mojatatu.com>
From: Jamal Hadi Salim <jhs@mojatatu.com>
Date: Tue, 25 Nov 2014 11:04:09 -0500
> Same comment on rocker.
Disagree :)
^ permalink raw reply
* Re: [patch net-next v3 07/17] rocker: introduce rocker switch driver
From: David Miller @ 2014-11-25 17:10 UTC (permalink / raw)
To: jhs
Cc: jiri, netdev, nhorman, andy, tgraf, dborkman, ogerlitz, jesse,
pshelar, azhou, ben, stephen, jeffrey.t.kirsher, vyasevic,
xiyou.wangcong, john.r.fastabend, edumazet, sfeldma, f.fainelli,
roopa, linville, jasowang, ebiederm, nicolas.dichtel,
ryazanov.s.a, buytenh, aviadr, nbd, alexei.starovoitov,
Neil.Jerram, ronye, simon.horman, alexander.h.duyck, john.ronciak,
mleitner, shrijeet, gospo, bcrl
In-Reply-To: <5474A705.5070007@mojatatu.com>
From: Jamal Hadi Salim <jhs@mojatatu.com>
Date: Tue, 25 Nov 2014 10:57:57 -0500
> On 11/25/14 05:28, Jiri Pirko wrote:
>> This patch introduces the first driver to benefit from the switchdev
>> infrastructure and to implement newly introduced switch ndos. This is
>> a
>> driver for emulated switch chip implemented in qemu:
>> https://github.com/sfeldma/qemu-rocker/
>>
>> This patch is a result of joint work with Scott Feldman.
>>
>> Signed-off-by: Scott Feldman <sfeldma@gmail.com>
>> Signed-off-by: Jiri Pirko <jiri@resnulli.us>
>> Reviewed-by: Thomas Graf <tgraf@suug.ch>
>> Reviewed-by: John Fastabend <john.r.fastabend@intel.com>
>
> Users should be a different patch set for easier review.
> I think you should separate rocker to be another patch series.
I want to see how the new infrastructure is used in the same patch
series as the changes that add that infrastructure.
^ permalink raw reply
* Re: [Bug 88871] New: SO_BINDTODEVICE set sock's sk_bound_dev_if ,but interface's index can chang where interface down and up
From: David Miller @ 2014-11-25 17:09 UTC (permalink / raw)
To: stephen; +Cc: netdev
In-Reply-To: <20141125074338.7476ad08@urahara>
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Tue, 25 Nov 2014 07:43:38 -0800
> This is not really a bug.
Agreed.
^ permalink raw reply
* Re: [patch net-next v3 04/17] net: introduce generic switch devices support
From: Jamal Hadi Salim @ 2014-11-25 17:08 UTC (permalink / raw)
To: Jiri Pirko
Cc: netdev, davem, nhorman, andy, tgraf, dborkman, ogerlitz, jesse,
pshelar, azhou, ben, stephen, jeffrey.t.kirsher, vyasevic,
xiyou.wangcong, john.r.fastabend, edumazet, sfeldma, f.fainelli,
roopa, linville, jasowang, ebiederm, nicolas.dichtel,
ryazanov.s.a, buytenh, aviadr, nbd, alexei.starovoitov,
Neil.Jerram, ronye, simon.horman, alexander.h.duyck, john.ronciak,
mleitner, shrijeet, gospo, bcrl
In-Reply-To: <20141125164954.GJ1971@nanopsycho.orion>
On 11/25/14 11:49, Jiri Pirko wrote:
>
> What does it do? "L3 switching"?
>
Absolutely not - that is too easy;-> Why not just a mellanox
chip for that? (Testing if Aviad is awake). But flows and associated
constructs apply.
>> "offload_id" would be the right term. switch doesnt sound right.
>
> When we talk about this area, we use word "switch". I know it is not
> accurate, but in my opinion it is the closest we can get. "chip" and
> "ASIC" are too generic I believe. I would not use "offload" cause it wan
> be easily mistaken with NIC offloads + it is alsno not accurate.
I think this interface is usable for example to offload to user space
ala DPDK and friends just as it would be for ASICs or standard NIC
offload (which we already have with fdb offload).
I dont know what a good name is - but switch looks incorrect.
cheers,
jamal
^ permalink raw reply
* Re: [patch net-next v3 16/17] bridge: add brport flags to dflt bridge_getlink
From: Scott Feldman @ 2014-11-25 17:02 UTC (permalink / raw)
To: Jamal Hadi Salim
Cc: Jiri Pirko, Netdev, David S. Miller, nhorman, Andy Gospodarek,
Thomas Graf, dborkman, ogerlitz, jesse, pshelar, azhou, ben,
stephen, Kirsher, Jeffrey T, vyasevic, Cong Wang,
Fastabend, John R, Eric Dumazet, Florian Fainelli, Roopa Prabhu,
John Linville, jasowang, ebiederm, Nicolas Dichtel, ryazanov.s.a,
buytenh, Aviad Raveh, nbd, Alexei Starovoitov <alexei.
In-Reply-To: <5474A992.5010305@mojatatu.com>
On Tue, Nov 25, 2014 at 8:08 AM, Jamal Hadi Salim <jhs@mojatatu.com> wrote:
> On 11/25/14 05:28, Jiri Pirko wrote:
>>
>> From: Scott Feldman <sfeldma@gmail.com>
>>
>> To allow brport device to return current brport flags set on port. Add
>> returned flags to nested IFLA_PROTINFO netlink msg built in dflt getlink.
>> With this change, netlink msg returned for bridge_getlink contains the
>> port's
>> offloaded flag settings (the port's SELF settings).
>>
>> Signed-off-by: Scott Feldman <sfeldma@gmail.com>
>> Signed-off-by: Jiri Pirko <jiri@resnulli.us>
>
>
> Not sure i followed this. VEPA etc are offload modes, no?
> I like the harvesting from netlink->internal format but
> not sure i followed the rest: VEPA etc are offload modes, no?
VEPA etc are offload modes.
> cheers,
> jamal
^ permalink raw reply
* Re: [patch net-next v3 07/17] rocker: introduce rocker switch driver
From: Jiri Pirko @ 2014-11-25 16:57 UTC (permalink / raw)
To: Jamal Hadi Salim
Cc: netdev, davem, nhorman, andy, tgraf, dborkman, ogerlitz, jesse,
pshelar, azhou, ben, stephen, jeffrey.t.kirsher, vyasevic,
xiyou.wangcong, john.r.fastabend, edumazet, sfeldma, f.fainelli,
roopa, linville, jasowang, ebiederm, nicolas.dichtel,
ryazanov.s.a, buytenh, aviadr, nbd, alexei.starovoitov,
Neil.Jerram, ronye, simon.horman, alexander.h.duyck, john.ronciak,
mleitner, shrijeet, gospo, bcrl
In-Reply-To: <5474A705.5070007@mojatatu.com>
Tue, Nov 25, 2014 at 04:57:57PM CET, jhs@mojatatu.com wrote:
>On 11/25/14 05:28, Jiri Pirko wrote:
>>This patch introduces the first driver to benefit from the switchdev
>>infrastructure and to implement newly introduced switch ndos. This is a
>>driver for emulated switch chip implemented in qemu:
>>https://github.com/sfeldma/qemu-rocker/
>>
>>This patch is a result of joint work with Scott Feldman.
>>
>>Signed-off-by: Scott Feldman <sfeldma@gmail.com>
>>Signed-off-by: Jiri Pirko <jiri@resnulli.us>
>>Reviewed-by: Thomas Graf <tgraf@suug.ch>
>>Reviewed-by: John Fastabend <john.r.fastabend@intel.com>
>
>Users should be a different patch set for easier review.
>I think you should separate rocker to be another patch series.
Hmm. When we introduce a new ops/callbacks, we need to use it in the
same patchset. That is the rule if I'm not mistaken. That is why I send
this together. I do not see any problems in that given the fact that
rocker is new driver so it cannot indroduce a regression.
I would like to keep pushing this as a single patchset.
>
>cheers,
>jamal
>
^ permalink raw reply
* Re: [patch net-next v3 02/17] net: make vid as a parameter for ndo_fdb_add/ndo_fdb_del
From: Jamal Hadi Salim @ 2014-11-25 16:57 UTC (permalink / raw)
To: John Fastabend, Roopa Prabhu
Cc: Jiri Pirko, netdev, davem, nhorman, andy, tgraf, dborkman,
ogerlitz, jesse, pshelar, azhou, ben, stephen, jeffrey.t.kirsher,
vyasevic, xiyou.wangcong, edumazet, sfeldma, f.fainelli, linville,
jasowang, ebiederm, nicolas.dichtel, ryazanov.s.a, buytenh,
aviadr, nbd, alexei.starovoitov, Neil.Jerram, ronye, simon.horman,
alexander.h.duyck, john.ronciak, mleitner, shrijeet, gospo, bcrl
In-Reply-To: <5474AF53.8030709@intel.com>
On 11/25/14 11:33, John Fastabend wrote:
> On 11/25/2014 08:19 AM, Roopa Prabhu wrote:
> I agree its needed but your already out of sync for some period of time
> why the software/hardware tables are being programmed. There is no global
> sw/hw commit operation.
>
> I'm not sure it matters if the time being out of sync is a touch longer
> because we go to user space to fix it. But agreed it can be supported.
>
Recent netfilter has 2 phase commit built in. Maybe we can generalize
that?
Note, there are use cases where it is important to do rollbacks.
If i am doing a distributed router, then to make sure a FIB/NH entries
are properly synced in across the cluster is extremely important. You
cant justify letting a few packets sneak in the wrong path.
in other words, strong consistency is important.
Having said that things can be worked around (and i would not use
2pc for the example use case i gave); however, that doesnt negate
the fact we need it.
cheers,
jamal
^ permalink raw reply
* [PATCH net-next] pkt_sched: fq: increase max delay from 125 ms to one second
From: Eric Dumazet @ 2014-11-25 16:57 UTC (permalink / raw)
To: Yang Yingliang, David Miller; +Cc: netdev, Neal Cardwell
In-Reply-To: <1416933094.29427.27.camel@edumazet-glaptop2.roam.corp.google.com>
From: Eric Dumazet <edumazet@google.com>
FQ/pacing has a clamp of delay of 125 ms, to avoid some possible harm.
It turns out this delay is too small to allow pacing low rates :
Some ISP setup very aggressive policers as low as 16kbit.
Now TCP stack has spurious rtx prevention, it seems safe to increase
this fixed parameter, without adding a qdisc attribute.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Yang Yingliang <yangyingliang@huawei.com>
---
This is something we run since July 2014 with good results, I forgot to
upstream this change. Thanks !
Notes for Googlers :
Google-Bug-Id: 9297267
Google-Bug-Id: 11789651
Change-Id: I081d7d842bfb860a4cd620bf1c71a8eb239150c8
net/sched/sch_fq.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/net/sched/sch_fq.c b/net/sched/sch_fq.c
index cbd7e1fd23b41bb7ba0bb348c3a1a287652cca93..9b05924cc386ecc2cdb9816be27e439637fb37b3 100644
--- a/net/sched/sch_fq.c
+++ b/net/sched/sch_fq.c
@@ -481,12 +481,11 @@ begin:
if (likely(rate))
do_div(len, rate);
/* Since socket rate can change later,
- * clamp the delay to 125 ms.
- * TODO: maybe segment the too big skb, as in commit
- * e43ac79a4bc ("sch_tbf: segment too big GSO packets")
+ * clamp the delay to 1 second.
+ * Really, providers of too big packets should be fixed !
*/
- if (unlikely(len > 125 * NSEC_PER_MSEC)) {
- len = 125 * NSEC_PER_MSEC;
+ if (unlikely(len > NSEC_PER_SEC)) {
+ len = NSEC_PER_SEC;
q->stat_pkts_too_long++;
}
^ permalink raw reply related
* Re: GRE with GRO very slow when forwarding starting with 3.14.24
From: Wolfgang Walter @ 2014-11-25 16:55 UTC (permalink / raw)
To: Tom Herbert; +Cc: Eric Dumazet, Linux Netdev List, Alexander Duyck
In-Reply-To: <CA+mtBx9SOr5RH7S63S28YbgxR8EwjgfS_dUkS2A4D1W3NzazHQ@mail.gmail.com>
Am Montag, 24. November 2014, 10:16:26 schrieb Tom Herbert:
> On Mon, Nov 24, 2014 at 8:48 AM, Eric Dumazet <eric.dumazet@gmail.com>
wrote:
> > On Mon, 2014-11-24 at 17:13 +0100, Wolfgang Walter wrote:
> > > Hello,
> > >
> > > starting with 3.14.24 GRE with GRO on is very slow. To be more specific:
> > >
> > > yyyy <--> GRO_endpoint <-_> .... <--> |eth0<->GRO-endpoint | eth1 |<->
> > > xxxx
> > >
> > > routing (IPv4) between xxxx and yyyy is very slow when GRO is enabled on
> > > eth0 and/or eth1 starting with stable kernel 3.14.24
> > >
> > > Regards,
> >
> > tcpdump might help, but I presume GSO is no longer working properly on
> > egress.
>
> Inner mac header is probably not being set in GRO->GSO GRE path.
> Please try this also:
Thanks, this patch fixes the problem.
>
> diff --git a/net/ipv4/gre_offload.c b/net/ipv4/gre_offload.c
> index bb5947b..51973dd 100644
> --- a/net/ipv4/gre_offload.c
> +++ b/net/ipv4/gre_offload.c
> @@ -247,6 +247,9 @@ static int gre_gro_complete(struct sk_buff *skb, int
> nhoff) err = ptype->callbacks.gro_complete(skb, nhoff + grehlen);
>
> rcu_read_unlock();
> +
> + skb_set_inner_mac_header(skb, nhoff + grehlen);
> +
> return err;
> }
>
> > Can you try to revert :
> >
> > commit abe640984aa492652232b65d3579361cf6d461f5
> > Author: Tom Herbert <therbert@google.com>
> > Date: Thu Oct 30 08:40:56 2014 -0700
> >
> > gre: Use inner mac length when computing tunnel length
> >
> > [ Upstream commit 14051f0452a2c26a3f4791e6ad6a435e8f1945ff ]
> >
> > Currently, skb_inner_network_header is used but this does not account
> > for Ethernet header for ETH_P_TEB. Use skb_inner_mac_header which
> > handles TEB and also should work with IP encapsulation in which case
> > inner mac and inner network headers are the same.
> >
> > Tested: Ran TCP_STREAM over GRE, worked as expected.
> >
> > Signed-off-by: Tom Herbert <therbert@google.com>
> > Acked-by: Alexander Duyck <alexander.h.duyck@redhat.com>
> > Signed-off-by: David S. Miller <davem@davemloft.net>
> > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> >
> > diff --git a/net/ipv4/gre_offload.c b/net/ipv4/gre_offload.c
> > index 2d24f293f977..8c8493ea6b1c 100644
> > --- a/net/ipv4/gre_offload.c
> > +++ b/net/ipv4/gre_offload.c
> > @@ -50,7 +50,7 @@ static struct sk_buff *gre_gso_segment(struct sk_buff
> > *skb,>
> > greh = (struct gre_base_hdr *)skb_transport_header(skb);
> >
> > - ghl = skb_inner_network_header(skb) - skb_transport_header(skb);
> > + ghl = skb_inner_mac_header(skb) - skb_transport_header(skb);
> >
> > if (unlikely(ghl < sizeof(*greh)))
> >
> > goto out;
Regards,
--
Wolfgang Walter
Studentenwerk München
Anstalt des öffentlichen Rechts
^ permalink raw reply
* Re: [patch net-next v3 08/17] bridge: call netdev_sw_port_stp_update when bridge port STP status changes
From: Jiri Pirko @ 2014-11-25 16:53 UTC (permalink / raw)
To: Andy Gospodarek
Cc: netdev, davem, nhorman, andy, tgraf, dborkman, ogerlitz, jesse,
pshelar, azhou, ben, stephen, jeffrey.t.kirsher, vyasevic,
xiyou.wangcong, john.r.fastabend, edumazet, jhs, sfeldma,
f.fainelli, roopa, linville, jasowang, ebiederm, nicolas.dichtel,
ryazanov.s.a, buytenh, aviadr, nbd, alexei.starovoitov,
Neil.Jerram, ronye, simon.horman, alexander.h.duyck, john.ronciak,
mleitner, shrijeet, bcrl
In-Reply-To: <20141125155832.GG27416@gospo.rtplab.test>
Tue, Nov 25, 2014 at 04:58:32PM CET, gospo@cumulusnetworks.com wrote:
>On Tue, Nov 25, 2014 at 11:28:39AM +0100, Jiri Pirko wrote:
>> From: Scott Feldman <sfeldma@gmail.com>
>>
>> To notify switch driver of change in STP state of bridge port, add new
>> .ndo op and provide switchdev wrapper func to call ndo op. Use it in bridge
>> code then.
>>
>> Signed-off-by: Scott Feldman <sfeldma@gmail.com>
>> Signed-off-by: Jiri Pirko <jiri@resnulli.us>
>> ---
>> v2->v3:
>> -changed "sw" string to "switch" to avoid confusion
>> v1->v2:
>> -no change
>> ---
>> include/linux/netdevice.h | 5 +++++
>> include/net/switchdev.h | 7 +++++++
>> net/bridge/br_stp.c | 2 ++
>> net/switchdev/switchdev.c | 19 +++++++++++++++++++
>> 4 files changed, 33 insertions(+)
>>
>> diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
>> index ce096dc..66cb64e 100644
>> --- a/include/linux/netdevice.h
>> +++ b/include/linux/netdevice.h
>> @@ -1024,6 +1024,9 @@ typedef u16 (*select_queue_fallback_t)(struct net_device *dev,
>> * Called to get an ID of the switch chip this port is part of.
>> * If driver implements this, it indicates that it represents a port
>> * of a switch chip.
>> + * int (*ndo_switch_port_stp_update)(struct net_device *dev, u8 state);
>> + * Called to notify switch device port of bridge port STP
>> + * state change.
>> */
>> struct net_device_ops {
>> int (*ndo_init)(struct net_device *dev);
>> @@ -1180,6 +1183,8 @@ struct net_device_ops {
>> #ifdef CONFIG_NET_SWITCHDEV
>> int (*ndo_switch_parent_id_get)(struct net_device *dev,
>> struct netdev_phys_item_id *psid);
>> + int (*ndo_switch_port_stp_update)(struct net_device *dev,
>> + u8 state);
>> #endif
>> };
>>
>> diff --git a/include/net/switchdev.h b/include/net/switchdev.h
>> index 7a52360..8a6d164 100644
>> --- a/include/net/switchdev.h
>> +++ b/include/net/switchdev.h
>> @@ -16,6 +16,7 @@
>>
>> int netdev_switch_parent_id_get(struct net_device *dev,
>> struct netdev_phys_item_id *psid);
>> +int netdev_switch_port_stp_update(struct net_device *dev, u8 state);
>>
>> #else
>>
>> @@ -25,6 +26,12 @@ static inline int netdev_switch_parent_id_get(struct net_device *dev,
>> return -EOPNOTSUPP;
>> }
>>
>> +static inline int netdev_switch_port_stp_update(struct net_device *dev,
>> + u8 state)
>> +{
>> + return -EOPNOTSUPP;
>> +}
>> +
>> #endif
>>
>> #endif /* _LINUX_SWITCHDEV_H_ */
>> diff --git a/net/bridge/br_stp.c b/net/bridge/br_stp.c
>> index 2b047bc..35e016c 100644
>> --- a/net/bridge/br_stp.c
>> +++ b/net/bridge/br_stp.c
>> @@ -12,6 +12,7 @@
>> */
>> #include <linux/kernel.h>
>> #include <linux/rculist.h>
>> +#include <net/switchdev.h>
>>
>> #include "br_private.h"
>> #include "br_private_stp.h"
>> @@ -39,6 +40,7 @@ void br_log_state(const struct net_bridge_port *p)
>> void br_set_state(struct net_bridge_port *p, unsigned int state)
>> {
>> p->state = state;
>> + netdev_switch_port_stp_update(p->dev, state);
>
>The only thing that concerns me about this patch is the fact that there
>is nothing paying attention to the return code.
>
>This means if *something* in the driver fails to set the STP state we
>have no way to feed this information back to the user to let them know
>that their hardware isn't exactly functioning as we expect.
>
>I do not expect that this first set would provide full feedback to
>br_make_forwarding, br_make_blocking, etc, to allow spanning tree to
>properly deal with the failure (that change is fine to add later), but a
>short one-liner indicating that the call to the hardware failed would e
>good. What about something simple like this:
>
>void br_set_state(struct net_bridge_port *p, unsigned int state)
>{
> int ret;
> p->state = state;
> ret = netdev_switch_port_stp_update(p->dev, state);
> if (ret && ret != -EOPNOTSUPP)
> br_warn(br, "error setting offload STP state for interface %s\n",
> p->dev->name);
>}
That makes sense. Will add this.
>
>>
>> /* called under bridge lock */
>> diff --git a/net/switchdev/switchdev.c b/net/switchdev/switchdev.c
>> index 66973de..d162b21 100644
>> --- a/net/switchdev/switchdev.c
>> +++ b/net/switchdev/switchdev.c
>> @@ -31,3 +31,22 @@ int netdev_switch_parent_id_get(struct net_device *dev,
>> return ops->ndo_switch_parent_id_get(dev, psid);
>> }
>> EXPORT_SYMBOL(netdev_switch_parent_id_get);
>> +
>> +/**
>> + * netdev_switch_port_stp_update - Notify switch device port of STP
>> + * state change
>> + * @dev: port device
>> + * @state: port STP state
>> + *
>> + * Notify switch device port of bridge port STP state change.
>> + */
>> +int netdev_switch_port_stp_update(struct net_device *dev, u8 state)
>> +{
>> + const struct net_device_ops *ops = dev->netdev_ops;
>> +
>> + if (!ops->ndo_switch_port_stp_update)
>> + return -EOPNOTSUPP;
>> + WARN_ON(!ops->ndo_switch_parent_id_get);
>> + return ops->ndo_switch_port_stp_update(dev, state);
>> +}
>> +EXPORT_SYMBOL(netdev_switch_port_stp_update);
>> --
>> 1.9.3
>>
^ permalink raw reply
* Re: [patch net-next v3 02/17] net: make vid as a parameter for ndo_fdb_add/ndo_fdb_del
From: Jamal Hadi Salim @ 2014-11-25 16:50 UTC (permalink / raw)
To: John Fastabend, Jiri Pirko, netdev
Cc: davem, nhorman, andy, tgraf, dborkman, ogerlitz, jesse, pshelar,
azhou, ben, stephen, jeffrey.t.kirsher, vyasevic, xiyou.wangcong,
edumazet, sfeldma, f.fainelli, roopa, linville, jasowang,
ebiederm, nicolas.dichtel, ryazanov.s.a, buytenh, aviadr, nbd,
alexei.starovoitov, Neil.Jerram, ronye, simon.horman,
alexander.h.duyck, john.ronciak, mleitner, shrijeet, gospo, bcrl
In-Reply-To: <5474AE9B.6000500@intel.com>
On 11/25/14 11:30, John Fastabend wrote:
> On 11/25/2014 08:18 AM, Jamal Hadi Salim wrote:
>> On 11/25/14 11:01, John Fastabend wrote:
>>> On 11/25/2014 07:38 AM, Jamal Hadi Salim wrote:
>>>> On 11/25/14 05:28, Jiri Pirko wrote:
>>>>> Do the work of parsing NDA_VLAN directly in rtnetlink code, pass simple
>>>>> u16 vid to drivers from there.
>>>>>
>>>>
> Actually (after having some coffee) this becomes much more useful
> if you return which items failed. Then you can slam the hardware
> with your 100 entries, probably a lot more then that, and come back
> later and clean it up.
>
Yes, that is the general use case.
Unfortunately at the moment we only return codes on a netlink set
direction - but would be a beauty if we could return what succeeded
and didnt in some form of vector.
Note: all is not lost because you can always do a get afterwards and
find what is missing if you got a return code of "partial success".
Just a little less efficient..
> We return a bitmask of which operations were successful. So if SW fails
> we have both bits cleared and we abort. When SW is successful we set the
> SW bit and try to program the HW. If its sucessful we set the HW bit if
> its not we abort with an err. Converting this to (1) is not much work
> just skip the abort.
>
Ok, guess i am gonna have to go stare at the code some more.
I thought we returned one of the error codes?
A bitmask would work for a single entry - because you have two
options add to h/ware and/or s/ware. So response is easy to encode.
But if i have 1000 and they are sparsely populated (think an indexed
table and i have indices 1, 23, 45, etc), then a bitmask would be
hard to use.
cheers,
jamal
^ permalink raw reply
* Re: [patch net-next v3 04/17] net: introduce generic switch devices support
From: Jiri Pirko @ 2014-11-25 16:50 UTC (permalink / raw)
To: Roopa Prabhu
Cc: netdev, davem, nhorman, andy, tgraf, dborkman, ogerlitz, jesse,
pshelar, azhou, ben, stephen, jeffrey.t.kirsher, vyasevic,
xiyou.wangcong, john.r.fastabend, edumazet, jhs, sfeldma,
f.fainelli, linville, jasowang, ebiederm, nicolas.dichtel,
ryazanov.s.a, buytenh, aviadr, nbd, alexei.starovoitov,
Neil.Jerram, ronye, simon.horman, alexander.h.duyck, john.ronciak,
mleitner, shrijeet, gospo, bcrl
In-Reply-To: <5474A926.30405@cumulusnetworks.com>
Tue, Nov 25, 2014 at 05:07:02PM CET, roopa@cumulusnetworks.com wrote:
>On 11/25/14, 2:28 AM, Jiri Pirko wrote:
>>The goal of this is to provide a possibility to support various switch
>>chips. Drivers should implement relevant ndos to do so. Now there is
>>only one ndo defined:
>>- for getting physical switch id is in place.
>>
>>Note that user can use random port netdevice to access the switch.
>>
>>Signed-off-by: Jiri Pirko <jiri@resnulli.us>
>>Reviewed-by: Thomas Graf <tgraf@suug.ch>
>>---
>>v2->v3:
>>-fixed documentation typo pointed out by M. Braun
>>-changed "sw" string to "switch" to avoid confusion
>
>Still voting for something generic like "hw" or "offload" or "hw_offload"
See my previous reply to Jamal.
>>v1->v2:
>>-no change
>>---
>> Documentation/networking/switchdev.txt | 59 ++++++++++++++++++++++++++++++++++
>> MAINTAINERS | 7 ++++
>> include/linux/netdevice.h | 10 ++++++
>> include/net/switchdev.h | 30 +++++++++++++++++
>> net/Kconfig | 1 +
>> net/Makefile | 3 ++
>> net/switchdev/Kconfig | 13 ++++++++
>> net/switchdev/Makefile | 5 +++
>> net/switchdev/switchdev.c | 33 +++++++++++++++++++
>> 9 files changed, 161 insertions(+)
>> create mode 100644 Documentation/networking/switchdev.txt
>> create mode 100644 include/net/switchdev.h
>> create mode 100644 net/switchdev/Kconfig
>> create mode 100644 net/switchdev/Makefile
>> create mode 100644 net/switchdev/switchdev.c
>>
>>diff --git a/Documentation/networking/switchdev.txt b/Documentation/networking/switchdev.txt
>>new file mode 100644
>>index 0000000..f981a92
>>--- /dev/null
>>+++ b/Documentation/networking/switchdev.txt
>>@@ -0,0 +1,59 @@
>>+Switch (and switch-ish) device drivers HOWTO
>>+===========================
>>+
>>+Please note that the word "switch" is here used in very generic meaning.
>>+This include devices supporting L2/L3 but also various flow offloading chips,
>>+including switches embedded into SR-IOV NICs.
>>+
>>+Lets describe a topology a bit. Imagine the following example:
>>+
>>+ +----------------------------+ +---------------+
>>+ | SOME switch chip | | CPU |
>>+ +----------------------------+ +---------------+
>>+ port1 port2 port3 port4 MNGMNT | PCI-E |
>>+ | | | | | +---------------+
>>+ PHY PHY | | | | NIC0 NIC1
>>+ | | | | | |
>>+ | | +- PCI-E -+ | |
>>+ | +------- MII -------+ |
>>+ +------------- MII ------------+
>>+
>>+In this example, there are two independent lines between the switch silicon
>>+and CPU. NIC0 and NIC1 drivers are not aware of a switch presence. They are
>>+separate from the switch driver. SOME switch chip is by managed by a driver
>>+via PCI-E device MNGMNT. Note that MNGMNT device, NIC0 and NIC1 may be
>>+connected to some other type of bus.
>>+
>>+Now, for the previous example show the representation in kernel:
>>+
>>+ +----------------------------+ +---------------+
>>+ | SOME switch chip | | CPU |
>>+ +----------------------------+ +---------------+
>>+ sw0p0 sw0p1 sw0p2 sw0p3 MNGMNT | PCI-E |
>>+ | | | | | +---------------+
>>+ PHY PHY | | | | eth0 eth1
>>+ | | | | | |
>>+ | | +- PCI-E -+ | |
>>+ | +------- MII -------+ |
>>+ +------------- MII ------------+
>>+
>>+Lets call the example switch driver for SOME switch chip "SOMEswitch". This
>>+driver takes care of PCI-E device MNGMNT. There is a netdevice instance sw0pX
>>+created for each port of a switch. These netdevices are instances
>>+of "SOMEswitch" driver. sw0pX netdevices serve as a "representation"
>>+of the switch chip. eth0 and eth1 are instances of some other existing driver.
>>+
>>+The only difference of the switch-port netdevice from the ordinary netdevice
>>+is that is implements couple more NDOs:
>>+
>>+ ndo_switch_parent_id_get - This returns the same ID for two port netdevices
>>+ of the same physical switch chip. This is
>>+ mandatory to be implemented by all switch drivers
>>+ and serves the caller for recognition of a port
>>+ netdevice.
>>+ ndo_switch_parent_* - Functions that serve for a manipulation of the switch
>>+ chip itself (it can be though of as a "parent" of the
>>+ port, therefore the name). They are not port-specific.
>>+ Caller might use arbitrary port netdevice of the same
>>+ switch and it will make no difference.
>>+ ndo_switch_port_* - Functions that serve for a port-specific manipulation.
>>diff --git a/MAINTAINERS b/MAINTAINERS
>>index a545d68..05addb6 100644
>>--- a/MAINTAINERS
>>+++ b/MAINTAINERS
>>@@ -9058,6 +9058,13 @@ F: lib/swiotlb.c
>> F: arch/*/kernel/pci-swiotlb.c
>> F: include/linux/swiotlb.h
>>+SWITCHDEV
>>+M: Jiri Pirko <jiri@resnulli.us>
>>+L: netdev@vger.kernel.org
>>+S: Supported
>>+F: net/switchdev/
>>+F: include/net/switchdev.h
>>+
>> SYNOPSYS ARC ARCHITECTURE
>> M: Vineet Gupta <vgupta@synopsys.com>
>> S: Supported
>>diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
>>index 5b491b3..ce096dc 100644
>>--- a/include/linux/netdevice.h
>>+++ b/include/linux/netdevice.h
>>@@ -1018,6 +1018,12 @@ typedef u16 (*select_queue_fallback_t)(struct net_device *dev,
>> * performing GSO on a packet. The device returns true if it is
>> * able to GSO the packet, false otherwise. If the return value is
>> * false the stack will do software GSO.
>>+ *
>>+ * int (*ndo_switch_parent_id_get)(struct net_device *dev,
>>+ * struct netdev_phys_item_id *psid);
>>+ * Called to get an ID of the switch chip this port is part of.
>>+ * If driver implements this, it indicates that it represents a port
>>+ * of a switch chip.
>> */
>> struct net_device_ops {
>> int (*ndo_init)(struct net_device *dev);
>>@@ -1171,6 +1177,10 @@ struct net_device_ops {
>> int (*ndo_get_lock_subclass)(struct net_device *dev);
>> bool (*ndo_gso_check) (struct sk_buff *skb,
>> struct net_device *dev);
>>+#ifdef CONFIG_NET_SWITCHDEV
>>+ int (*ndo_switch_parent_id_get)(struct net_device *dev,
>>+ struct netdev_phys_item_id *psid);
>>+#endif
>> };
>> /**
>>diff --git a/include/net/switchdev.h b/include/net/switchdev.h
>>new file mode 100644
>>index 0000000..7a52360
>>--- /dev/null
>>+++ b/include/net/switchdev.h
>>@@ -0,0 +1,30 @@
>>+/*
>>+ * include/net/switchdev.h - Switch device API
>>+ * Copyright (c) 2014 Jiri Pirko <jiri@resnulli.us>
>>+ *
>>+ * This program is free software; you can redistribute it and/or modify
>>+ * it under the terms of the GNU General Public License as published by
>>+ * the Free Software Foundation; either version 2 of the License, or
>>+ * (at your option) any later version.
>>+ */
>>+#ifndef _LINUX_SWITCHDEV_H_
>>+#define _LINUX_SWITCHDEV_H_
>>+
>>+#include <linux/netdevice.h>
>>+
>>+#ifdef CONFIG_NET_SWITCHDEV
>>+
>>+int netdev_switch_parent_id_get(struct net_device *dev,
>>+ struct netdev_phys_item_id *psid);
>>+
>>+#else
>>+
>>+static inline int netdev_switch_parent_id_get(struct net_device *dev,
>>+ struct netdev_phys_item_id *psid)
>>+{
>>+ return -EOPNOTSUPP;
>>+}
>>+
>>+#endif
>>+
>>+#endif /* _LINUX_SWITCHDEV_H_ */
>>diff --git a/net/Kconfig b/net/Kconfig
>>index 99815b5..ff9ffc1 100644
>>--- a/net/Kconfig
>>+++ b/net/Kconfig
>>@@ -228,6 +228,7 @@ source "net/vmw_vsock/Kconfig"
>> source "net/netlink/Kconfig"
>> source "net/mpls/Kconfig"
>> source "net/hsr/Kconfig"
>>+source "net/switchdev/Kconfig"
>> config RPS
>> boolean
>>diff --git a/net/Makefile b/net/Makefile
>>index 7ed1970..95fc694 100644
>>--- a/net/Makefile
>>+++ b/net/Makefile
>>@@ -73,3 +73,6 @@ obj-$(CONFIG_OPENVSWITCH) += openvswitch/
>> obj-$(CONFIG_VSOCKETS) += vmw_vsock/
>> obj-$(CONFIG_NET_MPLS_GSO) += mpls/
>> obj-$(CONFIG_HSR) += hsr/
>>+ifneq ($(CONFIG_NET_SWITCHDEV),)
>>+obj-y += switchdev/
>>+endif
>>diff --git a/net/switchdev/Kconfig b/net/switchdev/Kconfig
>>new file mode 100644
>>index 0000000..1557545
>>--- /dev/null
>>+++ b/net/switchdev/Kconfig
>>@@ -0,0 +1,13 @@
>>+#
>>+# Configuration for Switch device support
>>+#
>>+
>>+config NET_SWITCHDEV
>>+ boolean "Switch (and switch-ish) device support (EXPERIMENTAL)"
>>+ depends on INET
>>+ ---help---
>>+ This module provides glue between core networking code and device
>>+ drivers in order to support hardware switch chips in very generic
>>+ meaning of the word "switch". This include devices supporting L2/L3 but
>>+ also various flow offloading chips, including switches embedded into
>>+ SR-IOV NICs.
>>diff --git a/net/switchdev/Makefile b/net/switchdev/Makefile
>>new file mode 100644
>>index 0000000..5ed63ed
>>--- /dev/null
>>+++ b/net/switchdev/Makefile
>>@@ -0,0 +1,5 @@
>>+#
>>+# Makefile for the Switch device API
>>+#
>>+
>>+obj-$(CONFIG_NET_SWITCHDEV) += switchdev.o
>>diff --git a/net/switchdev/switchdev.c b/net/switchdev/switchdev.c
>>new file mode 100644
>>index 0000000..66973de
>>--- /dev/null
>>+++ b/net/switchdev/switchdev.c
>>@@ -0,0 +1,33 @@
>>+/*
>>+ * net/switchdev/switchdev.c - Switch device API
>>+ * Copyright (c) 2014 Jiri Pirko <jiri@resnulli.us>
>>+ *
>>+ * This program is free software; you can redistribute it and/or modify
>>+ * it under the terms of the GNU General Public License as published by
>>+ * the Free Software Foundation; either version 2 of the License, or
>>+ * (at your option) any later version.
>>+ */
>>+
>>+#include <linux/kernel.h>
>>+#include <linux/types.h>
>>+#include <linux/init.h>
>>+#include <linux/netdevice.h>
>>+#include <net/switchdev.h>
>>+
>>+/**
>>+ * netdev_switch_parent_id_get - Get ID of a switch
>>+ * @dev: port device
>>+ * @psid: switch ID
>>+ *
>>+ * Get ID of a switch this port is part of.
>>+ */
>>+int netdev_switch_parent_id_get(struct net_device *dev,
>>+ struct netdev_phys_item_id *psid)
>>+{
>>+ const struct net_device_ops *ops = dev->netdev_ops;
>>+
>>+ if (!ops->ndo_switch_parent_id_get)
>>+ return -EOPNOTSUPP;
>>+ return ops->ndo_switch_parent_id_get(dev, psid);
>>+}
>>+EXPORT_SYMBOL(netdev_switch_parent_id_get);
>
^ permalink raw reply
* Re: [patch net-next v3 04/17] net: introduce generic switch devices support
From: Jiri Pirko @ 2014-11-25 16:49 UTC (permalink / raw)
To: Jamal Hadi Salim
Cc: netdev, davem, nhorman, andy, tgraf, dborkman, ogerlitz, jesse,
pshelar, azhou, ben, stephen, jeffrey.t.kirsher, vyasevic,
xiyou.wangcong, john.r.fastabend, edumazet, sfeldma, f.fainelli,
roopa, linville, jasowang, ebiederm, nicolas.dichtel,
ryazanov.s.a, buytenh, aviadr, nbd, alexei.starovoitov,
Neil.Jerram, ronye, simon.horman, alexander.h.duyck, john.ronciak,
mleitner, shrijeet, gospo, bcrl
In-Reply-To: <5474A567.4040401@mojatatu.com>
Tue, Nov 25, 2014 at 04:51:03PM CET, jhs@mojatatu.com wrote:
>On 11/25/14 05:28, Jiri Pirko wrote:
>>The goal of this is to provide a possibility to support various switch
>>chips. Drivers should implement relevant ndos to do so. Now there is
>>only one ndo defined:
>>- for getting physical switch id is in place.
>>
>
>I am not sure switch id is the right term. I have a network processor
>that *does not* do switching. I am not sure if "chip" or "ASIC" or
What does it do? "L3 switching"?
>"offload_id" would be the right term. switch doesnt sound right.
When we talk about this area, we use word "switch". I know it is not
accurate, but in my opinion it is the closest we can get. "chip" and
"ASIC" are too generic I believe. I would not use "offload" cause it wan
be easily mistaken with NIC offloads + it is alsno not accurate.
>
>cheers,
>jamal
>
^ permalink raw reply
* Patch to fix scheduling while atomic splat
From: Larry Finger @ 2014-11-25 16:45 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: netdev@vger.kernel.org >> netdev
Greg,
On Nov. 12, I sent a patch for kernel 3.18 with the subject "[PATCH for 3.18]
staging: r8188eu: Fix scheduling while atomic error introduced in commit
fadbe0cd". To date, this fix does not seem to have appeared in mainline. Did it
get missed?
Thanks,
Larry
^ permalink raw reply
* [PATCH v4 42/42] af_packet: virtio 1.0 stubs
From: Michael S. Tsirkin @ 2014-11-25 16:44 UTC (permalink / raw)
To: linux-kernel
Cc: David Miller, cornelia.huck, rusty, nab, pbonzini,
Daniel Borkmann, Atzm Watanabe, Hannes Frederic Sowa,
Eric Dumazet, Tom Herbert, netdev
In-Reply-To: <1416933600-21398-1-git-send-email-mst@redhat.com>
This merely fixes sparse warnings, without actually
adding support for the new APIs.
Still working out the best way to enable the new
functionality.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
net/packet/af_packet.c | 35 ++++++++++++++++++++++-------------
1 file changed, 22 insertions(+), 13 deletions(-)
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 87d20f4..d4a877e 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -2444,13 +2444,15 @@ static int packet_snd(struct socket *sock, struct msghdr *msg, size_t len)
goto out_unlock;
if ((vnet_hdr.flags & VIRTIO_NET_HDR_F_NEEDS_CSUM) &&
- (vnet_hdr.csum_start + vnet_hdr.csum_offset + 2 >
- vnet_hdr.hdr_len))
- vnet_hdr.hdr_len = vnet_hdr.csum_start +
- vnet_hdr.csum_offset + 2;
+ (__virtio16_to_cpu(false, vnet_hdr.csum_start) +
+ __virtio16_to_cpu(false, vnet_hdr.csum_offset) + 2 >
+ __virtio16_to_cpu(false, vnet_hdr.hdr_len)))
+ vnet_hdr.hdr_len = __cpu_to_virtio16(false,
+ __virtio16_to_cpu(false, vnet_hdr.csum_start) +
+ __virtio16_to_cpu(false, vnet_hdr.csum_offset) + 2);
err = -EINVAL;
- if (vnet_hdr.hdr_len > len)
+ if (__virtio16_to_cpu(false, vnet_hdr.hdr_len) > len)
goto out_unlock;
if (vnet_hdr.gso_type != VIRTIO_NET_HDR_GSO_NONE) {
@@ -2492,7 +2494,8 @@ static int packet_snd(struct socket *sock, struct msghdr *msg, size_t len)
err = -ENOBUFS;
hlen = LL_RESERVED_SPACE(dev);
tlen = dev->needed_tailroom;
- skb = packet_alloc_skb(sk, hlen + tlen, hlen, len, vnet_hdr.hdr_len,
+ skb = packet_alloc_skb(sk, hlen + tlen, hlen, len,
+ __virtio16_to_cpu(false, vnet_hdr.hdr_len),
msg->msg_flags & MSG_DONTWAIT, &err);
if (skb == NULL)
goto out_unlock;
@@ -2534,14 +2537,16 @@ static int packet_snd(struct socket *sock, struct msghdr *msg, size_t len)
if (po->has_vnet_hdr) {
if (vnet_hdr.flags & VIRTIO_NET_HDR_F_NEEDS_CSUM) {
- if (!skb_partial_csum_set(skb, vnet_hdr.csum_start,
- vnet_hdr.csum_offset)) {
+ u16 s = __virtio16_to_cpu(false, vnet_hdr.csum_start);
+ u16 o = __virtio16_to_cpu(false, vnet_hdr.csum_offset);
+ if (!skb_partial_csum_set(skb, s, o)) {
err = -EINVAL;
goto out_free;
}
}
- skb_shinfo(skb)->gso_size = vnet_hdr.gso_size;
+ skb_shinfo(skb)->gso_size =
+ __virtio16_to_cpu(false, vnet_hdr.gso_size);
skb_shinfo(skb)->gso_type = gso_type;
/* Header must be checked, and gso_segs computed. */
@@ -2912,8 +2917,10 @@ static int packet_recvmsg(struct kiocb *iocb, struct socket *sock,
struct skb_shared_info *sinfo = skb_shinfo(skb);
/* This is a hint as to how much should be linear. */
- vnet_hdr.hdr_len = skb_headlen(skb);
- vnet_hdr.gso_size = sinfo->gso_size;
+ vnet_hdr.hdr_len =
+ __cpu_to_virtio16(false, skb_headlen(skb));
+ vnet_hdr.gso_size =
+ __cpu_to_virtio16(false, sinfo->gso_size);
if (sinfo->gso_type & SKB_GSO_TCPV4)
vnet_hdr.gso_type = VIRTIO_NET_HDR_GSO_TCPV4;
else if (sinfo->gso_type & SKB_GSO_TCPV6)
@@ -2931,8 +2938,10 @@ static int packet_recvmsg(struct kiocb *iocb, struct socket *sock,
if (skb->ip_summed == CHECKSUM_PARTIAL) {
vnet_hdr.flags = VIRTIO_NET_HDR_F_NEEDS_CSUM;
- vnet_hdr.csum_start = skb_checksum_start_offset(skb);
- vnet_hdr.csum_offset = skb->csum_offset;
+ vnet_hdr.csum_start = __cpu_to_virtio16(false,
+ skb_checksum_start_offset(skb));
+ vnet_hdr.csum_offset = __cpu_to_virtio16(false,
+ skb->csum_offset);
} else if (skb->ip_summed == CHECKSUM_UNNECESSARY) {
vnet_hdr.flags = VIRTIO_NET_HDR_F_DATA_VALID;
} /* else everything is zero */
--
MST
^ 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