openvswitch: split flow structures into ovs specific and generic ones

After this, flow related structures can be used in other code.

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
net: rename netdev_phys_port_id to more generic name

So this can be reused for identification of other "items" as well.

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
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.

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
rtnl: expose physical switch id for particular device

The 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.

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
net-sysfs: expose physical switch id for particular device

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
net: introduce dummy switch

Dummy switch implementation using switchdev interface

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
dsa: implement ndo_swdev_get_id

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
net: introduce netdev_phys_item_ids_match helper

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Acked-by: Scott Feldman <sfeldma@cumulusnetworks.com>
openvswitch: introduce vport_op get_netdev

This will allow to query easily if the vport has netdev. Also it allows
to unexpose netdev_vport_priv and struct netdev_vport.

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
openvswitch: add support for datapath hardware offload

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 <jiri@resnulli.us>
sw_flow: add misc section to key with in_port_ifindex field

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
rocker: introduce rocker switch driver

This patch introduces the first driver to benefit from the switchdev
infrastructure and to implement newly introduced switch ndos. This is a
driver for emulated switch chip implemented in qemu:
https://github.com/sfeldma/qemu-rocker/

This patch is a result of joint work with Scott Feldman.

Signed-off-by: Scott Feldman <sfeldma@cumulusnetworks.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
switchdev: introduce netlink API

Signed-off-by: Jiri Pirko <jiri@resnulli.us>