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 6D273A04DB; Thu, 15 Oct 2020 06:04:09 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B84681DC0D; Thu, 15 Oct 2020 06:04:07 +0200 (CEST) Received: from nat-hk.nvidia.com (nat-hk.nvidia.com [203.18.50.4]) by dpdk.org (Postfix) with ESMTP id 7C2391D16D for ; Thu, 15 Oct 2020 06:04:06 +0200 (CEST) Received: from HKMAIL101.nvidia.com (Not Verified[10.18.92.100]) by nat-hk.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Thu, 15 Oct 2020 12:04:04 +0800 Received: from HKMAIL104.nvidia.com (10.18.16.13) by HKMAIL101.nvidia.com (10.18.16.10) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Thu, 15 Oct 2020 04:03:59 +0000 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.43) by HKMAIL104.nvidia.com (10.18.16.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Thu, 15 Oct 2020 04:03:59 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LJe2WB0Cm1ikBGIN+Bmyy/P+q0+GzdQbcwm8JdExqaRBdfyO2R6wjLBqcoZBEDK1cC1Ybj3VWXQQKaGnhRM8Nrv1d8J6SV7URiaggkC2Xln8H+UOkk+CbDWVp+MGoZ1btIgePye/qs7rGu03UaEqgYgHuGclIFZo6FHOEWkHI6jhL1A7lZHNr5pOwIOfAwB1nD1vk/dsUv4iU7lhQDJumnEcCWsp8zb6BrQTugehmWbF19jR0lIDQlxhOsCV/tn8FkgWe4+FRJrynVjZ0HQqM1yLloec+z9swSeS/nDgvhCs7OT7ustuQ65+R191TcmPHBo0gzbtUQObJdvxIIFA+w== 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=p6iGwhPbmJIK4mvm1n+7E0e5vW4prpkyoqeJLcGm0Os=; b=B1dnMAwHs4x8XD0T3ixuWAyps6DG5Vs2xdQ12IqPNjYS9P6nvfMYOpB1ouCgG4Ph3VS3Ffyx2+B1n7NU6LZS+3s3HT1XnQGyLWVEwGHmxsfiIAtAEoNGcGYRtvP26Z0S80ZEDFLARDaID1LU5mSCCN4O5ZKkATGB8gtgRaUTyy9iSFXXKW2nlKdlY0CJMts6jtpTc/igrM+AusW5lfL1ac5hHc7MHkHoZIBrS4w6NorDTI/RKbGBhKMuFScXQs6Q/6qY9QeJWWXEkFPQtpZMs7SjHzm8pJ1hap1+Zf/ALsgRC96xsTqYwqy0FJXRHfX9Jgiyq5Ck5PnhNVbRpFIKDA== 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 CY4PR1201MB0072.namprd12.prod.outlook.com (2603:10b6:910:1b::19) by CY4PR1201MB0071.namprd12.prod.outlook.com (2603:10b6:910:1f::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.28; Thu, 15 Oct 2020 04:03:57 +0000 Received: from CY4PR1201MB0072.namprd12.prod.outlook.com ([fe80::ade4:b300:381d:fe5c]) by CY4PR1201MB0072.namprd12.prod.outlook.com ([fe80::ade4:b300:381d:fe5c%10]) with mapi id 15.20.3477.020; Thu, 15 Oct 2020 04:03:57 +0000 From: Bing Zhao To: NBU-Contact-Thomas Monjalon CC: Ori Kam , "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" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v4 3/5] ethdev: add API to get hairpin peer ports list Thread-Index: AQHWoj1oay2Vo6FtqEqeSuD/9Pre0KmYC6BQ Date: Thu, 15 Oct 2020 04:03:57 +0000 Message-ID: References: <1602158717-32038-1-git-send-email-bingz@nvidia.com> <1602605957-377464-1-git-send-email-bingz@nvidia.com> <1602605957-377464-4-git-send-email-bingz@nvidia.com> <3677075.ahOdM4pD4X@thomas> In-Reply-To: <3677075.ahOdM4pD4X@thomas> Accept-Language: en-US, zh-CN Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: monjalon.net; dkim=none (message not signed) header.d=none;monjalon.net; dmarc=none action=none header.from=nvidia.com; x-originating-ip: [154.18.172.130] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 5c8cf084-fd73-4746-e1a7-08d870bf570f x-ms-traffictypediagnostic: CY4PR1201MB0071: 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:5797; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: feYNU3ZboOnU8XLPjKHoCzWO+FRaXTVaJhQvD6QRxambWlXxw1Fjhx1zwEvvDg6rF0Az1es5cr3cLu5Z+rCrn7ai4vQnWY0vwtkyMFmw0dKqoAv6P3Y+rkroqUpEPPOEXPRautoRwFoV7cU0E9IUcDqdfK4ql07vG9/nm5kbziXReldqnhLt0k8kUPei1/jMYgkUr4TASSROb2hI1DWtNhrN2dp3EDcEvQDkEfBEejqVV6nVgWiTvQuMMAyjwQZmXM9m5hSDOCrMJTmjHA/G6EfhtUwcSBvUDJeV3agA0VwHaMbM6T1iHidcNNnq88ZT x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CY4PR1201MB0072.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(346002)(39860400002)(366004)(136003)(376002)(86362001)(55016002)(33656002)(478600001)(9686003)(6916009)(186003)(54906003)(66476007)(76116006)(66556008)(64756008)(66446008)(6506007)(7696005)(66946007)(5660300002)(316002)(52536014)(53546011)(4326008)(83380400001)(26005)(8936002)(71200400001)(8676002)(2906002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: lTTSpVEN3AUpWbSnx68prI+DIOrEPV3G+WNDDh0CXCGEAI95XQyrf+K6WekGhKnxnNvuYQFFqjwlMdjNuwqTcJ2P0kOJ3xyOLpRhoU6qNyV3Qmzi7Q2JGYUKEXeNXKfosj5ZhNV/dYG/JoAe4j6bDMvszdarxGM3suZycm4mD/da5q6+BgKcIBh8GnCWnqM6aoPsBEv7WPBACqfwoOvOofaPy1kFFRpvaCnOGlrJ0suf6Q0pn0lchuXyHRFjkBZC0byMUxHh9f8jJWbw0+p4Y3ZbtiazG9AWIrk0C/u3bZ3kHHw+nrvMarFvWDHQ0S2Y7ygKNC/5S6qOckYGUFUdpjh6Lg/CjTZjVu0W1u68Ckl72bECRzTaUdcFPQaUvlhIxDeY6J2Hh9V/Pp/yHQzQETS5ndrD4QikbVng5MfpIjg2kCrotWw0YBD65Ch0cCEQQ4BigGhANAW8V6j+kVmzSE6w687X+HdeT5peQg2TO3C9aT0R2xJFPG//btZBDuA63ENcQvpOWwBEX4y/YzoJRdSVex/yD7FKC29FHJ9rTmnkfB1xSc9dV9/pDMGPQOazC25MV7qU2qahha7GgTWYWzzaXH7oRaDFdAjhNrkEbvgHd1GV7gPr9/nSo00OfZVfFa4sL5OGU6wbW6V09NkCbA== 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: CY4PR1201MB0072.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5c8cf084-fd73-4746-e1a7-08d870bf570f X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Oct 2020 04:03:57.3098 (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: LMdC1+Dk9VnFs16Xcvyh3J/R53QfsG1iJSeuxDmgxFetqpU/SY+ZVIM73Pj0L0y9s2efPekHDOoMyJFQHmyJEw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1201MB0071 X-OriginatorOrg: Nvidia.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1602734644; bh=p6iGwhPbmJIK4mvm1n+7E0e5vW4prpkyoqeJLcGm0Os=; 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=PbbVswY3s3kYn2Fz4iHnKbvJsgwAe46fGxgdE9xQKxQ8owicYQlpO1CrlDHKDTTsZ 2yy+phsn747ajv/c7C75sEgM+ReUGmL3G1nJMqFA6AzjFSUpAA6GV6BV7xmzGXwF/m +hAon7vNw9MAWNqc0vyaeLLB0dRYQut+LqSQNb6zGloqDyqH9IM7vOfaXkhsL/cgSN NmnmTwJjpOO8DARZhUjSWSoNPbJxdeLsbCeblN8IS3u28YZtv6Bu1OONosvapQEDBe StlggqXvsqADeo0ifksLVYhvClozLtq3nZzX3JUrm/e/0ZnaHswcAlRuDP+eo5Ppwj +sexePWhI23wg== Subject: Re: [dpdk-dev] [PATCH v4 3/5] ethdev: add API to get hairpin peer ports list 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 Thomas, > -----Original Message----- > From: Thomas Monjalon > Sent: Wednesday, October 14, 2020 11:02 PM > To: Bing Zhao > Cc: Ori Kam ; 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; dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v4 3/5] ethdev: add API to get > hairpin peer ports list >=20 > External email: Use caution opening links or attachments >=20 >=20 > 13/10/2020 18:19, Bing Zhao: > > --- a/lib/librte_ethdev/rte_ethdev.c > > +++ b/lib/librte_ethdev/rte_ethdev.c > > @@ -2208,6 +2208,30 @@ struct rte_eth_dev * > > return ret; > > } > > > > +int > > +rte_eth_hairpin_get_peer_ports(uint16_t cur_port, uint16_t > *peer_ports, > > + size_t len, uint32_t direction) { > > + struct rte_eth_dev *dev; > > + int ret; > > + > > + if (!peer_ports || !len) > > + return -EINVAL; > > + > > + RTE_ETH_VALID_PORTID_OR_ERR_RET(cur_port, -EINVAL); >=20 > should be -ENODEV Fixed >=20 > > + dev =3D &rte_eth_devices[cur_port]; > > + RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops- > >hairpin_get_peer_ports, > > + -ENOTSUP); > > + > > + ret =3D (*dev->dev_ops->hairpin_get_peer_ports)(dev, > peer_ports, > > + len, > direction); > > + if (ret < 0) > > + RTE_ETHDEV_LOG(ERR, "Failed to get %d hairpin > peer %s ports", > > + cur_port, direction ? "RX" : "TX"); >=20 > Missing \n Thanks, done. >=20 > > + > > + return ret; > > +} > > --- a/lib/librte_ethdev/rte_ethdev.h > > +++ b/lib/librte_ethdev/rte_ethdev.h > > * @warning > > * @b EXPERIMENTAL: this API may change, or be removed, without > prior notice > > * > > + * Get all the hairpin peer RX / TX ports of the current port. > > + * The caller should ensure that the array is large enough to > save > > + the ports > > + * list. > > + * > > + * @param cur_port > > + * The current port identifier of the Ethernet device. >=20 > Why current? In general we use "port_id". Changed to port_id >=20 > > + * @param peer_ports > > + * Pointer to the array to store the peer ports list. > > + * @param len > > + * Length of the array to store the port identifiers. > > + * @param direction > > + * Current port to peer port direction > > + * positive - current used as TX to get all peer RX ports. > > + * zero - current used as RX to get all peer TX ports. > > + * > > + * @return > > + * - (0 or positive) actual peer ports number. > > + * - (-EINVAL) if bad parameter. > > + * - (-ENOTSUP) if hardware doesn't support. > > + * - Others detailed errors from PMD drivers. >=20 > Please add ENODEV Done. >=20 > > + */ > > +__rte_experimental > > +int rte_eth_hairpin_get_peer_ports(uint16_t cur_port, uint16_t > *peer_ports, > > + size_t len, uint32_t direction); >=20 >=20 Thanks a lot~