From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00052.outbound.protection.outlook.com [40.107.0.52]) by dpdk.org (Postfix) with ESMTP id 7790910B7 for ; Tue, 24 Apr 2018 03:39:13 +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=CIgaKi5p8ATgO1HfqNxEydgoDjjThCWJ3UoFJrCTkBQTlplm5/UIAUBJHWUWJ3Tdtx23CeiM93CcbVHLZU7qEwsZgnvz+T3tPH2t96s4WJAZ5e5ZuspRIELI3QE6c72AapFRIiIEZGbY26WfnHzO4YCgHTqQJCfQmOW6aMVV66U= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=mellanox.com; Received: from mellanox.com (209.116.155.178) by AM5PR0501MB2035.eurprd05.prod.outlook.com (2603:10a6:203:1a::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.13; Tue, 24 Apr 2018 01:39:10 +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: Mon, 23 Apr 2018 18:38:54 -0700 Message-Id: <20180424013854.33749-2-yskoh@mellanox.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180424013854.33749-1-yskoh@mellanox.com> References: <20180310012532.15809-1-yskoh@mellanox.com> <20180424013854.33749-1-yskoh@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [209.116.155.178] X-ClientProxiedBy: CY4PR04CA0073.namprd04.prod.outlook.com (2603:10b6:910:4f::38) To AM5PR0501MB2035.eurprd05.prod.outlook.com (2603:10a6:203:1a::21) 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:AM5PR0501MB2035; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0501MB2035; 3:mympcHDQ/D8O+0hkf8W3XM0s8l8mq3CfHxbGTXyErxNTGb3cD42COHxPZ1C3OS4MD3mqF/a+XGIezy8RnN8pHpSLNxRcmmF1ntVdn6KQ5w7qJ7As58jbEg/09G9kdEm7rYwBMZ0+7sUNHHGiB5s0c3W2/brCCb2J8RRJ4y3XFeALMYpvgq4GxeEzAoB8dRszggsggEYfBcE3q9MaT5+Sz9W4L7upgZG2vUUyioV3Jiq6gFzF6r7gv59m+jcPvxHL; 25:hYp8iKvHdJP8EmW3cvlumUYy8FtgQm/ahTG8k5E9jJ9nhnJlpA01+W/cTFsWHeqySY5eSCkYB8TAQ9hZM4gimPI7nGLIqvJlWKJkBiWPLb18GtKlO7g84uvidqfvQA9IGZeOEHvngHjNDNekTka7/NElXAiw/wvnHk237X7Rgqg0rYjtp4eYhbpHBiA6/88oTXnNTn3XzrJqw3d4Z/49rFEGG91RS3HUPglbuFdyLMA7meeyxR9yhmY894u2LEKXq35KzNEAXwgqGAv4e2xzTqgkSRciv9KDqRDC6xEOn9vJGDAMKhOSPw9pEyhBYhGjFkAvSJqGUS9xfj8TZ2hpkQ==; 31:c8E0ATDOy+zipHwpe/v6aNBGMCQYpcQgMUx+6o78EwdwW1bKvf5uc2CgKmNUJ4kJnfXuJqZbqTYg521dR+yq6hRSYpnfI9BQwfOZ46PhU3/uXZ3YZh+vuAaMx5TyccXnUwJWUzInC2fIOrHYQnyp9q4yKWnfyffP9dHJO1Y24AIOvlsM3IgljhkA3NnvF/7PndNad3/tdPYMCu/X+G2fqRQJKKnhAwIV7CSQgc6vKoc= X-MS-TrafficTypeDiagnostic: AM5PR0501MB2035: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; AM5PR0501MB2035; 20:ixGUq0ALW20P0Gek9YEia3gXlnE+5WJLOskcCMgoNnGHNc0N8K18fyjewdUyxVuNDXVrhRhNBawCUObM4oQKWA2v5oqsgy4Bd4mqjHRWKJVGL5ksuULPuTR3v27vMGlfJTkHUIllqxmd+F69uqOXWSq2MF4kaec3meZFCM4g2AFaZIz66yxMpLbIxJ6UA8y8GF3hNvAO+3R89+BKjGwWyaN7OcxMe5lfIz3cxllHQNktZh67job0mOB2IsLLs6pME0HHgeOqffLskE/eubvdZq5tNFCyvw6BeJr3ImHba2/ZGpBQ+ywM+r9Mw0GJM8wqp/+4DyMD4YVj9Mm52Latma931v+jr8lQycAOFhumiMvjs6qgYOR/F9JfbST2qtQumghPytebJwv7nBM/lekgMve70fLR6oQEo1nFIpsCHtcUlomGbE+hZ5MSOb7ShmUjRPIUW0ycDJSklbwRbtE0r7ULeqnEYYyiJTjbJEabJwk12fQfSwJwlZAW5H/usaxU; 4:6r8UTZIYewvjElCgSd0/Cy5iChpxXYjBtI+y3QunaLsWkuCJ2Mh7CABVZFDJBskxsqpCqCN2ydcz/UNPRLSqmpylybUJTuocRqdcv+FaPZ2FtLEZ73lKMdwlyptKBHm8z5AcWSAJ1sykGggZCXDKmzJ2hsrMO9PJSBgDyVdDEQqJHhUR31q0S8BTekJH/aXKvLV2aL6vN1I2kJh/yuxwREra2R3CLstuCIqgcgoepI3DafySU2TRqz86Z1qEYinWOkyMbw3Zw4fyrgmSLDgF6g== 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)(3231232)(944501410)(52105095)(3002001)(10201501046)(93006095)(93001095)(6055026)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123564045)(20161123560045)(20161123558120)(6072148)(201708071742011); SRVR:AM5PR0501MB2035; BCL:0; PCL:0; RULEID:; SRVR:AM5PR0501MB2035; X-Forefront-PRVS: 0652EA5565 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(366004)(376002)(39380400002)(396003)(346002)(50466002)(48376002)(16526019)(2906002)(386003)(6116002)(478600001)(1076002)(26005)(4326008)(186003)(6666003)(305945005)(3846002)(52116002)(7736002)(956004)(7696005)(11346002)(76176011)(575784001)(55016002)(86362001)(446003)(316002)(476003)(8936002)(5660300001)(81166006)(8676002)(36756003)(107886003)(50226002)(2616005)(53936002)(47776003)(16586007)(66066001)(25786009)(5890100001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0501MB2035; H:mellanox.com; FPR:; SPF:None; LANG:en; MLV:sfv; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM5PR0501MB2035; 23:nNvq7+ec8XzEgsew3OwHWh9xS7QJQbgG440Grk3?= =?us-ascii?Q?DJpEXN/0HIl9NpA2NO82CuACBBXBitJekHcE69ij52vGr76GT9m76U1cYbph?= =?us-ascii?Q?PHItcNFCxFH03qq8SKwpDzU4C0U4EyxAKpq3+4Em8kocgTswB6Tsry1j8m38?= =?us-ascii?Q?iyg5vfDUMFt/E1LydGMZlhY7DICkbTFT1aAKopX54015xKPpdGZD+TJfoSEe?= =?us-ascii?Q?LY54ofBRPCF19lD9q5DUUorms8vcvuaZ8JX8Pt+lr+WuGWGYoAvIPpDTT1g0?= =?us-ascii?Q?ObuNEarertW7l5PAQQypgW9seIrbJTNnISFyaMcsJ0vl6jHDIOS+HMHZMajQ?= =?us-ascii?Q?u6eiE3ETjpJoF85qEEiHIEtcZ9j9VW4YoaySuuCEzO0FG63AA9HCVRGdNYFr?= =?us-ascii?Q?h86nmpEDMy+88m8quwpYz/KD3A6pmxUCsz7QtradYzp5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correlation-Id: eac67246-1a44-43a9-e099-08d5a9842e27 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Apr 2018 01:39:10.1685 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: eac67246-1a44-43a9-e099-08d5a9842e27 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0501MB2035 Subject: [dpdk-dev] [PATCH v4 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: Tue, 24 Apr 2018 01:39:13 -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