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 0D1FCA04B7; Tue, 13 Oct 2020 15:21:41 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D3AA31C0DC; Tue, 13 Oct 2020 15:21:38 +0200 (CEST) Received: from hqnvemgate25.nvidia.com (hqnvemgate25.nvidia.com [216.228.121.64]) by dpdk.org (Postfix) with ESMTP id DC11D1BB47 for ; Tue, 13 Oct 2020 15:21:36 +0200 (CEST) Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate25.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Tue, 13 Oct 2020 06:20:36 -0700 Received: from HQMAIL107.nvidia.com (172.20.187.13) by HQMAIL105.nvidia.com (172.20.187.12) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Tue, 13 Oct 2020 13:21:34 +0000 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.174) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Tue, 13 Oct 2020 13:21:34 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XNd359mWtcyBWi6N2pAN0JeOKeGPCJaBCr6RtyFTkso8Ie6aK3DZXBQEmrtBMfeP79XhjMCUast1ESMtPUn6LyGtkX/V3/p0PgTZqcQOc47904ZSLbTlt4vUk19bF9uKRhHlKkrl7weklVp2gSDGXVqas5C6YNbNW1oz43AY43lk5GEKs8SdO9vGqqCyc0ewoy+9UwNmJFlv1s17p+iqhWtlKsUU5OiLHKvmDO3xSfJVVe3Erbv7KZpikFW07xfdg7j0IeqV6rVnlzkTM2m81QqOyibAO8db/QwQEzuPQVbYgw6iWOjcMmd5XgQRcjIVNGcbUcjeIDsXVNiWaxL3Ug== 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=EtzICifZ1l21RVOH6NzQD4FITjVlkJ7M3yvsGQRcM8g=; b=LIxUu3pGy4WOiKsL2Pvdhy4/tDlccqDHXjXrVyxZFqcBgs5fEOZjXOWJUKnZ4vvMCULHp+avyJQOxDwEhOmqUbwXBxCnudUpsmOvps//pELUsqIX2Bjl1IVFRBKzPPY6n3TgUk1namtAEVIaglCt75FwYsKar5LH1Hs4Y6K/KURKJUkXEP+lavPbFXYYeMUWe7pncz6OGm+NBI59YmXOmZompk8XXVTb62Y45bcORjCzSW6sqgM+uxf8tstkbtK+s34gWCCJP5kdhCdJ64Jir3OVcr2JmxsB+1mz76o4f54hBvycaGVR6TXnMtHc7Y+HPFGgmDDDl8gp62YoatET3Q== 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 CY4PR12MB1365.namprd12.prod.outlook.com (2603:10b6:903:43::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.28; Tue, 13 Oct 2020 13:21:32 +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; Tue, 13 Oct 2020 13:21:32 +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 2/6] ethdev: add new attributes to hairpin config Thread-Index: AQHWoN/gbd3OX22cCESbCUMV5vGk5qmVVeRAgAAkyYCAAAg5UA== Date: Tue, 13 Oct 2020 13:21:31 +0000 Message-ID: References: <1602147098-9768-1-git-send-email-bingz@nvidia.com> <2115353.iQtFZFVSCL@thomas> <1745030.Et98dJ8b6a@thomas> In-Reply-To: <1745030.Et98dJ8b6a@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: [112.10.106.244] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a1bd604f-e367-4e9b-b364-08d86f7ae6b6 x-ms-traffictypediagnostic: CY4PR12MB1365: 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: e+Lqm8M6RkJqFqO11tgLdkcppgSpRMa7KgA+TUNnRDuPzd+fp6JsmrpewcIZPWoXSv/R8uP1EQyxQu62PolBKJEvOSrD11xYGoDVDU1S7fA98CBZEeYpTX4z7NsLqC/CM7WwFTJWHPHJrX0m6CQu0aMr/c6rDOGSRrsgpF8gva65Xe5+z8U8+HUoDiBvpT21M721Wjvlb3hFJ8HsWcOtjMrb+PGmA0MZkrSQSmURA5NIgP1qR5+JeYSqhcSSl9rbi8lq+n9ZS0ld2HeF+LcGY4avJNGxzZIsnee/JoJo8EDl0jtZpa/GcyRY8TvkH8NfEo3UeN2t6GvgurK4bfIKuA== 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)(39860400002)(346002)(396003)(366004)(136003)(76116006)(478600001)(33656002)(7696005)(53546011)(52536014)(86362001)(6506007)(4326008)(55016002)(2906002)(316002)(8936002)(6916009)(26005)(66476007)(66446008)(8676002)(64756008)(66946007)(54906003)(5660300002)(186003)(9686003)(83380400001)(71200400001)(66556008); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: qRyZHL1IRDwkBSZhZ4eZjc9RMzlel9l7IrKx8l7VUBMPnvP2FohB9EPRrwM/itc3/aT/xi3VKSbk1gx9ymXP5OOaD2HJAFwo6vooiT9xawMLlbJ2zP6AVAuNBVchCIQG/KAjT/YT+DmMSvm/YEvMH5rmd+RjGt4qjViDAUmvqHCQp0Gk++QeaRv7zR4x+CnsB59YblyfpjlMnIIaFaIzXsBFpK+iMgL7xFj2A0bHR6Y7KIvksgARp6uUR+4LMOOsXHAGA2hczM84hFpH9ujlJuXG2ccJ0Rx9zpWj7cgRdyneeJYGK+EIS0rH/Z3EbdbpI0dTGQIFEDAS7HzglbB99wP9h/fAvJ/ZLKAFiWk9RPV8FM/UeDzHXMc0RDicD4FbRMx7VEd68/grf+7W1qOkdMAxbfKryxrwwL3TAqxxpkya28DyvfzPQHSzQQ4DesiO8lzKPxEDdY67JBlXpf8W0xZKlSAOAtmTkdu1JkrxG9WQeTCYS93nQghll/Ol0ifPMmblmW7lLR+dLtIFNxS1VIJ0IQu/jj16azZXcph+LOQoDF1fyfeHwU2WBWPzBHFAe7KBftZWh4dhzynqag9rctG/3KvkJ4Zb8XWQVu9ED3QQ5Do3GGgmpJWgHO7BFFWYiq0scO9pdnKXJc5wnsRfjQ== 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: a1bd604f-e367-4e9b-b364-08d86f7ae6b6 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Oct 2020 13:21:31.8792 (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: R0GxiqKxhrrwwSfvX9pntLsRx1MOo5iXwUf8fKkAA2y4nFXmKzN7KkSAuN4OP9nhiEFc+FRgK+5AFXDruyyG7w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1365 X-OriginatorOrg: Nvidia.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1602595237; bh=EtzICifZ1l21RVOH6NzQD4FITjVlkJ7M3yvsGQRcM8g=; 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=pIH5TO4p0IVx7Z+W5gAeBNKmXfRK36FL1x1qA8auiVwkJihWGqK0fQ01uQCfECKIi iGawamFG3QKma/+3KQfRSegJhByfRTkqrV7/Md8N2nOU73lHap6ZLadzhTBdczHgJT k5ENCnqYXnstQbQSNeJroW+LOB6Ar0brxALQ/wWaX2+Mh9DQ89G9WfkFSIJ3X/UV26 n7GeYZJxBry4KC/PhW1kW8tYIk6I3UpoN7goJKYd1BJMYfksIa9HQlVbGOwwu8yFqU iOPyq08jbP39LETHcwsy45tTYlYZ2Upq5o8o3x/6SQp7BWZnP1hi4ItGtfxIynaQKp n12S+PHqkZRjA== Subject: Re: [dpdk-dev] [PATCH v3 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 Thomas, > -----Original Message----- > From: Thomas Monjalon > Sent: Tuesday, October 13, 2020 8:42 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 2/6] ethdev: add new attributes to > hairpin config >=20 > External email: Use caution opening links or attachments >=20 >=20 > 13/10/2020 14:29, Bing Zhao: > > From: Thomas Monjalon > > > 08/10/2020 14:05, Bing Zhao: > > > > struct rte_eth_hairpin_conf { > > > > - uint16_t peer_count; /**< The number of peers. */ > > > > + uint32_t peer_count:16; /**< The number of peers. */ > > > > > > Why not keeping uint16_t? > > > > The inside structure has a multiple of 4B, and the peer_count now > only takes about 2B. AFAIK, usually, the structure will have an > aligned length/offset and there will be some padding between the 2B > + (2B pad) + 4B * 32 or 2B + (2B +2B) * 32 + 2B, depending on the > compiler. > > I changed to bit fields of a u32 due to the two facts: > > 1. Using the 2B and keep the whole structure aligned. No waste > except the reserved bits. > > 2. Only u32 with bit fields is standard. >=20 > Oh I see, this is because u16 bit fields are not standard? In some compiler, it is supported. But in the old compiler, it might not an= d some warning will be raised. " nonstandard extension used : bit-field types other than int " " The following properties of bit fields are implementation-defined: Whether bit fields of type int are treated as signed or unsigned Whether types other than int, signed int, unsigned int, and _Bool (since C9= 9) are permitted " In C11, it should be supported already. >=20 > > > > + uint32_t tx_explicit:1; /**< Explicit TX flow rule mode. > */ > > > > + uint32_t manual_bind:1; /**< Manually bind hairpin > queues. > > > */ > > > > > > Please describe more the expectations of these bits: > > > What is changed at ethdev or PMD level? > > > > In ethdev level, there is almost no change. This attribute will be > passed to PMD directly through the function pointer. > > In PMD level, these bits should be checked and better to be saved. > And the attribute fields should be checked for per queue pair and > all the queues, and each queue pair should have the same attributes > configured to make the behavior aligned. But it depends on the PMD > itself to decide if all the queue pairs between a port pair should > have the same attributes, or even all the queues from / to same port > of all hairpin port pairs. > > If manual_bind is not set, then the PMD will try to bind the > queues and enable hairpin during device start stage and there is no > need to call the bind / unbind API. > > If tx_explicit is set, the application should insert the RX flow > rules and TX flow rules separately and connect the RX/TX logic > connection together. > > > > > What the application is supposed to do? > > > > The application should specify the new two attributes during the > queue setup. And also, it could leave it unset (0 by default) to > keep the behavior compatible with the previous release. > > If manual_bind is set, then it is the application's responsibility > to call the bind / unbind API to enable / disable the hairpin > between specific ports. > > If tx_explicit is set, as described above, the application should > maintain the flows logic to make hairpin work as expected, e.g., > they can choose metadata (not the only method), in the RX flow, the > metadata is set and in the TX flow, it is used for matching. Then > even if the headers are changed with NAT action or encap, the > hairpin function could work as expected. > > > > > Why choosing one mode or the other? > > > > If the application wants to have the full control of hairpin flows, > it could chose the explicit TX flow mode. > > If two or more ports involved into the hairpin, it is suggested to > use the manual bind. > > Please note, the actual supported attributes denpend on the PMD > and HW. >=20 > The application impact must be described shortly in doxygen please. >=20 >=20 OK, sure. I added into the commit message. I will also describe it shortly = in the doc. Thanks