From patchwork Tue Jun 13 15:03:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roi Dayan X-Patchwork-Id: 775314 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wnD7B1fJdz9s71 for ; Wed, 14 Jun 2017 01:23:34 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id F39ADC7B; Tue, 13 Jun 2017 15:13:28 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id DA3D8C06 for ; Tue, 13 Jun 2017 15:13:22 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by smtp1.linuxfoundation.org (Postfix) with ESMTP id 59EE4253 for ; Tue, 13 Jun 2017 15:13:19 +0000 (UTC) Received: from Internal Mail-Server by MTLPINE1 (envelope-from roid@mellanox.com) with ESMTPS (AES256-SHA encrypted); 13 Jun 2017 18:04:28 +0300 Received: from dev-r-vrt-189.mtr.labs.mlnx (dev-r-vrt-189.mtr.labs.mlnx [10.212.189.1]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id v5DF4Kv0027434; Tue, 13 Jun 2017 18:04:28 +0300 From: Roi Dayan To: dev@openvswitch.org Date: Tue, 13 Jun 2017 18:03:52 +0300 Message-Id: <1497366235-20892-31-git-send-email-roid@mellanox.com> X-Mailer: git-send-email 1.8.4.3 In-Reply-To: <1497366235-20892-1-git-send-email-roid@mellanox.com> References: <1497366235-20892-1-git-send-email-roid@mellanox.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Shahar Klein , Hadar Hen Zion , Rony Efraim , Flavio Leitner , Jiri Pirko , Marcelo Ricardo Leitner , Simon Horman , Or Gerlitz , Andy Gospodarek Subject: [ovs-dev] [PATCH V11 30/33] netdev: Init flow api on already added ports on offload enable X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org From: Paul Blakey Ports already added to a switch are not being initialized for offloading so when enabling offload we need to go over those ports. Signed-off-by: Paul Blakey Reviewed-by: Roi Dayan Reviewed-by: Simon Horman Acked-by: Flavio Leitner --- lib/netdev.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/netdev.c b/lib/netdev.c index 0aae83a..001b7b3 100644 --- a/lib/netdev.c +++ b/lib/netdev.c @@ -2346,6 +2346,18 @@ netdev_ports_flow_get(const void *obj, struct match *match, } #ifdef __linux__ +static void +netdev_ports_flow_init(void) +{ + struct port_to_netdev_data *data; + + ovs_mutex_lock(&netdev_hmap_mutex); + HMAP_FOR_EACH(data, node, &port_to_netdev) { + netdev_init_flow_api(data->netdev); + } + ovs_mutex_unlock(&netdev_hmap_mutex); +} + void netdev_set_flow_api_enabled(const struct smap *ovs_other_config) { @@ -2360,6 +2372,8 @@ netdev_set_flow_api_enabled(const struct smap *ovs_other_config) tc_set_policy(smap_get_def(ovs_other_config, "tc-policy", TC_POLICY_DEFAULT)); + netdev_ports_flow_init(); + ovsthread_once_done(&once); } }