From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 58FBBA04BC; Thu, 8 Oct 2020 11:24:02 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B83E01BBD2; Thu, 8 Oct 2020 11:23:59 +0200 (CEST) Received: from hqnvemgate26.nvidia.com (hqnvemgate26.nvidia.com [216.228.121.65]) by dpdk.org (Postfix) with ESMTP id EA97C1BA6F for ; Thu, 8 Oct 2020 11:23:56 +0200 (CEST) Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate26.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Thu, 08 Oct 2020 02:23:43 -0700 Received: from HQMAIL111.nvidia.com (172.20.187.18) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Thu, 8 Oct 2020 09:23:54 +0000 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.43) by HQMAIL111.nvidia.com (172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Thu, 8 Oct 2020 09:23:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=csPLvHVsE8y7zkj09qnZPzdRlhygJUbN2gas3RlYdWUoDHT2xZo/yZA7lBIPIn6hnQlzeLhOHG2ylLQJ4miFeGnMRS2wVEe8/jdorukAzVV7TBnKsdwTilMyTfdqSvxGnYry+6kY93270+tGGuXrUbRA/cE3ulKagNgl/G1ol8S0Bf66DTkzqLHUOym4DB7X+1+5HafO5RxvWFsWCp+P79zQ6RY6rmztK92rFkVCTFzXsUygT08MPTsYSgD/yMCMiAS1WG3rr9TSUaC2zObxeYWkjxFI2TFC+4uGilSOg4axajJjQUKnKlhmgiH1x1CJu3o9mR7+BTc5w9mkC03oNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=N8lEk5BN3IbHTmb0sw+b/cyqYsLqfx48Wy/flT0h5WM=; b=f0IEW0ui4KulEKsjbfxNacVLIu7M5u7mn7+D58WXOq3BjjUgowbaa654AIeTblDKoj5+GbWhSkN8LqD0daYCjqVM0gY5N4DepWxt6em4W+NaoyYGPUYUWMb0dgRF6wbfLTaGhCqsIJMQRsFSWhvla2T1ZSwfsazI84nrSzN8yiuyAgit4EPS3MOG8ehKdimw+TR9g9y+Em0AE1p+/u6wacTGlLXWIAZJiRIT6Q50onkqR8rLRM5cldP4MTvXJdqx41d6z1tM5fj6mDQwx/BNIXx9qY0tcjGPpL/gkXRqt9F4pHS6P9HpPrD4Sqt11NITYQiXKUOo7TLWKRlkcxIo4Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none Received: from MN2PR12MB4286.namprd12.prod.outlook.com (2603:10b6:208:199::22) by BL0PR12MB5009.namprd12.prod.outlook.com (2603:10b6:208:1c2::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.21; Thu, 8 Oct 2020 09:23:53 +0000 Received: from MN2PR12MB4286.namprd12.prod.outlook.com ([fe80::61fd:a36e:cf4f:2d3f]) by MN2PR12MB4286.namprd12.prod.outlook.com ([fe80::61fd:a36e:cf4f:2d3f%9]) with mapi id 15.20.3455.023; Thu, 8 Oct 2020 09:23:53 +0000 From: Ori Kam To: Bing Zhao , NBU-Contact-Thomas Monjalon , "ferruh.yigit@intel.com" , "arybchenko@solarflare.com" , "mdr@ashroe.eu" , "nhorman@tuxdriver.com" , "bernard.iremonger@intel.com" , "beilei.xing@intel.com" , "wenzhuo.lu@intel.com" CC: "dev@dpdk.org" Thread-Topic: [PATCH v2 2/6] ethdev: add new attributes to hairpin config Thread-Index: AQHWnVBMPQqghqgLB0mLU1yZGFat96mNanLA Date: Thu, 8 Oct 2020 09:23:53 +0000 Message-ID: References: <1601511962-21532-1-git-send-email-bingz@nvidia.com> <1602147098-9768-1-git-send-email-bingz@nvidia.com> <1602147098-9768-3-git-send-email-bingz@nvidia.com> In-Reply-To: <1602147098-9768-3-git-send-email-bingz@nvidia.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: nvidia.com; dkim=none (message not signed) header.d=none;nvidia.com; dmarc=none action=none header.from=nvidia.com; x-originating-ip: [147.236.152.129] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 2ed3cb84-7679-43bc-3531-08d86b6bdfc7 x-ms-traffictypediagnostic: BL0PR12MB5009: x-ld-processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6108; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: I0msINakzcI4jJXQYEPqvD/LahKjMeg+SPZcc1cd0he3tlVD7KaFhiTJlBqDisCCd4KdyjM+aVlO66gPax6eVLTHjLm9pahpFT65W6mHJMGL4+em5W6T0B8sHRadsjrl6unMop8NcYMhZIBpqaD19WlQ0UaRaFfMn0Ew3Wk2eqahEKw38Srt9kcaD+eth+dYs3IX+RBq4fCcpDCKQ10C7D0wx5qKmor2wojhFemK3fCdRfKXIhCo+lXTjDYuhxbmH4TF7aVb7JNDlw3LDvlbppXb1z2ZptH4xGe/002H+XtSSu4BXIGt6chAuHU35wmf0N0szsZZ3w1whxsqzS0tgA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR12MB4286.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(136003)(376002)(396003)(366004)(39860400002)(66446008)(64756008)(66556008)(66946007)(8676002)(4326008)(6506007)(53546011)(186003)(9686003)(26005)(7696005)(71200400001)(8936002)(76116006)(2906002)(66476007)(316002)(55016002)(86362001)(33656002)(110136005)(5660300002)(478600001)(83380400001)(52536014); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: cQuWg/0XjqTc/jpGjy1ErAJJg5LViYiDZldXFoXK2arT84/zWf+XLryuDnwDOF3HA2XciC6e4zVFX/i9sULKMRVdnxFXdSEPu2lh+DaIiIuwi8K6EgY+DUKbxFEY1wSAF/DgKOaCxXPqD6iikfrLcFNfcebm5069rQoCRihXuEMA+PXRTzYLu0HpHukqn7OlaIwosoN8f+6+FsDWuhHLN9S8l+LHIBFgGrhS/91r3EQFOPvbMPjOOiamI7xAyIfqRwf/6lJveoWUt/Cir0FWGmD2GqKXoZNPdqzDo84cvk67FJhqpVwBEMp8Cea0Gzy1/0OeN7F5xokQcyrA2F4T8YWzu6bvmCfhUnorP8xYjljAFiosP/t2fQW3DGPhIZahnI9dwOBWMcTHgT5h7DRKnNwQrvQN8jyvvVmjXiIfPP5+URXvmP8W2oe+X38egrgLGLPgIl5unb5YEfhkaO36fv6SpIppu2nLefMIJZe5TpHDCqni7aIPL/65K70W3ENFrBspBY4/RptyT78jVEiBtUEGM6IcmaELxZP5G87QkNf2SPyEijT5srQ746j+lBWBSgLrLWFAmt7YYq+4KMMnG7/z/N0E+cTZWPKQ7b+EkQBbjUiYjz29B+H2GSEMezUz2FJgBMo1kDGKGRYsxQLp2w== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN2PR12MB4286.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2ed3cb84-7679-43bc-3531-08d86b6bdfc7 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Oct 2020 09:23:53.1897 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: gqq2a+FEwnYwk2iiViQnlg7x74Nw54IOdUA2OsrZUJkerKi0D8KJI74B3JdjnHiFA/kSqeMLeoxP2WPtK7ckgg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR12MB5009 X-OriginatorOrg: Nvidia.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1602149023; bh=N8lEk5BN3IbHTmb0sw+b/cyqYsLqfx48Wy/flT0h5WM=; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To: CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References: In-Reply-To:Accept-Language:Content-Language:X-MS-Has-Attach: X-MS-TNEF-Correlator:authentication-results:x-originating-ip: x-ms-publictraffictype:x-ms-office365-filtering-correlation-id: x-ms-traffictypediagnostic:x-ld-processed: x-ms-exchange-transport-forked:x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers:x-ms-exchange-senderadcheck: x-microsoft-antispam:x-microsoft-antispam-message-info: x-forefront-antispam-report:x-ms-exchange-antispam-messagedata: Content-Type:Content-Transfer-Encoding:MIME-Version: X-MS-Exchange-CrossTenant-AuthAs: X-MS-Exchange-CrossTenant-AuthSource: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-originalarrivaltime: X-MS-Exchange-CrossTenant-fromentityheader: X-MS-Exchange-CrossTenant-id:X-MS-Exchange-CrossTenant-mailboxtype: X-MS-Exchange-CrossTenant-userprincipalname: X-MS-Exchange-Transport-CrossTenantHeadersStamped:X-OriginatorOrg; b=MGrC8+Q1VdnaaJS3BkN/zT3qXkkfp4pDMCrgQKriWZvqN1NDcScYfxSQQ2c8RrTDC S6S/0XXQNE2EVxVZSlTb9cZh8+ind3/EN/sa3sLYmyuQfzue5rlugU3uwIbS5jkSBt 5RyOHETK02pPsTo1Bclu7BY7PlZgNjvft8A0LSoAUyoIVi71JQ5ftR/sXm0W5BMVpD Qwt6Wwf/dnBRZ71JHQ65v/MXzOV+DenxkBMyznHHiaRQbZDuCU32DUvHiE2lSJ5iNl xqEMIlfEeRKvtmJV6RT6XgSZs0HdxCjoYbytGzzRzmTQnxV1KAT01uR1xxdremMlkt dFinLu3kgs2pg== Subject: Re: [dpdk-dev] [PATCH v2 2/6] ethdev: add new attributes to hairpin config 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Bing, > -----Original Message----- > From: Bing Zhao > Sent: Thursday, October 8, 2020 11:52 AM > Subject: [PATCH v2 2/6] ethdev: add new attributes to hairpin config >=20 > To support two ports hairpin mode and keep the backward compatibility > for the application, two new attribute members of hairpin queue > configuration structure are added. >=20 > `tx_explicit` means if the application itself will insert the TX part > flow rules. If not set, PMD will insert the rules implicitly. > `manual_bind` means if the hairpin TX queue and peer RX queue will be > bound automatically during device start stage. >=20 > Different TX and RX queue pairs could have different values, but it > is highly recommended that all paired queues between one egress and > its peer ingress ports have the same values, in order not to bring > any chaos to the system. The actual support of these attribute > parameters will be checked and decided by the PMD drivers. >=20 > In a single port hairpin, if both are zero without any setting, the > behavior will remain the same as before. It means no bind API needs > to be called and no TX flow rules need to be inserted manually by > the application. >=20 > Signed-off-by: Bing Zhao > --- > v2: optimize the structure and remove unused macros > --- > lib/librte_ethdev/rte_ethdev.c | 8 ++++---- > lib/librte_ethdev/rte_ethdev.h | 5 ++++- > 2 files changed, 8 insertions(+), 5 deletions(-) >=20 > diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethde= v.c > index 85a19bd..a4adeff 100644 > --- a/lib/librte_ethdev/rte_ethdev.c > +++ b/lib/librte_ethdev/rte_ethdev.c > @@ -1954,13 +1954,13 @@ struct rte_eth_dev * > } > if (conf->peer_count > cap.max_rx_2_tx) { > RTE_ETHDEV_LOG(ERR, > - "Invalid value for number of peers for Rx queue(=3D%hu), > should be: <=3D %hu", > + "Invalid value for number of peers for Rx queue(=3D%u), > should be: <=3D %hu", > conf->peer_count, cap.max_rx_2_tx); > return -EINVAL; > } > if (conf->peer_count =3D=3D 0) { > RTE_ETHDEV_LOG(ERR, > - "Invalid value for number of peers for Rx queue(=3D%hu), > should be: > 0", > + "Invalid value for number of peers for Rx queue(=3D%u), > should be: > 0", > conf->peer_count); > return -EINVAL; > } > @@ -2125,13 +2125,13 @@ struct rte_eth_dev * > } > if (conf->peer_count > cap.max_tx_2_rx) { > RTE_ETHDEV_LOG(ERR, > - "Invalid value for number of peers for Tx queue(=3D%hu), > should be: <=3D %hu", > + "Invalid value for number of peers for Tx queue(=3D%u), > should be: <=3D %hu", > conf->peer_count, cap.max_tx_2_rx); > return -EINVAL; > } > if (conf->peer_count =3D=3D 0) { > RTE_ETHDEV_LOG(ERR, > - "Invalid value for number of peers for Tx queue(=3D%hu), > should be: > 0", > + "Invalid value for number of peers for Tx queue(=3D%u), > should be: > 0", > conf->peer_count); > return -EINVAL; > } > diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethde= v.h > index 6206643..94a981c 100644 > --- a/lib/librte_ethdev/rte_ethdev.h > +++ b/lib/librte_ethdev/rte_ethdev.h > @@ -1045,7 +1045,10 @@ struct rte_eth_hairpin_peer { > * A structure used to configure hairpin binding. > */ > struct rte_eth_hairpin_conf { > - uint16_t peer_count; /**< The number of peers. */ > + uint32_t peer_count:16; /**< The number of peers. */ > + uint32_t tx_explicit:1; /**< Explicit TX flow rule mode. */ > + uint32_t manual_bind:1; /**< Manually bind hairpin queues. */ > + uint32_t reserved:14; /**< Reserved bits. */ > struct rte_eth_hairpin_peer peers[RTE_ETH_MAX_HAIRPIN_PEERS]; > }; >=20 > -- > 1.8.3.1 Acked-by: Ori Kam Thanks, Ori