From patchwork Wed Jul 5 12:27:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shachar Beiser X-Patchwork-Id: 784574 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 3x2gCl22PYz9s7g for ; Wed, 5 Jul 2017 22:29:07 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 99E7EAD5; Wed, 5 Jul 2017 12:28:20 +0000 (UTC) X-Original-To: ovs-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 7A314A86 for ; Wed, 5 Jul 2017 12:28:18 +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 4ADA63D5 for ; Wed, 5 Jul 2017 12:28:17 +0000 (UTC) Received: from Internal Mail-Server by MTLPINE1 (envelope-from shacharbe@mellanox.com) with ESMTPS (AES256-SHA encrypted); 5 Jul 2017 15:27:51 +0300 Received: from r-aa-dragon21.mtr.labs.mlnx (r-aa-dragon21.mtr.labs.mlnx [10.209.68.158]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id v65CRpOX009624; Wed, 5 Jul 2017 15:27:51 +0300 Received: from r-aa-dragon21.mtr.labs.mlnx (localhost [127.0.0.1]) by r-aa-dragon21.mtr.labs.mlnx (8.14.7/8.14.7) with ESMTP id v65CRpOs025932; Wed, 5 Jul 2017 12:27:51 GMT Received: (from shacharbe@localhost) by r-aa-dragon21.mtr.labs.mlnx (8.14.7/8.14.7/Submit) id v65CRpdF025931; Wed, 5 Jul 2017 12:27:51 GMT From: Shachar Beiser To: ovs-dev@openvswitch.org Date: Wed, 5 Jul 2017 12:27:16 +0000 Message-Id: X-Mailer: git-send-email 1.8.3.1 In-Reply-To: References: In-Reply-To: References: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,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: Shachar Beiser Subject: [ovs-dev] [PATCH 09/11] ovs/dp-cls: flow tag read 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 PMD thread read the flow tag from the rte_mbuf . Signed-off-by: Shachar Beiser --- lib/dpif-netdev.c | 30 +++++++++++++++++------------- lib/hw-pipeline.c | 11 +++++++++++ 2 files changed, 28 insertions(+), 13 deletions(-) diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index 2bd3b89..45066d4 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -4399,8 +4399,7 @@ emc_processing(struct dp_netdev_pmd_thread *pmd, struct packet_batch_per_flow batches[], size_t *n_batches, bool md_is_valid, - odp_port_t port_no, - struct pipeline_md *md_tags) + odp_port_t port_no) { struct emc_cache *flow_cache = &pmd->flow_cache; struct netdev_flow_key *key = &keys[0]; @@ -4415,12 +4414,8 @@ emc_processing(struct dp_netdev_pmd_thread *pmd, DP_PACKET_BATCH_REFILL_FOR_EACH (i, size, packet, packets_) { struct dp_netdev_flow *flow; - if (md_tags[i].id == HW_OFFLOAD_PIPELINE && - md_tags[i].flow_tag != HW_NO_FREE_FLOW_TAG) { - VLOG_INFO("skip emc_processing flow_tag %x\n ", - md_tags[i].flow_tag); - continue; - } + if (pmd->dp->ppl_md.id == HW_OFFLOAD_PIPELINE) + continue; if (OVS_UNLIKELY(dp_packet_size(packet) < ETH_HEADER_LEN)) { dp_packet_delete(packet); @@ -4675,17 +4670,26 @@ dp_netdev_input__(struct dp_netdev_pmd_thread *pmd, long long now = time_msec(); size_t n_batches; odp_port_t in_port; + struct dp_netdev_port *port; + struct netdev *netdev; int index=0; n_batches = 0; - - for (index=0;indexdp->ppl_md.id == HW_OFFLOAD_PIPELINE) { + for (index=0;indexdp,port_no); + netdev = port->netdev; + hw_pipeline_get_packet_md(netdev, + packets->packets[index], + &md_tags[index]); + } } emc_processing(pmd, packets, keys, batches, &n_batches, - md_is_valid, port_no,md_tags); + md_is_valid, port_no); if (!dp_packet_batch_is_empty(packets)) { /* Get ingress port from first packet's metadata. */ in_port = packets->packets[0]->md.in_port.odp_port; diff --git a/lib/hw-pipeline.c b/lib/hw-pipeline.c index 9d608c3..676801f 100644 --- a/lib/hw-pipeline.c +++ b/lib/hw-pipeline.c @@ -31,7 +31,9 @@ #include #include "dpif-netdev.h" +#include "netdev-provider.h" #include "include/openvswitch/vlog.h" +#include "netdev-dpdk.h" #include "hw-pipeline.h" VLOG_DEFINE_THIS_MODULE(hw_pipeline); @@ -396,6 +398,15 @@ static bool hw_pipeline_msg_queue_enqueue(msg_queue *message_queue, return true; } +inline void +hw_pipeline_get_packet_md(struct netdev *netdev, + struct dp_packet *packet, + struct pipeline_md *ppl_md) +{ + if(netdev->netdev_class->get_pipeline) { + netdev->netdev_class->get_pipeline(netdev, packet, ppl_md); + } +} static struct dp_netdev_flow *hw_pipeline_read_flow(flow_tag_pool *p, uint32_t handle) {