From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60043.outbound.protection.outlook.com [40.107.6.43]) by dpdk.org (Postfix) with ESMTP id 13C5A201 for ; Wed, 3 Oct 2018 09:22:44 +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:X-MS-Exchange-SenderADCheck; bh=TEckWj5bvbQV4FdUavBWPDic0AoYDe8xWZu1vfxOnn4=; b=uM2QhePA4lQRO0dxNgE7csDXM5G7Ly4y2V+ZcxfMnkbr49tmkABnXi/2sIpRqc1keTxAsoO6fxk1mRv0rRXDZQRx/+E58+0ysw5QlHpTFrXMKb1Jv2kJICDYxo8hRPSjboUkg5nDLVD+kc3pWN1fV87TRc+i9ZJRIhn6YpO7Y/E= Received: from DB3PR0502MB3980.eurprd05.prod.outlook.com (52.134.72.27) by DB3PR0502MB3993.eurprd05.prod.outlook.com (52.134.70.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1185.25; Wed, 3 Oct 2018 07:22:43 +0000 Received: from DB3PR0502MB3980.eurprd05.prod.outlook.com ([fe80::1cb0:661b:ecab:6045]) by DB3PR0502MB3980.eurprd05.prod.outlook.com ([fe80::1cb0:661b:ecab:6045%2]) with mapi id 15.20.1185.024; Wed, 3 Oct 2018 07:22:41 +0000 From: Yongseok Koh To: Dekel Peled CC: "dev@dpdk.org" , Shahaf Shuler , Ori Kam Thread-Topic: [PATCH v2] net/mlx5: support metadata as flow rule criteria Thread-Index: AQHUVm1ULGxdfgUbYES/FWSaMZ5AmaUGhfIAgAZ/OACAACG3AA== Date: Wed, 3 Oct 2018 07:22:41 +0000 Message-ID: References: <1537105328-9367-1-git-send-email-dekelp@mellanox.com> <1538057935-34663-1-git-send-email-dekelp@mellanox.com> <20180929090906.GA95127@minint-98vp2qg> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=yskoh@mellanox.com; x-originating-ip: [69.181.245.183] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB3PR0502MB3993; 6:PeSUNxZ+00//v84XrvhNldHwlpD6FhpY9hMb67dD/RgExoGnN4OUW42V+xv5n5QJnd96ZwfEwYZMndQCQjg1vbAeqWim60TRq9zb4uDcW3P2rJfAI7zUwojxw3V4RX0JZlnWqQnRIF8Va4xewrts06QvNThQImUv/gSq9ToRagjk4xWBKc0Wq6dcsfMBgMkaHpVtmtqAKd7741ETTKYh1BeoBAikl8X4V0Bep1ACALjfbJj/F1haWb5C7oOSAAdzWZnhiL9a5hYlBsotXDCeVfMiwaTCBHp4lwwZsmeWwDlKMtuI1ViB6bk0rLqjzXE5AHIAGwaQT6C3O4V4du73ieZFBYpTVQ9bqMktqMZF+xVMU2gohgbmJ5XiAP3PWvPh22Yl8cMQ6VXKYV/JWO/pAfE7nZ9MePhmr0v7x1Tk0n87ti0BcBIFEFeGZZV7LuPooOA0TBxjDqrKCaBCh7xBiA==; 5:UVGjmKI3BTQSsZIOtquj+8sShwoMmoV0GoYFIupWmoe+Hv8sWs+UrYatarb3wNGXlxT4ZwekRmKZPna+/39hbcfnI518nYsR0vhJg5+6qDgLU+I7O+Xhm3Khd+Kwb5jta6YmjbNSYGGewMRZJMELiKqsdW8sYMeEtiCnioLAjF0=; 7:Nf5JoDEqW4/jB4gPR2yRMbJFkuvlRoRUaykHD593nFO1EAkjiUcGnRfiy+Tqm53by7yYjHbJx8n4wrXjJ9iITsomuE+yTGPdnNHq0I2AH/DMyd38uyZpqVM0RVlAvy9emCuTeamsSIxfoAd83ZGI2WKGlcTA6qte6HLEdsjYfPnyVKbEwyOP6htr8lc6/2zs7IblPYEls71jg0O8YQX//WPYo/qJrmhOMYqnF8KclDWU7oEnMJFgPC7rZGVbh/sY x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 700e69c0-525f-4cf4-8153-08d6290101a0 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:DB3PR0502MB3993; x-ms-traffictypediagnostic: DB3PR0502MB3993: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231355)(944501410)(52105095)(6055026)(149066)(150057)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123558120)(201708071742011)(7699051); SRVR:DB3PR0502MB3993; BCL:0; PCL:0; RULEID:; SRVR:DB3PR0502MB3993; x-forefront-prvs: 0814A2C7A3 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(396003)(39860400002)(136003)(346002)(366004)(199004)(189003)(83716004)(6486002)(5660300001)(3846002)(229853002)(25786009)(97736004)(6512007)(7736002)(305945005)(6436002)(8676002)(37006003)(76176011)(26005)(8936002)(486006)(54906003)(82746002)(81156014)(81166006)(446003)(476003)(2616005)(256004)(53546011)(11346002)(99286004)(86362001)(106356001)(6862004)(105586002)(66066001)(478600001)(68736007)(102836004)(6246003)(186003)(53936002)(6116002)(6506007)(107886003)(4326008)(14454004)(71190400001)(33656002)(93886005)(36756003)(6636002)(5250100002)(2900100001)(71200400001)(316002)(2906002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB3PR0502MB3993; H:DB3PR0502MB3980.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: RBTpKTAYndKoEN9LH7wf7vKI2N8dlTx+4At9rgP+Frv5BjmRQmWcFaXHFLVoeS3n2B8csi+w85/DFQ0a5e1OTMfjNaiB6UAanI7weqAPNWsHb2iDztHUvu5bUdsG0MqyHoiO1GXkcuSrsP5GQkbf6M26fQBPsyXDifmFsTVKdsVrvSV+IpGGKST9y6vBPJjtEruM+sHSHETlVaa5JTEMW50bzWquxliAtNn43DiDcyZw4/RWEqHEPlIc1FGRlCO9KJLVvatIMnJ5Ty5/qwVqKjEB23qbolRasgH9kEmT1fvj+kzewsCOm2kIDQ7a+ec3x02qdxq3njZVw6wWQwnnNSOooMNZdBb4c8V64dAnRN4= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-ID: <2EAE415FE570C841BAB7B98DD6E528FA@eurprd05.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 700e69c0-525f-4cf4-8153-08d6290101a0 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Oct 2018 07:22:41.7525 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0502MB3993 Subject: Re: [dpdk-dev] [PATCH v2] net/mlx5: support metadata as flow rule criteria 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: Wed, 03 Oct 2018 07:22:44 -0000 > On Oct 2, 2018, at 10:22 PM, Dekel Peled wrote: >=20 >>> @@ -137,8 +152,10 @@ >>> n =3D RTE_MIN((uint16_t)(pkts_n - nb_tx), >> MLX5_VPMD_TX_MAX_BURST); >>> if (txq->offloads & DEV_TX_OFFLOAD_MULTI_SEGS) >>> n =3D txq_count_contig_single_seg(&pkts[nb_tx], n); >>> - if (txq->offloads & MLX5_VEC_TX_CKSUM_OFFLOAD_CAP) >>> - n =3D txq_calc_offload(&pkts[nb_tx], n, &cs_flags); >>> + if (txq->offloads & (MLX5_VEC_TX_CKSUM_OFFLOAD_CAP | >>> + DEV_TX_OFFLOAD_MATCH_METADATA)) >>=20 >> How about writing a separate func - txq_count_contig_same_metadata()? >> And it would be better to rename txq_calc_offload() to >> txq_count_contig_same_csflag(). >> Then, there could be less redundant if-clause in the funcs. >=20 > It was considered during implementation but decided to handle all related= logic > In same function. But it doesn't look efficient. Note that it is performance critical datapat= h. if (A) { for (n) do_a(); } if (B) { for (n) do_b(); } vs. if (A or B) { for (n) { if (A) do_a(); if (B) do_b(); } } In the worst case, condition A and B will be checked n times each while it = can be only once in the first case. Thanks, Yongseok=