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 213C5A04DB; Thu, 15 Oct 2020 04:57:12 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F14071DBBE; Thu, 15 Oct 2020 04:57:10 +0200 (CEST) Received: from hqnvemgate26.nvidia.com (hqnvemgate26.nvidia.com [216.228.121.65]) by dpdk.org (Postfix) with ESMTP id 56D3F1DBBE for ; Thu, 15 Oct 2020 04:57:08 +0200 (CEST) Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate26.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Wed, 14 Oct 2020 19:56:54 -0700 Received: from HQMAIL111.nvidia.com (172.20.187.18) by HQMAIL109.nvidia.com (172.20.187.15) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Thu, 15 Oct 2020 02:57:02 +0000 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.168) by HQMAIL111.nvidia.com (172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Thu, 15 Oct 2020 02:57:02 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QGP667NJp7rZTiWAJNX1eAj/inH34uD+kaAn5OKwA4z5oqg2kn07bFWSiGJnAYBtEwwCVKRL806Jgvdmui6YlCsq/Zk1481r17hybHZFKKQ1ume/N6xZGvJwQxUnx9mV7InhOEGza2QQ0c8XlzcSUfyyFmA5CY+d1Y+I7LrcGhjNEnby0IQRx8IuXBSsqb+F1XDN7a+glvKS6v3kyOvg/qeRAycHol2gVDN4xDCraVo8Tuy+SlfJ6U5F+F/94t449FYVZd4bwAvCvzaJc5lX0rq1pKv8NwQPy7Lqi8ITMnSzRCsAjek+1zlHQbAcCmPyRgDN+bzR2jbqCyi//ftVkg== 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=HJYy9Jl8wFysIWduUWSxKBcqA5GHUHCjupqQl3+PF5I=; b=db9EDsJFVbjedzRMeXm29Xtb1cDscG7hIdTcckOQx0fXuy0z7TZBd42q3xz9sbspJI7GIf4n4jWKWGQmqMak96aJG2t8P6sXj+4FsimxMzGHkvboeXGIdiXCjBqlkpnQP1WRoD2/lYVlZMmTRyuPu6nUfs/Vgy3H6lzmIIZ/LLID4LmApyMPmL8ncPdzk3FlR+5lfC1lOs8+HDaiGV//6QGecXqP/YfnF9xbDiJ0dSf3eUR5/ZdDvJwAmhFK6WPBxbMtwAdh0/fYI5eLOMbHA+sRM0XxG12IwaBuyPh2noqoSrlrDtNTFK/y3yIXIhPGW1Kn/vA6+fUivUJviSMKQA== 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 CY4PR12MB1509.namprd12.prod.outlook.com (2603:10b6:910:8::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.21; Thu, 15 Oct 2020 02:56:59 +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 02:56:59 +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 v3 1/6] ethdev: add hairpin bind and unbind APIs Thread-Index: AQHWnWuvuAuwE//54EGIJ39FmEb/yKmXM8oAgADD2/A= Date: Thu, 15 Oct 2020 02:56:59 +0000 Message-ID: References: <1602147098-9768-1-git-send-email-bingz@nvidia.com> <1602158717-32038-1-git-send-email-bingz@nvidia.com> <1602158717-32038-2-git-send-email-bingz@nvidia.com> <3492876.G95Fza0IFT@thomas> In-Reply-To: <3492876.G95Fza0IFT@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: 4e7d5801-c8a0-4cd5-0e30-08d870b5fc06 x-ms-traffictypediagnostic: CY4PR12MB1509: 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:10000; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 36HqaLoXiNMwkPeBWSUfE77/uylNY6pA1/NmPbct/N22eH9HAnUUqqd4/Jf7dGHn56D2RxMpF+Az3QOUk2NThxJdjTnF9CCl4q27lF10N+lfIGfpKLQieHzThyfQJi8lunJe3sihx/TxyVBg2PJFk8vxQf7l7s8iB7evx4pMzgelVMHspCFuAv0TAxbXngw9Zqddm2tZCCUaYPS3EFOgiL6Uz4Jz+7RDzEozCUL0TSaZVu3FK2f4rWhQeYI9/LEVZ0JjCiLEJ1r4OqVjlxEBIPgtJp39gNmVG2uifc58dT2j6pIeshY5xc/GyuUmYPT+5CjRJkfV2MDmYTQp1qBLTw== 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)(376002)(346002)(136003)(39860400002)(396003)(366004)(54906003)(6916009)(5660300002)(6506007)(316002)(66556008)(66476007)(66446008)(64756008)(71200400001)(7696005)(76116006)(66946007)(53546011)(55016002)(86362001)(478600001)(4326008)(9686003)(83380400001)(8676002)(26005)(8936002)(2906002)(186003)(52536014)(33656002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: JvF1cp1yVaQfhFIRiUqOcc2XkRmrZgJvnjE3r6Tn0lYc8oByvBkOdldur1BsXt9AdnSvvj00qiVTXWwmJ9g3AIeceor+hZ/X6KWWzFALrjzjQ1hDgu6PaFDZaUqOghCCHmJ2x+Byxks3Vrpe35ayHjcosqpoImMvnIPV2dk4x+IV+/8sajOCDOHsHCJfQnzKOlfgVC6fcpDRHYUjII4B0y39Jz8/Mgg0ajmhwFpjATsB1eHrLRY+LzjPHfcPTXTgbJPQ7v5Hrcvka+hVOWZVZTruaOdGRy6x4Gc2tzc9monaPQdpDwoDXtusOYbFz1jsTOnlNZFYz8dXLm9YPeQL6UxRbAdAByKKDEPEa/ETYbTU7oXR7+KxS73bkJvXgpX0qclQ8SnNadPJ/W41jbq53fCMUo1wdReXAD8xxI/+/DJHNqK6lp+zOqGbLwW7TuMPQELdQ4QFl8lW+du+AWbSHJFsdSvcHN4gUf+D2Z0ohBX4pUspC2SsIZw0MFOeciv/7qubMNi6xsQQZr7yaXToyresKBDFG+sYGeHgyJbOyZTMttTjqFS/eGl79y9pmk/6KIQu5C8+g3GZt94lZRscGd7DKmSBuPKO7JnLR99Qo2eV2e0Rsl/uG5z1yyLEutONIrLv9ml91vgPozDo1MymCw== 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: 4e7d5801-c8a0-4cd5-0e30-08d870b5fc06 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Oct 2020 02:56:59.1302 (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: q12nW4PCHgpviK1ANKpJYWNWZwn/atrmoCWP7U2HpkSPt4FTw/kqtI+rUjXSAQbiob57lXN3Sq67MEBU4G24cQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1509 X-OriginatorOrg: Nvidia.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1602730614; bh=HJYy9Jl8wFysIWduUWSxKBcqA5GHUHCjupqQl3+PF5I=; 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=A4cAb/an/QZNV/9bu+JHkkKxeG4POE/DARNBv5C+zdJVNfSEZXIIqHat4sZngZQmI l1ds5mkqykJYQQHoQ5duKqQp6tCgycPReenbhBZAkaNg+KepiNbiFPNVy1162Pi8s5 JQCKrdt1zx88hMCQCRQkjHSu4FeuBcU/3ND/ZdY0e+Pj1w3bfClRF3pHAm8sy8jtvW YeDd8WUDydwFlVCSBImMNCgFfT98HVnIIL9uJHC0FIVjk0Tv3FnZxTh+/LUvASrb11 yBocRkOKljrgMSMKdaAVgM6Lztqypp9mB0tH8aRsaxRbrwOhRUh0HPdEK0dsgH/Ccn hW+gnIooojcxw== Subject: Re: [dpdk-dev] [PATCH v3 1/6] ethdev: add hairpin bind and unbind APIs 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 10:36 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 v3 1/6] ethdev: add hairpin bind and > unbind APIs >=20 > External email: Use caution opening links or attachments >=20 >=20 > Hi, > Cosmetic comments below: >=20 > 08/10/2020 14:05, Bing Zhao: > > +int > > +rte_eth_hairpin_bind(uint16_t tx_port, uint16_t rx_port) { > > + struct rte_eth_dev *dev; > > + int ret; > > + > > + RTE_ETH_VALID_PORTID_OR_ERR_RET(tx_port, -EINVAL); >=20 > It should be -ENODEV Got it, changed. BTW, I checked the ethdev and it seems some functions are = using "EINVAL" and some are using "ENODEV". So should all of these function= s use "ENODEV"? >=20 > > + dev =3D &rte_eth_devices[tx_port]; > > + if (!dev->data->dev_started) { > > + RTE_ETHDEV_LOG(ERR, "TX port %d is not started", > tx_port); > > + return -EBUSY; > > + } > > + > > + RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->hairpin_bind, - > ENOTSUP); > > + ret =3D (*dev->dev_ops->hairpin_bind)(dev, rx_port); > > + if (ret) > > + RTE_ETHDEV_LOG(ERR, "Failed to bind hairpin TX %d " > > + "to RX %d (%d - all ports)", tx_port, > > + rx_port, RTE_MAX_ETHPORTS); >=20 > Looks like \n is missing. Fixed, thanks. >=20 > > + > > + return ret; > > +} > > + > > +int > > +rte_eth_hairpin_unbind(uint16_t tx_port, uint16_t rx_port) >=20 > Same comments as for bind function. Done. >=20 > [...] > > /** > > + * @warning > > + * @b EXPERIMENTAL: this API may change, or be removed, without > prior > > + notice > > + * > > + * Bind all hairpin TX queues of one port to the RX queues of the > peer port. > > + * It is only allowed to call this API after all hairpin queues > are > > + configured > > + * properly and the devices of TX and peer RX are in started > state. >=20 > "call this API" -> "call this function" Done. >=20 > "devices of TX" is a strange wording. > I would make it simpler: > "the devices of TX and peer RX" -> "the devices" >=20 > > + * > > + * @param tx_port > > + * The TX port identifier of the Ethernet device. >=20 > A device does not have a TX port. > I think you mean "The identifier of the TX port." Done. >=20 > > + * @param rx_port > > + * The peer RX port identifier of the Ethernet device. >=20 > Remove "of the Ethernet device" Done. >=20 > > + * RTE_MAX_ETHPORTS is allowed for the traversal of all devices. > > + * RX port ID could have the same value with TX port ID. >=20 > "same value as" Done. >=20 > > + * > > + * @return > > + * - (0) if successful. > > + * - (-EINVAL) if bad parameter. > > + * - (-EBUSY) if device is not in started state. > > + * - (-ENOTSUP) if hardware doesn't support. > > + * - Others detailed errors from PMD drivers. >=20 > Please add ENODEV case, maybe instead of EINVAL. Replaced. PMD may return -EINVAL but it is not necessary so I will not list= it here anymore. >=20 > > + */ > > +__rte_experimental > > +int rte_eth_hairpin_bind(uint16_t tx_port, uint16_t rx_port); > > + > > +/** > > + * @warning > > + * @b EXPERIMENTAL: this API may change, or be removed, without > prior > > +notice > > + * > > + * Unbind all hairpin TX queues of one port from the RX queues of > the peer port. > > + * This should be called before closing the TX or RX devices > > +(optional). After >=20 > Split the line after the end of sentence and start next one on a > fresh line. >=20 Done > > + * unbind the hairpin ports pair, it is allowed to bind them > again. >=20 > "unbind" -> "unbinding" Done >=20 > > + * Changing queues configuration should be after stopping the > device. > > + * > > + * @param tx_port > > + * The TX port identifier of the Ethernet device. > > + * @param rx_port > > + * The peer RX port identifier of the Ethernet device. > > + * RTE_MAX_ETHPORTS is allowed for traversal of all devices. > > + * RX port ID could have the same value with TX port ID. > > + * > > + * @return > > + * - (0) if successful. > > + * - (-EINVAL) if bad parameter. > > + * - (-EBUSY) if device is in stopped state. > > + * - (-ENOTSUP) if hardware doesn't support. > > + * - Others detailed errors from PMD drivers. >=20 > Same comments as for the bind function. Done. >=20 > > + */ > > +__rte_experimental > > +int rte_eth_hairpin_unbind(uint16_t tx_port, uint16_t rx_port); >=20 >=20 Thanks a lot