[{"id":1778449,"web_url":"http://patchwork.ozlabs.org/comment/1778449/","msgid":"<2EF2F5C0CC56984AA024D0B180335FCB525690D0@IRSMSX102.ger.corp.intel.com>","list_archive_url":null,"date":"2017-10-02T16:26:25","subject":"Re: [ovs-dev] [PATCH v3 7/9] netdev-dpdk: remove offloaded flow on\n\tdeletion","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 7/9] netdev-dpdk: remove offloaded flow on deletion\n> \n> Inovke netdev class '->flow_del' method on flow deletion. The dpdk netdev\n> implementation will then remove the rte flow associated with the ufid.\n[Sugesh] I have few question on the flow delete functionality.\n\nWhat would be the behavior when a port is deleted from OVS.\nDoes it flush all the flows for that specific port from hardware.\n\nSimilarly what would be behavior when a port is administratively down/up?\n\n\n> \n> Co-authored-by: Finn Christensen <fc@napatech.com>\n> Signed-off-by: Yuanhan Liu <yliu@fridaylinux.org>\n> Signed-off-by: Finn Christensen <fc@napatech.com>\n> ---\n> \n> v2: - check the returned \"port\" from dp_netdev_lookup_port\n>     - error log when flow is not found\n> ---\n>  lib/dpif-netdev.c |  6 ++++++\n>  lib/netdev-dpdk.c | 19 ++++++++++++++++++-\n>  2 files changed, 24 insertions(+), 1 deletion(-)\n> \n> diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index 1a70af6..13fd012 100644\n> --- a/lib/dpif-netdev.c\n> +++ b/lib/dpif-netdev.c\n> @@ -1964,6 +1964,12 @@ dp_netdev_pmd_remove_flow(struct\n> dp_netdev_pmd_thread *pmd,\n>      dpcls_remove(cls, &flow->cr);\n>      cmap_remove(&pmd->flow_table, node, dp_netdev_flow_hash(&flow-\n> >ufid));\n>      if (flow->has_mark) {\n> +        struct dp_netdev_port *port;\n> +\n> +        port = dp_netdev_lookup_port(pmd->dp, in_port);\n> +        if (port) {\n> +            netdev_flow_del(port->netdev, &flow->ufid, NULL);\n> +        }\n>          dp_netdev_remove_flow_mark_map(flow->mark);\n>          flow->has_mark = false;\n>      }\n> diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c index 3e2b96b..02c3677\n> 100644\n> --- a/lib/netdev-dpdk.c\n> +++ b/lib/netdev-dpdk.c\n> @@ -3881,6 +3881,23 @@ netdev_dpdk_flow_put(struct netdev *netdev, struct\n> match *match,\n>                                              actions_len, ufid, info);  }\n> \n> +static int\n> +netdev_dpdk_flow_del(struct netdev *netdev, const ovs_u128 *ufid,\n> +                     struct dpif_flow_stats *stats OVS_UNUSED) {\n> +\n> +    struct rte_flow *rte_flow = get_rte_flow_by_ufid(ufid);\n> +\n> +    if (!rte_flow) {\n> +        VLOG_ERR(\"failed to find flow associated with ufid \" UUID_FMT \"\\n\",\n> +                 UUID_ARGS((struct uuid *)ufid));\n> +        return -1;\n> +    }\n> +\n> +    return netdev_dpdk_destroy_rte_flow(netdev_dpdk_cast(netdev),\n> +                                        ufid, rte_flow); }\n> +\n>  #define DPDK_FLOW_OFFLOAD_API                                 \\\n>      NULL,                   /* flow_flush */                  \\\n>      NULL,                   /* flow_dump_create */            \\\n> @@ -3888,7 +3905,7 @@ netdev_dpdk_flow_put(struct netdev *netdev, struct\n> match *match,\n>      NULL,                   /* flow_dump_next */              \\\n>      netdev_dpdk_flow_put,                                     \\\n>      NULL,                   /* flow_get */                    \\\n> -    NULL,                   /* flow_del */                    \\\n> +    netdev_dpdk_flow_del,                                     \\\n>      NULL                    /* init_flow_api */\n> \n> \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 3y5SLp4BYlz9t6m\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue,  3 Oct 2017 03:30:10 +1100 (AEDT)","from mail.linux-foundation.org (localhost [127.0.0.1])\n\tby mail.linuxfoundation.org (Postfix) with ESMTP id 5A283B50;\n\tMon,  2 Oct 2017 16:26:40 +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 EF8F7B2B\n\tfor <dev@openvswitch.org>; Mon,  2 Oct 2017 16:26:39 +0000 (UTC)","from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby smtp1.linuxfoundation.org (Postfix) with ESMTPS id C4258FC\n\tfor <dev@openvswitch.org>; Mon,  2 Oct 2017 16:26:38 +0000 (UTC)","from orsmga005.jf.intel.com ([10.7.209.41])\n\tby orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t02 Oct 2017 09:26:29 -0700","from irsmsx106.ger.corp.intel.com ([163.33.3.31])\n\tby orsmga005.jf.intel.com with ESMTP; 02 Oct 2017 09:26:27 -0700","from irsmsx112.ger.corp.intel.com (10.108.20.5) by\n\tIRSMSX106.ger.corp.intel.com (163.33.3.31) with Microsoft SMTP Server\n\t(TLS) id 14.3.319.2; Mon, 2 Oct 2017 17:26:26 +0100","from irsmsx102.ger.corp.intel.com ([169.254.2.180]) by\n\tirsmsx112.ger.corp.intel.com ([169.254.1.142]) with mapi id\n\t14.03.0319.002; Mon, 2 Oct 2017 17:26:26 +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\";a=\"155738662\"","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 7/9] netdev-dpdk: remove offloaded flow on deletion","Thread-Index":"AQHTNon/Gq2xc26+IE6+qEfoY/WWeqLQv3uw","Date":"Mon, 2 Oct 2017 16:26:25 +0000","Message-ID":"<2EF2F5C0CC56984AA024D0B180335FCB525690D0@IRSMSX102.ger.corp.intel.com>","References":"<1506404199-23579-1-git-send-email-yliu@fridaylinux.org>\n\t<1506404199-23579-8-git-send-email-yliu@fridaylinux.org>","In-Reply-To":"<1506404199-23579-8-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=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED,\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 7/9] netdev-dpdk: remove offloaded flow on\n\tdeletion","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"}}]