From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0051.outbound.protection.outlook.com [104.47.0.51]) by dpdk.org (Postfix) with ESMTP id B406F5B1E for ; Thu, 19 Apr 2018 03:11:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=j+5PXbBPOfT+3z5C+qRzxLeR7UK+85opQsPD0hxLlPM=; b=NZGzJC5R5iD6DeQcnPJH/CgmGFnXHZSKF0X8UjWuqBU5TmcbNO2yhf8ft3L4+2Sy59D6bNBYvY6LSrLkFuGzdJXCtr157XPyvM16GgTsFR9J6vRdVIezh+bNMa7lvE1SSdHBrGi/P/HINpsR/3RkL1cBwnx7NkwwmVolN+428T8= Received: from mellanox.com (209.116.155.178) by DB6PR0501MB2040.eurprd05.prod.outlook.com (2603:10a6:4:6::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.675.14; Thu, 19 Apr 2018 01:11:20 +0000 From: Yongseok Koh To: wenzhuo.lu@intel.com, jingjing.wu@intel.com, olivier.matz@6wind.com Cc: dev@dpdk.org, konstantin.ananyev@intel.com, adrien.mazarguil@6wind.com, nelio.laranjeiro@6wind.com, Yongseok Koh Date: Wed, 18 Apr 2018 18:11:05 -0700 Message-Id: <20180419011105.9694-2-yskoh@mellanox.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180419011105.9694-1-yskoh@mellanox.com> References: <20180310012532.15809-1-yskoh@mellanox.com> <20180419011105.9694-1-yskoh@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [209.116.155.178] X-ClientProxiedBy: BN6PR11CA0042.namprd11.prod.outlook.com (2603:10b6:404:4b::28) To DB6PR0501MB2040.eurprd05.prod.outlook.com (2603:10a6:4:6::22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:DB6PR0501MB2040; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0501MB2040; 3:T8mkex5tnfocW3F+e9RM4Cyul/iiRLo9uPliesOU3FrFt40e/dF+Zi1bfI3j6YFxvdVgIx6EteBu4fe6PvedsacR69MlE+igxbE9BHTm7pmYyulvaAl5u9K3EBPsA1nCQGxCsszNO6MiR6n4+NUxJf5ZZ8lx7BByoK8smL9AWiM8J4BgGbs1SmBJLV0WyEMjQyaxou5tX4UKTvreIP2YtD8ZMvn9YbZh7aF5uhUWtBQROV2AoT/rfvvcpeZ4n9vq; 25:iY1fho2LLc9ICaR+sURx1xlP09OMcfPOqIJirHpKtIGZzcS6jhu++8UHphtpNwkm06i/u6S+bZ+aJKOUE6r+eTSJvVBneMip7Sb7JpwOLkf0flK1t3pEgNdyJyuoa7jQmB1U6Dt1YEcpZhm/L/ttker8nInWs61L7n+UWAkaZYwWypfUa8jb6feg8b1IoytamipXtvLiMt23F9cSaeTzaNDycdHNr6MH4mWB/QmS1wJ+jPo74M4WxpUqfS3yzc+WcgyJHvDed3Q6AkndMJ9HGO1Oj28SiOJP3g9kPDv+jsQJI00lp3AZTjIZA+sSNgAN3BnoIYu/xUyEplcWQU26rA==; 31:ve3AzpKe3FK/ThFZl5usHRlJdRYPFHG2w26zuCGfh6SkF78YaBPaCAwa+OGs9bws5EHRv3cUwM6zx7dQNE4MMIhuf1VMEOaofnn6lM8ywPyBGACxM7w2qO1zLeEnPVlCX/chenCYuKxIohRvvmhlqyNmQZRMMQYeJ2OOoGg7moF066WX+GRbHJb9YweH1Y/wyH1eClrWqcsUYm0m9sce8QCKE8azqLFg14mFgfP8TLE= X-MS-TrafficTypeDiagnostic: DB6PR0501MB2040: Authentication-Results: outbound.protection.outlook.com; spf=skipped (originating message); dkim=none (message not signed) header.d=none; dmarc=none action=none header.from=mellanox.com; X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; DB6PR0501MB2040; 20:vIS0LeIwJ0SHb+5E9OdCm72ihPBW9TWjJHBvJpA+WjqQcy5AxaP0vZHBj/3F83bBe7Gx09ZNRcTp7NHvmzPO1OyMtT01wHbp9D4R57GkMdhSPvxk2iseN9iHsAqSl6jICml7fB1XoFubdLwHemUhE/GCyQX2Pkf/r+NRQVJoMzU8gU+ec6BV613c7ir974SQaHdDMF74wcH1Qw9wolKQmTB5pp/zfb9CUlXzhYFMNZz2aLVvdFgqGs/WV/w6nvXC3rGgFNfkd+9xuNmNINF3EN+sxKVIHuT0j1K8E+xyCflB/R/mEEEaThg1bdR+9OBnidLvW4orFh26FidmbbgvOx2HxcvWE5T1ZreFPjRSLfGnByAvL4CW3X8FONuG7asK90n6+gPpAB+RK397fWChdp6aWwDmT0KTVQuVQ6L805txUUvx847I1yDGwAfeIPapxZOF0rqiSPuDWrhaLseExcc2LC+5uNdBjpIb5t4LOFSharsQcrK4NutUkFgKjshI; 4:jfIBYfue/zOMc0lATdgJ+W/fC0UnjtVJ2zxR6rLsJgp7RKYFzerX9t2f40VKc2RhCTSlXXqjOXyj+S6GdBg8rj5+XMiZy97gTXki/42KFsUzdqimRo/VlGRx221sv7SkVxI8h9xHmuTylF7Vbk6koD/cuT86onYUkaqflHJjd349EwOIEYhqwEDEAwTyvlyFVJ98e25nPtkyCCexAV08Aze1HbYZYw0mCN0ZIdfAECVDgAacRuIesZdB2kR/OsDK6bdrZSgRRH/rcdzokVa/XA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(10201501046)(3231232)(944501372)(52105095)(6055026)(6041310)(20161123560045)(20161123558120)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:DB6PR0501MB2040; BCL:0; PCL:0; RULEID:; SRVR:DB6PR0501MB2040; X-Forefront-PRVS: 0647963F84 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(376002)(366004)(39380400002)(39860400002)(186003)(956004)(6666003)(52116002)(446003)(386003)(66066001)(1076002)(107886003)(86362001)(47776003)(11346002)(50466002)(26005)(16586007)(3846002)(36756003)(476003)(316002)(2616005)(76176011)(7696005)(51416003)(16526019)(8936002)(50226002)(478600001)(305945005)(575784001)(8676002)(81166006)(55016002)(53936002)(6116002)(5890100001)(7736002)(5660300001)(2906002)(25786009)(4326008); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0501MB2040; H:mellanox.com; FPR:; SPF:None; LANG:en; MLV:sfv; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB6PR0501MB2040; 23:ljXl7TQJ7sEIK0aIZ/i5+XcgUweUBBgpoP71xsd?= =?us-ascii?Q?gM3xs9Wn9aAah4N2q83oSVatVjiH26c7y90bGHoEZyxEE/C9SHRHfpgVivtc?= =?us-ascii?Q?1X0GyvmzvpsXwugPWbt1Pa52zkbiHv1cO29Hak4I7Ty2S3EFfzMvDjfw/tHF?= =?us-ascii?Q?KAiNMFNbDZUyDvZf/SoRE/OavplH81efAuzSrs7bnEkT4vCbFwRNSJaqzkvc?= =?us-ascii?Q?jNWqNdbttKkeaw1v9qj2Py8QgIa9eOITQgJb/vkNyFD2ManmwcjbzLcZh1Tp?= =?us-ascii?Q?FjPXoneJAL9lthyD3kXqgJ3IKelF7yjiqFz1WZ6ll6WYuWHzpUlQxRnL37Vy?= =?us-ascii?Q?QmMn/QU3Z3Q7Hzy+ey3msw8dyujqr7plsR78FG8sboeE0grap+QY5RzSA+jM?= =?us-ascii?Q?hnJJTeU9hVOUBku6ktfJnUFH34iqka4pj/iVJaTkUvDLO1gDNaZsYAWaDSEH?= =?us-ascii?Q?442LAJrWaXDLZzr7kj4draK7tSF8feYKT8NwbofzAJV+yVFXxZHf2Q7QX6Xn?= =?us-ascii?Q?k+ZHxXBnM8dtRC5Cq+syBiG7pAcHfW8S/+oar5Q9KpErDGCD4/BgoPsVAqLp?= =?us-ascii?Q?zoMoMYk/d43Hnf/ET2h5bcDRIevShc78u80ozgAOhFBmAYEzG296w3brlYHV?= =?us-ascii?Q?EsuimiiWf/YyR3KpzjRtJ9ALNqx0lXA+G4pit0kqiCDO85cUbUVTR6ochRRT?= =?us-ascii?Q?yfxPyau/E8ZHsmQr246m3p7WqQxE2suBVmjdcs4OAh7ubAZGIae/37gDOSpM?= =?us-ascii?Q?3ZmeK8ufCZbp2DbS5i4L0TSu/LHTuQBp9FvItMrWED+/Tij0Hk1k/C2jlxUl?= =?us-ascii?Q?CaiV4qi1QGCR+nPpIesTcv/Eji1ZKa4UKcj0+LsuNOWceMyFd59ykhPJPeuk?= =?us-ascii?Q?4JPO6bIgjcre4xzaHSh0xvNb5B4yMHfUOii7FCvjBmNyOfueqAeG2ZchpXSJ?= =?us-ascii?Q?i0a37pwh4SkQOa6eUortWeaQzlg+yyqNaxLTwfkqlr4+zR8sFOqyM9pZdqgF?= =?us-ascii?Q?hp1s083pg1TeUiTbZKAN4zDRaWhwYHyjsAr3vA5Ddri163g=3D=3D?= X-Microsoft-Antispam-Message-Info: McOl5s4b6o/U5H1HLLg7QsQlF0MtHzh0nYEQ7fNfoiYfx5lJCxGwGnU73F4zLEshMCCxEGPeO934+SxfR+CZ5EjOT8ZCB3zcKCX7sz9xUZRHQMynh5pMTK519XSz7dCjyLXmuVSypvIC53SyW5tCXuyVTyBqAfqQwsD7YlxxBOawDadIlt4ZBo3Y4aXD7TR1 X-Microsoft-Exchange-Diagnostics: 1; DB6PR0501MB2040; 6:/VmNjugkC46OL5AaGZyor04hm3AIwrqGTZ5ImpFoGC51SZlklniMN4ZidAETk6y6OJUNXf/GjR67kLvf/+ALCcXoCxObUhH4/D9LisB+8D3wBevScHngvWIYfkKp2lSB3WEh0G6j9gICQmpFrV8bUBqvtwzeaeCvMkdQ27aKLgXExcRaNppmhBUVXBaznTPCr5D1jjONKHv26apk5su4HyVCX5SRgtPIthxEDljxqUfTnzcKwSdfuodxFr8dkwPqAwEDgPrjdmmbT5Zr1lFwkpzqvMOhYCLmwt8a+eEhG/t1KtDzMZEHvyi0vlMMoDtLH5JYf7FNFDcm6DNZfvRH/UyVW0VsjW9VVCJta0M/E7MRyUIl1xTKZCpdI91wSgMZw/ay6Y4nN0IsnhEREPLpO1zZZDEyJoVi0R90O944LlLmjClhd5dgtA2KJFRGYSJtseVgmJ51QdoEUA/lq0spyQ==; 5:4vM588p4gE5LVszb46t5JNSysHsuPgpyma9EG+mZOhheMFyKzgB2RY0dpNI6lrDJFOmPgiKckaJdfBPr20766o0iNtHx9A1DWGPxKUFLDDke9T+gfE2j2iNFuK9U6TRRIXQC6xqzYZRF/6KUrTGnAnCAJ3oXMTYRuoXHs/91Wls=; 24:vhjsYfiV8IImTmNsexMVz7GLARJ4YHzKUy5EaurWj/eSok/eXU4NrsvTrz2WsBhcP/rDOLTIejJSEOOThR2HjNjjdSSyyizY23w5n7rtxgQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DB6PR0501MB2040; 7:Skzff2QrNI9sMua6SqCXi5wQ6222zbKEKPVIZCj0M/DxRRptw8UvYWFMojRQpxpXcqQgsafA65qzsbF7AHmIGsTU5MA53iDmgIPmwdZLk0KcXgZiO9PqrKiBZWwxnmcm8N3/1e/JzDSR9WzYAPPueLVhh/CxGsGu/7rPyLzEZyPym8rNKduk4FXg4DeSqNu78tFxzrg6as+kHKH28JNQlfjvAJQ7lZKaHfoCm2CwASjCGnDs/tOqimVm9yi/cmlU X-MS-Office365-Filtering-Correlation-Id: d6a27585-4be9-4c75-1b7e-08d5a59276b0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Apr 2018 01:11:20.2072 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d6a27585-4be9-4c75-1b7e-08d5a59276b0 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0501MB2040 Subject: [dpdk-dev] [PATCH v3 2/2] app/testpmd: conserve offload flags of mbuf X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Apr 2018 01:11:26 -0000 If PMD delivers Rx packets with non-direct mbuf, ol_flags should not be overwritten. For mlx5 PMD, if Multi-Packet RQ is enabled, Rx packets could be externally attached mbufs. Signed-off-by: Yongseok Koh --- app/test-pmd/csumonly.c | 3 +++ app/test-pmd/macfwd.c | 3 +++ app/test-pmd/macswap.c | 3 +++ 3 files changed, 9 insertions(+) diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c index 5f5ab64aa..bb0b675a8 100644 --- a/app/test-pmd/csumonly.c +++ b/app/test-pmd/csumonly.c @@ -770,6 +770,9 @@ pkt_burst_checksum_forward(struct fwd_stream *fs) m->l4_len = info.l4_len; m->tso_segsz = info.tso_segsz; } + if (!RTE_MBUF_DIRECT(m)) + tx_ol_flags |= m->ol_flags & + (IND_ATTACHED_MBUF | EXT_ATTACHED_MBUF); m->ol_flags = tx_ol_flags; /* Do split & copy for the packet. */ diff --git a/app/test-pmd/macfwd.c b/app/test-pmd/macfwd.c index 2adce7019..ba0021194 100644 --- a/app/test-pmd/macfwd.c +++ b/app/test-pmd/macfwd.c @@ -96,6 +96,9 @@ pkt_burst_mac_forward(struct fwd_stream *fs) ð_hdr->d_addr); ether_addr_copy(&ports[fs->tx_port].eth_addr, ð_hdr->s_addr); + if (!RTE_MBUF_DIRECT(mb)) + ol_flags |= mb->ol_flags & + (IND_ATTACHED_MBUF | EXT_ATTACHED_MBUF); mb->ol_flags = ol_flags; mb->l2_len = sizeof(struct ether_hdr); mb->l3_len = sizeof(struct ipv4_hdr); diff --git a/app/test-pmd/macswap.c b/app/test-pmd/macswap.c index e2cc4812c..b8d15f6ba 100644 --- a/app/test-pmd/macswap.c +++ b/app/test-pmd/macswap.c @@ -127,6 +127,9 @@ pkt_burst_mac_swap(struct fwd_stream *fs) ether_addr_copy(ð_hdr->s_addr, ð_hdr->d_addr); ether_addr_copy(&addr, ð_hdr->s_addr); + if (!RTE_MBUF_DIRECT(mb)) + ol_flags |= mb->ol_flags & + (IND_ATTACHED_MBUF | EXT_ATTACHED_MBUF); mb->ol_flags = ol_flags; mb->l2_len = sizeof(struct ether_hdr); mb->l3_len = sizeof(struct ipv4_hdr); -- 2.11.0