[{"id":1778447,"web_url":"http://patchwork.ozlabs.org/comment/1778447/","msgid":"<2EF2F5C0CC56984AA024D0B180335FCB525690AC@IRSMSX102.ger.corp.intel.com>","list_archive_url":null,"date":"2017-10-02T16:25:22","subject":"Re: [ovs-dev] [PATCH v3 9/9] dpif-netdev: do hw flow offload in\n\tanother thread","submitter":{"id":67440,"url":"http://patchwork.ozlabs.org/api/people/67440/","name":"Chandran, Sugesh","email":"sugesh.chandran@intel.com"},"content":"Regards\n_Sugesh\n\n\n> -----Original Message-----\n> From: Yuanhan Liu [mailto:yliu@fridaylinux.org]\n> Sent: Tuesday, September 26, 2017 6:37 AM\n> To: dev@openvswitch.org\n> Cc: Finn Christensen <fc@napatech.com>; Darrell Ball <dball@vmware.com>;\n> Chandran, Sugesh <sugesh.chandran@intel.com>; Simon Horman\n> <simon.horman@netronome.com>; Yuanhan Liu <yliu@fridaylinux.org>\n> Subject: [PATCH v3 9/9] dpif-netdev: do hw flow offload in another thread\n> \n> Currently, the major trigger for hw flow offload is at upcall handling, which is\n> actually in the datapath. Moreover, the hw offload installation and modification\n> is not that lightweight. Meaning, if there are so many flows being added or\n> modified frequently, it could stall the datapath, which could result to packet\n> loss.\n> \n> To diminish that, all those flow operations will be recorded and appended to a\n> list. A thread is then introduced to process this list (to do the real flow offloading\n> put/del operations). This could leave the datapath as lightweight as possible.\n[Sugesh] This is really very useful to reduce the flow install overhead on PMD threads.\n\n> \n> Signed-off-by: Yuanhan Liu <yliu@fridaylinux.org>\n> ---\n>  lib/dpif-netdev.c | 301 ++++++++++++++++++++++++++++++++++++++++++++---\n> -------\n>  1 file changed, 249 insertions(+), 52 deletions(-)\n> \n> diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index 13fd012..ef5c2e9 100644\n> --- a/lib/dpif-netdev.c\n> +++ b/lib/dpif-netdev.c\n> @@ -1949,6 +1949,223 @@ dp_netdev_pmd_find_flow_by_mark(const\n> uint32_t mark)\n>      return NULL;\n>  }\n\n[Snip] \n> \n> +                          offload->actions, offload->actions_len,\n> +                          &offload->ufid, &info, NULL);\n> +    if (ret) {\n> +        if (create) {\n> +            dp_netdev_remove_flow_mark_map(info.flow_mark);\n> +        }\n> +        return ret;\n> +    }\n> +\n> +    ovs_mutex_lock(&offload->pmd->flow_mutex);\n> +    if (create) {\n> +        flow->has_mark = true;\n> +        flow->mark = info.flow_mark;\n> +        if (!flow->dead) {\n[Sugesh] Just to confirm, so the assumption here is the flow delete from\nrevalidator will set the flow as dead and its still keep the structure as its referenced\nhere. There wont be a situation where flow is deleted and this strcture may freed up.\n\n> +            /*\n> +             * A flow could have been dead after we regain the lock,\n> +             * while the flow has offloaded to the netdev. When that\n> +             * happens, there should be an offload item in the offload\n> +             * list for the flow removal. To make sure the flow will\n\n[Snip] \n> --\n> 2.7.4","headers":{"Return-Path":"<ovs-dev-bounces@openvswitch.org>","X-Original-To":["incoming@patchwork.ozlabs.org","dev@openvswitch.org"],"Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","ovs-dev@mail.linuxfoundation.org"],"Authentication-Results":"ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=openvswitch.org\n\t(client-ip=140.211.169.12; helo=mail.linuxfoundation.org;\n\tenvelope-from=ovs-dev-bounces@openvswitch.org;\n\treceiver=<UNKNOWN>)","Received":["from mail.linuxfoundation.org (mail.linuxfoundation.org\n\t[140.211.169.12])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3y5SFc3LJ0z9s7g\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue,  3 Oct 2017 03:25:40 +1100 (AEDT)","from mail.linux-foundation.org (localhost [127.0.0.1])\n\tby mail.linuxfoundation.org (Postfix) with ESMTP id B07E4B0B;\n\tMon,  2 Oct 2017 16:25:27 +0000 (UTC)","from smtp1.linuxfoundation.org (smtp1.linux-foundation.org\n\t[172.17.192.35])\n\tby mail.linuxfoundation.org (Postfix) with ESMTPS id 63590B0C\n\tfor <dev@openvswitch.org>; Mon,  2 Oct 2017 16:25:26 +0000 (UTC)","from mga03.intel.com (mga03.intel.com [134.134.136.65])\n\tby smtp1.linuxfoundation.org (Postfix) with ESMTPS id 48C4D1A9\n\tfor <dev@openvswitch.org>; Mon,  2 Oct 2017 16:25:25 +0000 (UTC)","from fmsmga001.fm.intel.com ([10.253.24.23])\n\tby orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t02 Oct 2017 09:25:24 -0700","from irsmsx103.ger.corp.intel.com ([163.33.3.157])\n\tby fmsmga001.fm.intel.com with ESMTP; 02 Oct 2017 09:25:23 -0700","from irsmsx102.ger.corp.intel.com ([169.254.2.180]) by\n\tIRSMSX103.ger.corp.intel.com ([169.254.3.49]) with mapi id\n\t14.03.0319.002; Mon, 2 Oct 2017 17:25:22 +0100"],"X-Greylist":"domain auto-whitelisted by SQLgrey-1.7.6","X-ExtLoop1":"1","X-IronPort-AV":"E=Sophos; i=\"5.42,470,1500966000\"; d=\"scan'208\";\n\ta=\"1201317323\"","From":"\"Chandran, Sugesh\" <sugesh.chandran@intel.com>","To":"Yuanhan Liu <yliu@fridaylinux.org>, \"dev@openvswitch.org\"\n\t<dev@openvswitch.org>","Thread-Topic":"[PATCH v3 9/9] dpif-netdev: do hw flow offload in another\n\tthread","Thread-Index":"AQHTNooTL1pGDXEF40e6JRVDnpeS7aLQxBoA","Date":"Mon, 2 Oct 2017 16:25:22 +0000","Message-ID":"<2EF2F5C0CC56984AA024D0B180335FCB525690AC@IRSMSX102.ger.corp.intel.com>","References":"<1506404199-23579-1-git-send-email-yliu@fridaylinux.org>\n\t<1506404199-23579-10-git-send-email-yliu@fridaylinux.org>","In-Reply-To":"<1506404199-23579-10-git-send-email-yliu@fridaylinux.org>","Accept-Language":"en-US","Content-Language":"en-US","X-MS-Has-Attach":"","X-MS-TNEF-Correlator":"","dlp-product":"dlpe-windows","dlp-version":"11.0.0.116","dlp-reaction":"no-action","x-originating-ip":"[163.33.239.182]","MIME-Version":"1.0","X-Spam-Status":"No, score=-5.0 required=5.0 tests=RCVD_IN_DNSWL_HI,\n\tRP_MATCHES_RCVD autolearn=disabled version=3.3.1","X-Spam-Checker-Version":"SpamAssassin 3.3.1 (2010-03-16) on\n\tsmtp1.linux-foundation.org","Cc":"Simon Horman <simon.horman@netronome.com>","Subject":"Re: [ovs-dev] [PATCH v3 9/9] dpif-netdev: do hw flow offload in\n\tanother thread","X-BeenThere":"ovs-dev@openvswitch.org","X-Mailman-Version":"2.1.12","Precedence":"list","List-Id":"<ovs-dev.openvswitch.org>","List-Unsubscribe":"<https://mail.openvswitch.org/mailman/options/ovs-dev>,\n\t<mailto:ovs-dev-request@openvswitch.org?subject=unsubscribe>","List-Archive":"<http://mail.openvswitch.org/pipermail/ovs-dev/>","List-Post":"<mailto:ovs-dev@openvswitch.org>","List-Help":"<mailto:ovs-dev-request@openvswitch.org?subject=help>","List-Subscribe":"<https://mail.openvswitch.org/mailman/listinfo/ovs-dev>,\n\t<mailto:ovs-dev-request@openvswitch.org?subject=subscribe>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Sender":"ovs-dev-bounces@openvswitch.org","Errors-To":"ovs-dev-bounces@openvswitch.org"}}]