introduce rocker switch driver with openvswitch hardware accelerated datapath
Subsystems (12)
Jiri Pirko
maintainercover introduce rocker switch driver with openvswitch hardware accelerated datapath
This patchset can be divided into 3 main sections:
- introduce switchdev api for implementing switch drivers
- add hardware acceleration bits into openvswitch datapath, This uses previously mentioned switchdev api
- introduce rocker switch driver which implements switchdev api
More info in separate patches.
So now there is possible out of the box to create ovs bridge over rocker switch ports and the flows will be offloaded into hardware.
RFC->v1 changes:
- moved include/linux/*.h -> include/net/
- moved net/core/switchdev.c -> net/switchdev/
- moved drivers/net/rocker.* -> drivers/net/ethernet/rocker/
- fixed couple of little bugs and typos
- in dsa the switch id is generated randomly
- fixed rocker schedule in atomic context bug in rocker_port_set_rx_mode
- added switchdev Netlink API
Jiri Pirko (13):
openvswitch: split flow structures into ovs specific and generic ones
net: rename netdev_phys_port_id to more generic name
net: introduce generic switch devices support
rtnl: expose physical switch id for particular device
net-sysfs: expose physical switch id for particular device
net: introduce dummy switch
dsa: implement ndo_swdev_get_id
net: introduce netdev_phys_item_ids_match helper
openvswitch: introduce vport_op get_netdev
openvswitch: add support for datapath hardware offload
sw_flow: add misc section to key with in_port_ifindex field
rocker: introduce rocker switch driver
switchdev: introduce Netlink API
Documentation/networking/switchdev.txt | 53 + MAINTAINERS | 14 + drivers/net/Kconfig | 7 + drivers/net/Makefile | 1 + drivers/net/dummyswitch.c | 130 + drivers/net/ethernet/Kconfig | 1 + drivers/net/ethernet/Makefile | 1 + drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 2 +- drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +- drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 2 +- drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 2 +- drivers/net/ethernet/rocker/Kconfig | 29 + drivers/net/ethernet/rocker/Makefile | 5 + drivers/net/ethernet/rocker/rocker.c | 3553 ++++++++++++++++++++++ drivers/net/ethernet/rocker/rocker.h | 465 +++ include/linux/netdevice.h | 54 +- include/net/dsa.h | 1 + include/net/sw_flow.h | 116 + include/net/switchdev.h | 44 + include/uapi/linux/if_link.h | 10 + include/uapi/linux/switchdev.h | 119 + net/Kconfig | 1 + net/Makefile | 3 + net/core/dev.c | 2 +- net/core/net-sysfs.c | 26 +- net/core/rtnetlink.c | 30 +- net/dsa/Kconfig | 2 +- net/dsa/dsa.c | 3 + net/dsa/slave.c | 10 + net/openvswitch/Makefile | 3 +- net/openvswitch/actions.c | 3 +- net/openvswitch/datapath.c | 109 +- net/openvswitch/datapath.h | 7 +- net/openvswitch/dp_notify.c | 7 +- net/openvswitch/flow.c | 6 +- net/openvswitch/flow.h | 102 +- net/openvswitch/flow_netlink.c | 53 +- net/openvswitch/flow_netlink.h | 10 +- net/openvswitch/flow_table.c | 119 +- net/openvswitch/flow_table.h | 30 +- net/openvswitch/hw_offload.c | 267 ++ net/openvswitch/hw_offload.h | 22 + net/openvswitch/vport-gre.c | 4 +- net/openvswitch/vport-internal_dev.c | 56 +- net/openvswitch/vport-netdev.c | 19 + net/openvswitch/vport-netdev.h | 12 - net/openvswitch/vport-vxlan.c | 2 +- net/openvswitch/vport.c | 2 +- net/openvswitch/vport.h | 6 +- net/switchdev/Kconfig | 20 + net/switchdev/Makefile | 6 + net/switchdev/switchdev.c | 174 ++ net/switchdev/switchdev_netlink.c | 493 +++ 53 files changed, 5931 insertions(+), 289 deletions(-) create mode 100644 Documentation/networking/switchdev.txt create mode 100644 drivers/net/dummyswitch.c create mode 100644 drivers/net/ethernet/rocker/Kconfig create mode 100644 drivers/net/ethernet/rocker/Makefile create mode 100644 drivers/net/ethernet/rocker/rocker.c create mode 100644 drivers/net/ethernet/rocker/rocker.h create mode 100644 include/net/sw_flow.h create mode 100644 include/net/switchdev.h create mode 100644 include/uapi/linux/switchdev.h create mode 100644 net/openvswitch/hw_offload.c create mode 100644 net/openvswitch/hw_offload.h create mode 100644 net/switchdev/Kconfig create mode 100644 net/switchdev/Makefile create mode 100644 net/switchdev/switchdev.c create mode 100644 net/switchdev/switchdev_netlink.c
Signature · 1 line
1.9.3
A message that is not in the archive (sent off-list or not yet received): 1409736300-12303-1-git-send-email-jiri-rHqAuBHg3fBzbRFIqnYvSA@public.gmane.org
PATCH 3/13 net: introduce generic switch devices support
The goal of this is to provide a possibility to suport various switch chips. Drivers should implement relevant ndos to do so. Now there is a couple of ndos defines:
- for getting physical switch id is in place.
- for work with flows.
Note that user can use random port netdevice to access the switch.
--- Documentation/networking/switchdev.txt | 53 ++++++++++ MAINTAINERS | 7 ++ include/linux/netdevice.h | 28 ++++++ include/net/sw_flow.h | 14 +++ include/net/switchdev.h | 44 +++++++++ net/Kconfig | 1 + net/Makefile | 3 + net/switchdev/Kconfig | 9 ++ net/switchdev/Makefile | 5 + net/switchdev/switchdev.c | 172 +++++++++++++++++++++++++++++++++ 10 files changed, 336 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
Documentation/networking/switchdev.txt new file +53 -0
@@ -0,0 +1,53 @@ +Switch device drivers HOWTO +=========================== + +First 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_swdev_get_id - 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_swdev_* - Functions that serve for a manipulation of the switch chip + itself. They are not port-specific. Caller might use + arbitrary port netdevice of the same switch and it will + make no difference. + ndo_swportdev_* - Functions that serve for a port-specific manipulation.
MAINTAINERS +7 -0
@@ -8808,6 +8808,13 @@ F: lib/swiotlb.c F: arch/*/kernel/pci-swiotlb.c F: include/linux/swiotlb.h +SWITCHDEV +M: Jiri Pirko <[email protected]> +L: [email protected] +S: Supported +F: net/switchdev/ +F: include/net/switchdev.h + SYNOPSYS ARC ARCHITECTURE M: Vineet Gupta <vgupta-HKixBCOQz3hWk0Htik3J/[email protected]> S: Supported
include/linux/netdevice.h +28 -0
@@ -46,9 +46,11 @@#include <net/dcbnl.h> #endif #include <net/netprio_cgroup.h> +#include <net/sw_flow.h> #include <linux/netdev_features.h> #include <linux/neighbour.h> +#include <uapi/linux/netdevice.h> struct netpoll_info ;
@@ -997,6 +999,24 @@ typedef u16 (*select_queue_fallback_t)(struct net_device *dev,* Callback to use for xmit over the accelerated station. This * is used in place of ndo_start_xmit on accelerated net * devices. +* +* int (*ndo_swdev_get_id)(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. +* +* int (*ndo_swdev_flow_insert)(struct net_device *dev, +* const struct sw_flow *flow); +* Called to insert a flow into switch device. If driver does +* not implement this, it is assumed that the hw does not have +* a capability to work with flows. +* +* int (*ndo_swdev_flow_remove)(struct net_device *dev, +* const struct sw_flow *flow); +* Called to remove a flow from switch device. If driver does +* not implement this, it is assumed that the hw does not have +* a capability to work with flows. */ struct net_device_ops {int (*ndo_init)(struct net_device *dev);
@@ -1146,6 +1166,14 @@ struct net_device_ops {struct net_device *dev, void *priv);int (*ndo_get_lock_subclass)(struct net_device *dev); +#ifdef CONFIG_NET_SWITCHDEV +int (*ndo_swdev_get_id)(struct net_device *dev, +struct netdev_phys_item_id *psid); +int (*ndo_swdev_flow_insert)(struct net_device *dev, +const struct sw_flow *flow); +int (*ndo_swdev_flow_remove)(struct net_device *dev, +const struct sw_flow *flow); +#endif };/**
include/net/sw_flow.h +14 -0
@@ -81,7 +81,21 @@ struct sw_flow_mask {struct sw_flow_key key; }; +enum sw_flow_action_type { +SW_FLOW_ACTION_TYPE_OUTPUT , +SW_FLOW_ACTION_TYPE_VLAN_PUSH , +SW_FLOW_ACTION_TYPE_VLAN_POP , +}; +struct sw_flow_action { +enum sw_flow_action_type type; +union { +u32 out_port_ifindex; +struct { +__be16 vlan_proto; +u16 vlan_tci; + } vlan; + }; };struct sw_flow_actions {
include/net/switchdev.h new file +44 -0
44 lines not on this page · raw message
net/Kconfig +1 -0
@@ -226,6 +226,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
net/Makefile +3 -0
@@ -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
net/switchdev/Kconfig new file +9 -0
@@ -0,0 +1,9 @@ +# +# Configuration for Switch device support +# + +config NET_SWITCHDEV + boolean "Switch device support (EXPERIMENTAL)" + depends on INET + ---help--- + This module provides support for hardware switch chips.
net/switchdev/Makefile new file +5 -0
@@ -0,0 +1,5 @@ +# +# Makefile for the Switch device API +# + +obj-$(CONFIG_NET_SWITCHDEV) += switchdev.o
net/switchdev/switchdev.c new file +172 -0
172 lines not on this page · raw message
Signature · 1 line
1.9.3
A message that is not in the archive (sent off-list or not yet received): 1409736300-12303-4-git-send-email-jiri-rHqAuBHg3fBzbRFIqnYvSA@public.gmane.org
Re: [patch net-next 03/13] net: introduce generic switch devices support
Quoted 10 lines · Jiri Pirko
The goal of this is to provide a possibility to suport various switch chips. Drivers should implement relevant ndos to do so. Now there is a couple of ndos defines:
- for getting physical switch id is in place.
- for work with flows.Note that user can use random port netdevice to access the switch.
Signed-off-by Jiri Pirko <[email protected]>---
[...]
Quoted 27 lines
struct
netpoll_info;include/linux/netdevice.h +18
-0@@ -997,6 +999,24 @@ typedef u16 (*select_queue_fallback_t)(struct net_device *dev,* Callback to use for xmit over the accelerated station. This * is used in place of ndo_start_xmit on accelerated net * devices. +* +* int (*ndo_swdev_get_id)(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. +* +* int (*ndo_swdev_flow_insert)(struct net_device *dev, +* const struct sw_flow *flow); +* Called to insert a flow into switch device. If driver does +* not implement this, it is assumed that the hw does not have +* a capability to work with flows. +* +* int (*ndo_swdev_flow_remove)(struct net_device *dev, +* const struct sw_flow *flow); +* Called to remove a flow from switch device. If driver does +* not implement this, it is assumed that the hw does not have +* a capability to work with flows. */ struct net_device_ops {int (*ndo_init)(struct net_device *dev);
include/linux/netdevice.h struct net_device_ops { · line 1175
Quoted 10 lines
include/linux/netdevice.h +7
-0@@ -1146,6 +1166,14 @@ struct net_device_ops {struct net_device *dev, void *priv);int (*ndo_get_lock_subclass)(struct net_device *dev); +#ifdef CONFIG_NET_SWITCHDEV +int (*ndo_swdev_get_id)(struct net_device *dev, +struct netdev_phys_item_id *psid); +int (*ndo_swdev_flow_insert)(struct net_device *dev, +const struct sw_flow *flow); +int (*ndo_swdev_flow_remove)(struct net_device *dev, +const struct sw_flow *flow);
Not really a critique of your patch but I'll need to extend this with a ndo_swdev_flow_dump() to get the fields. Without this if your user space side ever restarts, gets out of sync there is no way to get back in sync.
Also with hardware that has multiple flow tables we need to indicate the table to insert the flow into. One concrete reason to do this is to create atomic updates of multiple ACLs. The idea is to create a new ACL table build the table up and then link it in. This can be added when its needed my opensource drivers don't support this yet either but maybe adding multiple tables to rocker switch will help flush this out.
Finally we need some way to drive capabilities out of the swdev. Even rocker switch needs this to indicate it doesn't support matching on all the sw_flow fields. Without this its not clear to me how to manage the device from user space. I tried writing user space daemon for the simpler flow director interface and the try and see model breaks quickly.
Quoted 9 lines
include/linux/netdevice.h +1
-0+#endif };/** include/net/sw_flow.h +0
-0
include/net/sw_flow.h struct sw_flow_mask { · line 89
Quoted 9 lines
include/net/sw_flow.h +6
-0@@ -81,7 +81,21 @@ struct sw_flow_mask {struct sw_flow_key key; }; +enum sw_flow_action_type { +SW_FLOW_ACTION_TYPE_OUTPUT , +SW_FLOW_ACTION_TYPE_VLAN_PUSH , +SW_FLOW_ACTION_TYPE_VLAN_POP , +}; +
OK my previous comment about having another patch to create generic actions seems to be resolved here. I'm not sure how important it is but if we abstract the flow types away from OVS is there any reason not to reuse and relabel the action types as well? I guess we can't break userspace API but maybe a 1:1 mapping would be better?
include/net/sw_flow.h struct sw_flow_mask { · line 99
Quoted 10 lines
include/net/sw_flow.h +8
-0struct sw_flow_action { +enum sw_flow_action_type type; +union { +u32 out_port_ifindex; +struct { +__be16 vlan_proto; +u16 vlan_tci; + } vlan; + }; };
[...]
I think my comments could be addressed with additional patches if you want. I could help but it will be another week or so before I have some time. The biggest issue IMO is the lack of capabilities queries.
Thanks,
John
Signature · 1 line
John Fastabend Intel Corporation
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [patch net-next 03/13] net: introduce generic switch devices support
Quoted 49 lines · Wed, Sep 03, 2014 at 05:46:23PM CEST, john.fastabend-Re5JQEeQqe8AvxtiuMwx3w@pub…
Quoted 10 lines · Jiri Pirko
The goal of this is to provide a possibility to suport various switch chips. Drivers should implement relevant ndos to do so. Now there is a couple of ndos defines:
- for getting physical switch id is in place.
- for work with flows.Note that user can use random port netdevice to access the switch.
Signed-off-by Jiri Pirko <[email protected]>---
[...]
Quoted 34 lines
struct
netpoll_info;include/linux/netdevice.h +22
-0@@ -997,6 +999,24 @@ typedef u16 (*select_queue_fallback_t)(struct net_device *dev,* Callback to use for xmit over the accelerated station. This * is used in place of ndo_start_xmit on accelerated net * devices. +* +* int (*ndo_swdev_get_id)(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. +* +* int (*ndo_swdev_flow_insert)(struct net_device *dev, +* const struct sw_flow *flow); +* Called to insert a flow into switch device. If driver does +* not implement this, it is assumed that the hw does not have +* a capability to work with flows. +* +* int (*ndo_swdev_flow_remove)(struct net_device *dev, +* const struct sw_flow *flow); +* Called to remove a flow from switch device. If driver does +* not implement this, it is assumed that the hw does not have +* a capability to work with flows. */ struct net_device_ops {int (*ndo_init)(struct net_device *dev);@@ -1146,6 +1166,14 @@ struct net_device_ops {struct net_device *dev, void *priv);int (*ndo_get_lock_subclass)(struct net_device *dev); +#ifdef CONFIG_NET_SWITCHDEV +int (*ndo_swdev_get_id)(struct net_device *dev, +struct netdev_phys_item_id *psid); + int (*ndo_swdev_flow_insert)(struct net_device *dev,
Quoted 8 lines
include/linux/netdevice.h struct net_device_ops { · line 1175
Quoted 3 lines
include/linux/netdevice.h +3
-0+ const struct sw_flow *flow); +int (*ndo_swdev_flow_remove)(struct net_device *dev, +const struct sw_flow *flow);Not really a critique of your patch but I'll need to extend this with a
ndo_swdev_flow_dump()to get the fields. Without this if your user space side ever restarts, gets out of sync there is no way to get back in sync.
Sure. I do not say that the api is complete (If anything ever is...) Feel free to add dump ndo. In fact we can take care of it and implement in rocker driver.
Quoted 8 lines
Also with hardware that has multiple flow tables we need to indicate the table to insert the flow into. One concrete reason to do this is to create atomic updates of multiple ACLs. The idea is to create a new ACL table build the table up and then link it in. This can be added when its needed my opensource drivers don't support this yet either but maybe adding multiple tables to rocker switch will help flush this out.
Ok. Lets leave this for future follow-ups.
Quoted 7 lines
Finally we need some way to drive capabilities out of the swdev. Even rocker switch needs this to indicate it doesn't support matching on all the
sw_flowfields. Without this its not clear to me how to manage the device from user space. I tried writing user space daemon for the simpler flow director interface and the try and see model breaks quickly.
Hmm. I was under impression that a simple fact that the flow insertion fails with error is enough. But thining of it more. I believe that a set of features makes sense. I will think about it and add it into the next patchset version.
Quoted 40 lines
Quoted 10 lines
include/linux/netdevice.h +1
-0+#endif };/** include/net/sw_flow.h +0
-0include/net/sw_flow.h struct sw_flow_mask { · line 89
Quoted 9 lines
include/net/sw_flow.h +6
-0@@ -81,7 +81,21 @@ struct sw_flow_mask {struct sw_flow_key key; }; +enum sw_flow_action_type { +SW_FLOW_ACTION_TYPE_OUTPUT , +SW_FLOW_ACTION_TYPE_VLAN_PUSH , +SW_FLOW_ACTION_TYPE_VLAN_POP , +}; +OK my previous comment about having another patch to create generic actions seems to be resolved here. I'm not sure how important it is but if we abstract the flow types away from OVS is there any reason not to reuse and relabel the action types as well? I guess we can't break userspace API but maybe a 1:1 mapping would be better?
Quoted 10 lines
include/net/sw_flow.h +8
-0struct sw_flow_action { +enum sw_flow_action_type type; +union { +u32 out_port_ifindex; +struct { +__be16 vlan_proto; +u16 vlan_tci; + } vlan; + }; };[...]
Quoted 4 lines
I think my comments could be addressed with additional patches if you want. I could help but it will be another week or so before I have some time. The biggest issue IMO is the lack of capabilities queries.
Np. I will handle these (probably not before I return from vacation (Sep 15)).
Thanks!
PATCH 4/13 rtnl: expose physical switch id for particular device
In reply to a message not in the archiveThe netdevice represents a port in a switch, it will expose IFLA_PHYS_SWITCH_ID value via rtnl. Two netdevices with the same value belong to one physical switch.
--- include/uapi/linux/if_link.h | 1 + net/core/rtnetlink.c | 26 +++++++++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-)
include/uapi/linux/if_link.h +1 -0
@@ -145,6 +145,7 @@ enum {IFLA_CARRIER ,IFLA_PHYS_PORT_ID ,IFLA_CARRIER_CHANGES , +IFLA_PHYS_SWITCH_ID , __IFLA_MAX };
net/core/rtnetlink.c +25 -1
@@ -43,6 +43,7 @@#include <linux/inet.h> #include <linux/netdevice.h> +#include <net/switchdev.h> #include <net/ip.h> #include <net/protocol.h> #include <net/arp.h>
@@ -868,7 +869,8 @@ static noinline size_t if_nlmsg_size(const struct net_device *dev, +rtnl_port_size (dev, ext_filter_mask)/* IFLA_VF_PORTS + IFLA_PORT_SELF */ +rtnl_link_get_size (dev)/* IFLA_LINKINFO */ +rtnl_link_get_af_size (dev)/* IFLA_AF_SPEC */ - +nla_total_size (MAX_PHYS_ITEM_ID_LEN );/* IFLA_PHYS_PORT_ID */ + +nla_total_size (MAX_PHYS_ITEM_ID_LEN )/* IFLA_PHYS_PORT_ID */ + +nla_total_size (MAX_PHYS_ITEM_ID_LEN );/* IFLA_PHYS_SWITCH_ID */ }static int rtnl_vf_ports_fill (struct sk_buff *skb,struct net_device *dev)
@@ -967,6 +969,24 @@ static int rtnl_phys_port_id_fill(struct sk_buff *skb, struct net_device *dev)return 0 ; } +static int rtnl_phys_switch_id_fill (struct sk_buff *skb,struct net_device *dev) +{ +int err; +struct netdev_phys_item_id psid; + + err =swdev_get_id (dev, &psid); +if (err) { +if (err == -EOPNOTSUPP ) +return 0 ; +return err; + } + +if (nla_put (skb,IFLA_PHYS_SWITCH_ID , psid.id_len, psid.id)) +return -EMSGSIZE ; + +return 0 ; +} +static int rtnl_fill_ifinfo (struct sk_buff *skb,struct net_device *dev,int type,u32 pid,u32 seq,u32 change,unsigned int flags,u32 ext_filter_mask)
@@ -1039,6 +1059,9 @@ static int rtnl_fill_ifinfo(struct sk_buff *skb, struct net_device *dev,if (rtnl_phys_port_id_fill (skb, dev)) goto nla_put_failure; +if (rtnl_phys_switch_id_fill (skb, dev)) + goto nla_put_failure; + attr =nla_reserve (skb,IFLA_STATS ,sizeof (struct rtnl_link_stats ));if (attr ==NULL )
@@ -1198,6 +1221,7 @@ static const struct nla_policy ifla_policy[IFLA_MAX+1] = { [IFLA_NUM_RX_QUEUES] = { .type = NLA_U32 }, [IFLA_PHYS_PORT_ID] = { .type = NLA_BINARY, .len = MAX_PHYS_ITEM_ID_LEN }, [IFLA_CARRIER_CHANGES] = { .type = NLA_U32 }, /* ignored */ + [IFLA_PHYS_SWITCH_ID] = { .type = NLA_BINARY, .len = MAX_PHYS_ITEM_ID_LEN }, };static const struct nla_policy ifla_info_policy[IFLA_INFO_MAX +1 ] = {
Signature · 1 line
1.9.3
PATCH 5/13 net-sysfs: expose physical switch id for particular device
In reply to a message not in the archive--- net/core/net-sysfs.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+)
net/core/net-sysfs.c +24 -0
@@ -12,6 +12,7 @@#include <linux/capability.h> #include <linux/kernel.h> #include <linux/netdevice.h> +#include <net/switchdev.h> #include <linux/if_arp.h> #include <linux/slab.h> #include <linux/nsproxy.h>
@@ -399,6 +400,28 @@ static ssize_t phys_port_id_show(struct device *dev, }static DEVICE_ATTR_RO (phys_port_id); +static ssize_t phys_switch_id_show (struct device *dev, +struct device_attribute *attr,char *buf) +{ +struct net_device *netdev =to_net_dev (dev); +ssize_t ret = -EINVAL ; + +if (!rtnl_trylock ()) +return restart_syscall (); + +if (dev_isalive (netdev)) { +struct netdev_phys_item_id ppid; + + ret =swdev_get_id (netdev, &ppid); +if (!ret) + ret =sprintf (buf,"%*phN\n" , ppid.id_len, ppid.id); + } +rtnl_unlock (); + +return ret; +} +static DEVICE_ATTR_RO (phys_switch_id); +static struct attribute *net_class_attrs[] = { &dev_attr_netdev_group.attr, &dev_attr_type.attr,
@@ -423,6 +446,7 @@ static struct attribute *net_class_attrs[] = { &dev_attr_flags.attr, &dev_attr_tx_queue_len.attr, &dev_attr_phys_port_id.attr, + &dev_attr_phys_switch_id.attr,NULL , };ATTRIBUTE_GROUPS (net_class);
Signature · 1 line
1.9.3
PATCH 6/13 net: introduce dummy switch
In reply to a message not in the archiveDummy switch implementation using switchdev interface
--- drivers/net/Kconfig | 7 +++ drivers/net/Makefile | 1 + drivers/net/dummyswitch.c | 130 +++++++++++++++++++++++++++++++++++++++++++ include/uapi/linux/if_link.h | 9 +++ 4 files changed, 147 insertions(+) create mode 100644 drivers/net/dummyswitch.c
drivers/net/Kconfig +7 -0
@@ -71,6 +71,13 @@ config DUMMY To compile this driver as a module, choose M here: the module will be called dummy. +config NET_DUMMY_SWITCH + tristate "Dummy switch net driver support" + depends on NET_SWITCHDEV + ---help--- + To compile this driver as a module, choose M here: the module + will be called dummyswitch. + config EQUALIZER tristate "EQL (serial line load balancing) support" ---help---
drivers/net/Makefile +1 -0
@@ -7,6 +7,7 @@ # obj-$(CONFIG_BONDING) += bonding/ obj-$(CONFIG_DUMMY) += dummy.o +obj-$(CONFIG_NET_DUMMY_SWITCH) += dummyswitch.o obj-$(CONFIG_EQUALIZER) += eql.o obj-$(CONFIG_IFB) += ifb.o obj-$(CONFIG_MACVLAN) += macvlan.o
drivers/net/dummyswitch.c new file +130 -0
130 lines not on this page · raw message
include/uapi/linux/if_link.h +9 -0
@@ -562,4 +562,13 @@ enum {#define IFLA_HSR_MAX (__IFLA_HSR_MAX - 1) +/* DUMMYSWPORT section */ +enum { +IFLA_DUMMYSWPORT_UNSPEC , +IFLA_DUMMYSWPORT_PHYS_SWITCH_ID , + __IFLA_DUMMYSWPORT_MAX, +}; + +#define IFLA_DUMMYSWPORT_MAX (__IFLA_DUMMYSWPORT_MAX - 1) +#endif /* _UAPI_LINUX_IF_LINK_H */
Signature · 1 line
1.9.3
PATCH 7/13 dsa: implement ndo_swdev_get_id
In reply to a message not in the archive--- include/linux/netdevice.h | 3 ++- include/net/dsa.h | 1 + net/dsa/Kconfig | 2 +- net/dsa/dsa.c | 3 +++ net/dsa/slave.c | 10 ++++++++++ 5 files changed, 17 insertions(+), 2 deletions(-)
include/linux/netdevice.h +2 -1
@@ -41,7 +41,6 @@#include <linux/ethtool.h> #include <net/net_namespace.h> -#include <net/dsa.h> #ifdef CONFIG_DCB #include <net/dcbnl.h> #endif
@@ -1259,6 +1258,8 @@ enum netdev_priv_flags {#define IFF_LIVE_ADDR_CHANGE IFF_LIVE_ADDR_CHANGE#define IFF_MACVLAN IFF_MACVLAN +#include <net/dsa.h> +/** * struct net_device - The DEVICE structure. * Actually, this whole structure is a big mistake. It mixes I/O
include/net/dsa.h +1 -0
@@ -140,6 +140,7 @@ struct dsa_switch {u32 phys_mii_mask;struct mii_bus *slave_mii_bus;struct net_device *ports[DSA_MAX_PORTS ]; +struct netdev_phys_item_id psid; };static inline bool dsa_is_cpu_port (struct dsa_switch *ds,int p)
net/dsa/Kconfig +1 -1
@@ -1,6 +1,6 @@ config HAVE_NET_DSA def_bool y - depends on NETDEVICES && !S390 + depends on NETDEVICES && NET_SWITCHDEV && !S390 # Drivers must select NET_DSA and the appropriate tagging format
net/dsa/dsa.c +3 -0
@@ -202,6 +202,9 @@ dsa_switch_setup(struct dsa_switch_tree *dst, int index, ds->ports[i] = slave_dev; } + ds->psid.id_len =MAX_PHYS_ITEM_ID_LEN ; +get_random_bytes (ds->psid.id, ds->psid.id_len); +return ds; out_free:
net/dsa/slave.c +10 -0
@@ -192,6 +192,15 @@ static netdev_tx_t dsa_slave_notag_xmit(struct sk_buff *skb,return NETDEV_TX_OK ; } +static int dsa_slave_swdev_get_id (struct net_device *dev, +struct netdev_phys_item_id *psid) +{ +struct dsa_slave_priv *p =netdev_priv (dev); +struct dsa_switch *ds = p->parent; + +memcpy (psid, &ds->psid,sizeof (*psid)); +return 0 ; +}/* ethtool operations *******************************************************/ static int
@@ -323,6 +332,7 @@ static const struct net_device_ops dsa_slave_netdev_ops = { .ndo_set_rx_mode = dsa_slave_set_rx_mode, .ndo_set_mac_address = dsa_slave_set_mac_address, .ndo_do_ioctl = dsa_slave_ioctl, + .ndo_swdev_get_id = dsa_slave_swdev_get_id, };static const struct dsa_device_ops notag_netdev_ops = {
Signature · 1 line
1.9.3
A message that is not in the archive (sent off-list or not yet received): 1409736300-12303-8-git-send-email-jiri-rHqAuBHg3fBzbRFIqnYvSA@public.gmane.org
Re: [patch net-next 07/13] dsa: implement ndo_swdev_get_id
Quoted 47 lines · Jiri Pirko
Signed-off-by Jiri Pirko <[email protected]>--- include/linux/netdevice.h | 3 ++- include/net/dsa.h | 1 + net/dsa/Kconfig | 2 +- net/dsa/dsa.c | 3 +++ net/dsa/slave.c | 10 ++++++++++ 5 files changed, 17 insertions(+), 2 deletions(-)include/linux/netdevice.h +2
-1@@ -41,7 +41,6 @@#include <linux/ethtool.h> #include <net/net_namespace.h> -#include <net/dsa.h> #ifdef CONFIG_DCB #include <net/dcbnl.h> #endif @@ -1259,6 +1258,8 @@ enum netdev_priv_flags {#define IFF_LIVE_ADDR_CHANGE IFF_LIVE_ADDR_CHANGE#define IFF_MACVLAN IFF_MACVLAN +#include <net/dsa.h> +/** * struct net_device - The DEVICE structure. * Actually, this whole structure is a big mistake. It mixes I/O include/net/dsa.h +1
-0@@ -140,6 +140,7 @@ struct dsa_switch {u32 phys_mii_mask;struct mii_bus *slave_mii_bus;struct net_device *ports[DSA_MAX_PORTS ]; +struct netdev_phys_item_id psid; };static inline bool dsa_is_cpu_port (struct dsa_switch *ds,int p)net/dsa/Kconfig +0
-0
net/dsa/Kconfig line 3
Quoted 4 lines
net/dsa/Kconfig +1
-1@@ -1,6 +1,6 @@ config HAVE_NET_DSA def_bool y - depends on NETDEVICES && !S390 + depends on NETDEVICES && NET_SWITCHDEV && !S390
It does not look like this is necessary, we are only using definitions from net/dsa.h and include/linux/netdevice.h, and if it was, a 'select' would be more appropriate here I think.
TBH, I think we should rather drop this patch for now, I do not see any benefit in providing a random id over no-id at all.
Quoted 46 lines
net/dsa/Kconfig +0
-0# Drivers must select NET_DSA and the appropriate tagging formatnet/dsa/dsa.c +3
-0@@ -202,6 +202,9 @@ dsa_switch_setup(struct dsa_switch_tree *dst, int index, ds->ports[i] = slave_dev; } + ds->psid.id_len =MAX_PHYS_ITEM_ID_LEN ; +get_random_bytes (ds->psid.id, ds->psid.id_len); +return ds; out_free:net/dsa/slave.c +10
-0@@ -192,6 +192,15 @@ static netdev_tx_t dsa_slave_notag_xmit(struct sk_buff *skb,return NETDEV_TX_OK ; } +static int dsa_slave_swdev_get_id (struct net_device *dev, +struct netdev_phys_item_id *psid) +{ +struct dsa_slave_priv *p =netdev_priv (dev); +struct dsa_switch *ds = p->parent; + +memcpy (psid, &ds->psid,sizeof (*psid)); +return 0 ; +}/* ethtool operations *******************************************************/ static int@@ -323,6 +332,7 @@ static const struct net_device_ops dsa_slave_netdev_ops = { .ndo_set_rx_mode = dsa_slave_set_rx_mode, .ndo_set_mac_address = dsa_slave_set_mac_address, .ndo_do_ioctl = dsa_slave_ioctl, + .ndo_swdev_get_id = dsa_slave_swdev_get_id, };static const struct dsa_device_ops notag_netdev_ops = {
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [patch net-next 07/13] dsa: implement ndo_swdev_get_id
Quoted 57 lines · Thu, Sep 04, 2014 at 01:20:58AM CEST, f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.…
Quoted 47 lines · Jiri Pirko
Signed-off-by Jiri Pirko <[email protected]>--- include/linux/netdevice.h | 3 ++- include/net/dsa.h | 1 + net/dsa/Kconfig | 2 +- net/dsa/dsa.c | 3 +++ net/dsa/slave.c | 10 ++++++++++ 5 files changed, 17 insertions(+), 2 deletions(-)include/linux/netdevice.h +2
-1@@ -41,7 +41,6 @@#include <linux/ethtool.h> #include <net/net_namespace.h> -#include <net/dsa.h> #ifdef CONFIG_DCB #include <net/dcbnl.h> #endif @@ -1259,6 +1258,8 @@ enum netdev_priv_flags {#define IFF_LIVE_ADDR_CHANGE IFF_LIVE_ADDR_CHANGE#define IFF_MACVLAN IFF_MACVLAN +#include <net/dsa.h> +/** * struct net_device - The DEVICE structure. * Actually, this whole structure is a big mistake. It mixes I/O include/net/dsa.h +1
-0@@ -140,6 +140,7 @@ struct dsa_switch {u32 phys_mii_mask;struct mii_bus *slave_mii_bus;struct net_device *ports[DSA_MAX_PORTS ]; +struct netdev_phys_item_id psid; };static inline bool dsa_is_cpu_port (struct dsa_switch *ds,int p)net/dsa/Kconfig +0
-0net/dsa/Kconfig line 3
Quoted 4 lines
net/dsa/Kconfig +1
-1@@ -1,6 +1,6 @@ config HAVE_NET_DSA def_bool y - depends on NETDEVICES && !S390 + depends on NETDEVICES && NET_SWITCHDEV && !S390It does not look like this is necessary, we are only using definitions from
net/dsa.handinclude/linux/netdevice.h, and if it was, a 'select' would be more appropriate here I think.
Quoted 2 lines
TBH, I think we should rather drop this patch for now, I do not see any benefit in providing a random id over no-id at all.
Well, the benefit is that you are still able to see which ports belong to the same switch.
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [patch net-next 07/13] dsa: implement ndo_swdev_get_id
Quoted 58 lines · Jiri Pirko
Quoted 57 lines · Thu, Sep 04, 2014 at 01:20:58AM CEST, f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.…
Quoted 47 lines · Jiri Pirko
Signed-off-by Jiri Pirko <[email protected]>--- include/linux/netdevice.h | 3 ++- include/net/dsa.h | 1 + net/dsa/Kconfig | 2 +- net/dsa/dsa.c | 3 +++ net/dsa/slave.c | 10 ++++++++++ 5 files changed, 17 insertions(+), 2 deletions(-)include/linux/netdevice.h +2
-1@@ -41,7 +41,6 @@#include <linux/ethtool.h> #include <net/net_namespace.h> -#include <net/dsa.h> #ifdef CONFIG_DCB #include <net/dcbnl.h> #endif @@ -1259,6 +1258,8 @@ enum netdev_priv_flags {#define IFF_LIVE_ADDR_CHANGE IFF_LIVE_ADDR_CHANGE#define IFF_MACVLAN IFF_MACVLAN +#include <net/dsa.h> +/** * struct net_device - The DEVICE structure. * Actually, this whole structure is a big mistake. It mixes I/O include/net/dsa.h +1
-0@@ -140,6 +140,7 @@ struct dsa_switch {u32 phys_mii_mask;struct mii_bus *slave_mii_bus;struct net_device *ports[DSA_MAX_PORTS ]; +struct netdev_phys_item_id psid; };static inline bool dsa_is_cpu_port (struct dsa_switch *ds,int p)net/dsa/Kconfig +0
-0net/dsa/Kconfig line 3
Quoted 4 lines
net/dsa/Kconfig +1
-1@@ -1,6 +1,6 @@ config HAVE_NET_DSA def_bool y - depends on NETDEVICES && !S390 + depends on NETDEVICES && NET_SWITCHDEV && !S390It does not look like this is necessary, we are only using definitions from
net/dsa.handinclude/linux/netdevice.h, and if it was, a 'select' would be more appropriate here I think.
Quoted 5 lines
Quoted 2 lines
TBH, I think we should rather drop this patch for now, I do not see any benefit in providing a random id over no-id at all.
Well, the benefit is that you are still able to see which ports belong to the same switch.
I think it's a bad idea to force switchdev bloat onto DSA users just for that random id thing.
- Felix
Jiri Pirko
maintainerRe: [patch net-next 07/13] dsa: implement ndo_swdev_get_id
Quoted 59 lines · Fri, Sep 05, 2014 at 06:43:23AM CEST, [email protected] wrote:
Quoted 58 lines · Jiri Pirko
Quoted 57 lines · Thu, Sep 04, 2014 at 01:20:58AM CEST, [email protected] wrote:
Quoted 47 lines · Jiri Pirko
Signed-off-by Jiri Pirko <[email protected]>--- include/linux/netdevice.h | 3 ++- include/net/dsa.h | 1 + net/dsa/Kconfig | 2 +- net/dsa/dsa.c | 3 +++ net/dsa/slave.c | 10 ++++++++++ 5 files changed, 17 insertions(+), 2 deletions(-)include/linux/netdevice.h +2
-1@@ -41,7 +41,6 @@#include <linux/ethtool.h> #include <net/net_namespace.h> -#include <net/dsa.h> #ifdef CONFIG_DCB #include <net/dcbnl.h> #endif @@ -1259,6 +1258,8 @@ enum netdev_priv_flags {#define IFF_LIVE_ADDR_CHANGE IFF_LIVE_ADDR_CHANGE#define IFF_MACVLAN IFF_MACVLAN +#include <net/dsa.h> +/** * struct net_device - The DEVICE structure. * Actually, this whole structure is a big mistake. It mixes I/O include/net/dsa.h +1
-0@@ -140,6 +140,7 @@ struct dsa_switch {u32 phys_mii_mask;struct mii_bus *slave_mii_bus;struct net_device *ports[DSA_MAX_PORTS ]; +struct netdev_phys_item_id psid; };static inline bool dsa_is_cpu_port (struct dsa_switch *ds,int p)net/dsa/Kconfig +0
-0net/dsa/Kconfig line 3
Quoted 4 lines
net/dsa/Kconfig +1
-1@@ -1,6 +1,6 @@ config HAVE_NET_DSA def_bool y - depends on NETDEVICES && !S390 + depends on NETDEVICES && NET_SWITCHDEV && !S390It does not look like this is necessary, we are only using definitions from
net/dsa.handinclude/linux/netdevice.h, and if it was, a 'select' would be more appropriate here I think.
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
TBH, I think we should rather drop this patch for now, I do not see any benefit in providing a random id over no-id at all.
Well, the benefit is that you are still able to see which ports belong to the same switch.
I think it's a bad idea to force switchdev bloat onto DSA users just for that random id thing.
Np. I will drop this.
Quoted 2 lines
- Felix
PATCH 10/13 openvswitch: add support for datapath hardware offload
In reply to a message not in the archiveBenefit from the possibility to work with flows in switch devices and use the swdev api to offload flow datapath.
--- net/openvswitch/Makefile | 3 +- net/openvswitch/datapath.c | 33 ++++++ net/openvswitch/datapath.h | 3 + net/openvswitch/flow_table.c | 1 + net/openvswitch/hw_offload.c | 245 +++++++++++++++++++++++++++++++++++++++++ net/openvswitch/hw_offload.h | 22 ++++ net/openvswitch/vport-netdev.c | 3 + net/openvswitch/vport.h | 2 + 8 files changed, 311 insertions(+), 1 deletion(-) create mode 100644 net/openvswitch/hw_offload.c create mode 100644 net/openvswitch/hw_offload.h
net/openvswitch/Makefile +2 -1
@@ -13,7 +13,8 @@ openvswitch-y := \ flow_table.o \ vport.o \ vport-internal_dev.o \ - vport-netdev.o + vport-netdev.o \ + hw_offload.o ifneq ($(CONFIG_OPENVSWITCH_VXLAN),) openvswitch-y += vport-vxlan.o
net/openvswitch/datapath.c +33 -0
@@ -57,6 +57,7 @@#include "flow_netlink.h" #include "vport-internal_dev.h" #include "vport-netdev.h" +#include "hw_offload.h" int ovs_net_id__read_mostly ;
@@ -864,6 +865,9 @@ static int ovs_flow_cmd_new(struct sk_buff *skb, struct genl_info *info) acts =NULL ; goto err_unlock_ovs; } + error =ovs_hw_flow_insert (dp, new_flow); +if (error) +pr_warn ("failed to insert flow into hw\n" );if (unlikely (reply)) { error = ovs_flow_cmd_fill_info(new_flow,
@@ -896,10 +900,18 @@ static int ovs_flow_cmd_new(struct sk_buff *skb, struct genl_info *info) goto err_unlock_ovs; } } + error =ovs_hw_flow_remove (dp, flow); +if (error) +pr_warn ("failed to remove flow from hw\n" ); +/* Update actions. */ old_acts =ovsl_dereference (flow->sf_acts);rcu_assign_pointer (flow->sf_acts, acts); + error =ovs_hw_flow_insert (dp, flow); +if (error) +pr_warn ("failed to insert flow into hw\n" ); +if (unlikely (reply)) { error = ovs_flow_cmd_fill_info(flow, ovs_header->dp_ifindex,
@@ -993,9 +1005,17 @@ static int ovs_flow_cmd_set(struct sk_buff *skb, struct genl_info *info)/* Update actions, if present. */ if (likely (acts)) { + error =ovs_hw_flow_remove (dp, flow); +if (error) +pr_warn ("failed to remove flow from hw\n" ); + old_acts =ovsl_dereference (flow->sf_acts);rcu_assign_pointer (flow->sf_acts, acts); + error =ovs_hw_flow_insert (dp, flow); +if (error) +pr_warn ("failed to insert flow into hw\n" ); +if (unlikely (reply)) { error = ovs_flow_cmd_fill_info(flow, ovs_header->dp_ifindex,
@@ -1109,6 +1129,9 @@ static int ovs_flow_cmd_del(struct sk_buff *skb, struct genl_info *info) }if (unlikely (!a[OVS_FLOW_ATTR_KEY ])) { + err =ovs_hw_flow_flush (dp); +if (err) +pr_warn ("failed to flush flows from hw\n" ); err =ovs_flow_tbl_flush (&dp->table); goto unlock; }
@@ -1120,6 +1143,9 @@ static int ovs_flow_cmd_del(struct sk_buff *skb, struct genl_info *info) }ovs_flow_tbl_remove (&dp->table, flow); + err =ovs_hw_flow_remove (dp, flow); +if (err) +pr_warn ("failed to remove flow from hw\n" );ovs_unlock (); reply = ovs_flow_cmd_alloc_info((const struct ovs_flow_actions __force *) flow->sf_acts,
@@ -1368,6 +1394,8 @@ static int ovs_dp_cmd_new(struct sk_buff *skb, struct genl_info *info)for (i =0 ; i <DP_VPORT_HASH_BUCKETS ; i++)INIT_HLIST_HEAD (&dp->ports[i]); +INIT_LIST_HEAD (&dp->swdev_rep_list); +/* Set up our datapath device. */ parms.name =nla_data (a[OVS_DP_ATTR_NAME ]); parms.type =OVS_VPORT_TYPE_INTERNAL ;
@@ -1431,6 +1459,7 @@ err:static void __dp_destroy (struct datapath *dp) {int i; +int err;for (i =0 ; i <DP_VPORT_HASH_BUCKETS ; i++) {struct vport *vport;
@@ -1448,6 +1477,10 @@ static void __dp_destroy(struct datapath *dp)*/ ovs_dp_detach_port (ovs_vport_ovsl (dp,OVSP_LOCAL )); + err =ovs_hw_flow_flush (dp); +if (err) +pr_warn ("failed to flush flows from hw\n" ); +/* RCU destroy the flow table */ ovs_flow_tbl_destroy (&dp->table, true);
net/openvswitch/datapath.h +3 -0
@@ -90,6 +90,9 @@ struct datapath {#endif u32 user_features; + +/* List of switchdev representative ports */ +struct list_head swdev_rep_list; };/**
net/openvswitch/flow_table.c +1 -0
@@ -85,6 +85,7 @@ struct ovs_flow *ovs_flow_alloc(void) flow->sf_acts =NULL ; flow->flow.mask =NULL ; + flow->flow.actions =NULL ; flow->stats_last_writer =NUMA_NO_NODE ;/* Initialize the default stat node. */
net/openvswitch/hw_offload.c new file +245 -0
245 lines not on this page · raw message
net/openvswitch/hw_offload.h new file +22 -0
@@ -0,0 +1,22 @@ +/* +* Copyright (c) 2014 Jiri Pirko <[email protected]> +* +* 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 HW_OFFLOAD_H +#define HW_OFFLOAD_H 1 + +#include "datapath.h" +#include "flow.h" + +int ovs_hw_flow_insert (struct datapath *dp,struct ovs_flow *flow); +int ovs_hw_flow_remove (struct datapath *dp,struct ovs_flow *flow); +int ovs_hw_flow_flush (struct datapath *dp); +void ovs_hw_port_add (struct datapath *dp,struct vport *vport); +void ovs_hw_port_del (struct datapath *dp,struct vport *vport); + +#endif
net/openvswitch/vport-netdev.c +3 -0
@@ -32,6 +32,7 @@#include "datapath.h" #include "vport-internal_dev.h" #include "vport-netdev.h" +#include "hw_offload.h" struct netdev_vport {struct rcu_head rcu;
@@ -136,6 +137,7 @@ static struct vport *netdev_create(const struct vport_parms *parms)dev_set_promiscuity (netdev_vport->dev,1 ); netdev_vport->dev->priv_flags |=IFF_OVS_DATAPATH ;rtnl_unlock (); +ovs_hw_port_add (vport->dp, vport);return vport;
@@ -176,6 +178,7 @@ static void netdev_destroy(struct vport *vport) {struct netdev_vport *netdev_vport =netdev_vport_priv (vport); +ovs_hw_port_del (vport->dp, vport);rtnl_lock ();if (netdev_vport->dev->priv_flags &IFF_OVS_DATAPATH )ovs_netdev_detach_dev (vport);
net/openvswitch/vport.h +2 -0
@@ -110,6 +110,8 @@ struct vport {spinlock_t stats_lock;struct vport_err_stats err_stats; + +struct list_head swdev_rep_list; };/**
Signature · 1 line
1.9.3
A message that is not in the archive (sent off-list or not yet received): 1409736300-12303-11-git-send-email-jiri-rHqAuBHg3fBzbRFIqnYvSA@public.gmane.org
Re: [patch net-next 10/13] openvswitch: add support for datapath hardware offload
Quoted 44 lines · Jiri Pirko
Benefit from the possibility to work with flows in switch devices and use the swdev api to offload flow datapath.
Signed-off-by Jiri Pirko <[email protected]>--- net/openvswitch/Makefile | 3 +- net/openvswitch/datapath.c | 33 ++++++ net/openvswitch/datapath.h | 3 + net/openvswitch/flow_table.c | 1 + net/openvswitch/hw_offload.c | 245 +++++++++++++++++++++++++++++++++++++++++ net/openvswitch/hw_offload.h | 22 ++++ net/openvswitch/vport-netdev.c | 3 + net/openvswitch/vport.h | 2 + 8 files changed, 311 insertions(+), 1 deletion(-)create mode 100644
net/openvswitch/hw_offload.c
create mode 100644net/openvswitch/hw_offload.hnet/openvswitch/Makefile +2
-1@@ -13,7 +13,8 @@ openvswitch-y := \ flow_table.o \ vport.o \ vport-internal_dev.o \ - vport-netdev.o + vport-netdev.o \ + hw_offload.o ifneq ($(CONFIG_OPENVSWITCH_VXLAN),) openvswitch-y += vport-vxlan.onet/openvswitch/datapath.c +1
-0@@ -57,6 +57,7 @@#include "flow_netlink.h" #include "vport-internal_dev.h" #include "vport-netdev.h" +#include "hw_offload.h" int ovs_net_id__read_mostly ;
net/openvswitch/datapath.c static int ovs_flow_cmd_new(struct sk_buff *skb, struct genl_info *info) · line 870
Quoted 6 lines
net/openvswitch/datapath.c +3
-0@@ -864,6 +865,9 @@ static int ovs_flow_cmd_new(struct sk_buff *skb, struct genl_info *info) acts =NULL ; goto err_unlock_ovs; } + error =ovs_hw_flow_insert (dp, new_flow); +if (error) +pr_warn ("failed to insert flow into hw\n" );
This is really close to silently failing. I think we need to hard fail here somehow and push it back to userspace as part of the reply and ovs_notify.
Otherwise I don't know how to manage the hardware correctly. Consider the hardware table is full. In this case user space will continue to add rules and they will be silently discarded. Similarly if user space adds a flow/action that can not be supported by the hardware it will be silently ignored.
Even if we do careful accounting on resources in user space we could still get an ENOMEM error from sw_flow_action_create.
Same comment for the other hw commands flush/remove.
net/openvswitch/datapath.c static int ovs_flow_cmd_new(struct sk_buff *skb, struct genl_info *info) · line 902
Quoted 6 lines
net/openvswitch/datapath.c +0
-0if (unlikely (reply)) { error = ovs_flow_cmd_fill_info(new_flow,@@ -896,10 +900,18 @@ static int ovs_flow_cmd_new(struct sk_buff *skb, struct genl_info *info) goto err_unlock_ovs; } }
[...]
Thanks,
John
Signature · 1 line
John Fastabend Intel Corporation
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [patch net-next 10/13] openvswitch: add support for datapath hardware offload
Quoted 44 lines · Wed, Sep 03, 2014 at 06:37:08PM CEST, john.fastabend-Re5JQEeQqe8AvxtiuMwx3w@pub…
Quoted 43 lines · Jiri Pirko
Benefit from the possibility to work with flows in switch devices and use the swdev api to offload flow datapath.
Signed-off-by Jiri Pirko <[email protected]>--- net/openvswitch/Makefile | 3 +- net/openvswitch/datapath.c | 33 ++++++ net/openvswitch/datapath.h | 3 + net/openvswitch/flow_table.c | 1 + net/openvswitch/hw_offload.c | 245 +++++++++++++++++++++++++++++++++++++++++ net/openvswitch/hw_offload.h | 22 ++++ net/openvswitch/vport-netdev.c | 3 + net/openvswitch/vport.h | 2 + 8 files changed, 311 insertions(+), 1 deletion(-) create mode 100644 net/openvswitch/hw_offload.c create mode 100644 net/openvswitch/hw_offload.hnet/openvswitch/Makefile +2
-1@@ -13,7 +13,8 @@ openvswitch-y := \ flow_table.o \ vport.o \ vport-internal_dev.o \ - vport-netdev.o + vport-netdev.o \ + hw_offload.o ifneq ($(CONFIG_OPENVSWITCH_VXLAN),) openvswitch-y += vport-vxlan.onet/openvswitch/datapath.c +1
-0@@ -57,6 +57,7 @@#include "flow_netlink.h" #include "vport-internal_dev.h" #include "vport-netdev.h" +#include "hw_offload.h" int ovs_net_id__read_mostly ;
Quoted 11 lines
net/openvswitch/datapath.c static int ovs_flow_cmd_new(struct sk_buff *skb, struct genl_info *info) · line 870
Quoted 7 lines
net/openvswitch/datapath.c +3
-0@@ -864,6 +865,9 @@ static int ovs_flow_cmd_new(struct sk_buff *skb, struct genl_info *info) acts =NULL ; goto err_unlock_ovs; } + error =ovs_hw_flow_insert (dp, new_flow); +if (error) +pr_warn ("failed to insert flow into hw\n" );This is really close to silently failing. I think we need to hard fail here somehow and push it back to userspace as part of the reply and
ovs_notify.
Yes, I agree. My plan was to handle this in ovs hw/sw/both netlink attr implementation.
Quoted 28 lines
Otherwise I don't know how to manage the hardware correctly. Consider the hardware table is full. In this case user space will continue to add rules and they will be silently discarded. Similarly if user space adds a flow/action that can not be supported by the hardware it will be silently ignored.
Even if we do careful accounting on resources in user space we could still get an ENOMEM error from
sw_flow_action_create.Same comment for the other hw commands flush/remove.
net/openvswitch/datapath.c static int ovs_flow_cmd_new(struct sk_buff *skb, struct genl_info *info) · line 902
Quoted 6 lines
net/openvswitch/datapath.c +0
-0if (unlikely (reply)) { error = ovs_flow_cmd_fill_info(new_flow,@@ -896,10 +900,18 @@ static int ovs_flow_cmd_new(struct sk_buff *skb, struct genl_info *info) goto err_unlock_ovs; } }[...]
Thanks,
JohnSignature · 1 line
John Fastabend Intel Corporation
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [patch net-next 10/13] openvswitch: add support for datapath hardware offload
Quoted 57 lines · Jiri Pirko
Quoted 44 lines · Wed, Sep 03, 2014 at 06:37:08PM CEST, john.fastabend-Re5JQEeQqe8AvxtiuMwx3w@pub…
Quoted 43 lines · Jiri Pirko
Benefit from the possibility to work with flows in switch devices and use the swdev api to offload flow datapath.
Signed-off-by Jiri Pirko <[email protected]>--- net/openvswitch/Makefile | 3 +- net/openvswitch/datapath.c | 33 ++++++ net/openvswitch/datapath.h | 3 + net/openvswitch/flow_table.c | 1 + net/openvswitch/hw_offload.c | 245 +++++++++++++++++++++++++++++++++++++++++ net/openvswitch/hw_offload.h | 22 ++++ net/openvswitch/vport-netdev.c | 3 + net/openvswitch/vport.h | 2 + 8 files changed, 311 insertions(+), 1 deletion(-) create mode 100644 net/openvswitch/hw_offload.c create mode 100644 net/openvswitch/hw_offload.hnet/openvswitch/Makefile +2
-1@@ -13,7 +13,8 @@ openvswitch-y := \ flow_table.o \ vport.o \ vport-internal_dev.o \ - vport-netdev.o + vport-netdev.o \ + hw_offload.o ifneq ($(CONFIG_OPENVSWITCH_VXLAN),) openvswitch-y += vport-vxlan.onet/openvswitch/datapath.c +1
-0@@ -57,6 +57,7 @@#include "flow_netlink.h" #include "vport-internal_dev.h" #include "vport-netdev.h" +#include "hw_offload.h" int ovs_net_id__read_mostly ;Quoted 11 lines
net/openvswitch/datapath.c static int ovs_flow_cmd_new(struct sk_buff *skb, struct genl_info *info) · line 870
Quoted 7 lines
net/openvswitch/datapath.c +3
-0@@ -864,6 +865,9 @@ static int ovs_flow_cmd_new(struct sk_buff *skb, struct genl_info *info) acts =NULL ; goto err_unlock_ovs; } + error =ovs_hw_flow_insert (dp, new_flow); +if (error) +pr_warn ("failed to insert flow into hw\n" );This is really close to silently failing. I think we need to hard fail here somehow and push it back to userspace as part of the reply and
ovs_notify.
Quoted 2 lines
Yes, I agree. My plan was to handle this in ovs hw/sw/both netlink attr implementation.
FWIW I agree that handling it in that way makes sense.
In particular I think that "both", where the datapath is allowed to fall back to software is a useful mode to have (its the current implementation, right?). But that it is also good to allow user-space more control.
Quoted 32 lines
Quoted 22 lines
Otherwise I don't know how to manage the hardware correctly. Consider the hardware table is full. In this case user space will continue to add rules and they will be silently discarded. Similarly if user space adds a flow/action that can not be supported by the hardware it will be silently ignored.
Even if we do careful accounting on resources in user space we could still get an ENOMEM error from
sw_flow_action_create.Same comment for the other hw commands flush/remove.
Quoted 6 lines
net/openvswitch/datapath.c +0
-0if (unlikely (reply)) { error = ovs_flow_cmd_fill_info(new_flow,@@ -896,10 +900,18 @@ static int ovs_flow_cmd_new(struct sk_buff *skb, struct genl_info *info) goto err_unlock_ovs; } }[...]
Quoted 5 lines
Thanks,
JohnSignature · 1 line
John Fastabend Intel Corporation_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev
PATCH 11/13 sw_flow: add misc section to key with in_port_ifindex field
In reply to a message not in the archive--- include/net/sw_flow.h | 3 +++ net/openvswitch/hw_offload.c | 22 ++++++++++++++++++++++ net/switchdev/switchdev.c | 2 ++ 3 files changed, 27 insertions(+)
include/net/sw_flow.h +3 -0
@@ -69,6 +69,9 @@ struct sw_flow_key { } nd; } ipv6; }; +struct { +u32 in_port_ifindex;/* Input switch port ifindex (or 0). */ + } misc; }__aligned(BITS_PER_LONG/8) ;/* Ensure that we can do comparisons as longs. */ struct sw_flow_key_range {
net/openvswitch/hw_offload.c +22 -0
@@ -83,6 +83,24 @@ errout:return err; } +void ovs_hw_flow_adjust (struct datapath *dp,struct ovs_flow *flow) +{ +struct vport *vport; + + flow->flow.key.misc.in_port_ifindex =0 ; + flow->flow.mask->key.misc.in_port_ifindex =0 ; + vport =ovs_vport_ovsl (dp, flow->flow.key.phy.in_port); +if (vport && vport->ops->type ==OVS_VPORT_TYPE_NETDEV ) { +struct net_device *dev; + + dev = vport->ops->get_netdev (vport); +if (dev) { + flow->flow.key.misc.in_port_ifindex = dev->ifindex; + flow->flow.mask->key.misc.in_port_ifindex =0xFFFFFFFF ; + } + } +} +int ovs_hw_flow_insert (struct datapath *dp,struct ovs_flow *flow) {struct sw_flow_actions *actions;
@@ -93,6 +111,8 @@ int ovs_hw_flow_insert(struct datapath *dp, struct ovs_flow *flow)ASSERT_OVSL ();BUG_ON (flow->flow.actions); +ovs_hw_flow_adjust (dp, flow); + err =sw_flow_action_create (dp, &actions, flow->sf_acts);if (err)return err;
@@ -124,6 +144,8 @@ int ovs_hw_flow_remove(struct datapath *dp, struct ovs_flow *flow)ASSERT_OVSL (); +ovs_hw_flow_adjust (dp, flow); +if (!flow->flow.actions) { err =sw_flow_action_create (dp, &actions, flow->sf_acts);if (err)
net/switchdev/switchdev.c +2 -0
@@ -129,6 +129,8 @@ static void print_flow(const struct sw_flow *flow, struct net_device *dev,print_flow_key_ip (PREFIX_MASK , &flow->mask->key);print_flow_key_ipv4 (PREFIX_NONE , &flow->key);print_flow_key_ipv4 (PREFIX_MASK , &flow->mask->key); +print_flow_key_misc (PREFIX_NONE , &flow->key); +print_flow_key_misc (PREFIX_MASK , &flow->mask->key);print_flow_actions (flow->actions); }
Signature · 1 line
1.9.3
PATCH 12/13 rocker: introduce rocker switch driver
In reply to a message not in the archiveThis 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.
--- MAINTAINERS | 6 + drivers/net/ethernet/Kconfig | 1 + drivers/net/ethernet/Makefile | 1 + drivers/net/ethernet/rocker/Kconfig | 29 + drivers/net/ethernet/rocker/Makefile | 5 + drivers/net/ethernet/rocker/rocker.c | 3553 ++++++++++++++++++++++++++++++++++ drivers/net/ethernet/rocker/rocker.h | 465 +++++ 7 files changed, 4060 insertions(+) create mode 100644 drivers/net/ethernet/rocker/Kconfig create mode 100644 drivers/net/ethernet/rocker/Makefile create mode 100644 drivers/net/ethernet/rocker/rocker.c create mode 100644 drivers/net/ethernet/rocker/rocker.h
MAINTAINERS +6 -0
@@ -7638,6 +7638,12 @@ F: drivers/hid/hid-roccat* F: include/linux/hid-roccat* F: Documentation/ABI/*/sysfs-driver-hid-roccat* +ROCKER DRIVER +M: Jiri Pirko <[email protected]> +L: [email protected] +S: Supported +F: drivers/net/ethernet/rocker/ + ROCKETPORT DRIVER P: Comtrol Corp. W: http://www.comtrol.com
drivers/net/ethernet/Kconfig +1 -0
@@ -153,6 +153,7 @@ source "drivers/net/ethernet/qlogic/Kconfig" source "drivers/net/ethernet/realtek/Kconfig" source "drivers/net/ethernet/renesas/Kconfig" source "drivers/net/ethernet/rdc/Kconfig" +source "drivers/net/ethernet/rocker/Kconfig" config S6GMAC tristate "S6105 GMAC ethernet support"
drivers/net/ethernet/Makefile +1 -0
@@ -63,6 +63,7 @@ obj-$(CONFIG_NET_VENDOR_QLOGIC) += qlogic/ obj-$(CONFIG_NET_VENDOR_REALTEK) += realtek/ obj-$(CONFIG_SH_ETH) += renesas/ obj-$(CONFIG_NET_VENDOR_RDC) += rdc/ +obj-$(CONFIG_NET_VENDOR_ROCKER) += rocker/ obj-$(CONFIG_S6GMAC) += s6gmac.o obj-$(CONFIG_NET_VENDOR_SAMSUNG) += samsung/ obj-$(CONFIG_NET_VENDOR_SEEQ) += seeq/
drivers/net/ethernet/rocker/Kconfig new file +29 -0
@@ -0,0 +1,29 @@ +# +# Rocker device configuration +# + +config NET_VENDOR_ROCKER + bool "Rocker devices" + default y + ---help--- + If you have a network (Ethernet) card belonging to this class, say Y + and read the Ethernet-HOWTO, available from + <http://www.tldp.org/docs.html#howto>. + + Note that the answer to this question doesn't directly affect the + kernel: saying N will just cause the configurator to skip all + the questions about Rocker devices. If you say Y, you will be asked for + your specific card in the following questions. + +if NET_VENDOR_ROCKER + +config ROCKER + tristate "Rocker switch driver (EXPERIMENTAL)" + depends on PCI && NET_SWITCHDEV + ---help--- + This driver supports Rocker switch device. + + To compile this driver as a module, choose M here: the + module will be called rocker. + +endif # NET_VENDOR_ROCKER
drivers/net/ethernet/rocker/Makefile new file +5 -0
@@ -0,0 +1,5 @@ +# +# Makefile for the Rocker network device drivers. +# + +obj-$(CONFIG_ROCKER) += rocker.o
drivers/net/ethernet/rocker/rocker.c new file +3553 -0
2,940 lines not on this page · raw message
drivers/net/ethernet/rocker/rocker.h new file +465 -0
465 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
1.9.3
Part of the diff is not shown here. View the raw message.
Jiri Pirko
maintainerPATCH 1/13 openvswitch: split flow structures into ovs specific and generic ones
In reply to Jiri PirkoAfter this, flow related structures can be used in other code.
--- include/net/sw_flow.h | 99 ++++++++++++++++++++++++++++++++++ net/openvswitch/actions.c | 3 +- net/openvswitch/datapath.c | 74 +++++++++++++------------- net/openvswitch/datapath.h | 4 +- net/openvswitch/flow.c | 6 +-- net/openvswitch/flow.h | 102 +++++++---------------------------- net/openvswitch/flow_netlink.c | 53 +++++++++--------- net/openvswitch/flow_netlink.h | 10 ++-- net/openvswitch/flow_table.c | 118 ++++++++++++++++++++++------------------- net/openvswitch/flow_table.h | 30 +++++------ net/openvswitch/vport-gre.c | 4 +- net/openvswitch/vport-vxlan.c | 2 +- net/openvswitch/vport.c | 2 +- net/openvswitch/vport.h | 2 +- 14 files changed, 276 insertions(+), 233 deletions(-) create mode 100644 include/net/sw_flow.h
include/net/sw_flow.h new file +99 -0
@@ -0,0 +1,99 @@ +/* +* include/net/sw_flow.h - Generic switch flow structures +* Copyright (c) 2007-2012 Nicira, Inc. +* Copyright (c) 2014 Jiri Pirko <[email protected]> +* +* 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 _NET_SW_FLOW_H_ +#define _NET_SW_FLOW_H_ + +struct sw_flow_key_ipv4_tunnel { +__be64 tun_id; +__be32 ipv4_src; +__be32 ipv4_dst; +__be16 tun_flags; +u8 ipv4_tos; +u8 ipv4_ttl; +}; + +struct sw_flow_key { +struct sw_flow_key_ipv4_tunnel tun_key;/* Encapsulating tunnel key. */ +struct { +u32 priority;/* Packet QoS priority. */ +u32 skb_mark;/* SKB mark. */ +u16 in_port;/* Input switch port (or DP_MAX_PORTS). */ + } __packed phy; /* Safe when right after 'tun_key'. */ +struct { +u8 src[ETH_ALEN ];/* Ethernet source address. */ +u8 dst[ETH_ALEN ];/* Ethernet destination address. */ +__be16 tci;/* 0 if no VLAN, VLAN_TAG_PRESENT set otherwise. */ +__be16 type;/* Ethernet frame type. */ + } eth; +struct { +u8 proto;/* IP protocol or lower 8 bits of ARP opcode. */ +u8 tos;/* IP ToS. */ +u8 ttl;/* IP TTL/hop limit. */ +u8 frag;/* One of OVS_FRAG_TYPE_*. */ + } ip; +struct { +__be16 src;/* TCP/UDP/SCTP source port. */ +__be16 dst;/* TCP/UDP/SCTP destination port. */ +__be16 flags;/* TCP flags. */ + } tp; +union { +struct { +struct { +__be32 src;/* IP source address. */ +__be32 dst;/* IP destination address. */ + } addr; +struct { +u8 sha[ETH_ALEN ];/* ARP source hardware address. */ +u8 tha[ETH_ALEN ];/* ARP target hardware address. */ + } arp; + } ipv4; +struct { +struct { +struct in6_addr src;/* IPv6 source address. */ +struct in6_addr dst;/* IPv6 destination address. */ + } addr; +__be32 label;/* IPv6 flow label. */ +struct { +struct in6_addr target;/* ND target address. */ +u8 sll[ETH_ALEN ];/* ND source link layer address. */ +u8 tll[ETH_ALEN ];/* ND target link layer address. */ + } nd; + } ipv6; + }; +}__aligned(BITS_PER_LONG/8) ;/* Ensure that we can do comparisons as longs. */ + +struct sw_flow_key_range { +unsigned short int start; +unsigned short int end; +}; + +struct sw_flow_mask { +struct sw_flow_key_range range; +struct sw_flow_key key; +}; + +struct sw_flow_action { +}; + +struct sw_flow_actions { +unsigned count; +struct sw_flow_action actions[0 ]; +}; + +struct sw_flow { +struct sw_flow_key key; +struct sw_flow_key unmasked_key; +struct sw_flow_mask *mask; +struct sw_flow_actions *actions; +}; + +#endif /* _NET_SW_FLOW_H_ */
net/openvswitch/actions.c +2 -1
@@ -610,8 +610,9 @@ static int do_execute_actions(struct datapath *dp, struct sk_buff *skb,/* Execute a list of actions against 'skb'. */ int ovs_execute_actions (struct datapath *dp,struct sk_buff *skb) { -struct sw_flow_actions *acts =rcu_dereference (OVS_CB (skb)->flow->sf_acts); +struct ovs_flow_actions *acts; + acts =rcu_dereference (OVS_CB (skb)->flow->sf_acts);OVS_CB (skb)->tun_key =NULL ;return do_execute_actions (dp, skb, acts->actions, acts->actions_len); }
net/openvswitch/datapath.c +38 -36
222 lines not on this page · raw message
net/openvswitch/datapath.h +2 -2
@@ -100,9 +100,9 @@ struct datapath {* packet is not being tunneled. */ struct ovs_skb_cb { -struct sw_flow *flow; +struct ovs_flow *flow;struct sw_flow_key *pkt_key; -struct ovs_key_ipv4_tunnel *tun_key; +struct sw_flow_key_ipv4_tunnel *tun_key; };#define OVS_CB (skb) ((struct ovs_skb_cb *)(skb)->cb)
net/openvswitch/flow.c +3 -3
@@ -61,7 +61,7 @@ u64 ovs_flow_used_time(unsigned long flow_jiffies)#define TCP_FLAGS_BE16 (tp) (*(__be16 *)&tcp_flag_word(tp) & htons(0x0FFF)) -void ovs_flow_stats_update (struct sw_flow *flow,__be16 tcp_flags, +void ovs_flow_stats_update (struct ovs_flow *flow,__be16 tcp_flags,struct sk_buff *skb) {struct flow_stats *stats;
@@ -123,7 +123,7 @@ unlock: }/* Must be called with rcu_read_lock or ovs_mutex. */ -void ovs_flow_stats_get (const struct sw_flow *flow, +void ovs_flow_stats_get (const struct ovs_flow *flow,struct ovs_flow_stats *ovs_stats,unsigned long *used,__be16 *tcp_flags) {
@@ -152,7 +152,7 @@ void ovs_flow_stats_get(const struct sw_flow *flow, }/* Called with ovs_mutex. */ -void ovs_flow_stats_clear (struct sw_flow *flow) +void ovs_flow_stats_clear (struct ovs_flow *flow) {int node;
net/openvswitch/flow.h +18 -84
148 lines not on this page · raw message
net/openvswitch/flow_netlink.c +27 -26
181 lines not on this page · raw message
net/openvswitch/flow_netlink.h +5 -5
@@ -37,24 +37,24 @@#include "flow.h" -void ovs_match_init (struct sw_flow_match *match, +void ovs_match_init (struct ovs_flow_match *match,struct sw_flow_key *key,struct sw_flow_mask *mask);int ovs_nla_put_flow (const struct sw_flow_key *,const struct sw_flow_key *,struct sk_buff *);int ovs_nla_get_flow_metadata (struct sw_flow *flow,const struct nlattr *attr); -int ovs_nla_get_match (struct sw_flow_match *match, +int ovs_nla_get_match (struct ovs_flow_match *match,const struct nlattr *,const struct nlattr *);int ovs_nla_copy_actions (const struct nlattr *attr,const struct sw_flow_key *key,int depth, -struct sw_flow_actions **sfa); +struct ovs_flow_actions **sfa);int ovs_nla_put_actions (const struct nlattr *attr,int len,struct sk_buff *skb); -struct sw_flow_actions *ovs_nla_alloc_flow_actions (int actions_len); -void ovs_nla_free_flow_actions (struct sw_flow_actions *); +struct ovs_flow_actions *ovs_nla_alloc_flow_actions (int actions_len); +void ovs_nla_free_flow_actions (struct ovs_flow_actions *);#endif /* flow_netlink.h */
net/openvswitch/flow_table.c +62 -56
298 lines not on this page · raw message
net/openvswitch/flow_table.h +15 -15
@@ -57,29 +57,29 @@ extern struct kmem_cache *flow_stats_cache;int ovs_flow_init (void );void ovs_flow_exit (void ); -struct sw_flow *ovs_flow_alloc (void ); -void ovs_flow_free (struct sw_flow *,bool deferred); +struct ovs_flow *ovs_flow_alloc (void ); +void ovs_flow_free (struct ovs_flow *,bool deferred);int ovs_flow_tbl_init (struct flow_table *);int ovs_flow_tbl_count (struct flow_table *table);void ovs_flow_tbl_destroy (struct flow_table *table,bool deferred);int ovs_flow_tbl_flush (struct flow_table *flow_table); -int ovs_flow_tbl_insert (struct flow_table *table,struct sw_flow *flow, +int ovs_flow_tbl_insert (struct flow_table *table,struct ovs_flow *flow,struct sw_flow_mask *mask); -void ovs_flow_tbl_remove (struct flow_table *table,struct sw_flow *flow); +void ovs_flow_tbl_remove (struct flow_table *table,struct ovs_flow *flow);int ovs_flow_tbl_num_masks (const struct flow_table *table); -struct sw_flow *ovs_flow_tbl_dump_next (struct table_instance *table, -u32 *bucket,u32 *idx); -struct sw_flow *ovs_flow_tbl_lookup_stats (struct flow_table *, -const struct sw_flow_key *, -u32 *n_mask_hit); -struct sw_flow *ovs_flow_tbl_lookup (struct flow_table *, -const struct sw_flow_key *); -struct sw_flow *ovs_flow_tbl_lookup_exact (struct flow_table *tbl, -struct sw_flow_match *match); -bool ovs_flow_cmp_unmasked_key (const struct sw_flow *flow, -struct sw_flow_match *match); +struct ovs_flow *ovs_flow_tbl_dump_next (struct table_instance *table, +u32 *bucket,u32 *idx); +struct ovs_flow *ovs_flow_tbl_lookup_stats (struct flow_table *, +const struct sw_flow_key *, +u32 *n_mask_hit); +struct ovs_flow *ovs_flow_tbl_lookup (struct flow_table *, +const struct sw_flow_key *); +struct ovs_flow *ovs_flow_tbl_lookup_exact (struct flow_table *tbl, +struct ovs_flow_match *match); +bool ovs_flow_cmp_unmasked_key (const struct ovs_flow *flow, +struct ovs_flow_match *match);void ovs_flow_mask_key (struct sw_flow_key *dst,const struct sw_flow_key *src,const struct sw_flow_mask *mask);
net/openvswitch/vport-gre.c +2 -2
@@ -63,7 +63,7 @@ static __be16 filter_tnl_flags(__be16 flags)static struct sk_buff *__build_header (struct sk_buff *skb,int tunnel_hlen) { -const struct ovs_key_ipv4_tunnel *tun_key =OVS_CB (skb)->tun_key; +const struct sw_flow_key_ipv4_tunnel *tun_key =OVS_CB (skb)->tun_key;struct tnl_ptk_info tpi; skb =gre_handle_offloads (skb, !!(tun_key->tun_flags &TUNNEL_CSUM ));
@@ -92,7 +92,7 @@ static __be64 key_to_tunnel_id(__be32 key, __be32 seq)static int gre_rcv (struct sk_buff *skb,const struct tnl_ptk_info *tpi) { -struct ovs_key_ipv4_tunnel tun_key; +struct sw_flow_key_ipv4_tunnel tun_key;struct ovs_net *ovs_net;struct vport *vport;__be64 key;
net/openvswitch/vport-vxlan.c +1 -1
@@ -58,7 +58,7 @@ static inline struct vxlan_port *vxlan_vport(const struct vport *vport)/* Called with rcu_read_lock and BH disabled. */ static void vxlan_rcv (struct vxlan_sock *vs,struct sk_buff *skb,__be32 vx_vni) { -struct ovs_key_ipv4_tunnel tun_key; +struct sw_flow_key_ipv4_tunnel tun_key;struct vport *vport = vs->data;struct iphdr *iph;__be64 key;
net/openvswitch/vport.c +1 -1
@@ -438,7 +438,7 @@ u32 ovs_vport_find_upcall_portid(const struct vport *p, struct sk_buff *skb)* skb->data should point to the Ethernet header. */ void ovs_vport_receive (struct vport *vport,struct sk_buff *skb, -struct ovs_key_ipv4_tunnel *tun_key) +struct sw_flow_key_ipv4_tunnel *tun_key) {struct pcpu_sw_netstats *stats;
net/openvswitch/vport.h +1 -1
@@ -210,7 +210,7 @@ static inline struct vport *vport_from_priv(void *priv) }void ovs_vport_receive (struct vport *,struct sk_buff *, -struct ovs_key_ipv4_tunnel *); +struct sw_flow_key_ipv4_tunnel *);/* List of statically compiled vport implementations. Don't forget to also * add yours to the list at the top of vport.c. */
Signature · 1 line
1.9.3
A message that is not in the archive (sent off-list or not yet received): 1409736300-12303-2-git-send-email-jiri-rHqAuBHg3fBzbRFIqnYvSA@public.gmane.org
Re: [patch net-next 01/13] openvswitch: split flow structures into ovs specific and generic ones
Quoted 4 lines · Jiri Pirko
After this, flow related structures can be used in other code.
Signed-off-by Jiri Pirko <[email protected]>---
Hi Jiri,
As I indicated before I'm looking into integrating this with some hardware here. Progress is a bit slow but starting to look at it.The i40e/ixgbe driver being one open source example with very limited support for tables, flow matches, etc. And then a closed source driver with much more flexibility. What I don't have is a middle of the road switch to work with something better then a host nic but not as flexible as a TOR.
Couple questions my assumption here is I can extend the flow_key as needed to support additional match criteria my hardware has. I scanned the ./net/openvswitch source and I didn't catch any place that would break but might need to take a closer look. Similarly the actions set will need to be extended. For example if I want to use this with i40e a OVS_ACTION_ATTR_QUEUE could be used to steer packets to the queue. With this in mind we will want a follow up patch to rename OVS_ACTION_ATTR_* to FLOW_ACTION_ATTR_*
Also I have some filters that can match on offset/length/mask tuples. As far as I can tell this is going to have to be yet another interface? Or would it be worth the effort to define the flow key more generically. My initial guess is I'll just write a separate interface. I think this is what Jamal referred to as another "classifier".
Thanks,
John
[...]
Quoted 85 lines
include/net/sw_flow.h new file +85
-0+ +struct sw_flow_key_ipv4_tunnel { +__be64 tun_id; +__be32 ipv4_src; +__be32 ipv4_dst; +__be16 tun_flags; +u8 ipv4_tos; +u8 ipv4_ttl; +}; + +struct sw_flow_key { +struct sw_flow_key_ipv4_tunnel tun_key;/* Encapsulating tunnel key. */ +struct { +u32 priority;/* Packet QoS priority. */ +u32 skb_mark;/* SKB mark. */ +u16 in_port;/* Input switch port (or DP_MAX_PORTS). */ + } __packed phy; /* Safe when right after 'tun_key'. */ +struct { +u8 src[ETH_ALEN ];/* Ethernet source address. */ +u8 dst[ETH_ALEN ];/* Ethernet destination address. */ +__be16 tci;/* 0 if no VLAN, VLAN_TAG_PRESENT set otherwise. */ +__be16 type;/* Ethernet frame type. */ + } eth; +struct { +u8 proto;/* IP protocol or lower 8 bits of ARP opcode. */ +u8 tos;/* IP ToS. */ +u8 ttl;/* IP TTL/hop limit. */ +u8 frag;/* One of OVS_FRAG_TYPE_*. */ + } ip; +struct { +__be16 src;/* TCP/UDP/SCTP source port. */ +__be16 dst;/* TCP/UDP/SCTP destination port. */ +__be16 flags;/* TCP flags. */ + } tp; +union { +struct { +struct { +__be32 src;/* IP source address. */ +__be32 dst;/* IP destination address. */ + } addr; +struct { +u8 sha[ETH_ALEN ];/* ARP source hardware address. */ +u8 tha[ETH_ALEN ];/* ARP target hardware address. */ + } arp; + } ipv4; +struct { +struct { +struct in6_addr src;/* IPv6 source address. */ +struct in6_addr dst;/* IPv6 destination address. */ + } addr; +__be32 label;/* IPv6 flow label. */ +struct { +struct in6_addr target;/* ND target address. */ +u8 sll[ETH_ALEN ];/* ND source link layer address. */ +u8 tll[ETH_ALEN ];/* ND target link layer address. */ + } nd; + } ipv6; + }; +}__aligned(BITS_PER_LONG/8) ;/* Ensure that we can do comparisons as longs. */ + +struct sw_flow_key_range { +unsigned short int start; +unsigned short int end; +}; + +struct sw_flow_mask { +struct sw_flow_key_range range; +struct sw_flow_key key; +}; + +struct sw_flow_action { +}; + +struct sw_flow_actions { +unsigned count; +struct sw_flow_action actions[0 ]; +}; + +struct sw_flow { +struct sw_flow_key key; +struct sw_flow_key unmasked_key; +struct sw_flow_mask *mask; +struct sw_flow_actions *actions; +}; +
Signature · 1 line
John Fastabend Intel Corporation
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [patch net-next 01/13] openvswitch: split flow structures into ovs specific and generic ones
Quoted 18 lines · John Fastabend
Quoted 5 lines · Jiri Pirko
After this, flow related structures can be used in other code.
Signed-off-by Jiri Pirko <[email protected]>---
Hi Jiri,
As I indicated before I'm looking into integrating this with some hardware here. Progress is a bit slow but starting to look at it.The i40e/ixgbe driver being one open source example with very limited support for tables, flow matches, etc. And then a closed source driver with much more flexibility. What I don't have is a middle of the road switch to work with something better then a host nic but not as flexible as a TOR.
Quoted 10 lines
Couple questions my assumption here is I can extend the
flow_keyas needed to support additional match criteria my hardware has. I scanned the ./net/openvswitch source and I didn't catch any place that would break but might need to take a closer look. Similarly the actions set will need to be extended. For example if I want to use this with i40e aOVS_ACTION_ATTR_QUEUEcould be used to steer packets to the queue. With this in mind we will want a follow up patch to rename OVS_ACTION_ATTR_* to FLOW_ACTION_ATTR_*
struct sw_flow_key is internal structure of OVS, it is designed to have better flow-table performance. By adding hw specific fields in sw_flow_key, it increase flow-key size and that has negative impact on OVS software switching performance. Therefore it is better not to share this internal structure with driver interface.
Thanks.
Quoted 119 lines
Also I have some filters that can match on offset/length/mask tuples. As far as I can tell this is going to have to be yet another interface? Or would it be worth the effort to define the flow key more generically. My initial guess is I'll just write a separate interface. I think this is what Jamal referred to as another "classifier".
Thanks,
John[...]
Quoted 91 lines
include/net/sw_flow.h new file +12
-0+ +struct sw_flow_key_ipv4_tunnel { +__be64 tun_id; +__be32 ipv4_src; +__be32 ipv4_dst; +__be16 tun_flags; +u8 ipv4_tos; +u8 ipv4_ttl; +}; + +struct sw_flow_key { +struct sw_flow_key_ipv4_tunnel tun_key;/* Encapsulating tunnel key. */
include/net/sw_flow.h new file +4
-0+struct { +u32 priority;/* Packet QoS priority. */ +u32 skb_mark;/* SKB mark. */ +u16 in_port;/* Input switch port (or
DP_MAX_PORTS). */include/net/sw_flow.h new file +4
-0+ }__packed phy;/* Safe when right after 'tun_key'. */ +struct { +u8 src[ETH_ALEN ];/* Ethernet source address. */ +u8 dst[ETH_ALEN ];/* Ethernet destination address. */
+__be16tci; /* 0 if no VLAN,VLAN_TAG_PRESENT
set otherwise. */include/net/sw_flow.h new file +4
-0+__be16 type;/* Ethernet frame type. */ + } eth; +struct { +u8 proto;/* IP protocol or lower 8 bits of ARP opcode. */
include/net/sw_flow.h new file +7
-0+u8 tos;/* IP ToS. */ +u8 ttl;/* IP TTL/hop limit. */ +u8 frag;/* One of OVS_FRAG_TYPE_*. */ + } ip; +struct { +__be16 src;/* TCP/UDP/SCTP source port. */ +__be16 dst;/* TCP/UDP/SCTP destination port. */
include/net/sw_flow.h new file +7
-0+__be16 flags;/* TCP flags. */ + } tp; + union { + struct { + struct { + __be32 src; /* IP source address. */ + __be32 dst; /* IP destination address.*/
include/net/sw_flow.h new file +3
-0+ } addr; +struct { +u8 sha[ETH_ALEN ];/* ARP source hardware address. */
+ u8 tha[ETH_ALEN]; /* ARP target
hardware address. */include/net/sw_flow.h new file +5
-0+ } arp; + } ipv4; + struct { + struct { + struct in6_addr src; /* IPv6 sourceaddress. */
+ structin6_addrdst; /* IPv6
destination address. */(quoted diff) +2
-0+ } addr; + __be32 label; /* IPv6 flowlabel. */
(quoted diff) +2
-0+ struct { + struct in6_addr target; /* ND targetaddress. */
+ u8 sll[ETH_ALEN]; /* ND source link
layer address. */
+ u8 tll[ETH_ALEN]; /* ND target link
layer address. */include/net/sw_flow.h new file +4
-0+ } nd; + } ipv6; + }; +}__aligned(BITS_PER_LONG/8) ;/* Ensure that we can do comparisons as longs. */
include/net/sw_flow.h new file +16
-0+ +struct sw_flow_key_range { +unsigned short int start; +unsigned short int end; +}; + +struct sw_flow_mask { +struct sw_flow_key_range range; +struct sw_flow_key key; +}; + +struct sw_flow_action { +}; + +struct sw_flow_actions { +unsigned count;include/net/sw_flow.h line 98
Quoted 10 lines
include/net/sw_flow.h new file +10
-0+struct sw_flow_action actions[0 ]; +}; + +struct sw_flow { +struct sw_flow_key key; +struct sw_flow_key unmasked_key; +struct sw_flow_mask *mask; +struct sw_flow_actions *actions; +}; +--
John Fastabend Intel Corporation
A message that is not in the archive (sent off-list or not yet received): CALnjE+rk26Om1O5_Q=8tn7eAyh4Ywen-1+UD_nCVj_geZY1HuQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Re: [patch net-next 01/13] openvswitch: split flow structures into ovs specific and generic ones
Quoted 30 lines · Wed, Sep 03, 2014 at 08:42:18PM CEST, [email protected]…
Quoted 18 lines · John Fastabend
Quoted 5 lines · Jiri Pirko
After this, flow related structures can be used in other code.
Signed-off-by Jiri Pirko <[email protected]>---
Hi Jiri,
As I indicated before I'm looking into integrating this with some hardware here. Progress is a bit slow but starting to look at it.The i40e/ixgbe driver being one open source example with very limited support for tables, flow matches, etc. And then a closed source driver with much more flexibility. What I don't have is a middle of the road switch to work with something better then a host nic but not as flexible as a TOR.
Quoted 10 lines
Couple questions my assumption here is I can extend the
flow_keyas needed to support additional match criteria my hardware has. I scanned the ./net/openvswitch source and I didn't catch any place that would break but might need to take a closer look. Similarly the actions set will need to be extended. For example if I want to use this with i40e aOVS_ACTION_ATTR_QUEUEcould be used to steer packets to the queue. With this in mind we will want a follow up patch to rename OVS_ACTION_ATTR_* to FLOW_ACTION_ATTR_*
Quoted 5 lines
struct
sw_flow_keyis internal structure of OVS, it is designed to have better flow-table performance. By adding hw specific fields insw_flow_key, it increase flow-key size and that has negative impact on OVS software switching performance. Therefore it is better not to share this internal structure with driver interface.
Ok. I will split this leaving the sw_flow_key into ovs and introducing new one. Thanks.
Quoted 122 lines
Thanks.
Quoted 119 lines
Also I have some filters that can match on offset/length/mask tuples. As far as I can tell this is going to have to be yet another interface? Or would it be worth the effort to define the flow key more generically. My initial guess is I'll just write a separate interface. I think this is what Jamal referred to as another "classifier".
Thanks,
John[...]
Quoted 91 lines
include/net/sw_flow.h new file +12
-0+ +struct sw_flow_key_ipv4_tunnel { +__be64 tun_id; +__be32 ipv4_src; +__be32 ipv4_dst; +__be16 tun_flags; +u8 ipv4_tos; +u8 ipv4_ttl; +}; + +struct sw_flow_key { +struct sw_flow_key_ipv4_tunnel tun_key;/* Encapsulating tunnel key. */
include/net/sw_flow.h new file +4
-0+struct { +u32 priority;/* Packet QoS priority. */ +u32 skb_mark;/* SKB mark. */ +u16 in_port;/* Input switch port (or
DP_MAX_PORTS). */include/net/sw_flow.h new file +4
-0+ }__packed phy;/* Safe when right after 'tun_key'. */ +struct { +u8 src[ETH_ALEN ];/* Ethernet source address. */ +u8 dst[ETH_ALEN ];/* Ethernet destination address. */
+__be16tci; /* 0 if no VLAN,VLAN_TAG_PRESENT
set otherwise. */include/net/sw_flow.h new file +4
-0+__be16 type;/* Ethernet frame type. */ + } eth; +struct { +u8 proto;/* IP protocol or lower 8 bits of ARP opcode. */
include/net/sw_flow.h new file +7
-0+u8 tos;/* IP ToS. */ +u8 ttl;/* IP TTL/hop limit. */ +u8 frag;/* One of OVS_FRAG_TYPE_*. */ + } ip; +struct { +__be16 src;/* TCP/UDP/SCTP source port. */ +__be16 dst;/* TCP/UDP/SCTP destination port. */
include/net/sw_flow.h new file +7
-0+__be16 flags;/* TCP flags. */ + } tp; + union { + struct { + struct { + __be32 src; /* IP source address. */ + __be32 dst; /* IP destination address.*/
include/net/sw_flow.h new file +3
-0+ } addr; +struct { +u8 sha[ETH_ALEN ];/* ARP source hardware address. */
+ u8 tha[ETH_ALEN]; /* ARP target
hardware address. */include/net/sw_flow.h new file +5
-0+ } arp; + } ipv4; + struct { + struct { + struct in6_addr src; /* IPv6 sourceaddress. */
+ structin6_addrdst; /* IPv6
destination address. */(quoted diff) +2
-0+ } addr; + __be32 label; /* IPv6 flowlabel. */
(quoted diff) +2
-0+ struct { + struct in6_addr target; /* ND targetaddress. */
+ u8 sll[ETH_ALEN]; /* ND source link
layer address. */
+ u8 tll[ETH_ALEN]; /* ND target link
layer address. */include/net/sw_flow.h new file +4
-0+ } nd; + } ipv6; + }; +}__aligned(BITS_PER_LONG/8) ;/* Ensure that we can do comparisons as longs. */
include/net/sw_flow.h new file +16
-0+ +struct sw_flow_key_range { +unsigned short int start; +unsigned short int end; +}; + +struct sw_flow_mask { +struct sw_flow_key_range range; +struct sw_flow_key key; +}; + +struct sw_flow_action { +}; + +struct sw_flow_actions { +unsigned count;include/net/sw_flow.h line 98
Quoted 10 lines
include/net/sw_flow.h new file +10
-0+struct sw_flow_action actions[0 ]; +}; + +struct sw_flow { +struct sw_flow_key key; +struct sw_flow_key unmasked_key; +struct sw_flow_mask *mask; +struct sw_flow_actions *actions; +}; +--
John Fastabend Intel Corporation
Re: [patch net-next 01/13] openvswitch: split flow structures into ovs specific and generic ones
In reply to a message not in the archiveQuoted 26 lines · Wed, Sep 03, 2014 at 05:20:25PM CEST, john.fastabend-Re5JQEeQqe8AvxtiuMwx3w@pub…
Quoted 4 lines · Jiri Pirko
After this, flow related structures can be used in other code.
Signed-off-by Jiri Pirko <[email protected]>---
Hi Jiri,
As I indicated before I'm looking into integrating this with some hardware here. Progress is a bit slow but starting to look at it.The i40e/ixgbe driver being one open source example with very limited support for tables, flow matches, etc. And then a closed source driver with much more flexibility. What I don't have is a middle of the road switch to work with something better then a host nic but not as flexible as a TOR.
Couple questions my assumption here is I can extend the
flow_keyas needed to support additional match criteria my hardware has. I scanned the ./net/openvswitch source and I didn't catch any place that would break but might need to take a closer look. Similarly the actions set will need to be extended. For example if I want to use this with i40e aOVS_ACTION_ATTR_QUEUEcould be used to steer packets to the queue. With this in mind we will want a follow up patch to rename OVS_ACTION_ATTR_* to FLOW_ACTION_ATTR_*
Quoted 6 lines
Also I have some filters that can match on offset/length/mask tuples. As far as I can tell this is going to have to be yet another interface? Or would it be worth the effort to define the flow key more generically. My initial guess is I'll just write a separate interface. I think this is what Jamal referred to as another "classifier".
I'm thinking about using some more generic match key. It would incorporate ovs key and possible other classifiers (as your off/len/mask) as well. Drivers will have free will to implement whatever the hw supports.
Will do it for the next version of the patchset (most probably after I return from holliday, Sep 15).
Quoted 95 lines
Thanks,
John[...]
Quoted 85 lines
include/net/sw_flow.h new file +85
-0+ +struct sw_flow_key_ipv4_tunnel { +__be64 tun_id; +__be32 ipv4_src; +__be32 ipv4_dst; +__be16 tun_flags; +u8 ipv4_tos; +u8 ipv4_ttl; +}; + +struct sw_flow_key { +struct sw_flow_key_ipv4_tunnel tun_key;/* Encapsulating tunnel key. */ +struct { +u32 priority;/* Packet QoS priority. */ +u32 skb_mark;/* SKB mark. */ +u16 in_port;/* Input switch port (or DP_MAX_PORTS). */ + } __packed phy; /* Safe when right after 'tun_key'. */ +struct { +u8 src[ETH_ALEN ];/* Ethernet source address. */ +u8 dst[ETH_ALEN ];/* Ethernet destination address. */ +__be16 tci;/* 0 if no VLAN, VLAN_TAG_PRESENT set otherwise. */ +__be16 type;/* Ethernet frame type. */ + } eth; +struct { +u8 proto;/* IP protocol or lower 8 bits of ARP opcode. */ +u8 tos;/* IP ToS. */ +u8 ttl;/* IP TTL/hop limit. */ +u8 frag;/* One of OVS_FRAG_TYPE_*. */ + } ip; +struct { +__be16 src;/* TCP/UDP/SCTP source port. */ +__be16 dst;/* TCP/UDP/SCTP destination port. */ +__be16 flags;/* TCP flags. */ + } tp; +union { +struct { +struct { +__be32 src;/* IP source address. */ +__be32 dst;/* IP destination address. */ + } addr; +struct { +u8 sha[ETH_ALEN ];/* ARP source hardware address. */ +u8 tha[ETH_ALEN ];/* ARP target hardware address. */ + } arp; + } ipv4; +struct { +struct { +struct in6_addr src;/* IPv6 source address. */ +struct in6_addr dst;/* IPv6 destination address. */ + } addr; +__be32 label;/* IPv6 flow label. */ +struct { +struct in6_addr target;/* ND target address. */ +u8 sll[ETH_ALEN ];/* ND source link layer address. */ +u8 tll[ETH_ALEN ];/* ND target link layer address. */ + } nd; + } ipv6; + }; +}__aligned(BITS_PER_LONG/8) ;/* Ensure that we can do comparisons as longs. */ + +struct sw_flow_key_range { +unsigned short int start; +unsigned short int end; +}; + +struct sw_flow_mask { +struct sw_flow_key_range range; +struct sw_flow_key key; +}; + +struct sw_flow_action { +}; + +struct sw_flow_actions { +unsigned count; +struct sw_flow_action actions[0 ]; +}; + +struct sw_flow { +struct sw_flow_key key; +struct sw_flow_key unmasked_key; +struct sw_flow_mask *mask; +struct sw_flow_actions *actions; +}; +Signature · 1 line
John Fastabend Intel Corporation
Re: [patch net-next 01/13] openvswitch: split flow structures into ovs specific and generic ones
In reply to John FastabendQuoted 7 lines · John Fastabend
Also I have some filters that can match on offset/length/mask tuples. As far as I can tell this is going to have to be yet another interface? Or would it be worth the effort to define the flow key more generically. My initial guess is I'll just write a separate interface. I think this is what Jamal referred to as another "classifier".
Exactly. I have more complex classifiers as stated earlier. I am afraid these patches again are not satisfying that need.
In any case - we are taking a different tact than these patches do and hopefully at some point we can merge thoughts.
cheers,
jamal
Re: [patch net-next 01/13] openvswitch: split flow structures into ovs specific and generic ones
In reply to Jiri PirkoQuoted 90 lines · Jiri Pirko
After this, flow related structures can be used in other code.
Signed-off-by Jiri Pirko <[email protected]>--- include/net/sw_flow.h | 99 ++++++++++++++++++++++++++++++++++ net/openvswitch/actions.c | 3 +- net/openvswitch/datapath.c | 74 +++++++++++++------------- net/openvswitch/datapath.h | 4 +- net/openvswitch/flow.c | 6 +-- net/openvswitch/flow.h | 102 +++++++---------------------------- net/openvswitch/flow_netlink.c | 53 +++++++++--------- net/openvswitch/flow_netlink.h | 10 ++-- net/openvswitch/flow_table.c | 118 ++++++++++++++++++++++------------------- net/openvswitch/flow_table.h | 30 +++++------ net/openvswitch/vport-gre.c | 4 +- net/openvswitch/vport-vxlan.c | 2 +- net/openvswitch/vport.c | 2 +- net/openvswitch/vport.h | 2 +- 14 files changed, 276 insertions(+), 233 deletions(-) create mode 100644 include/net/sw_flow.hinclude/net/sw_flow.h new file +63
-0@@ -0,0 +1,99 @@ +/* +* include/net/sw_flow.h - Generic switch flow structures +* Copyright (c) 2007-2012 Nicira, Inc. +* Copyright (c) 2014 Jiri Pirko <[email protected]> +* +* 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 _NET_SW_FLOW_H_ +#define _NET_SW_FLOW_H_ + +struct sw_flow_key_ipv4_tunnel { + __be64 tun_id; + __be32 ipv4_src; + __be32 ipv4_dst; + __be16 tun_flags; + u8 ipv4_tos; + u8 ipv4_ttl; +}; + +struct sw_flow_key { + struct sw_flow_key_ipv4_tunnel tun_key; /* Encapsulating tunnel key. */ + struct { + u32 priority; /* Packet QoS priority. */ + u32 skb_mark; /* SKB mark. */ + u16 in_port; /* Input switch port (or DP_MAX_PORTS). */ + } __packed phy; /* Safe when right after 'tun_key'. */ + struct { + u8 src[ETH_ALEN]; /* Ethernet source address. */ + u8 dst[ETH_ALEN]; /* Ethernet destination address. */ + __be16 tci; /* 0 if no VLAN, VLAN_TAG_PRESENT set otherwise. */ + __be16 type; /* Ethernet frame type. */ + } eth; + struct { + u8 proto; /* IP protocol or lower 8 bits of ARP opcode. */ + u8 tos; /* IP ToS. */ + u8 ttl; /* IP TTL/hop limit. */ + u8 frag; /* One of OVS_FRAG_TYPE_*. */ + } ip; + struct { + __be16 src; /* TCP/UDP/SCTP source port. */ + __be16 dst; /* TCP/UDP/SCTP destination port. */ + __be16 flags; /* TCP flags. */ + } tp; + union { + struct { + struct { + __be32 src; /* IP source address. */ + __be32 dst; /* IP destination address. */ + } addr; + struct { + u8 sha[ETH_ALEN]; /* ARP source hardware address. */ + u8 tha[ETH_ALEN]; /* ARP target hardware address. */ + } arp; + } ipv4; + struct { + struct { + struct in6_addr src; /* IPv6 source address. */ + struct in6_addr dst; /* IPv6 destination address. */ + } addr;
include/net/sw_flow.h line 73
Quoted 10 lines
include/net/sw_flow.h new file +10
-0+__be32 label;/* IPv6 flow label. */ +struct { +struct in6_addr target;/* ND target address. */ +u8 sll[ETH_ALEN ];/* ND source link layer address. */ +u8 tll[ETH_ALEN ];/* ND target link layer address. */ + } nd; + } ipv6; + }; +}__aligned(BITS_PER_LONG/8) ;/* Ensure that we can do comparisons as longs. */ +
HW offload API should be separate from OVS module. This has following advantages.
1. It can be managed by OVS userspace vswitchd process which has much better context to setup hardware flow table. Once we add capabilities for swdev, it is much more easier for vswitchd process to choose correct (hw or sw) flow table for given flow.
2. Other application that wants to use HW offload does not have dependency on OVS kernel module.
3. Hardware and software datapath remains separate, these two components has no dependency on each other, both can be developed independent of each other.
Thanks.
Re: [patch net-next 01/13] openvswitch: split flow structures into ovs specific and generic ones
Quoted 3 lines · Pravin Shelar
On Wed, Sep 3, 2014 at 2:24 AM, Jiri Pirko <[email protected]> wrote:
HW offload API should be separate from OVS module.
The above part i agree with. Infact it is very odd that it seems hard to get this point across ;->
Quoted 6 lines
This has following
advantages.
1. It can be managed by OVS userspace vswitchd process which has much better context to setup hardware flow table. Once we add capabilities for swdev, it is much more easier for vswitchd process to choose correct (hw or sw) flow table for given flow.
This i disagree with.
The desire is to have existing user tools to work with offloads. When necessary, we then create new tools.
Existing tools may need to be taught to do selectively do hardware vs software offload. We have a precedence with bridging code which selectively offloads to hardware using iproute2.
Quoted 2 lines
2. Other application that wants to use HW offload does not have dependency on OVS kernel module.
Or on OF for that matter.
Quoted 4 lines
3. Hardware and software datapath remains separate, these two components has no dependency on each other, both can be developed independent of each other.
The basic definition of "offload" implies dependency;-> So, I strongly disagree. You may need to go backwards and look at views expressed on this (other than emails - theres slideware).
cheers,
jamal
A message that is not in the archive (sent off-list or not yet received): 54078694.5040104-jkUAjuhPggJWk0Htik3J/[email protected]
Re: [patch net-next 01/13] openvswitch: split flow structures into ovs specific and generic ones
Quoted 20 lines · Jamal Hadi Salim
Quoted 5 lines · Pravin Shelar
On Wed, Sep 3, 2014 at 2:24 AM, Jiri Pirko <[email protected]> wrote:
HW offload API should be separate from OVS module.
The above part i agree with. Infact it is very odd that it seems hard to get this point across ;->
Quoted 6 lines
This has following
advantages.
1. It can be managed by OVS userspace vswitchd process which has much better context to setup hardware flow table. Once we add capabilities for swdev, it is much more easier for vswitchd process to choose correct (hw or sw) flow table for given flow.
Quoted 7 lines
This i disagree with.
The desire is to have existing user tools to work with offloads. When necessary, we then create new tools.
Existing tools may need to be taught to do selectively do hardware vs software offload. We have a precedence with bridging code which selectively offloads to hardware using iproute2.
Both of us are saying same thing.
What I meant was for OVS use-case, where OVS wants to use offload for switching flows, vswitchd userspace process can program HW offload using kernel HW offload APIs directly from userspace, rather than going through OVS kernel module. If user wants to use some other tool, then the tool can use same kernel HW offload APIs.
Quoted 8 lines
Quoted 3 lines
2. Other application that wants to use HW offload does not have dependency on OVS kernel module.
Or on OF for that matter.
Quoted 9 lines
Quoted 4 lines
3. Hardware and software datapath remains separate, these two components has no dependency on each other, both can be developed independent of each other.
The basic definition of "offload" implies dependency;-> So, I strongly disagree. You may need to go backwards and look at views expressed on this (other than emails - theres slideware).
I was referring to code dependency in kernel. For example ovs flow-key structure used. This complicates OVS internal structure which needs to be shared plus OVS might need to extend interface for configuring HW match or action that does not exist in OVS software datapath.
I agree these two components are related and that dependency can be handled from userspace.
A message that is not in the archive (sent off-list or not yet received): CALnjE+qUqSK7kHSi5BZuA0hzFjMcZ8TCTd9JRG1PPmMfDmAQOA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Re: [patch net-next 01/13] openvswitch: split flow structures into ovs specific and generic ones
Quoted 6 lines · Pravin Shelar
Both of us are saying same thing.
What I meant was for OVS use-case, where OVS wants to use offload for switching flows, vswitchd userspace process can program HW offload using kernel HW offload APIs directly from userspace, rather than going through OVS kernel module. If user wants to use some other tool, then the tool can use same kernel HW offload APIs.
Ok, sorry, you are right - we are saying the same thing.
cheers,
jamal
A message that is not in the archive (sent off-list or not yet received): CALnjE+pscRmfhaWgkWCunJfjvG04RiNUAj6nefSFHrknQTC+xw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Re: [patch net-next 01/13] openvswitch: split flow structures into ovs specific and generic ones
Quoted 100 lines · Wed, Sep 03, 2014 at 08:41:39PM CEST, [email protected]…
Quoted 99 lines · Jiri Pirko
After this, flow related structures can be used in other code.
Signed-off-by Jiri Pirko <[email protected]>--- include/net/sw_flow.h | 99 ++++++++++++++++++++++++++++++++++ net/openvswitch/actions.c | 3 +- net/openvswitch/datapath.c | 74 +++++++++++++------------- net/openvswitch/datapath.h | 4 +- net/openvswitch/flow.c | 6 +-- net/openvswitch/flow.h | 102 +++++++---------------------------- net/openvswitch/flow_netlink.c | 53 +++++++++--------- net/openvswitch/flow_netlink.h | 10 ++-- net/openvswitch/flow_table.c | 118 ++++++++++++++++++++++------------------- net/openvswitch/flow_table.h | 30 +++++------ net/openvswitch/vport-gre.c | 4 +- net/openvswitch/vport-vxlan.c | 2 +- net/openvswitch/vport.c | 2 +- net/openvswitch/vport.h | 2 +- 14 files changed, 276 insertions(+), 233 deletions(-) create mode 100644 include/net/sw_flow.hinclude/net/sw_flow.h new file +72
-0@@ -0,0 +1,99 @@ +/* +* include/net/sw_flow.h - Generic switch flow structures +* Copyright (c) 2007-2012 Nicira, Inc. +* Copyright (c) 2014 Jiri Pirko <[email protected]> +* +* 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 _NET_SW_FLOW_H_ +#define _NET_SW_FLOW_H_ + +struct sw_flow_key_ipv4_tunnel { +__be64 tun_id; +__be32 ipv4_src; +__be32 ipv4_dst; +__be16 tun_flags; +u8 ipv4_tos; +u8 ipv4_ttl; +}; + +struct sw_flow_key { +struct sw_flow_key_ipv4_tunnel tun_key;/* Encapsulating tunnel key. */ +struct { +u32 priority;/* Packet QoS priority. */ +u32 skb_mark;/* SKB mark. */ +u16 in_port;/* Input switch port (or DP_MAX_PORTS). */ + } __packed phy; /* Safe when right after 'tun_key'. */ +struct { +u8 src[ETH_ALEN ];/* Ethernet source address. */ +u8 dst[ETH_ALEN ];/* Ethernet destination address. */ +__be16 tci;/* 0 if no VLAN, VLAN_TAG_PRESENT set otherwise. */ +__be16 type;/* Ethernet frame type. */ + } eth; +struct { +u8 proto;/* IP protocol or lower 8 bits of ARP opcode. */ +u8 tos;/* IP ToS. */ +u8 ttl;/* IP TTL/hop limit. */ +u8 frag;/* One of OVS_FRAG_TYPE_*. */ + } ip; +struct { +__be16 src;/* TCP/UDP/SCTP source port. */ +__be16 dst;/* TCP/UDP/SCTP destination port. */ +__be16 flags;/* TCP flags. */ + } tp; +union { +struct { +struct { +__be32 src;/* IP source address. */ +__be32 dst;/* IP destination address. */ + } addr; +struct { +u8 sha[ETH_ALEN ];/* ARP source hardware address. */ +u8 tha[ETH_ALEN ];/* ARP target hardware address. */ + } arp; + } ipv4; +struct { +struct { +struct in6_addr src;/* IPv6 source address. */ +struct in6_addr dst;/* IPv6 destination address. */ + } addr; +__be32 label;/* IPv6 flow label. */ +struct { +struct in6_addr target;/* ND target address. */ +u8 sll[ETH_ALEN ];/* ND source link layer address. */ +u8 tll[ETH_ALEN ];/* ND target link layer address. */ + } nd; + } ipv6; + }; +}__aligned(BITS_PER_LONG/8) ;/* Ensure that we can do comparisons as longs. */
Quoted 8 lines
include/net/sw_flow.h line 73
Quoted 1 line
include/net/sw_flow.h new file +1
-0+HW offload API should be separate from OVS module. This has following advantages.
1. It can be managed by OVS userspace vswitchd process which has much better context to setup hardware flow table. Once we add capabilities for swdev, it is much more easier for vswitchd process to choose correct (hw or sw) flow table for given flow.
The idea is to add a nl attr in ovs genl iface so the vswitchd can speficify the flow the to be in sw only, in hw only, in both. I believe that is is more convenient to let switchd to communicate flows via single iface.
Quoted 2 lines
2. Other application that wants to use HW offload does not have dependency on OVS kernel module.
That is not the case for this patchset. Userspace can insert/remove flows using the switchdev generic netlink api - see:
[patch net-next 13/13] switchdev: introduce Netlink API
Quoted 3 lines
3. Hardware and software datapath remains separate, these two components has no dependency on each other, both can be developed independent of each other.
The general idea is to have the offloads handled in-kernel. Therefore I hooked on to ovs kernel dp code.
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [patch net-next 01/13] openvswitch: split flow structures into ovs specific and generic ones
Quoted 110 lines · Jiri Pirko
Quoted 100 lines · Wed, Sep 03, 2014 at 08:41:39PM CEST, [email protected]…
Quoted 99 lines · Jiri Pirko
After this, flow related structures can be used in other code.
Signed-off-by Jiri Pirko <[email protected]>--- include/net/sw_flow.h | 99 ++++++++++++++++++++++++++++++++++ net/openvswitch/actions.c | 3 +- net/openvswitch/datapath.c | 74 +++++++++++++------------- net/openvswitch/datapath.h | 4 +- net/openvswitch/flow.c | 6 +-- net/openvswitch/flow.h | 102 +++++++---------------------------- net/openvswitch/flow_netlink.c | 53 +++++++++--------- net/openvswitch/flow_netlink.h | 10 ++-- net/openvswitch/flow_table.c | 118 ++++++++++++++++++++++------------------- net/openvswitch/flow_table.h | 30 +++++------ net/openvswitch/vport-gre.c | 4 +- net/openvswitch/vport-vxlan.c | 2 +- net/openvswitch/vport.c | 2 +- net/openvswitch/vport.h | 2 +- 14 files changed, 276 insertions(+), 233 deletions(-) create mode 100644 include/net/sw_flow.hinclude/net/sw_flow.h new file +72
-0@@ -0,0 +1,99 @@ +/* +* include/net/sw_flow.h - Generic switch flow structures +* Copyright (c) 2007-2012 Nicira, Inc. +* Copyright (c) 2014 Jiri Pirko <[email protected]> +* +* 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 _NET_SW_FLOW_H_ +#define _NET_SW_FLOW_H_ + +struct sw_flow_key_ipv4_tunnel { +__be64 tun_id; +__be32 ipv4_src; +__be32 ipv4_dst; +__be16 tun_flags; +u8 ipv4_tos; +u8 ipv4_ttl; +}; + +struct sw_flow_key { +struct sw_flow_key_ipv4_tunnel tun_key;/* Encapsulating tunnel key. */ +struct { +u32 priority;/* Packet QoS priority. */ +u32 skb_mark;/* SKB mark. */ +u16 in_port;/* Input switch port (or DP_MAX_PORTS). */ + } __packed phy; /* Safe when right after 'tun_key'. */ +struct { +u8 src[ETH_ALEN ];/* Ethernet source address. */ +u8 dst[ETH_ALEN ];/* Ethernet destination address. */ +__be16 tci;/* 0 if no VLAN, VLAN_TAG_PRESENT set otherwise. */ +__be16 type;/* Ethernet frame type. */ + } eth; +struct { +u8 proto;/* IP protocol or lower 8 bits of ARP opcode. */ +u8 tos;/* IP ToS. */ +u8 ttl;/* IP TTL/hop limit. */ +u8 frag;/* One of OVS_FRAG_TYPE_*. */ + } ip; +struct { +__be16 src;/* TCP/UDP/SCTP source port. */ +__be16 dst;/* TCP/UDP/SCTP destination port. */ +__be16 flags;/* TCP flags. */ + } tp; +union { +struct { +struct { +__be32 src;/* IP source address. */ +__be32 dst;/* IP destination address. */ + } addr; +struct { +u8 sha[ETH_ALEN ];/* ARP source hardware address. */ +u8 tha[ETH_ALEN ];/* ARP target hardware address. */ + } arp; + } ipv4; +struct { +struct { +struct in6_addr src;/* IPv6 source address. */ +struct in6_addr dst;/* IPv6 destination address. */ + } addr; +__be32 label;/* IPv6 flow label. */ +struct { +struct in6_addr target;/* ND target address. */ +u8 sll[ETH_ALEN ];/* ND source link layer address. */ +u8 tll[ETH_ALEN ];/* ND target link layer address. */ + } nd; + } ipv6; + }; +}__aligned(BITS_PER_LONG/8) ;/* Ensure that we can do comparisons as longs. */ Quoted 8 lines
include/net/sw_flow.h line 73
Quoted 1 line
include/net/sw_flow.h new file +1
-0+HW offload API should be separate from OVS module. This has following advantages.
1. It can be managed by OVS userspace vswitchd process which has much better context to setup hardware flow table. Once we add capabilities for swdev, it is much more easier for vswitchd process to choose correct (hw or sw) flow table for given flow.
Quoted 5 lines
The idea is to add a nl attr in ovs genl iface so the vswitchd can speficify the flow the to be in sw only, in hw only, in both. I believe that is is more convenient to let switchd to communicate flows via single iface.
How is it convenient? this patch complicates OVS kernel module. It add OVS interfaces for HW offload. And you need similar interfaces for switchdev device. So it duplicate code.
On the other hand if vswitchd uses common interface (switchdev) there is no need to extend ovs kernel interface. For example specifying extra metadata, like (sw only, hw olny, both).
Quoted 17 lines
Quoted 2 lines
2. Other application that wants to use HW offload does not have dependency on OVS kernel module.
That is not the case for this patchset. Userspace can insert/remove flows using the switchdev generic netlink api - see:
[patch net-next 13/13] switchdev: introduce Netlink APIQuoted 3 lines
3. Hardware and software datapath remains separate, these two components has no dependency on each other, both can be developed independent of each other.
The general idea is to have the offloads handled in-kernel. Therefore I hooked on to ovs kernel dp code.
Jiri Pirko
maintainerRe: [patch net-next 01/13] openvswitch: split flow structures into ovs specific and generic ones
Quoted 111 lines · Thu, Sep 04, 2014 at 10:46:28PM CEST, [email protected] wrote:
Quoted 110 lines · Jiri Pirko
Quoted 108 lines · Wed, Sep 03, 2014 at 08:41:39PM CEST, [email protected] wrote:
Quoted 90 lines · Jiri Pirko
After this, flow related structures can be used in other code.
Signed-off-by Jiri Pirko <[email protected]>--- include/net/sw_flow.h | 99 ++++++++++++++++++++++++++++++++++ net/openvswitch/actions.c | 3 +- net/openvswitch/datapath.c | 74 +++++++++++++------------- net/openvswitch/datapath.h | 4 +- net/openvswitch/flow.c | 6 +-- net/openvswitch/flow.h | 102 +++++++---------------------------- net/openvswitch/flow_netlink.c | 53 +++++++++--------- net/openvswitch/flow_netlink.h | 10 ++-- net/openvswitch/flow_table.c | 118 ++++++++++++++++++++++------------------- net/openvswitch/flow_table.h | 30 +++++------ net/openvswitch/vport-gre.c | 4 +- net/openvswitch/vport-vxlan.c | 2 +- net/openvswitch/vport.c | 2 +- net/openvswitch/vport.h | 2 +- 14 files changed, 276 insertions(+), 233 deletions(-) create mode 100644 include/net/sw_flow.hinclude/net/sw_flow.h new file +63
-0@@ -0,0 +1,99 @@ +/* +* include/net/sw_flow.h - Generic switch flow structures +* Copyright (c) 2007-2012 Nicira, Inc. +* Copyright (c) 2014 Jiri Pirko <[email protected]> +* +* 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 _NET_SW_FLOW_H_ +#define _NET_SW_FLOW_H_ + +struct sw_flow_key_ipv4_tunnel { + __be64 tun_id; + __be32 ipv4_src; + __be32 ipv4_dst; + __be16 tun_flags; + u8 ipv4_tos; + u8 ipv4_ttl; +}; + +struct sw_flow_key { + struct sw_flow_key_ipv4_tunnel tun_key; /* Encapsulating tunnel key. */ + struct { + u32 priority; /* Packet QoS priority. */ + u32 skb_mark; /* SKB mark. */ + u16 in_port; /* Input switch port (or DP_MAX_PORTS). */ + } __packed phy; /* Safe when right after 'tun_key'. */ + struct { + u8 src[ETH_ALEN]; /* Ethernet source address. */ + u8 dst[ETH_ALEN]; /* Ethernet destination address. */ + __be16 tci; /* 0 if no VLAN, VLAN_TAG_PRESENT set otherwise. */ + __be16 type; /* Ethernet frame type. */ + } eth; + struct { + u8 proto; /* IP protocol or lower 8 bits of ARP opcode. */ + u8 tos; /* IP ToS. */ + u8 ttl; /* IP TTL/hop limit. */ + u8 frag; /* One of OVS_FRAG_TYPE_*. */ + } ip; + struct { + __be16 src; /* TCP/UDP/SCTP source port. */ + __be16 dst; /* TCP/UDP/SCTP destination port. */ + __be16 flags; /* TCP flags. */ + } tp; + union { + struct { + struct { + __be32 src; /* IP source address. */ + __be32 dst; /* IP destination address. */ + } addr; + struct { + u8 sha[ETH_ALEN]; /* ARP source hardware address. */ + u8 tha[ETH_ALEN]; /* ARP target hardware address. */ + } arp; + } ipv4; + struct { + struct { + struct in6_addr src; /* IPv6 source address. */ + struct in6_addr dst; /* IPv6 destination address. */ + } addr;include/net/sw_flow.h line 73
Quoted 10 lines
include/net/sw_flow.h new file +10
-0+__be32 label;/* IPv6 flow label. */ +struct { +struct in6_addr target;/* ND target address. */ +u8 sll[ETH_ALEN ];/* ND source link layer address. */ +u8 tll[ETH_ALEN ];/* ND target link layer address. */ + } nd; + } ipv6; + }; +}__aligned(BITS_PER_LONG/8) ;/* Ensure that we can do comparisons as longs. */ +HW offload API should be separate from OVS module. This has following advantages.
1. It can be managed by OVS userspace vswitchd process which has much better context to setup hardware flow table. Once we add capabilities for swdev, it is much more easier for vswitchd process to choose correct (hw or sw) flow table for given flow.
Quoted 8 lines
Quoted 5 lines
The idea is to add a nl attr in ovs genl iface so the vswitchd can speficify the flow the to be in sw only, in hw only, in both. I believe that is is more convenient to let switchd to communicate flows via single iface.
How is it convenient? this patch complicates OVS kernel module. It add OVS interfaces for HW offload. And you need similar interfaces for switchdev device. So it duplicate code.
There is almost no code duplication there. And in next patchset iteration I plan to have even less.
Quoted 3 lines
On the other hand if vswitchd uses common interface (switchdev) there is no need to extend ovs kernel interface. For example specifying extra metadata, like (sw only, hw olny, both).
I understand you point of view. However from the offloading perspective it makes much more sense to push the flows through a single interface (ovs genl) and only offload selected flows to hw (pushing further). Having vswitchd to handle 2 different ifaces for the same/similar thing does not seem like a clean solution to me. And it really breaks the offloading view.
Plus the amount of code needed to be pushed into ovs kernel dp code in order to enable this is small.
Quoted 18 lines
Quoted 18 lines
Quoted 3 lines
2. Other application that wants to use HW offload does not have dependency on OVS kernel module.
That is not the case for this patchset. Userspace can insert/remove flows using the switchdev generic netlink api - see:
[patch net-next 13/13] switchdev: introduce Netlink APIQuoted 3 lines
3. Hardware and software datapath remains separate, these two components has no dependency on each other, both can be developed independent of each other.
The general idea is to have the offloads handled in-kernel. Therefore I hooked on to ovs kernel dp code.
Re: [patch net-next 01/13] openvswitch: split flow structures into ovs specific and generic ones
Quoted 12 lines · Jiri Pirko
Quoted 3 lines · Thu, Sep 04, 2014 at 10:46:28PM CEST, [email protected] wrote:
On the other hand if vswitchd uses common interface (switchdev) there is no need to extend ovs kernel interface. For example specifying extra metadata, like (sw only, hw olny, both).
I understand you point of view. However from the offloading perspective it makes much more sense to push the flows through a single interface (ovs genl) and only offload selected flows to hw (pushing further). Having vswitchd to handle 2 different ifaces for the same/similar thing does not seem like a clean solution to me. And it really breaks the offloading view.
Quoted 2 lines
Plus the amount of code needed to be pushed into ovs kernel dp code in order to enable this is small.
This is missing the point: software forwarding and a hardware driver interface are doing totally different things. Over time, these will diverge and you will essentially up with two separate paths packed together which doesn't help anything. This is not a theoretical concern as different directions either already exist or have been proposed. On the software side, there is the BPF proposal which is not likely to map to hardware any time soon. On the other hand, hardware is usually composed of multiple tables/functions with varying capabilities. Sooner or later you will want to take advantage of these and doing so isn't really possible with the software optimized flows that the kernel handles. At that point, you will likely introduce a new interface to userspace to expose this and get flows processed in a different way.
Jiri Pirko
maintainerPATCH 2/13 net: rename netdev_phys_port_id to more generic name
In reply to Jiri PirkoSo this can be reused for identification of other "items" as well.
--- drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 2 +- drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +- drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 2 +- drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 2 +- include/linux/netdevice.h | 16 ++++++++-------- net/core/dev.c | 2 +- net/core/net-sysfs.c | 2 +- net/core/rtnetlink.c | 6 +++--- 8 files changed, 17 insertions(+), 17 deletions(-)
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +1 -1
@@ -12410,7 +12410,7 @@ static int bnx2x_validate_addr(struct net_device *dev) }static int bnx2x_get_phys_port_id (struct net_device *netdev, -struct netdev_phys_port_id *ppid) +struct netdev_phys_item_id *ppid) {struct bnx2x *bp =netdev_priv (netdev);
drivers/net/ethernet/intel/i40e/i40e_main.c +1 -1
@@ -7336,7 +7336,7 @@ static void i40e_del_vxlan_port(struct net_device *netdev,#endif static int i40e_get_phys_port_id (struct net_device *netdev, -struct netdev_phys_port_id *ppid) +struct netdev_phys_item_id *ppid) {struct i40e_netdev_priv *np =netdev_priv (netdev);struct i40e_pf *pf = np->vsi->back;
drivers/net/ethernet/mellanox/mlx4/en_netdev.c +1 -1
@@ -2276,7 +2276,7 @@ static int mlx4_en_set_vf_link_state(struct net_device *dev, int vf, int link_st#define PORT_ID_BYTE_LEN 8static int mlx4_en_get_phys_port_id (struct net_device *dev, -struct netdev_phys_port_id *ppid) +struct netdev_phys_item_id *ppid) {struct mlx4_en_priv *priv =netdev_priv (dev);struct mlx4_dev *mdev = priv->mdev->dev;
drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c +1 -1
@@ -460,7 +460,7 @@ static void qlcnic_82xx_cancel_idc_work(struct qlcnic_adapter *adapter) }static int qlcnic_get_phys_port_id (struct net_device *netdev, -struct netdev_phys_port_id *ppid) +struct netdev_phys_item_id *ppid) {struct qlcnic_adapter *adapter =netdev_priv (netdev);struct qlcnic_hardware_context *ahw = adapter->ahw;
include/linux/netdevice.h +8 -8
@@ -739,13 +739,13 @@ struct netdev_fcoe_hbainfo { };#endif -#define MAX_PHYS_PORT_ID_LEN 32 +#define MAX_PHYS_ITEM_ID_LEN 32 -/* This structure holds a unique identifier to identify the -* physical port used by a netdevice. +/* This structure holds a unique identifier to identify some +* physical item (port for example) used by a netdevice. */ -struct netdev_phys_port_id { -unsigned char id[MAX_PHYS_PORT_ID_LEN ]; +struct netdev_phys_item_id { +unsigned char id[MAX_PHYS_ITEM_ID_LEN ];unsigned char id_len; };
@@ -961,7 +961,7 @@ typedef u16 (*select_queue_fallback_t)(struct net_device *dev,* USB_CDC_NOTIFY_NETWORK_CONNECTION) should NOT implement this function. * * int (*ndo_get_phys_port_id)(struct net_device *dev, -* struct netdev_phys_port_id *ppid); +* struct netdev_phys_item_id *ppid); * Called to get ID of physical port of this device. If driver does * not implement this, it is assumed that the hw is not able to have * multiple net devices on single physical port.
@@ -1129,7 +1129,7 @@ struct net_device_ops {int (*ndo_change_carrier)(struct net_device *dev,bool new_carrier);int (*ndo_get_phys_port_id)(struct net_device *dev, -struct netdev_phys_port_id *ppid); +struct netdev_phys_item_id *ppid);void (*ndo_add_vxlan_port)(struct net_device *dev,sa_family_t sa_family,__be16 port);
@@ -2848,7 +2848,7 @@ void dev_set_group(struct net_device *, int);int dev_set_mac_address (struct net_device *,struct sockaddr *);int dev_change_carrier (struct net_device *,bool new_carrier);int dev_get_phys_port_id (struct net_device *dev, -struct netdev_phys_port_id *ppid); +struct netdev_phys_item_id *ppid);struct sk_buff *validate_xmit_skb (struct sk_buff *skb,struct net_device *dev);struct sk_buff *dev_hard_start_xmit (struct sk_buff *skb,struct net_device *dev,struct netdev_queue *txq,int *ret);
net/core/dev.c +1 -1
@@ -5650,7 +5650,7 @@ EXPORT_SYMBOL(dev_change_carrier);* Get device physical port ID */ int dev_get_phys_port_id (struct net_device *dev, -struct netdev_phys_port_id *ppid) +struct netdev_phys_item_id *ppid) {const struct net_device_ops *ops = dev->netdev_ops;
net/core/net-sysfs.c +1 -1
@@ -387,7 +387,7 @@ static ssize_t phys_port_id_show(struct device *dev,return restart_syscall ();if (dev_isalive (netdev)) { -struct netdev_phys_port_id ppid; +struct netdev_phys_item_id ppid; ret =dev_get_phys_port_id (netdev, &ppid);if (!ret)
net/core/rtnetlink.c +3 -3
@@ -868,7 +868,7 @@ static noinline size_t if_nlmsg_size(const struct net_device *dev, +rtnl_port_size (dev, ext_filter_mask)/* IFLA_VF_PORTS + IFLA_PORT_SELF */ +rtnl_link_get_size (dev)/* IFLA_LINKINFO */ +rtnl_link_get_af_size (dev)/* IFLA_AF_SPEC */ - +nla_total_size (MAX_PHYS_PORT_ID_LEN );/* IFLA_PHYS_PORT_ID */ + +nla_total_size (MAX_PHYS_ITEM_ID_LEN );/* IFLA_PHYS_PORT_ID */ }static int rtnl_vf_ports_fill (struct sk_buff *skb,struct net_device *dev)
@@ -952,7 +952,7 @@ static int rtnl_port_fill(struct sk_buff *skb, struct net_device *dev,static int rtnl_phys_port_id_fill (struct sk_buff *skb,struct net_device *dev) {int err; -struct netdev_phys_port_id ppid; +struct netdev_phys_item_id ppid; err =dev_get_phys_port_id (dev, &ppid);if (err) {
@@ -1196,7 +1196,7 @@ static const struct nla_policy ifla_policy[IFLA_MAX+1] = { [IFLA_PROMISCUITY] = { .type = NLA_U32 }, [IFLA_NUM_TX_QUEUES] = { .type = NLA_U32 }, [IFLA_NUM_RX_QUEUES] = { .type = NLA_U32 }, - [IFLA_PHYS_PORT_ID] = { .type = NLA_BINARY, .len = MAX_PHYS_PORT_ID_LEN }, + [IFLA_PHYS_PORT_ID] = { .type = NLA_BINARY, .len = MAX_PHYS_ITEM_ID_LEN }, [IFLA_CARRIER_CHANGES] = { .type = NLA_U32 }, /* ignored */ };
Signature · 1 line
1.9.3
Jiri Pirko
maintainerPATCH 8/13 net: introduce netdev_phys_item_ids_match helper
In reply to Jiri Pirko--- include/linux/netdevice.h | 7 +++++++ 1 file changed, 7 insertions(+)
include/linux/netdevice.h +7 -0
@@ -750,6 +750,13 @@ struct netdev_phys_item_id {unsigned char id_len; }; +static inline bool netdev_phys_item_ids_match (struct netdev_phys_item_id *id1, +struct netdev_phys_item_id *id2) +{ +return id1->id_len == id2->id_len && + !memcmp (id1->id, id2->id, id1->id_len); +} +typedef u16 (*select_queue_fallback_t )(struct net_device *dev,struct sk_buff *skb);
Signature · 1 line
1.9.3
Jiri Pirko
maintainerPATCH 9/13 openvswitch: introduce vport_op get_netdev
In reply to Jiri PirkoThis will allow to query easily if the vport has netdev. Also it allows to unexpose netdev_vport_priv and struct netdev_vport.
--- net/openvswitch/datapath.c | 2 +- net/openvswitch/dp_notify.c | 7 ++--- net/openvswitch/vport-internal_dev.c | 56 ++++++++++++++++++++++++------------ net/openvswitch/vport-netdev.c | 16 +++++++++++ net/openvswitch/vport-netdev.h | 12 -------- net/openvswitch/vport.h | 2 ++ 6 files changed, 59 insertions(+), 36 deletions(-)
net/openvswitch/datapath.c +1 -1
@@ -171,7 +171,7 @@ static int get_dpifindex(struct datapath *dp) local =ovs_vport_rcu (dp,OVSP_LOCAL );if (local) - ifindex =netdev_vport_priv (local)->dev->ifindex; + ifindex = local->ops->get_netdev (local)->ifindex;else ifindex =0 ;
net/openvswitch/dp_notify.c +3 -4
@@ -58,13 +58,12 @@ void ovs_dp_notify_wq(struct work_struct *work)struct hlist_node *n;hlist_for_each_entry_safe (vport, n, &dp->ports[i], dp_hash_node) { -struct netdev_vport *netdev_vport; +struct net_device *dev;if (vport->ops->type !=OVS_VPORT_TYPE_NETDEV )continue ; - - netdev_vport =netdev_vport_priv (vport); -if (!(netdev_vport->dev->priv_flags &IFF_OVS_DATAPATH )) + dev = vport->ops->get_netdev (vport); +if (!(dev->priv_flags &IFF_OVS_DATAPATH ))dp_detach_port_notify (vport); } }
net/openvswitch/vport-internal_dev.c +37 -19
125 lines not on this page · raw message
net/openvswitch/vport-netdev.c +16 -0
@@ -33,6 +33,16 @@#include "vport-internal_dev.h" #include "vport-netdev.h" +struct netdev_vport { +struct rcu_head rcu; +struct net_device *dev; +}; + +static struct netdev_vport *netdev_vport_priv (const struct vport *vport) +{ +return vport_priv (vport); +} +/* Must be called with rcu_read_lock. */ static void netdev_port_receive (struct vport *vport,struct sk_buff *skb) {
@@ -224,10 +234,16 @@ struct vport *ovs_netdev_get_vport(struct net_device *dev)return NULL ; } +static struct net_device *netdev_get_netdev (struct vport *vport) +{ +return netdev_vport_priv (vport)->dev; +} +const struct vport_ops ovs_netdev_vport_ops = { .type =OVS_VPORT_TYPE_NETDEV , .create = netdev_create, .destroy = netdev_destroy, .get_name = ovs_netdev_get_name, .send = netdev_send, + .get_netdev = netdev_get_netdev, };
net/openvswitch/vport-netdev.h +0 -12
@@ -26,18 +26,6 @@struct vport *ovs_netdev_get_vport (struct net_device *dev); -struct netdev_vport { -struct rcu_head rcu; - -struct net_device *dev; -}; - -static inline struct netdev_vport * -netdev_vport_priv (const struct vport *vport) -{ -return vport_priv (vport); -} -const char *ovs_netdev_get_name (const struct vport *);void ovs_netdev_detach_dev (struct vport *);
net/openvswitch/vport.h +2 -0
@@ -164,6 +164,8 @@ struct vport_ops {const char *(*get_name)(const struct vport *);int (*send)(struct vport *,struct sk_buff *); + +struct net_device *(*get_netdev)(struct vport *); };enum vport_err_type {
Signature · 1 line
1.9.3
Jiri Pirko
maintainerPATCH 13/13 switchdev: introduce Netlink API
In reply to Jiri PirkoThis patch exposes switchdev API using generic Netlink. Example userspace utility is here:
https://github.com/jpirko/switchdev
--- MAINTAINERS | 1 + include/uapi/linux/switchdev.h | 119 +++++++++ net/switchdev/Kconfig | 11 + net/switchdev/Makefile | 1 + net/switchdev/switchdev_netlink.c | 493 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 625 insertions(+) create mode 100644 include/uapi/linux/switchdev.h create mode 100644 net/switchdev/switchdev_netlink.c
MAINTAINERS +1 -0
@@ -8820,6 +8820,7 @@ L: [email protected] S: Supported F: net/switchdev/ F: include/net/switchdev.h +F: include/uapi/linux/switchdev.h SYNOPSYS ARC ARCHITECTURE M: Vineet Gupta <[email protected]>
include/uapi/linux/switchdev.h new file +119 -0
119 lines not on this page · raw message
net/switchdev/Kconfig +11 -0
@@ -7,3 +7,14 @@ config NET_SWITCHDEV depends on INET ---help--- This module provides support for hardware switch chips. + +config NET_SWITCHDEV_NETLINK + tristate "Netlink interface to Switch device" + depends on NET_SWITCHDEV + default m + ---help--- + This module provides Generic Netlink intercace to hardware switch + chips. + + To compile this code as a module, choose M here: the + module will be called switchdev_netlink.
net/switchdev/Makefile +1 -0
@@ -3,3 +3,4 @@ # obj-$(CONFIG_NET_SWITCHDEV) += switchdev.o +obj-$(CONFIG_NET_SWITCHDEV_NETLINK) += switchdev_netlink.o
net/switchdev/switchdev_netlink.c new file +493 -0
493 lines not on this page · raw message
Signature · 1 line
1.9.3
Quoted 5 lines · Jiri Pirko
This patchset can be divided into 3 main sections:
- introduce switchdev api for implementing switch drivers
- add hardware acceleration bits into openvswitch datapath, This uses previously mentioned switchdev api
- introduce rocker switch driver which implements switchdev api
Jiri, Scott,
Enclosed is the GOOG doc which outlines some details on my particular interests [0]. It includes several diagrams which might help to understand the overall arch. It is highly related to John's work as well. Please let me know if something does not align with the model you have in mind.
Summary:
The full virtual tunnel endpoint flow offload attempts to offload full flows to the hardware and utilize the embedded switch on the host NIC to empower the eSwitch with the required flexibility of the software driven network. In this model, the guest (VM or LXC) attaches through a SR-IOV VF which serves as the primary path. A slow path / software path is provided via the CPU which can route packets back into the VF by tagging packets with forwarding metadata and sending the frame back to the NIC.
[0] https://docs.google.com/document/d/195waUliu7G5YYVuXHmLmHgJ38DFSte321WPq0oaFhyU/edit?usp=sharing
(Publicly accessible and open for comments)
Quoted 25 lines · Thomas Graf
Quoted 5 lines · Jiri Pirko
This patchset can be divided into 3 main sections:
- introduce switchdev api for implementing switch drivers
- add hardware acceleration bits into openvswitch datapath, This uses previously mentioned switchdev api
- introduce rocker switch driver which implements switchdev apiJiri, Scott,
Enclosed is the GOOG doc which outlines some details on my particular interests [0]. It includes several diagrams which might help to understand the overall arch. It is highly related to John's work as well. Please let me know if something does not align with the model you have in mind.
Summary:
The full virtual tunnel endpoint flow offload attempts to offload full flows to the hardware and utilize the embedded switch on the host NIC to empower the eSwitch with the required flexibility of the software driven network. In this model, the guest (VM or LXC) attaches through a SR-IOV VF which serves as the primary path. A slow path / software path is provided via the CPU which can route packets back into the VF by tagging packets with forwarding metadata and sending the frame back to the NIC.
Quoted 2 lines
[0] https://docs.google.com/document/d/195waUliu7G5YYVuXHmLmHgJ38DFSte321WPq0oaFhyU/edit?usp=sharing
(Publicly accessible and open for comments)
Great doc. Very clear. I wish I could write docs like this :)
Few questions:
- on the 1st slide dpdk is used accept vm and lxc packet. How is that working? I know of 3 dpdk mechanisms to receive vm traffic, but all of them are kinda deficient, since offloads need to be disabled inside VM, so VM to VM performance over dpdk is not impressive. What is there for lxc? Is there a special pmd that can take packets from veth?
- full offload vs partial.
The doc doesn't say, but I suspect we want transition from full to partial to be transparent? Especially for lxc. criu should be able to snapshot container on one box with full offload and restore it seamlessly on the other machine with partial offload, right?
- full offload with two nics.
how bonding and redundancy suppose to work in such case?
If wire attached to eth0 no longer passing packet, how traffic from VM1 will reach eth1 on a different nic? Via sw datapath (flow table) ? I suspect we want to reuse current bonding/team abstraction here. I'm not quite getting the whole point of two separate physical nics. Is it for completeness and generality of the picture ?
I think typical hypervisor will likely have only one multi-port nic, then bonding can be off-loaded within single nic via bonding driver. Partial offload scenario doesn't have this issue, since 'flow table' is fed by standard netdev which can be bond-dev and everything else, right?
- number of VFs
I believe it's still very limited even in the newest nics, but number of containers will be large.
So some lxcs will be using VFs and some will use standard veth? We cannot swap them dynamically based on load, so I'm not sure how VF approach is generically applicable here. For some use cases with demanding lxcs, it probably helps, but is it worth the gains?
Thanks!
Quoted 4 lines · Alexei Starovoitov
Quoted 2 lines · Thomas Graf
[0] https://docs.google.com/document/d/195waUliu7G5YYVuXHmLmHgJ38DFSte321WPq0oaFhyU/edit?usp=sharing
(Publicly accessible and open for comments)
Quoted 8 lines
Great doc. Very clear. I wish I could write docs like this :)
Few questions:
- on the 1st slide dpdk is used accept vm and lxc packet. How is that working? I know of 3 dpdk mechanisms to receive vm traffic, but all of them are kinda deficient, since offloads need to be disabled inside VM, so VM to VM performance over dpdk is not impressive. What is there for lxc? Is there a special pmd that can take packets from veth?
Glad to see you are paying attention ;-) I'm assuming somebody to write a veth PMD at some point. It does not exist yet.
Quoted 5 lines
- full offload vs partial.
The doc doesn't say, but I suspect we want transition from full to partial to be transparent? Especially for lxc. criu should be able to snapshot container on one box with full offload and restore it seamlessly on the other machine with partial offload, right?
Correct. In a full offload environment, the CPU path could still use partial offload functionality. I'll update the doc.
Quoted 4 lines
- full offload with two nics.
how bonding and redundancy suppose to work in such case?
If wire attached to eth0 no longer passing packet, how traffic from VM1 will reach eth1 on a different nic? Via sw datapath (flow table) ?
Yes.
Quoted 1 line
I suspect we want to reuse current bonding/team abstraction here.
Yes, both kernel bond/team and OVS group table based abstraction (see Simon's recent effrots).
Quoted 2 lines
I'm not quite getting the whole point of two separate physical nics. Is it for completeness and generality of the picture ?
Correct. It is entirely to outline the more difficult case of multiple physical NICs.
Quoted 2 lines
I think typical hypervisor will likely have only one multi-port nic, then bonding can be off-loaded within single nic via bonding driver.
Agreed. I would expect that to be the reference architecture.
Quoted 2 lines
Partial offload scenario doesn't have this issue, since 'flow table' is fed by standard netdev which can be bond-dev and everything else, right?
It is unclear how a virtual LAG device would forward flow table hints. A particular NIC might take 5 tuples which point to a particular fwd entry. The state of this offload might be different on individual NICs forming a bond. Either case, it should be abstracted.
Quoted 3 lines
- number of VFs
I believe it's still very limited even in the newest nics, but number of containers will be large.
Agreed.
Quoted 1 line
So some lxcs will be using VFs and some will use standard veth?
Likely yes. I could forsee this to be driven by an elephant detection algorithm or driven by policy.
Quoted 3 lines
We cannot swap them dynamically based on load, so I'm not sure how VF approach is generically applicable here. For some use cases with demanding lxcs, it probably helps, but is it worth the gains?
TBH, I don't know. I'm trying to figure that out ;-) It is obvious that dedicating individual cores to PMDs is not ideal either for lxc type workloads. The same question also applies to live migration which is complicated by this and DPDK type setups. However, I believe that a proper HW offload abstraction API is superior in terms of providing virtualization abstraction but I'm afraid we won't know for sure until we've actually tried it ;-)
Jiri Pirko
maintainerQuoted 7 lines · Mon, Sep 08, 2014 at 03:54:13PM CEST, [email protected] wrote:
Quoted 5 lines · Jiri Pirko
This patchset can be divided into 3 main sections:
- introduce switchdev api for implementing switch drivers
- add hardware acceleration bits into openvswitch datapath, This uses previously mentioned switchdev api
- introduce rocker switch driver which implements switchdev api
Quoted 7 lines
Jiri, Scott,
Enclosed is the GOOG doc which outlines some details on my particular interests [0]. It includes several diagrams which might help to understand the overall arch. It is highly related to John's work as well. Please let me know if something does not align with the model you have in mind.
Hi Thomas.
Sorry for late answer, I returned from vacation yesterday.
I went over your document, I did not find anything which would not align with our approach. Looks good to me.
Quoted 13 lines
Summary:
The full virtual tunnel endpoint flow offload attempts to offload full flows to the hardware and utilize the embedded switch on the host NIC to empower the eSwitch with the required flexibility of the software driven network. In this model, the guest (VM or LXC) attaches through a SR-IOV VF which serves as the primary path. A slow path / software path is provided via the CPU which can route packets back into the VF by tagging packets with forwarding metadata and sending the frame back to the NIC.[0] https://docs.google.com/document/d/195waUliu7G5YYVuXHmLmHgJ38DFSte321WPq0oaFhyU/edit?usp=sharing
(Publicly accessible and open for comments)
A message that is not in the archive (sent off-list or not yet received): [email protected]
Hi All,
Shall we expect these changes to be available in the upcoming 2.4 release? or is it still in development?
Quoted 42 lines · Jiri Pirko
Quoted 7 lines · Mon, Sep 08, 2014 at 03:54:13PM CEST, [email protected] wrote:
Quoted 5 lines · Jiri Pirko
This patchset can be divided into 3 main sections:
- introduce switchdev api for implementing switch drivers
- add hardware acceleration bits into openvswitch datapath, This uses previously mentioned switchdev api
- introduce rocker switch driver which implements switchdev apiQuoted 7 lines
Jiri, Scott,
Enclosed is the GOOG doc which outlines some details on my particular interests [0]. It includes several diagrams which might help to understand the overall arch. It is highly related to John's work as well. Please let me know if something does not align with the model you have in mind.
Hi Thomas.
Sorry for late answer, I returned from vacation yesterday.
I went over your document, I did not find anything which would not align with our approach. Looks good to me.Quoted 11 lines
Summary:
The full virtual tunnel endpoint flow offload attempts to offload full flows to the hardware and utilize the embedded switch on the host NIC to empower the eSwitch with the required flexibility of the software driven network. In this model, the guest (VM or LXC) attaches through a SR-IOV VF which serves as the primary path. A slow path / software path is provided via the CPU which can route packets back into the VF by tagging packets with forwarding metadata and sending the frame back to the NIC.Quoted 1 line
[0]
https://docs.google.com/document/d/195waUliu7G5YYVuXHmLmHgJ38DFSte321WPq0oaFhyU/edit?usp=sharing
Quoted 1 line
(Publicly accessible and open for comments)
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev
Signature · 6 lines
Thanks & Regards Neelakantam Gaddam _______________________________________________ dev mailing list [email protected] http://openvswitch.org/mailman/listinfo/dev
A message that is not in the archive (sent off-list or not yet received): CAOv37=BNU1-+kgTR6RUqxw7snJL6=5g-rLYhuPc1F-V0B1k7tA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Quoted 4 lines · Mon, Jun 29, 2015 at 07:44:38AM CEST, [email protected] wrote:
Hi All,
Shall we expect these changes to be available in the upcoming 2.4 release? or is it still in development?
Still in devel.
Quoted 42 lines · Jiri Pirko
Quoted 35 lines
Quoted 7 lines · Mon, Sep 08, 2014 at 03:54:13PM CEST, [email protected] wrote:
Quoted 5 lines · Jiri Pirko
This patchset can be divided into 3 main sections:
- introduce switchdev api for implementing switch drivers
- add hardware acceleration bits into openvswitch datapath, This uses previously mentioned switchdev api
- introduce rocker switch driver which implements switchdev apiQuoted 7 lines
Jiri, Scott,
Enclosed is the GOOG doc which outlines some details on my particular interests [0]. It includes several diagrams which might help to understand the overall arch. It is highly related to John's work as well. Please let me know if something does not align with the model you have in mind.
Hi Thomas.
Sorry for late answer, I returned from vacation yesterday.
I went over your document, I did not find anything which would not align with our approach. Looks good to me.Quoted 11 lines
Summary:
The full virtual tunnel endpoint flow offload attempts to offload full flows to the hardware and utilize the embedded switch on the host NIC to empower the eSwitch with the required flexibility of the software driven network. In this model, the guest (VM or LXC) attaches through a SR-IOV VF which serves as the primary path. A slow path / software path is provided via the CPU which can route packets back into the VF by tagging packets with forwarding metadata and sending the frame back to the NIC.
Quoted 14 lines
Quoted 8 lines
Quoted 1 line
[0]
https://docs.google.com/document/d/195waUliu7G5YYVuXHmLmHgJ38DFSte321WPq0oaFhyU/edit?usp=sharing
Quoted 1 line
(Publicly accessible and open for comments)
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/devSignature · 2 lines
Thanks & Regards Neelakantam Gaddam
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev