From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A47ADA0C47; Thu, 22 Jul 2021 00:31:25 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2CB994014E; Thu, 22 Jul 2021 00:31:25 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2076.outbound.protection.outlook.com [40.107.223.76]) by mails.dpdk.org (Postfix) with ESMTP id 8A5294014D for ; Thu, 22 Jul 2021 00:31:23 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fs9jkezLEmcdVT70OnT3rhQL9nnJ+INXIPidOJdSsaVf6CNAFKqX+ZPTFSRDSUGVSVpQ6AZ6BbZqqWqHR80ZwCCVYJzS1iTm08eIs7vwXbFVP3gS4mkoHy45YHcE8b37/24qSEWSkWlxhYXnkJGNgZAyGk4qD3FS2JQj55MhUTCPuDePgMwORLbslJzRVWs4VC3ODV4cXCaR8t/u8fPc+Jm2FK3RuP4vbhpWgf7UeMPl3mrYsSL2CUReVvFInLlT5Gp0Ar7Oe52BE+xFqX78KMO51ugoIuHdkUg6XEEt33+FKB/raK8mw/s5JVnuwZvgpkadagGgXUjTYP13qK3S+Q== 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=U3t5TIQ7aasqwVRcB4FLcI9nSEDrvSFBqzvwsrq2HeQ=; b=lZN+dWtkUscvMYpng7PFly4JlPAFPv486j7IbtD3fqTovGi+xQWo7GdIri02pIIcDZei1zCOn2TYwWJydhvG5SkFrHhG6oiGzzOM8wvWHGh3uHAcDkEe8W8I115SbgywAx1dVlMKPFFlmSIdqK9B9yCdbyTrxaH7oAkSUa9+G4VyUy6oDy1io56llzZQxJovS0I8Ro0BsxyzZm+aF3uG2vS7t3H4YBAFublAVkYIhaJbEldOyspIL8Dzqg3D2k47fMkVWHmcFkX40Tbp1kVt2rXdFozpzt3kXBZqNPvyd8hmWpg1sGm+TjcbDrocOvd5tfS1Gr+S8/G0LQsozrWNDg== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=U3t5TIQ7aasqwVRcB4FLcI9nSEDrvSFBqzvwsrq2HeQ=; b=KiWENjQf3IzsRYufLRbPdUb69ir4CHZ1Sig4MDjHrWQa55EcSXzo0wUR+ArkZmUjH1xi92R4yoUbEtxjR+fqWh59FVZR3vxULGIu+3yhP/x3wE3sV/lpUx/5o/kehnvtm1XTEkYj5+3wWsznKCVN6/J4/nh/QQeTHzg6b0rBMe2rLyyRm5wSk5id3uDsR0diIaaL2qamjkCWJ2EFzm4Cr/3YfmHQJOVZszKg5n3bLl5LvW/6JH+ysFTIaJcAaiInoZs5eLZtzZYF4t2bQfsfBsq4eLiMQJbIPHr5jEpvqm+hofQni8j+zIINl95pFhkWw9oskSyi/qGtMhhqwuAcsg== Received: from DM8PR12MB5494.namprd12.prod.outlook.com (2603:10b6:8:24::9) by DM6PR12MB5534.namprd12.prod.outlook.com (2603:10b6:5:20b::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.25; Wed, 21 Jul 2021 22:31:22 +0000 Received: from DM8PR12MB5494.namprd12.prod.outlook.com ([fe80::2424:ff5f:bba6:42b1]) by DM8PR12MB5494.namprd12.prod.outlook.com ([fe80::2424:ff5f:bba6:42b1%5]) with mapi id 15.20.4331.034; Wed, 21 Jul 2021 22:31:22 +0000 From: Asaf Penso To: Asaf Penso , "dev@dpdk.org" Thread-Topic: [DISCUSSION] code snippet documentation Thread-Index: Add5RxapGnpY5D0tS4m/cC+5PYBHHAFOPb5O Date: Wed, 21 Jul 2021 22:31:22 +0000 Message-ID: References: In-Reply-To: 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-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 5bc57933-5bfa-4d8a-42b1-08d94c974499 x-ms-traffictypediagnostic: DM6PR12MB5534: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5516; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: B5cjsSSYvP0ZPGkn5nt8xYCkjZXmK7Mrp+YWm+bA/wEaTc4Sm8c23EKXms1clt8VBpHk8r9x9xn6P6MqgYd9qrpsAYPYD53tndN+N37s9KIV3craawRn7E7/nzHI1CNPoskdOUtZH9gXQ77wg8saSiPY+lWSJf8CcBQGVh252auW2oq9gJVCVSx1mbfNYtRDKEqlPxLr5CLAfJzOqIlF1JL+KF5vMmnpacQOUW8MBWFdk3hQfZnATfRzAZyEFYBFJbPpDkPnwNJB4+2qn+EzP1XtKFDeav6ux3axl5CQwx/ZEA7FwEl2DfrwE7Qtg+AQp+vVzz4C99o/c8ST6OzBgkFOpePKT4d06NQk2Ak4fvnKbT0t9zZrYdos8sjgeEuj05j6fiZk0N3zdHra/9QAuaGtnV5uYtBOXyFSnphx+JiRvdRZqc++j1FcR28qJSNDvr+uO9A/pPpD648IwZrFHTTJpjzXObQ661wt/D6O7sx3bs390Ew6igtXby2JWnub0RpBkzkIZ3HzomnaARdYDXbqsk1sfrP2X/hFzY5YMLs2MlYby66TsoGG5IFV2NtYuWEHzUbyq4SHS1CrbnBckqO36mSCMggxIhXE6jVIweoCX58WVK/laHOIa765LyXdNci+yX60B9397MSpwIRkhU6B4IVEt/o+6R3G2sPyaCGGAiImkQ8Psw+lBnB1yB5hrs5+hMlDDl4jQXHU0MCW1w== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM8PR12MB5494.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39860400002)(366004)(376002)(136003)(346002)(396003)(55016002)(478600001)(8936002)(8676002)(53546011)(66476007)(316002)(76116006)(86362001)(2906002)(110136005)(38100700002)(122000001)(71200400001)(6506007)(5660300002)(33656002)(26005)(186003)(52536014)(66446008)(9686003)(66946007)(91956017)(64756008)(7696005)(66556008)(38070700004); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?yG1KlAEmKfnx8X0R+2YpvVHvAlVSN3E0rrsG7QjEWlm60wnc8lrqsmuHAkpx?= =?us-ascii?Q?azsqd0YmIG4fuewXQkusO4ASk/Mxbwqgm06Q1oRTaE3ObyXrHnT4hdXzdWuh?= =?us-ascii?Q?UyrJJ994yrz3FQ6E3p+mKWltBwqIChIM5RFLLUlLG4EV9FdmopTwyFahHpIx?= =?us-ascii?Q?FyzIwAHgFCIJpQvKtqZAnJ/DYOlbQAx4++pCz0ozNXfsSvkfzg5JBEpfmicl?= =?us-ascii?Q?vz/7jXwjjcOz+vlqj9tsLohsD1EcFf6Ro6FQvjGj/zhFs5pnlQ61VSNDqXgt?= =?us-ascii?Q?7mNcfAzNePhXwnalADu9XZL3igYayCKHTKb/Eudrb9nbxVbq4ytDeLrDwSy5?= =?us-ascii?Q?6NKOl0yOLsk8PPcWPLOgpnQcoSL55DHUC51obLDaiICU+pbMCfteDMv0NNCN?= =?us-ascii?Q?xHLv1jEjkZBeu/Dgl3aRShAZZtuTlbqo3Dsm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GDhswGswtcl/cpUUXE+/wY704IH+ztbZvaJPhA18yCtLg=3D=3D?= MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM8PR12MB5494.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5bc57933-5bfa-4d8a-42b1-08d94c974499 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Jul 2021 22:31:22.3168 (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: LYIx9cU7Kgy6iBnTQg/5p2iA8pJLEKGVcwO+YpB8u9KYjtza4dwP+4CZZj075CJld3Q7lrLL15fdxLAmSUEHhA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB5534 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: [dpdk-dev] [DISCUSSION] code snippet documentation X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" + dev@dpdk Regards, Asaf Penso ________________________________ From: users on behalf of Asaf Penso Sent: Thursday, 15 July 2021, 10:02 To: users@dpdk.org Subject: [dpdk-users] [DISCUSSION] code snippet documentation Hello DPDK community, I would like to bring up a discussion about a way to have code snippets as = an example for proper usage. The DPDK tree is filled with great pieces of code that are well documented = and maintained in high quality. I feel we are a bit behind when we talk about usage examples. One way, whenever we implement a new feature, is to extend one of the test-= * under the "app" folder. This, however, provides means to test but doesn't provide a good usage exam= ple. Another way is to check the content of the "example" folder and whenever we= have a BIG new feature it seems like a good place. This, however, doesn't provide a good option when we talk about small featu= res. If, for example, we extend rte_flow with an extra action then providing a f= ull-blown example application is somewhat an entry barrier. A third option could be to document it in one of the .rst files we have. Obviously, this requires high maintenance and no option to assure it still = compiles. I'd like to propose another approach that will address the main two issues:= remove the entry barrier and assure compilation. In this approach, inside the "examples" folder we'll create another folder = for "snippets". Inside "snippets" we'll have several files per category, for example, rte_f= low_snippets.c Each .c file will include a main function that calls the different use case= s we want to give as an example. The purpose is not to generate traffic nor read rx/tx packets from the DPDK= ports. The purpose is to have a good example that compiles properly. Taking the rte_flow_snippets.c as an example its main function would look l= ike this: int main(int argc, char **argv) { rte_flow_snippet_match_5tuple_and_drop(); rte_flow_snippet_match_geneve_ope_and_rss(); ... Return 0; } Regards, Asaf Penso