13 Nov, 2016

3 commits

  • Support receiving, extracting flow key and sending of L3 packets (packets
    without an Ethernet header).

    Note that even after this patch, non-Ethernet interfaces are still not
    allowed to be added to bridges. Similarly, netlink interface for sending and
    receiving L3 packets to/from user space is not in place yet.

    Based on previous versions by Lorand Jakab and Simon Horman.

    Signed-off-by: Lorand Jakab
    Signed-off-by: Simon Horman
    Signed-off-by: Jiri Benc
    Acked-by: Pravin B Shelar
    Signed-off-by: David S. Miller

    Jiri Benc
     
  • We'll need it to alter packets sent to ARPHRD_NONE interfaces.

    Change do_output() to use the actual L2 header size of the packet when
    deciding on the minimum cutlen. The assumption here is that what matters is
    not the output interface hard_header_len but rather the L2 header of the
    particular packet. For example, ARPHRD_NONE tunnels that encapsulate
    Ethernet should get at least the Ethernet header.

    Signed-off-by: Jiri Benc
    Acked-by: Pravin B Shelar
    Signed-off-by: David S. Miller

    Jiri Benc
     
  • On tx, use hard_header_len while deciding whether to refragment or drop the
    packet. That way, all combinations are calculated correctly:

    * L2 packet going to L2 interface (the L2 header len is subtracted),
    * L2 packet going to L3 interface (the L2 header is included in the packet
    lenght),
    * L3 packet going to L3 interface.

    Signed-off-by: Jiri Benc
    Acked-by: Pravin B Shelar
    Signed-off-by: David S. Miller

    Jiri Benc
     

20 Oct, 2016

2 commits


13 Oct, 2016

1 commit

  • When the packet has its vlan tag in skb->vlan_tci, the length of the VLAN
    header is not counted in skb->len. It doesn't make sense to subtract it.

    Fixes: 018c1dda5ff1 ("openvswitch: 802.1AD Flow handling, actions, vlan parsing, netlink attributes")
    Signed-off-by: Jiri Benc
    Acked-by: Pravin B Shelar
    Acked-by: Eric Garver
    Signed-off-by: David S. Miller

    Jiri Benc
     

09 Sep, 2016

1 commit

  • Add support for 802.1ad including the ability to push and pop double
    tagged vlans. Add support for 802.1ad to netlink parsing and flow
    conversion. Uses double nested encap attributes to represent double
    tagged vlan. Inner TPID encoded along with ctci in nested attributes.

    This is based on Thomas F Herbert's original v20 patch. I made some
    small clean ups and bug fixes.

    Signed-off-by: Thomas F Herbert
    Signed-off-by: Eric Garver
    Acked-by: Pravin B Shelar
    Signed-off-by: David S. Miller

    Eric Garver
     

11 Jun, 2016

1 commit

  • The patch adds a new OVS action, OVS_ACTION_ATTR_TRUNC, in order to
    truncate packets. A 'max_len' is added for setting up the maximum
    packet size, and a 'cutlen' field is to record the number of bytes
    to trim the packet when the packet is outputting to a port, or when
    the packet is sent to userspace.

    Signed-off-by: William Tu
    Cc: Pravin Shelar
    Acked-by: Pravin B Shelar
    Signed-off-by: David S. Miller

    William Tu
     

03 Dec, 2015

1 commit

  • After 614732eaa12d, no refcount is maintained for the vport-vxlan module.
    This allows the userspace to remove such module while vport-vxlan
    devices still exist, which leads to later oops.

    v1 -> v2:
    - move vport 'owner' initialization in ovs_vport_ops_register()
    and make such function a macro

    Fixes: 614732eaa12d ("openvswitch: Use regular VXLAN net_device device")
    Signed-off-by: Paolo Abeni
    Signed-off-by: David S. Miller

    Paolo Abeni
     

25 Nov, 2015

1 commit

  • During pre-upstream development, the openvswitch datapath used a custom
    hashtable to store vports that could fail on delete due to lack of
    memory. However, prior to upstream submission, this code was reworked to
    use an hlist based hastable with flexible-array based buckets. As such
    the failure condition was eliminated from the vport_del path, rendering
    this comment invalid.

    Signed-off-by: Aaron Conole
    Signed-off-by: David S. Miller

    Aaron Conole
     

24 Oct, 2015

1 commit

  • Conflicts:
    net/ipv6/xfrm6_output.c
    net/openvswitch/flow_netlink.c
    net/openvswitch/vport-gre.c
    net/openvswitch/vport-vxlan.c
    net/openvswitch/vport.c
    net/openvswitch/vport.h

    The openvswitch conflicts were overlapping changes. One was
    the egress tunnel info fix in 'net' and the other was the
    vport ->send() op simplification in 'net-next'.

    The xfrm6_output.c conflicts was also a simplification
    overlapping a bug fix.

    Signed-off-by: David S. Miller

    David S. Miller
     

23 Oct, 2015

1 commit

  • While transitioning to netdev based vport we broke OVS
    feature which allows user to retrieve tunnel packet egress
    information for lwtunnel devices. Following patch fixes it
    by introducing ndo operation to get the tunnel egress info.
    Same ndo operation can be used for lwtunnel devices and compat
    ovs-tnl-vport devices. So after adding such device operation
    we can remove similar operation from ovs-vport.

    Fixes: 614732eaa12d ("openvswitch: Use regular VXLAN net_device device").
    Signed-off-by: Pravin B Shelar
    Signed-off-by: David S. Miller

    Pravin B Shelar
     

22 Oct, 2015

1 commit


19 Oct, 2015

1 commit

  • If OVS receives a packet from another namespace, then the packet should
    be scrubbed. However, people have already begun to rely on the behaviour
    that skb->mark is preserved across namespaces, so retain this one field.

    This is mainly to address information leakage between namespaces when
    using OVS internal ports, but by placing it in ovs_vport_receive() it is
    more generally applicable, meaning it should not be overlooked if other
    port types are allowed to be moved into namespaces in future.

    Signed-off-by: Joe Stringer
    Acked-by: Pravin B Shelar
    Acked-by: Thomas Graf
    Signed-off-by: David S. Miller

    Joe Stringer
     

05 Oct, 2015

1 commit

  • Not every device has dev->tstats set. So when OVS tries to calculate
    vport stats it causes kernel panic. Following patch fixes it by
    using standard API to get net-device stats.

    ---8
    Call trace:
    [] ovs_vport_get_stats+0x150/0x1f8 [openvswitch]
    [] ovs_vport_cmd_fill_info+0x140/0x1e0 [openvswitch]
    [] ovs_vport_cmd_dump+0xbc/0x138 [openvswitch]
    [] netlink_dump+0xb8/0x258
    [] __netlink_dump_start+0x120/0x178
    [] genl_family_rcv_msg+0x2d4/0x308
    [] genl_rcv_msg+0x88/0xc4
    [] netlink_rcv_skb+0xd4/0x100
    [] genl_rcv+0x30/0x48
    [] netlink_unicast+0x154/0x200
    [] netlink_sendmsg+0x308/0x364
    [] sock_sendmsg+0x14/0x2c
    [] SyS_sendto+0xbc/0xf0
    Code: aa1603e1 f94037a4 aa1303e2 aa1703e0 (f9400465)

    Reported-by: Tomasz Sawicki
    Fixes: 8c876639c98 ("openvswitch: Remove vport stats.")
    Signed-off-by: Pravin B Shelar
    Signed-off-by: David S. Miller

    Pravin B Shelar
     

01 Sep, 2015

1 commit

  • Currently tun-info options pointer is used in few cases to
    pass options around. But tunnel options can be accessed using
    ip_tunnel_info_opts() API without using the pointer. Following
    patch removes the redundant pointer and consistently make use
    of API.

    Signed-off-by: Pravin B Shelar
    Acked-by: Thomas Graf
    Reviewed-by: Jesse Gross
    Signed-off-by: David S. Miller

    Pravin B Shelar
     

30 Aug, 2015

3 commits

  • Since all vport types are now backed by netdev, we can directly
    use netdev stats. Following patch removes redundant stat
    from vport.

    Signed-off-by: Pravin B Shelar
    Signed-off-by: David S. Miller

    Pravin B Shelar
     
  • tun info is passed using skb-dst pointer. Now we have
    converted all vports to netdev based implementation so
    Now we can remove redundant pointer to tun-info from OVS_CB.

    Signed-off-by: Pravin B Shelar
    Signed-off-by: David S. Miller

    Pravin B Shelar
     
  • There's currently nothing preventing directing packets with IPv6
    encapsulation data to IPv4 tunnels (and vice versa). If this happens,
    IPv6 addresses are incorrectly interpreted as IPv4 ones.

    Track whether the given ip_tunnel_key contains IPv4 or IPv6 data. Store this
    in ip_tunnel_info. Reject packets at appropriate places if they are supposed
    to be encapsulated into an incompatible protocol.

    Signed-off-by: Jiri Benc
    Acked-by: Alexei Starovoitov
    Acked-by: Thomas Graf
    Acked-by: Pravin B Shelar
    Signed-off-by: David S. Miller

    Jiri Benc
     

28 Aug, 2015

1 commit

  • Expose the kernel connection tracker via OVS. Userspace components can
    make use of the CT action to populate the connection state (ct_state)
    field for a flow. This state can be subsequently matched.

    Exposed connection states are OVS_CS_F_*:
    - NEW (0x01) - Beginning of a new connection.
    - ESTABLISHED (0x02) - Part of an existing connection.
    - RELATED (0x04) - Related to an established connection.
    - INVALID (0x20) - Could not track the connection for this packet.
    - REPLY_DIR (0x40) - This packet is in the reply direction for the flow.
    - TRACKED (0x80) - This packet has been sent through conntrack.

    When the CT action is executed by itself, it will send the packet
    through the connection tracker and populate the ct_state field with one
    or more of the connection state flags above. The CT action will always
    set the TRACKED bit.

    When the COMMIT flag is passed to the conntrack action, this specifies
    that information about the connection should be stored. This allows
    subsequent packets for the same (or related) connections to be
    correlated with this connection. Sending subsequent packets for the
    connection through conntrack allows the connection tracker to consider
    the packets as ESTABLISHED, RELATED, and/or REPLY_DIR.

    The CT action may optionally take a zone to track the flow within. This
    allows connections with the same 5-tuple to be kept logically separate
    from connections in other zones. If the zone is specified, then the
    "ct_zone" match field will be subsequently populated with the zone id.

    IP fragments are handled by transparently assembling them as part of the
    CT action. The maximum received unit (MRU) size is tracked so that
    refragmentation can occur during output.

    IP frag handling contributed by Andy Zhou.

    Based on original design by Justin Pettit.

    Signed-off-by: Joe Stringer
    Signed-off-by: Justin Pettit
    Signed-off-by: Andy Zhou
    Acked-by: Thomas Graf
    Acked-by: Pravin B Shelar
    Signed-off-by: David S. Miller

    Joe Stringer
     

21 Aug, 2015

2 commits


22 Jul, 2015

2 commits


01 Apr, 2015

1 commit

  • Return module reference before invoking the respective vport
    ->destroy() function. This is needed as ovs_vport_del() is not
    invoked inside an RCU read side critical section so the kfree
    can occur immediately before returning to ovs_vport_del().

    Returning the module reference before ->destroy() is safe because
    the module unregistration is blocked on ovs_lock which we hold
    while destroying the datapath.

    Fixes: 62b9c8d0372d ("ovs: Turn vports with dependencies into separate modules")
    Reported-by: Pravin Shelar
    Signed-off-by: Thomas Graf
    Acked-by: Pravin B Shelar
    Signed-off-by: David S. Miller

    Thomas Graf
     

15 Jan, 2015

1 commit


14 Jan, 2015

1 commit


03 Jan, 2015

1 commit

  • Until now, when VLAN acceleration was in use, the bytes of the VLAN header
    were not included in port or flow byte counters. They were however
    included when VLAN acceleration was not used. This commit corrects the
    inconsistency, by always including the VLAN header in byte counters.

    Previous discussion at
    http://openvswitch.org/pipermail/dev/2014-December/049521.html

    Reported-by: Motonori Shindo
    Signed-off-by: Ben Pfaff
    Reviewed-by: Flavio Leitner
    Acked-by: Pravin B Shelar
    Signed-off-by: David S. Miller

    Ben Pfaff
     

24 Dec, 2014

1 commit

  • Today vport-send has complex error handling because it involves
    freeing skb and updating stats depending on return value from
    vport send implementation.
    This can be simplified by delegating responsibility of freeing
    skb to the vport implementation for all cases. So that
    vport-send needs just update stats.

    Fixes: 91b7514cdf ("openvswitch: Unify vport error stats
    handling")
    Signed-off-by: Pravin B Shelar
    Signed-off-by: David S. Miller

    Pravin B Shelar
     

10 Dec, 2014

1 commit


10 Nov, 2014

3 commits


29 Oct, 2014

1 commit

  • The internal and netdev vport remain part of openvswitch.ko. Encap
    vports including vxlan, gre, and geneve can be built as separate
    modules and are loaded on demand. Modules can be unloaded after use.
    Datapath ports keep a reference to the vport module during their
    lifetime.

    Allows to remove the error prone maintenance of the global list
    vport_ops_list.

    Signed-off-by: Thomas Graf
    Signed-off-by: David S. Miller

    Thomas Graf
     

16 Oct, 2014

1 commit


06 Oct, 2014

2 commits

  • The Openvswitch implementation is completely agnostic to the options
    that are in use and can handle newly defined options without
    further work. It does this by simply matching on a byte array
    of options and allowing userspace to setup flows on this array.

    Signed-off-by: Jesse Gross
    Singed-off-by: Ansis Atteka
    Signed-off-by: Andy Zhou
    Acked-by: Thomas Graf
    Acked-by: Pravin B Shelar
    Signed-off-by: David S. Miller

    Jesse Gross
     
  • Currently, the flow information that is matched for tunnels and
    the tunnel data passed around with packets is the same. However,
    as additional information is added this is not necessarily desirable,
    as in the case of pointers.

    This adds a new structure for tunnel metadata which currently contains
    only the existing struct. This change is purely internal to the kernel
    since the current OVS_KEY_ATTR_IPV4_TUNNEL is simply a compressed version
    of OVS_KEY_ATTR_TUNNEL that is translated at flow setup.

    Signed-off-by: Jesse Gross
    Signed-off-by: Andy Zhou
    Acked-by: Pravin B Shelar
    Signed-off-by: David S. Miller

    Jesse Gross
     

16 Sep, 2014

2 commits


10 Sep, 2014

1 commit