hardware offload support for openvswitch

In Kernel 4.8 we introduced Traffic Control (TC see [1]) hardware offloads
framework for SR-IOV VFs which allows us to configure the NIC [2].
Subsequent OVS patches [3] allow us to use the TC framework
to offload OVS datapath rules.

This patch allow OVS mech driver to bind direct (SR-IOV) port.
This will allow to offload the OVS flows using tc to the SR-IOV NIC
and gain accelerate OVS.

[1] https://linux.die.net/man/8/tc
[2] http://netdevconf.org/1.2/papers/efraim-gerlitz-sriov-ovs-final.pdf
[3] https://mail.openvswitch.org/pipermail/ovs-dev/2017-April/330606.html

DocImpact: Add SR-IOV offload support for OVS mech driver
Partial-Bug: #1627987
Depends-On: I6bc2539a1ddbf7990164abeb8bb951ddcb45c993

Change-Id: I77650be5f04775a72e2bdf694f93988825a84b72
This commit is contained in:
Moshe Levi 2016-01-04 11:14:58 +02:00
parent d7e7dd451a
commit 8ff25e725e
3 changed files with 27 additions and 1 deletions

View File

@ -50,10 +50,16 @@ class OpenvswitchMechanismDriver(mech_agent.SimpleAgentMechanismDriverBase):
IPTABLES_FW_DRIVER_FULL, 'iptables_hybrid')) and sg_enabled IPTABLES_FW_DRIVER_FULL, 'iptables_hybrid')) and sg_enabled
vif_details = {portbindings.CAP_PORT_FILTER: sg_enabled, vif_details = {portbindings.CAP_PORT_FILTER: sg_enabled,
portbindings.OVS_HYBRID_PLUG: hybrid_plug_required} portbindings.OVS_HYBRID_PLUG: hybrid_plug_required}
# NOTE(moshele): Bind DIRECT (SR-IOV) port allows
# to offload the OVS flows using tc to the SR-IOV NIC.
# We are using OVS mechanism driver because the openvswitch (>=2.8.0)
# support hardware offload via tc and that allow us to manage the VF by
# OpenFlow control plane using representor net-device.
super(OpenvswitchMechanismDriver, self).__init__( super(OpenvswitchMechanismDriver, self).__init__(
constants.AGENT_TYPE_OVS, constants.AGENT_TYPE_OVS,
portbindings.VIF_TYPE_OVS, portbindings.VIF_TYPE_OVS,
vif_details) vif_details, supported_vnic_types=[portbindings.VNIC_NORMAL,
portbindings.VNIC_DIRECT])
ovs_qos_driver.register() ovs_qos_driver.register()
def get_allowed_network_types(self, agent): def get_allowed_network_types(self, agent):

View File

@ -236,3 +236,16 @@ class OpenvswitchMechanismDPDKTestCase(OpenvswitchMechanismBaseTestCase):
result = self.driver.get_vif_type(None, self.AGENT_SYSTEM, None) result = self.driver.get_vif_type(None, self.AGENT_SYSTEM, None)
self.assertEqual(portbindings.VIF_TYPE_OVS, result) self.assertEqual(portbindings.VIF_TYPE_OVS, result)
class OpenvswitchMechanismSRIOVTestCase(OpenvswitchMechanismBaseTestCase):
def _make_port_ctx(self, agents):
segments = [{api.ID: 'local_segment_id', api.NETWORK_TYPE: 'local'}]
return base.FakePortContext(self.AGENT_TYPE, agents, segments,
vnic_type=portbindings.VNIC_DIRECT)
def test_get_vif_type(self):
context = self._make_port_ctx(self.AGENTS)
result = self.driver.get_vif_type(context, self.AGENTS[0], None)
self.assertEqual(self.VIF_TYPE, result)

View File

@ -0,0 +1,7 @@
---
prelude: >
The ``openvswitch`` mechanism driver now supports hardware offload via SR-IOV.
features:
- The ``openvswitch`` mechanism driver now allows binding direct (SR-IOV) ports.
Using ``openvswitch`` 2.8.0 and 'Linux Kernel' 4.8 allows to control the SR-IOV VF
via OpenFlow control plane and gain accelerated 'Open vSwitch'.