From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00088.outbound.protection.outlook.com [40.107.0.88]) by dpdk.org (Postfix) with ESMTP id 655F3AAE8 for ; Fri, 27 Apr 2018 19:23:16 +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=Ci6iO3nX49HaAS/phvSeOw6G0djtmsoA6hETkeeSr6I=; b=TWWVrFiSyA92aZx2Zqp31mfzCqs0XLxNbu2i9HKZwWZ2VX4/gDF1biOlzdOj/t67j78d7FpLtzJI4eIoQOzr1+CnXpzZgxzOxAfsJIKbc7veE/nsCRUBWzs1mf/9T3drnESefatyM4kUH1HJTRfiaRueRDMbdBqG0nWt4vMiaI0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=yskoh@mellanox.com; Received: from mellanox.com (209.116.155.178) by HE1PR0501MB2043.eurprd05.prod.outlook.com (2603:10a6:3:35::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.696.15; Fri, 27 Apr 2018 17:23:12 +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, arybchenko@solarflare.com, stephen@networkplumber.org, thomas@monjalon.net, adrien.mazarguil@6wind.com, nelio.laranjeiro@6wind.com, Yongseok Koh Date: Fri, 27 Apr 2018 10:22:52 -0700 Message-Id: <20180427172252.8153-2-yskoh@mellanox.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180427172252.8153-1-yskoh@mellanox.com> References: <20180310012532.15809-1-yskoh@mellanox.com> <20180427172252.8153-1-yskoh@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [209.116.155.178] X-ClientProxiedBy: CY4PR13CA0011.namprd13.prod.outlook.com (2603:10b6:903:32::21) To HE1PR0501MB2043.eurprd05.prod.outlook.com (2603:10a6:3:35::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:HE1PR0501MB2043; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0501MB2043; 3:xayCdryV8MX4a3UT9DC5A8jBD/vD+y1/cYbnoamjbxbs5+qT/5ydzQIouxH3+Q/Urzlv9Se3VSH+Fnvlc28i5PS3ezSqvNJc2Z1v9GZeokSnlWSDh8KUIQxr7xpnfAXkfx8Xlu2rRtihkNQ/hhxOXwLFimYHlLeShl4ASgq8+U45Gg2EvZYLrXwRU47+dyBTPOoSAJS5oyvCZwzE02IAtwLISPuBTXnER3RLDhrKiQykuwCxJb+Ffu4BDvpzvTms; 25:z8Kg/uMx0tnz+Qq02lbDg4wooRg1Ext1ZRnrdrrtXeWiQ43S2OwmDPC0Fot7gwji9KYzLwx60S2o0p+qgnFEVVNdc6jdjXBsAub3eH1G3FafPBojbE8yLjczjnw81HfyQ+KDWCb6Jq5dWyv1nnKfBkrw/sPhkIvW6bv20894TdFjJtukhPn5liKUrKgUng395/bGvculfpCP4LDi6zCXrCd2uF7eq9YImlL5X4yJp55VbyquI5PNAsWhkqZ+l8d3xoBLfh4cD3dpHOLAA9a0gf0aq7PnUsKJeMboKz8PD5Y5aLcDRdqoiTVY3Cx7XFXZMO8OIjCXKBfsKSjAoOMidQ==; 31:0UFzxQf+yrbUx7lma0y8WrYtTk2nylC78UKro8qyV5w6EPL3hXXRzOLQ2tVc7XJYrIaXcZ6cRZEX5grKx/XDhyE/edr2UmEH+Wn9mBuKk4Q6QK2b8yE2l04mlKqmyag9sdeAFX95A7cj5kLjBcMAhkNxh8uOVo/rdb37qiciFzbThxQQn5Kqtfx+s3UmZQPAn68+CHFiSgOE3wwfm1n0boQJc5v5CaaVLqZPhmJG8bE= X-MS-TrafficTypeDiagnostic: HE1PR0501MB2043: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; HE1PR0501MB2043; 20:+Bl8EUdEC4Zl9GPk6PvyST+phpkEgt5rLw2fJJBpb/sJGm2j/lUUqHWsfyDIYhA5tCcgddx/aXePCxMBuNn2GBP4Jqv06YrFGGukhKpth8YMuLAvFG/ZrYcN3m7QqpDCn3EOCxhtuaLx2v+cKy0trD5wP8teH+9kc+fsdMl1U82mPZnPppo0M/lEL79Ji4vRt/UJu1V3aUqvGmvMJXsUNRlVqd5n76QvHZLfJm4vyhDEj6D5S0mtuJj7Nrt93p2kJ4qV0dvbR6sYlqmc+DKfTUCw7iGzpDeBndOA4Gig+nDpEhW5nJRq57BAMSX2RX7Que4LrFZzDm+O4Mm59uozI/AY4f2D/euMGrwrU2QcpvUy/jsKSVOtskwzsWUe03stiPHnIWP+tPZW5kX7DwU3Loh0kdo+7StnuCPO2JvCgu/ruYASAhuKWKWp5AfwGB8F45H942lyHFwoCdpwYohZceLXjse5BRWoKLBjAyQQUw9ikGgtSf3cCq8aTCEGByta; 4:zk/Ewd01mQV2cxJg9ekbbR6ESO4ZOMf+5mc+Y6oIN2/2WFJcBq89aLVeZJSSuF31Ia8bik7DvEnyEYbGjFF4KRR63uj/yzC9HlhGaBtstFdn6CwkTmxdIBbAuxBz5I6uEsHumERC8YANXOdXGL7vbRJ+Fi+5UfB4JF6jpwvNLNjcK/p/KN4jgP6GNomaDkbA8LU5BVQzZwlLCKcAtzL0wYukplBPqEkqV9tKBnsRqPAXbGlDKBQM+g4/Ov5xG0JC0MfeMd4pQtHnU2C9JV7HX9whHhg3t24Jl2rkzvI71fLwZYeH4QhTuhA9W14PxFFU X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(57589403200043); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(10201501046)(3231232)(944501410)(52105095)(6055026)(6041310)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(6072148)(201708071742011); SRVR:HE1PR0501MB2043; BCL:0; PCL:0; RULEID:; SRVR:HE1PR0501MB2043; X-Forefront-PRVS: 0655F9F006 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(396003)(39380400002)(366004)(376002)(346002)(189003)(199004)(4326008)(26005)(6666003)(53936002)(50466002)(21086003)(69596002)(97736004)(186003)(446003)(107886003)(956004)(55016002)(486006)(2906002)(86362001)(50226002)(16526019)(36756003)(51416003)(76176011)(68736007)(59450400001)(48376002)(81156014)(81166006)(305945005)(386003)(1076002)(8676002)(2616005)(8936002)(476003)(7696005)(3846002)(6116002)(106356001)(105586002)(52116002)(5890100001)(7736002)(5660300001)(7416002)(478600001)(47776003)(316002)(11346002)(66066001)(16586007)(25786009); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR0501MB2043; H:mellanox.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR0501MB2043; 23:W7A8gvGa1VCoy/O8wMfSfRdSuLxtq6OvQCrlpf2?= =?us-ascii?Q?mU+begQQYYdG6ClrnTPaXtv//4S3kuITSUUx2payHQaWbTI2/1DjboFSCgwt?= =?us-ascii?Q?wc8a3A840NEvtIheALm6fpn3b5bI/eUl9S+JTzuH8LrpJd/ohL0pNGq/FAkf?= =?us-ascii?Q?E1IF0vpH5egEVbmFIR0eF6DSM6Z9qwaZLh9XqH0evr2Iz05Gv4uZJ1W3aVcL?= =?us-ascii?Q?cVzEA5zAcy9+Tsjz/GrWcsl8n92YglW5DFsKsgDB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ZBgBP+2S+ZPxXEGQL5/iuuo8DsW9ED8wKlkiA=; 24:4W2tRI0I9JlHEqrd7h8AUZlp4XvUQvsmxuicnmlOuiH/+uRGj+MfQkxkH3xIoII0eFIi5L5W8TvEpgt4F8iHQEo5FdJW2XKuOEHFzGQjllU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; HE1PR0501MB2043; 7:CdAybmH/NESuzXVanRh4Vr8/9D9L46WRbJsvIFq4YXrebaD/Lq7IwuB3vUJfiOxuFypJXkiyfoPxzlAqhau9i0x/nTlkS0WV2PPo/ryNj1VFimCmnNFIX7ftzrfha54WlTK/YNBO1EpAp1qMzgMDXl93kvlsc/0hcDjkV2ySu9E81ZA/BNZa8CDO6cHSFPZT/Uq5KLHgBDX1q4nIi46U9VM5mjTvdukmcjsKCN39ktceDfTFwrGeO2xKhsAjLxW5 X-MS-Office365-Filtering-Correlation-Id: 31db2e66-401b-417e-f390-08d5ac638f44 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Apr 2018 17:23:12.3817 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 31db2e66-401b-417e-f390-08d5ac638f44 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0501MB2043 Subject: [dpdk-dev] [PATCH v8 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: Fri, 27 Apr 2018 17:23:16 -0000 This patch is to accommodate an experimental feature of mbuf - external buffer attachment. If mbuf is attached to an external buffer, its ol_flags will have EXT_ATTACHED_MBUF set. Without enabling/using the feature, everything remains same. 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 carried with externally attached mbufs. Signed-off-by: Yongseok Koh Acked-by: Andrew Rybchenko v8: * inherit flags from mbuf instead of checking !RTE_MBUF_DIRECT(). * fix a bug - update flags on per-packet basis. --- app/test-pmd/csumonly.c | 3 ++- app/test-pmd/macfwd.c | 3 ++- app/test-pmd/macswap.c | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c index 53b98412a..0bb88cf7d 100644 --- a/app/test-pmd/csumonly.c +++ b/app/test-pmd/csumonly.c @@ -737,7 +737,8 @@ pkt_burst_checksum_forward(struct fwd_stream *fs) m = pkts_burst[i]; info.is_tunnel = 0; info.pkt_len = rte_pktmbuf_pkt_len(m); - tx_ol_flags = 0; + tx_ol_flags = m->ol_flags & + (IND_ATTACHED_MBUF | EXT_ATTACHED_MBUF); rx_ol_flags = m->ol_flags; /* Update the L3/L4 checksum error packet statistics */ diff --git a/app/test-pmd/macfwd.c b/app/test-pmd/macfwd.c index 2adce7019..7cac757a0 100644 --- a/app/test-pmd/macfwd.c +++ b/app/test-pmd/macfwd.c @@ -96,7 +96,8 @@ pkt_burst_mac_forward(struct fwd_stream *fs) ð_hdr->d_addr); ether_addr_copy(&ports[fs->tx_port].eth_addr, ð_hdr->s_addr); - mb->ol_flags = 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); mb->vlan_tci = txp->tx_vlan_id; diff --git a/app/test-pmd/macswap.c b/app/test-pmd/macswap.c index e2cc4812c..a8384d5b8 100644 --- a/app/test-pmd/macswap.c +++ b/app/test-pmd/macswap.c @@ -127,7 +127,8 @@ pkt_burst_mac_swap(struct fwd_stream *fs) ether_addr_copy(ð_hdr->s_addr, ð_hdr->d_addr); ether_addr_copy(&addr, ð_hdr->s_addr); - mb->ol_flags = 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); mb->vlan_tci = txp->tx_vlan_id; -- 2.11.0