{"id":818461,"url":"http://patchwork.ozlabs.org/api/patches/818461/?format=json","web_url":"http://patchwork.ozlabs.org/project/openvswitch/patch/1506404199-23579-6-git-send-email-yliu@fridaylinux.org/","project":{"id":47,"url":"http://patchwork.ozlabs.org/api/projects/47/?format=json","name":"Open vSwitch","link_name":"openvswitch","list_id":"ovs-dev.openvswitch.org","list_email":"ovs-dev@openvswitch.org","web_url":"http://openvswitch.org/","scm_url":"git@github.com:openvswitch/ovs.git","webscm_url":"https://github.com/openvswitch/ovs","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<1506404199-23579-6-git-send-email-yliu@fridaylinux.org>","list_archive_url":null,"date":"2017-09-26T05:36:35","name":"[ovs-dev,v3,5/9] dpif-netdev: record rx queue id for the upcall","commit_ref":null,"pull_url":null,"state":"changes-requested","archived":false,"hash":"9d8d3239fdc3e4b35e4f6dd93af693f147f88edf","submitter":{"id":72215,"url":"http://patchwork.ozlabs.org/api/people/72215/?format=json","name":"Yuanhan Liu","email":"yliu@fridaylinux.org"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/openvswitch/patch/1506404199-23579-6-git-send-email-yliu@fridaylinux.org/mbox/","series":[{"id":5061,"url":"http://patchwork.ozlabs.org/api/series/5061/?format=json","web_url":"http://patchwork.ozlabs.org/project/openvswitch/list/?series=5061","date":"2017-09-26T05:36:30","name":"OVS-DPDK flow offload with rte_flow","version":3,"mbox":"http://patchwork.ozlabs.org/series/5061/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/818461/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/818461/checks/","tags":{},"related":[],"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>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=fridaylinux-org.20150623.gappssmtp.com\n\theader.i=@fridaylinux-org.20150623.gappssmtp.com\n\theader.b=\"IT6GHfL1\"; dkim-atps=neutral"],"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 3y1VFb21mtz9t30\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 26 Sep 2017 15:41:55 +1000 (AEST)","from mail.linux-foundation.org (localhost [127.0.0.1])\n\tby mail.linuxfoundation.org (Postfix) with ESMTP id 6454FBE9;\n\tTue, 26 Sep 2017 05:40:11 +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 2AE0BB92\n\tfor <dev@openvswitch.org>; Tue, 26 Sep 2017 05:40:10 +0000 (UTC)","from mail-pg0-f46.google.com (mail-pg0-f46.google.com\n\t[74.125.83.46])\n\tby smtp1.linuxfoundation.org (Postfix) with ESMTPS id 4045D3DB\n\tfor <dev@openvswitch.org>; Tue, 26 Sep 2017 05:40:08 +0000 (UTC)","by mail-pg0-f46.google.com with SMTP id 7so5350832pgd.13\n\tfor <dev@openvswitch.org>; Mon, 25 Sep 2017 22:40:08 -0700 (PDT)","from localhost.localdomain ([101.228.205.132])\n\tby smtp.gmail.com with ESMTPSA id\n\to79sm13180077pfi.108.2017.09.25.22.39.50\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tMon, 25 Sep 2017 22:40:05 -0700 (PDT)"],"X-Greylist":"whitelisted by SQLgrey-1.7.6","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=fridaylinux-org.20150623.gappssmtp.com; s=20150623;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=q/8Fjx//5ZP7u/wxOreXurq9lTAKjfoxrV7jsXIR7cA=;\n\tb=IT6GHfL1byfzV+TZ1aADPmhugaxHxAdtyZgL1oIyq5BZz3b8/vNiKv+DlNAqqGXhLf\n\tkX7SBMGqA3dB8QtRyY2IRhQYe+X0tFS2APi3PFHKothlOzaEUFEGvNK0dKwNXf1QfGq+\n\tqv4Ys01Dyk/LX9cOj1BK+plkAymbtIapglMVsVrB4FPAogi/PutAUSZaUhPZQpm2lYff\n\tEJwQNxPqRaRjszG3oW6ZHNq4nK304f/Na3VqHU96O5sZDumlG4/KEVTrAOHSQBFzTb0h\n\tdRfVuittughYl1Sb27v+xMrLGa7oSMdGxZoNlLe66Hbr+x2WDPUV01cbAuwyUQdWoS8m\n\t1fgg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=q/8Fjx//5ZP7u/wxOreXurq9lTAKjfoxrV7jsXIR7cA=;\n\tb=iqOKQfGquI2f3HX2FimKDnVNUJ+qkUfRNs6bFZamCzoePSvlSsrXi5ZRqLqoGorvWp\n\tQEE1dUi7gO6L4Gi836UVQnlHxcgJqdOfVlz0/Z8fmaXAVfEadfUd1ly8LT1n3vDv0JEX\n\twvG+0CsyQOSwpBWsx1jtg2+h1QxetFilb1HO6/eE/C2O55faT72YrksEvZ2LVO3yBZa1\n\ta02Usvw+Xh4PBcC6EBptwN6xVP955g+XykaOJury6HRrUZRXcx9ISFqk7FIOhQX4Zx0/\n\tJdOFAYo1i0Z4U6+QsotY9FAn9wxBlP+o+pWHDtYasYtSrhkkZqANZzJFs193txNLYNBn\n\tE4/w==","X-Gm-Message-State":"AHPjjUjxhvsLctYq8XUOL/15NQAvTPZRtGKmVYB/OLdqM+z9FSoyHdQ+\n\tflwRVQMKMGGudABxZPGSlcES68p4MEtVXA==","X-Google-Smtp-Source":"AOwi7QAqk1sVQms/nt8srH7haxSWwmRfriSCZbA0Q292aonWGAv1c+QFDXyUUK+ne+4jcj3hIJX/Eg==","X-Received":"by 10.101.73.129 with SMTP id r1mr10052868pgs.411.1506404407434; \n\tMon, 25 Sep 2017 22:40:07 -0700 (PDT)","From":"Yuanhan Liu <yliu@fridaylinux.org>","To":"dev@openvswitch.org","Date":"Tue, 26 Sep 2017 13:36:35 +0800","Message-Id":"<1506404199-23579-6-git-send-email-yliu@fridaylinux.org>","X-Mailer":"git-send-email 2.7.4","In-Reply-To":"<1506404199-23579-1-git-send-email-yliu@fridaylinux.org>","References":"<1506404199-23579-1-git-send-email-yliu@fridaylinux.org>","X-Spam-Status":"No, score=0.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID,\n\tRCVD_IN_DNSWL_NONE 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":"[ovs-dev] [PATCH v3 5/9] dpif-netdev: record rx queue id for the\n\tupcall","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>","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Sender":"ovs-dev-bounces@openvswitch.org","Errors-To":"ovs-dev-bounces@openvswitch.org"},"content":"From: Shachar Beiser <shacharbe@mellanox.com>\n\nFor the DPDK flow offload, which basically just binds a MARK action to\na flow, the MARK is required to be used together with a QUEUE action for\nthe most NICs I'm aware of. The QUEUE action then needs a queue index,\nwhich is not given in the flow content.\n\nHere we record the rx queue while recieving the pkts to solve above issue.\n\nCo-authored-by: Yuanhan Liu <yliu@fridaylinux.org>\nSigned-off-by: Shachar Beiser <shacharbe@mellanox.com>\nSigned-off-by: Yuanhan Liu <yliu@fridaylinux.org>\n---\n lib/dp-packet.h   |  1 +\n lib/dpif-netdev.c | 19 +++++++++++--------\n lib/netdev.c      |  1 +\n lib/netdev.h      |  1 +\n 4 files changed, 14 insertions(+), 8 deletions(-)","diff":"diff --git a/lib/dp-packet.h b/lib/dp-packet.h\nindex a7a062f..479a734 100644\n--- a/lib/dp-packet.h\n+++ b/lib/dp-packet.h\n@@ -709,6 +709,7 @@ enum { NETDEV_MAX_BURST = 32 }; /* Maximum number packets in a batch. */\n struct dp_packet_batch {\n     size_t count;\n     bool trunc; /* true if the batch needs truncate. */\n+    int rxq;\n     struct dp_packet *packets[NETDEV_MAX_BURST];\n };\n \ndiff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c\nindex 5c33c74..1a70af6 100644\n--- a/lib/dpif-netdev.c\n+++ b/lib/dpif-netdev.c\n@@ -2550,7 +2550,7 @@ static void\n try_netdev_flow_put(struct dp_netdev_pmd_thread *pmd, odp_port_t in_port,\n                     struct dp_netdev_flow *flow, struct match *match,\n                     const ovs_u128 *ufid, const struct nlattr *actions,\n-                    size_t actions_len)\n+                    size_t actions_len, int rxq)\n {\n     struct offload_info info;\n     struct dp_netdev_port *port;\n@@ -2562,6 +2562,7 @@ try_netdev_flow_put(struct dp_netdev_pmd_thread *pmd, odp_port_t in_port,\n     if (!port) {\n         return;\n     }\n+    info.rxq = rxq;\n \n     if (modification) {\n         info.flow_mark = flow->mark;\n@@ -2598,7 +2599,8 @@ try_netdev_flow_put(struct dp_netdev_pmd_thread *pmd, odp_port_t in_port,\n static struct dp_netdev_flow *\n dp_netdev_flow_add(struct dp_netdev_pmd_thread *pmd,\n                    struct match *match, const ovs_u128 *ufid,\n-                   const struct nlattr *actions, size_t actions_len)\n+                   const struct nlattr *actions, size_t actions_len,\n+                   int rxq)\n     OVS_REQUIRES(pmd->flow_mutex)\n {\n     struct dp_netdev_flow *flow;\n@@ -2647,7 +2649,7 @@ dp_netdev_flow_add(struct dp_netdev_pmd_thread *pmd,\n                 dp_netdev_flow_hash(&flow->ufid));\n \n     try_netdev_flow_put(pmd, in_port, flow, match, ufid,\n-                        actions, actions_len);\n+                        actions, actions_len, rxq);\n \n     if (OVS_UNLIKELY(!VLOG_DROP_DBG((&upcall_rl)))) {\n         struct ds ds = DS_EMPTY_INITIALIZER;\n@@ -2717,7 +2719,7 @@ flow_put_on_pmd(struct dp_netdev_pmd_thread *pmd,\n         if (put->flags & DPIF_FP_CREATE) {\n             if (cmap_count(&pmd->flow_table) < MAX_FLOWS) {\n                 dp_netdev_flow_add(pmd, match, ufid, put->actions,\n-                                   put->actions_len);\n+                                   put->actions_len, -1);\n                 error = 0;\n             } else {\n                 error = EFBIG;\n@@ -2738,7 +2740,7 @@ flow_put_on_pmd(struct dp_netdev_pmd_thread *pmd,\n             ovsrcu_set(&netdev_flow->actions, new_actions);\n \n             try_netdev_flow_put(pmd, in_port, netdev_flow, match, ufid,\n-                                put->actions, put->actions_len);\n+                                put->actions, put->actions_len, -1);\n \n             if (stats) {\n                 get_dpif_flow_stats(netdev_flow, stats);\n@@ -5119,7 +5121,7 @@ handle_packet_upcall(struct dp_netdev_pmd_thread *pmd,\n                      struct dp_packet *packet,\n                      const struct netdev_flow_key *key,\n                      struct ofpbuf *actions, struct ofpbuf *put_actions,\n-                     int *lost_cnt, long long now)\n+                     int *lost_cnt, long long now, int rxq)\n {\n     struct ofpbuf *add_actions;\n     struct dp_packet_batch b;\n@@ -5175,7 +5177,8 @@ handle_packet_upcall(struct dp_netdev_pmd_thread *pmd,\n         if (OVS_LIKELY(!netdev_flow)) {\n             netdev_flow = dp_netdev_flow_add(pmd, &match, &ufid,\n                                              add_actions->data,\n-                                             add_actions->size);\n+                                             add_actions->size,\n+                                             rxq);\n         }\n         ovs_mutex_unlock(&pmd->flow_mutex);\n         emc_probabilistic_insert(pmd, key, netdev_flow);\n@@ -5245,7 +5248,7 @@ fast_path_processing(struct dp_netdev_pmd_thread *pmd,\n \n             miss_cnt++;\n             handle_packet_upcall(pmd, packets[i], &keys[i], &actions,\n-                                 &put_actions, &lost_cnt, now);\n+                                 &put_actions, &lost_cnt, now, packets_->rxq);\n         }\n \n         ofpbuf_uninit(&actions);\ndiff --git a/lib/netdev.c b/lib/netdev.c\nindex b4e570b..c9b7019 100644\n--- a/lib/netdev.c\n+++ b/lib/netdev.c\n@@ -700,6 +700,7 @@ netdev_rxq_recv(struct netdev_rxq *rx, struct dp_packet_batch *batch)\n \n     retval = rx->netdev->netdev_class->rxq_recv(rx, batch);\n     if (!retval) {\n+        batch->rxq = rx->queue_id;\n         COVERAGE_INC(netdev_received);\n     } else {\n         batch->count = 0;\ndiff --git a/lib/netdev.h b/lib/netdev.h\nindex 2003165..28ad39d 100644\n--- a/lib/netdev.h\n+++ b/lib/netdev.h\n@@ -194,6 +194,7 @@ struct offload_info {\n      * it will be in the pkt meta data.\n      */\n     uint32_t flow_mark;\n+    int rxq;\n };\n struct dpif_class;\n struct netdev_flow_dump;\n","prefixes":["ovs-dev","v3","5/9"]}