From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 4612FA034F;
	Tue, 23 Mar 2021 08:50:51 +0100 (CET)
Received: from [217.70.189.124] (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id B80034014D;
	Tue, 23 Mar 2021 08:50:50 +0100 (CET)
Received: from mga12.intel.com (mga12.intel.com [192.55.52.136])
 by mails.dpdk.org (Postfix) with ESMTP id 974E440143
 for <dev@dpdk.org>; Tue, 23 Mar 2021 08:50:49 +0100 (CET)
IronPort-SDR: Sqga1R1KCbB3uJ36FcLnBOshucUSVFk92wmIWDvVEbEW/E/SKU4in8eYtAVE22puttB32KgGcI
 4g1NnEcLBYWA==
X-IronPort-AV: E=McAfee;i="6000,8403,9931"; a="169762402"
X-IronPort-AV: E=Sophos;i="5.81,271,1610438400"; d="scan'208";a="169762402"
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
 by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 23 Mar 2021 00:50:48 -0700
IronPort-SDR: bCJ7/crntDcEqSsw5SEYw1SdXok/zWoyahLRtBdLsaM+4+OJNP+EgFRjXEpy+dSLqxZTL77vi/
 b3jssj31bVLg==
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.81,271,1610438400"; d="scan'208";a="513612822"
Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16])
 by fmsmga001.fm.intel.com with ESMTP; 23 Mar 2021 00:50:48 -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.2106.2; Tue, 23 Mar 2021 00:50:47 -0700
Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) 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.2106.2; Tue, 23 Mar 2021 00:50:47 -0700
Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by
 orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2
 via Frontend Transport; Tue, 23 Mar 2021 00:50:47 -0700
Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.177)
 by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.1.2106.2; Tue, 23 Mar 2021 00:50:47 -0700
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=OzVcaBfC9B584fwKlu1cPta5Wi+mR64ylLjV6dMQ+NoMXtgopbYYtpmB/s9zC3VaMm3sgyFi3p+uxveNO4ou1wNLY1yPT1QU2EWx7928ZFKHLZ2QYJLfgrpSCktqynpzP9yg7nhDPXMGA6ar1fz5XU7VKGw2uK6AvDZX81T2CxBeJObqq21SVP4/+GID80lhYAp9uvquAWrVbkjQybN26vBNvyYUWzvaMAtecax86EpgdMgprLdtuf1LWHGwg7yzy/BFUoYhcoUvViqUNu/vPE0GAND39AqH5LOSMyfn3tqULS8jrNMR4gxrb5Cm3CYzHdcLm4lFcGaxPbtdB9sfcw==
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=dGinjWpyKRBTmY/h9BLKuc6Dw1yYpJovogJVpCvERE4=;
 b=jqyECD1ouBZZDiVK6Kx/NN/8qxd49ahkZprdQrnI35Xz6BUDV5Kwg5C73yVPDSfDdMvZo/HtKd7K1k1pLLsGfcEIYnqTRqgm0+Nagzu/MHO4wjAzfV2WMB3DDdPlof5OF5cqqOkO+1UZmCVHECGE8FLLPlqE1jDg6wHYG3I3tT+S9wWcQLb3f0bAuA2nwBj7ytbaXtRuDUWri3UcSDM56aY6ZArX9nR6dmzjRRKExJ3uW/fcSJKHKCBF4DGD3SgUL3dQAKAiSA48F+1GWyZotSvyFfTJR/87AV9TH7/RmFMyWTY29fU1OmlhmYmtyRLoXXXJsIzQN/WGEB7EiDjWeg==
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=dGinjWpyKRBTmY/h9BLKuc6Dw1yYpJovogJVpCvERE4=;
 b=pqQ4qAJbeQH9Z06BABS5/0+NfqBzmzghgtYyvaIqhUdqBj6Iaby0EE6tQbOeDCVKPBrrlC7qD/QsPnp10rrAdF6cQ75gZM0k8wsx5cKFJrKCUUxzqpv/ButtoYnEZQO8jgxlSh5qocOXaNnkFJi9Q7waWy2ahBKNT3nPdIpgeFg=
Received: from DM4PR11MB5534.namprd11.prod.outlook.com (2603:10b6:5:391::22)
 by DM6PR11MB2636.namprd11.prod.outlook.com (2603:10b6:5:c8::14) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.17; Tue, 23 Mar
 2021 07:50:43 +0000
Received: from DM4PR11MB5534.namprd11.prod.outlook.com
 ([fe80::79a3:3404:b907:d49c]) by DM4PR11MB5534.namprd11.prod.outlook.com
 ([fe80::79a3:3404:b907:d49c%6]) with mapi id 15.20.3955.027; Tue, 23 Mar 2021
 07:50:43 +0000
From: "Li, Xiaoyun" <xiaoyun.li@intel.com>
To: Lijun Ou <oulijun@huawei.com>, "Yigit, Ferruh" <ferruh.yigit@intel.com>
CC: "dev@dpdk.org" <dev@dpdk.org>, "linuxarm@openeuler.org"
 <linuxarm@openeuler.org>
Thread-Topic: [PATCH 2/3] app/testpmd: remove forwarding config from parsing
 Rx and Tx
Thread-Index: AQHXEaldDfAva4xisEaALSlRIYLxeKqRMteQ
Date: Tue, 23 Mar 2021 07:50:43 +0000
Message-ID: <DM4PR11MB5534FB44FF48753A8B94035499649@DM4PR11MB5534.namprd11.prod.outlook.com>
References: <1614939741-63927-1-git-send-email-oulijun@huawei.com>
 <1614939741-63927-3-git-send-email-oulijun@huawei.com>
In-Reply-To: <1614939741-63927-3-git-send-email-oulijun@huawei.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
authentication-results: huawei.com; dkim=none (message not signed)
 header.d=none;huawei.com; dmarc=none action=none header.from=intel.com;
x-originating-ip: [192.102.204.53]
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: 838c154f-b1e2-4132-106d-08d8edd05ca7
x-ms-traffictypediagnostic: DM6PR11MB2636:
x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr
x-ms-exchange-transport-forked: True
x-microsoft-antispam-prvs: <DM6PR11MB2636F2DCCEA7041F5083C57199649@DM6PR11MB2636.namprd11.prod.outlook.com>
x-ms-oob-tlc-oobclassifiers: OLM:1284;
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: +YGUx/SoSzXJC7snST6I1/TMOyHqZIkgFAuGMWMD0QMgEeJJcCipx3jdBhRrb6jruSu2EYSA6zP9PrFz8UaMEeURuxYXcm4xFpRJ6aEHbS3wRUqW10/s1zrLWSRsLYgNPFB+TUM2VBi0pRCSb1fDpTVHczhV4EyWxiJY297NsIVD+Cegwv4vx6rqeH3Jggz5qm+52ornJVU7TOoXrVbkkkeg9vEoiEs6WM5l7zxHwd6B7vheYO+N2MqKiuFk+hfKYgu1UJtSkaEkn9F8Ji0OZYE2K+uln4OLgk3JwyycRh3HwwHJXbj3fqrU+aNoqSFBJPA6uE8jRVCyHpmNg3dc3okfvos8XPEvEkXD7ydmgNckZJF68vYCIRJrqRmriitjmWsfnze4tNNJfB2j+pgVsel6H3lyFjf4a0dHCT+Jslb0oeqiklrEwvkQuy6vRvGQ7AAZH02P5ZcZSUBRvsKFSYvSKe6ZsmSyycV8TCBJ4S2O1ScBaRYA2V+x3KdQ8wCGEFv84GkXr1A2ENlm5Hp+4zk1c3L4AoSWX8DJG/joFUMw+sMbI0/XQURsr+G3XceCa5LihkHuJym8jlsJd+wDxw==
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;
 IPV:NLI; SFV:NSPM; H:DM4PR11MB5534.namprd11.prod.outlook.com; PTR:; CAT:NONE;
 SFS:(396003)(39860400002)(346002)(136003)(376002)(366004)(83380400001)(9686003)(71200400001)(5660300002)(66946007)(55016002)(54906003)(6636002)(8936002)(4326008)(6506007)(38100700001)(66476007)(478600001)(8676002)(7696005)(53546011)(33656002)(52536014)(76116006)(2906002)(64756008)(110136005)(26005)(66446008)(186003)(66556008)(86362001)(316002);
 DIR:OUT; SFP:1102; 
x-ms-exchange-antispam-messagedata: =?us-ascii?Q?+IzaPQUjiKTi3hHAGFDb9durbrWLw9l97sqrYEioLOvYETOLfiiG1DrNu77N?=
 =?us-ascii?Q?8qQKQcxsAxm5rrtjG3O2CiS8l5FeISgZqngX2KGqo0/qnXTPouM2DydnoM8l?=
 =?us-ascii?Q?5oLVORU4xcyH2PNlaYCX2G5mM3fWIsM6ZfzF/EMbUGhz9QjfzKb+jcdwwAf5?=
 =?us-ascii?Q?aZy/dKaUDsJbQTuzprsTgOApSeJyVHYjY45DVRZ7k3aiypZIyAL66c12RABg?=
 =?us-ascii?Q?yMXm6uHSGtxx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EsqQjd/q9qQ35fFqRaIDz56k2wM7?=
 =?us-ascii?Q?Cr0RIIEIixgT+3AqlAMFwyI7eEL/XhyyalWPimLNxIQAkKG72nJfMgpkdt2d?=
 =?us-ascii?Q?OH23cjszfSXPtnHafP0tGAT1y8MQU/lsLdlDoRsGh1KE0b6WE24xFT25agWd?=
 =?us-ascii?Q?uHEPvhwW60q7du3Xo7d38ufQI5pLJruOsEyYW0mxRRwMH0OlgNmoOBrBOwSM?=
 =?us-ascii?Q?eARQ50iY1rIpcXejwIIK4IsJ?=
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: DM4PR11MB5534.namprd11.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 838c154f-b1e2-4132-106d-08d8edd05ca7
X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Mar 2021 07:50:43.2455 (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: OWs1pzGM7V9R+9yxSqN1C4tJHy70jzecEZlgmn8rTKiR2na2aDRc4p4QCdW01REThPRJA7yOZN6ustIM1KIB4A==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB2636
X-OriginatorOrg: intel.com
Subject: Re: [dpdk-dev] [PATCH 2/3] app/testpmd: remove forwarding config
 from parsing Rx and Tx
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

Hi

> -----Original Message-----
> From: Lijun Ou <oulijun@huawei.com>
> Sent: Friday, March 5, 2021 18:22
> To: Yigit, Ferruh <ferruh.yigit@intel.com>
> Cc: Li, Xiaoyun <xiaoyun.li@intel.com>; dev@dpdk.org;
> linuxarm@openeuler.org
> Subject: [PATCH 2/3] app/testpmd: remove forwarding config from parsing R=
x
> and Tx
>=20
> From: Huisong Li <lihuisong@huawei.com>
>=20

The commit message should be more simple and avoids grammar mistakes.

> The "fwd_config_setup()" function does release and apply for memory of
> forwarding flows, and re-establish these streams when rxq/txq or rxd/txd =
is
> changed. The function is also called by "start_packet_forwarding()" when =
user
> executes "start" cmd.
> All changes for rxq/txq or rxd/txd can be updated uniformly when this com=
mand
> is executed. Therefore, it is a little redundant in the "cmd_config_rx_tx=
_parsed"
> function.

It's not redundant. This command may configure number of rxq/txq. So the fw=
d streams map may change.
Then it's common to check the fwd streams after this command using "show co=
nfig fwd".
If you remove this fwd stream update, users can't get the correct new fwd s=
treams until they start the traffic.
But they may change a lot of things and want to check if the setting is cor=
rect before they start the traffic.

>=20
> In addition, the forwarding stream under one TC is configured based on nu=
mber
> of queues allocated to TC. And number of queues allocated to TC is update=
d
> after calling  "rte_eth_dev_configure"
> again. If the number of queues is reduced after configuring the DCB, and =
then,
> release and apply for stream memory, and reinitialize the forwarding stre=
am
> under the DCB mode based on the old TC information. As a result, null poi=
nter
> may be accessed.

I think you should add "rte_eth_dev_configure " into dcb_fwd_config_setup()=
 before rte_eth_dev_get_dcb_info().

And the commit message should be similar like the following:
Segment fault might happen after configuring queue number to less because d=
cb_fwd_config_setup setup dcb based on old dcb info.
And dcb info can only update after rte_eth_dev_configure().
So this patch adds rte_eth_dev_configure() before rte_eth_dev_get_dcb_info(=
) to get updated dcb info to fix this issue.

>=20
> Like:
> set nbcore 4
> port stop all
> port config 0 dcb vt off 4 pfc on
> port start all
> port stop all
> port config all rxq 8
> port config all txq 8
>=20
> At the moment, a segmentation fault occurs.
>=20
> Fixes: ce8d561418d4 ("app/testpmd: add port configuration settings")
> Cc: stable@dpdk.org
>=20
> Signed-off-by: Huisong Li <lihuisong@huawei.com>
> Signed-off-by: Lijun Ou <oulijun@huawei.com>
> ---
> V1->V2:
> - use stream instead of flow
> ---
>  app/test-pmd/cmdline.c | 2 --
>  1 file changed, 2 deletions(-)
>=20
> diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index
> 4df0c32..e316f5c 100644
> --- a/app/test-pmd/cmdline.c
> +++ b/app/test-pmd/cmdline.c
> @@ -1837,8 +1837,6 @@ cmd_config_rx_tx_parsed(void *parsed_result,
>  		return;
>  	}
>=20
> -	fwd_config_setup();
> -
>  	init_port_config();
>=20
>  	cmd_reconfig_device_queue(RTE_PORT_ALL, 1, 1);
> --
> 2.7.4