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 4E0CAA04B1; Tue, 29 Sep 2020 23:23:19 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CE03B1DAA9; Tue, 29 Sep 2020 23:23:17 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 447B41DA99 for ; Tue, 29 Sep 2020 23:23:16 +0200 (CEST) IronPort-SDR: r92sVZ9n6j0Jh4KuuH4MlcmDD/aOxdaUhvnESUXOcV/6gcLiH109fXMkGadxxCwta9WIXPVaSr Puvj1BJrKfKA== X-IronPort-AV: E=McAfee;i="6000,8403,9759"; a="162352799" X-IronPort-AV: E=Sophos;i="5.77,319,1596524400"; d="scan'208";a="162352799" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Sep 2020 14:23:13 -0700 IronPort-SDR: l41pxMqg6Lsl6zekwuDIWCdeBifzmPXbVHOzZNxTpl1aHywtYODvnAFXjXFHX0QvnAjNHwF6da gBonxAHK9XZQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,319,1596524400"; d="scan'208";a="415519578" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmsmga001.fm.intel.com with ESMTP; 29 Sep 2020 14:23:13 -0700 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 29 Sep 2020 14:23:12 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx609.amr.corp.intel.com (10.22.229.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Tue, 29 Sep 2020 14:23:12 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.104) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Tue, 29 Sep 2020 14:23:12 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d3R3qXN9xMGPDnnT/AOQnLRdu05xzFtww/6OEsZ6tm2X4Y9dYn08UmjeT0Om6ULMZDtLhCIWDAOcdq/LrnUxDZH1DFg/U5KQ5mBhquccWkSYiBII9zJ5iGbMfHjzMCAkGEirDUZQVcubHpBFrRMPI2Rppvf3mQ2Dgc45lwj+ciWl2MOQO+HW7cUTQysN0GpWaYntUE7cMdVLTDxK7ZMAYCMUniph/VOGrUgmAGOoH9tPmScYHXSFMLA2TKJsrrmfMChYjhlPyP2AseaeoxRa+ystJUCerkTwEhThM4wf/xf06ce/DZk2Hz3I0g6MFcx3WaTP1cLu/p1eKZvJVnyyOA== 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=yTQ449IJ8zzBbfSpuIMGELLg6xc75k3vLGY9d0IQOVg=; b=djf30EDRFOi8f5mOm5p9twrEfrVVogW1TLzAQkZY1d9fUNI6V0ODFsTfZb3srsp6mwLDnkutD3VueCvcSVKpbGbX/mxn4Kd8raMGupnaX+u806lqM3S5aj8ilbKQhtgUA2W9mTqWvJb3XUnjYG+R9/bp9qA6TktfjFqfas69b6JbULAhe1S5UorbTlVyxGv8iikvN0dYWEJOixUpF2Ukoho1NosCDPV5znSXaE8L8ii1suTnepFyMY9bOioSZNrFy9TJUM4OoFAgIvF+G6a4r6uaub3Hkhrz5hYPI/GhvoVENMWpBRVpD3latPX7HM8fV0nFGHdy7sItvHEIy06wug== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yTQ449IJ8zzBbfSpuIMGELLg6xc75k3vLGY9d0IQOVg=; b=H0xR0GgpZlKXTxiF2kbEFukQsGBeyp3TWalmw+ZBTtPi/xl0So6nnPYc1r0vE4FdBP/ZEZWc26vIQHffGFzEAviMjWsMbm7XH17kZelC9e084A1JWNDDIIBPMD1/26RL0IEJg5+g2vEvc+EgpWod80W10oPdSbWHELxY/6u73mU= Received: from CY4PR11MB1702.namprd11.prod.outlook.com (2603:10b6:903:2e::8) by CY4PR1101MB2198.namprd11.prod.outlook.com (2603:10b6:910:1d::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3433.32; Tue, 29 Sep 2020 21:23:11 +0000 Received: from CY4PR11MB1702.namprd11.prod.outlook.com ([fe80::ddb:33e0:ba2a:e390]) by CY4PR11MB1702.namprd11.prod.outlook.com ([fe80::ddb:33e0:ba2a:e390%4]) with mapi id 15.20.3412.029; Tue, 29 Sep 2020 21:23:11 +0000 From: "Dumitrescu, Cristian" To: "Dharmappa, Savinay" , "Singh, Jasvinder" , "dev@dpdk.org" Thread-Topic: [PATCH v4 6/9] example/ip_pipeline: add dynamic config of subport Thread-Index: AQHWjM6MfTxheC2BuU2hHxdLMz253KmAMteA Date: Tue, 29 Sep 2020 21:23:11 +0000 Message-ID: References: <1600274633-371993-1-git-send-email-savinay.dharmappa@intel.com> <1600332159-26018-1-git-send-email-savinay.dharmappa@intel.com> <1600332159-26018-7-git-send-email-savinay.dharmappa@intel.com> In-Reply-To: <1600332159-26018-7-git-send-email-savinay.dharmappa@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.5.1.3 dlp-reaction: no-action dlp-product: dlpe-windows authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [109.79.102.18] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: b7375b11-1334-4c61-03e5-08d864bdde92 x-ms-traffictypediagnostic: CY4PR1101MB2198: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:256; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 7k2dvKuA9yvj5bic+EqJTG2jce1cK3sPbzYeLGp7yRM8pv60sRJKlzDfgCnR8yChMdTT0ydTf1K7aDtRVB8aF5FxldcvCw+pgI0V0zhDwwW25Hg2TY2FvqusoCHtlVEorFfG8pfgZbm1MkV+aJUta72RncH6gpLMhZyEWdteYgt8D1zj2q3bAInCeg8kIstFRtYQbqJUGxUlVTPCanT6Rc7uPCOne4gb9jK5VuG8WsN+b69PMQfYRdfrXuYiDZc9HxptLCLcnN1w129h/C+0Z+LMawnOEdDjtIIVzMkWDHm7Uh8p9e0CRljKXAMKQqVhFgEscDYCGVN3cV9QtC4vfw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CY4PR11MB1702.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(396003)(346002)(39860400002)(376002)(366004)(6506007)(26005)(8936002)(53546011)(86362001)(478600001)(33656002)(7696005)(316002)(71200400001)(83380400001)(52536014)(110136005)(2906002)(55016002)(66476007)(66446008)(64756008)(66556008)(9686003)(5660300002)(8676002)(66946007)(76116006)(186003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: JUzptt6JdFSmwxcYub2GVl0jyQ3e3I3vIvV4bt+/hxmFTFie1vXbNt4A7ZkzcrWHtOIdLE86LGrDx9m8PWfu0oEoSb13iBwJaZeUcY90n8y6SE1q6WFU62ApiCVMel+vRNV3GKlTArX4ZSip2mxH5tH3UggcPuNGVqLF2T0iUiCtf7AZYrIcSitW8oLJieD0Xe6mxTJ5BauOcJIWvCGW01cJRrm+TrfnWtBKSvb0PiDFOUuske6dP9BA1lcWH879OOwyES94QFEGJLDmulJaS5uBx4a7CH01vN1UELSizjwwH2BdML5oKve6gH8OJNtAJhJ1MfPu5YXBjiO9DgnWrXnk78n9F2Vgcbz96/U2AMvHBZC0JIsJpN3X8k3g9VTYmI3Aw7f1fS7H2ECBl05eGbnfZXNW6lHdtdj23TolqX34ok/oyMwGJBAsGzcKPbhWImXtfscHL2wsktH0ganP1dmoU9e48g11g7X3n/kbXLC/zbVPagTN515Q8IjW9CAiOYYvsnDE5jPmc2J/U+IY1PF6caqy3N9JXrHF40LclmQE1ubGiDUrgn/0QnmIEaIzZy4lXtO8sgvCMe08q5qm4O4J+I+FnxJIfR77AdbSvBYWGLd7Co38lKhcQgrPqYadN5/9Gr01IKECdvsvJLvMkg== 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: CY4PR11MB1702.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b7375b11-1334-4c61-03e5-08d864bdde92 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Sep 2020 21:23:11.5954 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: V0gzCAeXnNe8dnPkRowksJZbSZ4xGtH/GG3spixwBb8UOUhx0pf6OFdxp4hMk/kIGY7OF3WZgaqONxS+jh8pw5Jk7nCC0VA8tn6pZg9VdPQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1101MB2198 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v4 6/9] example/ip_pipeline: add dynamic config of subport 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" > -----Original Message----- > From: Dharmappa, Savinay > Sent: Thursday, September 17, 2020 9:43 AM > To: Singh, Jasvinder ; Dumitrescu, Cristian > ; dev@dpdk.org > Cc: Dharmappa, Savinay > Subject: [PATCH v4 6/9] example/ip_pipeline: add dynamic config of subpor= t >=20 > Modify the ip_pipeline application to build the hierarchical scheduler > with default subport bandwidth profile. It also allows to configure > a subport with different subport bandwidth profile dynamically >=20 > Signed-off-by: Savinay Dharmappa > --- > examples/ip_pipeline/cli.c | 14 ++++++++------ > examples/ip_pipeline/tmgr.c | 26 ++++++++++++++++++++++++-- > examples/ip_pipeline/tmgr.h | 3 ++- > 3 files changed, 34 insertions(+), 9 deletions(-) >=20 > diff --git a/examples/ip_pipeline/cli.c b/examples/ip_pipeline/cli.c > index d79699e..7eccde3 100644 > --- a/examples/ip_pipeline/cli.c > +++ b/examples/ip_pipeline/cli.c > @@ -407,6 +407,7 @@ cmd_tmgr_subport_profile(char **tokens, > size_t out_size) > { > struct rte_sched_subport_params p; > + struct rte_sched_subport_profile_params pp; > int status, i; >=20 > if (n_tokens !=3D 35) { > @@ -414,23 +415,23 @@ cmd_tmgr_subport_profile(char **tokens, > return; > } >=20 > - if (parser_read_uint64(&p.tb_rate, tokens[3]) !=3D 0) { > + if (parser_read_uint64(&pp.tb_rate, tokens[3]) !=3D 0) { > snprintf(out, out_size, MSG_ARG_INVALID, "tb_rate"); > return; > } >=20 > - if (parser_read_uint64(&p.tb_size, tokens[4]) !=3D 0) { > + if (parser_read_uint64(&pp.tb_size, tokens[4]) !=3D 0) { > snprintf(out, out_size, MSG_ARG_INVALID, "tb_size"); > return; > } >=20 > for (i =3D 0; i < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE; i++) > - if (parser_read_uint64(&p.tc_rate[i], tokens[5 + i]) !=3D 0) { > + if (parser_read_uint64(&pp.tc_rate[i], tokens[5 + i]) !=3D 0) { > snprintf(out, out_size, MSG_ARG_INVALID, > "tc_rate"); > return; > } >=20 > - if (parser_read_uint64(&p.tc_period, tokens[18]) !=3D 0) { > + if (parser_read_uint64(&pp.tc_period, tokens[18]) !=3D 0) { > snprintf(out, out_size, MSG_ARG_INVALID, "tc_period"); > return; > } > @@ -440,7 +441,8 @@ cmd_tmgr_subport_profile(char **tokens, > return; > } >=20 > - if (parser_read_uint32(&p.n_pipes_per_subport_enabled, > tokens[20]) !=3D 0) { > + if (parser_read_uint32(&p.n_pipes_per_subport_enabled, > + tokens[20]) !=3D 0) { > snprintf(out, out_size, MSG_ARG_INVALID, > "n_pipes_per_subport"); > return; > } > @@ -456,7 +458,7 @@ cmd_tmgr_subport_profile(char **tokens, > return; > } >=20 > - status =3D tmgr_subport_profile_add(&p); > + status =3D tmgr_subport_profile_add(&p, &pp); > if (status !=3D 0) { > snprintf(out, out_size, MSG_CMD_FAIL, tokens[0]); > return; > diff --git a/examples/ip_pipeline/tmgr.c b/examples/ip_pipeline/tmgr.c > index 91ccbf6..5c3df92 100644 > --- a/examples/ip_pipeline/tmgr.c > +++ b/examples/ip_pipeline/tmgr.c > @@ -11,6 +11,9 @@ > static struct rte_sched_subport_params > subport_profile[TMGR_SUBPORT_PROFILE_MAX]; >=20 > +static struct rte_sched_subport_profile_params > + profile_params[TMGR_SUBPORT_PROFILE_MAX]; > + As discussed, it is probably better to merge these two tables into one. struct subport_profile_params { struct rte_sched_subport_params params; rte_sched_subport_profile_params profile; }; struct subport_profile_params subport_profile[TMGR_SUBPORT_PROFILE_MAX]; It avoids confusion and also minimizes the app changes. The same should be done for the SoftNIC code. > static uint32_t n_subport_profiles; >=20 > static struct rte_sched_pipe_params > @@ -44,10 +47,11 @@ tmgr_port_find(const char *name) > } >=20 > int > -tmgr_subport_profile_add(struct rte_sched_subport_params *p) > +tmgr_subport_profile_add(struct rte_sched_subport_params *p, > + struct rte_sched_subport_profile_params *pp) > { > /* Check input params */ > - if (p =3D=3D NULL || > + if (p =3D=3D NULL || pp =3D=3D NULL || > p->n_pipes_per_subport_enabled =3D=3D 0) > return -1; >=20 > @@ -56,6 +60,10 @@ tmgr_subport_profile_add(struct > rte_sched_subport_params *p) > p, > sizeof(*p)); >=20 > + memcpy(&profile_params[n_subport_profiles], > + pp, > + sizeof(*pp)); > + > n_subport_profiles++; >=20 > return 0; > @@ -103,6 +111,9 @@ tmgr_port_create(const char *name, struct > tmgr_port_params *params) > p.mtu =3D params->mtu; > p.frame_overhead =3D params->frame_overhead; > p.n_subports_per_port =3D params->n_subports_per_port; > + p.n_subport_profiles =3D n_subport_profiles; > + p.subport_profiles =3D profile_params; > + p.n_max_subport_profiles =3D TMGR_SUBPORT_PROFILE_MAX; > p.n_pipes_per_subport =3D TMGR_PIPE_SUBPORT_MAX; >=20 > s =3D rte_sched_port_config(&p); > @@ -126,6 +137,13 @@ tmgr_port_create(const char *name, struct > tmgr_port_params *params) > return NULL; > } >=20 > + status =3D rte_sched_subport_profile_config(s, i, 0); > + > + if (status) { > + rte_sched_port_free(s); > + return NULL; > + } > + > for (j =3D 0; j < > subport_profile[0].n_pipes_per_subport_enabled; j++) { > status =3D rte_sched_pipe_config( > s, > @@ -182,6 +200,10 @@ tmgr_subport_config(const char *port_name, > subport_id, > &subport_profile[subport_profile_id]); >=20 > + if (!status) > + status =3D rte_sched_subport_profile_config(port->s, > subport_id, > + subport_profile_id); > + > return status; > } >=20 > diff --git a/examples/ip_pipeline/tmgr.h b/examples/ip_pipeline/tmgr.h > index ee50cf7..8c14523 100644 > --- a/examples/ip_pipeline/tmgr.h > +++ b/examples/ip_pipeline/tmgr.h > @@ -48,7 +48,8 @@ struct tmgr_port_params { > }; >=20 > int > -tmgr_subport_profile_add(struct rte_sched_subport_params *p); > +tmgr_subport_profile_add(struct rte_sched_subport_params *p, > + struct rte_sched_subport_profile_params *pp); >=20 > int > tmgr_pipe_profile_add(struct rte_sched_pipe_params *p); > -- > 2.7.4