From patchwork Thu Oct 27 06:15:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Qiu X-Patchwork-Id: 687461 X-Patchwork-Delegate: diproiettod@vmware.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (archives.nicira.com [96.126.127.54]) by ozlabs.org (Postfix) with ESMTP id 3t4GyZ33fVz9t2b for ; Thu, 27 Oct 2016 17:22:30 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=el42nVwG; dkim-atps=neutral Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 9C7A3101D6; Wed, 26 Oct 2016 23:22:29 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx3v3.cudamail.com (mx3.cudamail.com [64.34.241.5]) by archives.nicira.com (Postfix) with ESMTPS id A69FD101E6 for ; Wed, 26 Oct 2016 23:22:27 -0700 (PDT) Received: from bar6.cudamail.com (localhost [127.0.0.1]) by mx3v3.cudamail.com (Postfix) with ESMTPS id 3F54D162E9A for ; Thu, 27 Oct 2016 00:22:27 -0600 (MDT) X-ASG-Debug-ID: 1477549346-0b323724ed2167f0001-byXFYA Received: from mx3-pf1.cudamail.com ([192.168.14.2]) by bar6.cudamail.com with ESMTP id 5Yyv1WbxRDsIqSvi (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 27 Oct 2016 00:22:26 -0600 (MDT) X-Barracuda-Envelope-From: qdy220091330@gmail.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.14.2 Received: from unknown (HELO mail-pf0-f194.google.com) (209.85.192.194) by mx3-pf1.cudamail.com with ESMTPS (AES128-SHA encrypted); 27 Oct 2016 06:22:26 -0000 Received-SPF: pass (mx3-pf1.cudamail.com: SPF record at _netblocks.google.com designates 209.85.192.194 as permitted sender) X-Barracuda-Apparent-Source-IP: 209.85.192.194 X-Barracuda-RBL-IP: 209.85.192.194 Received: by mail-pf0-f194.google.com with SMTP id n85so1646752pfi.3 for ; Wed, 26 Oct 2016 23:22:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=cXMh2zzeernqghuD44ePSXxERjw1uIAPdDC255ImDUs=; b=el42nVwGbLP7hOeEiNdwCvf0rFA6VHWKPhqRL6mYpGFvoif25YKAtFtwnPfM3FnU7J zN0rPe+SnSRBzSt+UifLf8vhNFK7/mMsQlAjmqxtqvR9uNEQkF3Qr54hlOWak2B1aH85 EifMBs7jTguEUWMzcLBWCmnsj43355ryaqjITIs7tB/I1vGQlS7KczrT/qXrqXPuLyrU o256R80Sui75g7r8FJ4d6R+pLqfiUhsiSmk46xs9Njr0U5QoyAjJegQGiS3DxBdY2dez TeJ8G/jlfcVM9xUYZJuNCgCKW/3SdZNp1GbfcM4uM23Lkxrh12OCY0pcJm6YTLwfAEht gKeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=cXMh2zzeernqghuD44ePSXxERjw1uIAPdDC255ImDUs=; b=S+emKwtkNqbSHDb7rMbhzu1BdthugCNYys372G9Kv0pNusMbbtzK9mHLhEkxPsE/ri LHB5FRmySZniewOa0ymtLEZzzE1zVhxKWmye0efUhglqzPHYNz5iwOrqx/gCffRonWUw Icn70nkKhD3/GMdX6lPfjXpPRsPoFTZQg/hIxCPt2IQ3OkzGqWImIh2/UA2n8d6vKUmR +fwxnvAPsbl1y/bLLBXdii7Zgny1F7zS3Ebuq2NjptxgzyAfzfqODoxmHXkmf+X3k3zF ECJjVI1Soppso+CQgI9XUGoXrRaC2RrL0GQ76707jjntNu1omFFGlipMT9aAwWnTNK/V Jb5w== X-Gm-Message-State: ABUngvcWGWZBOl/JeXgDtcPZTDweSVm3V83cGhbcu91f0Ns3T0LulycwdMEciNEyH23h+g== X-Received: by 10.98.92.68 with SMTP id q65mr11316893pfb.53.1477549346120; Wed, 26 Oct 2016 23:22:26 -0700 (PDT) Received: from localhost.localdomain ([67.229.141.125]) by smtp.gmail.com with ESMTPSA id 141sm8410079pfw.63.2016.10.26.23.22.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 26 Oct 2016 23:22:25 -0700 (PDT) X-CudaMail-Envelope-Sender: qdy220091330@gmail.com From: Michael Qiu X-Google-Original-From: Michael Qiu To: dev@openvswitch.org X-CudaMail-MID: CM-V1-1026000191 X-CudaMail-DTE: 102716 X-CudaMail-Originating-IP: 209.85.192.194 Date: Thu, 27 Oct 2016 14:15:21 +0800 X-ASG-Orig-Subj: [##CM-V1-1026000191##][PATCH 2/5] lib/dp-packet: copy additional packet info when do packet copy Message-Id: <1477548924-26376-3-git-send-email-qiudayu@chinac.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1477548924-26376-1-git-send-email-qiudayu@chinac.com> References: <1477548924-26376-1-git-send-email-qiudayu@chinac.com> X-GBUdb-Analysis: 0, 209.85.192.194, Ugly c=0.285716 p=-0.25 Source Normal X-MessageSniffer-Rules: 0-0-0-6423-c X-Barracuda-Connect: UNKNOWN[192.168.14.2] X-Barracuda-Start-Time: 1477549346 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.60 X-Barracuda-Spam-Status: No, SCORE=0.60 using global scores of TAG_LEVEL=3.5 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=4.0 tests=BSF_SC5_MJ1963, DKIM_SIGNED, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.34084 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS 0.50 BSF_SC5_MJ1963 Custom Rule MJ1963 Cc: Jijiang Liu , kevin.traynor@intel.com, Michael Qiu Subject: [ovs-dev] [PATCH 2/5] lib/dp-packet: copy additional packet info when do packet copy X-BeenThere: dev@openvswitch.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dev-bounces@openvswitch.org Sender: "dev" Currently, when doing packet copy, lots of DPDK mbuf's info will be missed, like packet type, ol_flags, etc. Those information is very important for DPDK to do packets processing. Signed-off-by: Michael Qiu Signed-off-by: Jijiang Liu --- lib/dp-packet.c | 3 +++ lib/netdev-dpdk.c | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/lib/dp-packet.c b/lib/dp-packet.c index bf8522e..619f651 100644 --- a/lib/dp-packet.c +++ b/lib/dp-packet.c @@ -175,6 +175,9 @@ dp_packet_clone_with_headroom(const struct dp_packet *buffer, size_t headroom) new_buffer->cutlen = buffer->cutlen; #ifdef DPDK_NETDEV new_buffer->mbuf.ol_flags = buffer->mbuf.ol_flags; + new_buffer->mbuf.tx_offload = buffer->mbuf.tx_offload; + new_buffer->mbuf.packet_type = buffer->mbuf.packet_type; + new_buffer->mbuf.nb_segs = buffer->mbuf.nb_segs; #else new_buffer->rss_hash_valid = buffer->rss_hash_valid; #endif diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c index 27b4ee2..ad92504 100644 --- a/lib/netdev-dpdk.c +++ b/lib/netdev-dpdk.c @@ -1589,6 +1589,10 @@ dpdk_do_tx_copy(struct netdev *netdev, int qid, struct dp_packet_batch *batch) memcpy(rte_pktmbuf_mtod(mbufs[newcnt], void *), dp_packet_data(batch->packets[i]), size); + mbufs[newcnt]->nb_segs = batch->packets[i]->mbuf.nb_segs; + mbufs[newcnt]->ol_flags = batch->packets[i]->mbuf.ol_flags; + mbufs[newcnt]->packet_type = batch->packets[i]->mbuf.packet_type; + mbufs[newcnt]->tx_offload = batch->packets[i]->mbuf.tx_offload; rte_pktmbuf_data_len(mbufs[newcnt]) = size; rte_pktmbuf_pkt_len(mbufs[newcnt]) = size;