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 A5FDEA034F; Mon, 29 Mar 2021 03:53:47 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1C6B44069B; Mon, 29 Mar 2021 03:53:47 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 1C71240042 for ; Mon, 29 Mar 2021 03:53:45 +0200 (CEST) IronPort-SDR: zLPxCWltJJXsihaT+hWSdv/FB3Mkta/uZkGJEobgiunuNmTgnWn8zeGoCp10ZePvqSBypsfPGu DFv5OP7bBlnw== X-IronPort-AV: E=McAfee;i="6000,8403,9937"; a="178590382" X-IronPort-AV: E=Sophos;i="5.81,285,1610438400"; d="scan'208";a="178590382" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Mar 2021 18:53:44 -0700 IronPort-SDR: UpBPerWuCJZcK4F8q2WfCZyRjhA0vnrdjAPUbuFr/J9nhIqm5isBsvxHv6QM1Ww57WSoZ0VecI Nhy9Q2IaUYWA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,285,1610438400"; d="scan'208";a="437661103" Received: from fmsmsx604.amr.corp.intel.com ([10.18.126.84]) by fmsmga004.fm.intel.com with ESMTP; 28 Mar 2021 18:53:44 -0700 Received: from fmsmsx605.amr.corp.intel.com (10.18.126.85) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Sun, 28 Mar 2021 18:53:44 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2 via Frontend Transport; Sun, 28 Mar 2021 18:53:44 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.170) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2106.2; Sun, 28 Mar 2021 18:53:43 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OUVDuIR66iQW1xJ6idDGubOBbVk8s4CIIp7R0rhz6lelDmRp8x2CKqmhWJZSkVp3EKX49JrcH49+jUVSkn7bPJN1ZCQM5vS77BANTHk8UyJ+zF1+E+ZKSeY1fMx4RdQyrETWn0tZokhgJY6syngoP0HM6DI8AdTKc3w65EJmZLR0Lf6fbcNPWqnqIjFcORUbloJB9VIDvI/W9t7vSP4KiPN6kwuhXA8V6ICeCmpyOFgVrimFqFCTF+h0D3v8jkht7wovKqr7LehEOOt/K8CEVEUDryCGN5zHHSaSK8KmOGp/zovHJ6fSe81qUjXjqS6bhNl+NZ0Akq4WHOzVHfIN9Q== 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=J3X7XU6W/I5dPE8qYgro/xi168kPlxk7sbRVZ74Nzeg=; b=haMdq4YMsywJNlwKz+cPt7cKZ0ZtS0oPP83dqOW1zfK2HHW6ZBq47XnAovue6rXM2rnAflVbRicp+6Kp2+ROen5JbQG6tzarzZ4rU0ufUs6S1aCNmHJ4O6Z28Hohvc8gjJOzYa1tQTGVq+uUBLvKgg+VfkDyC85GF6Lk8yPAk5ctTuCs7gr0UBR/aAQQBvmOxx/EBr4Y7sHyY34PMCjp2zqNrkstyKyjq7E5f6g5PHb0ERePfnF77X2XAREqlPf4ILjz/NS5f47JDZcbJTGFs5He7vQsh33Wn8ynRhlKx1nUoMHN0zQxVgeBWQ1O52JDchgdj08zUdfIJRnfchCBpg== 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=J3X7XU6W/I5dPE8qYgro/xi168kPlxk7sbRVZ74Nzeg=; b=NXdKmD6xE9ChVAHsGCnxs0wJ5zn+ZGAATBZ5nUwPLdc3BBcBzlI7oLwjQ2X3G6/ql/lCaZMNcycoYx9UevbvMXb5D2NVmr4HQpIjpC/jng1Gx2BFBk8wdbWVtap8ycyuRLD+mGb38f5uys43vldMUAGNEv+RTLcn92M1EKSYfyk= Received: from DM4PR11MB5534.namprd11.prod.outlook.com (2603:10b6:5:391::22) by DM4PR11MB5392.namprd11.prod.outlook.com (2603:10b6:5:397::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.24; Mon, 29 Mar 2021 01:53:40 +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.3977.033; Mon, 29 Mar 2021 01:53:40 +0000 From: "Li, Xiaoyun" To: oulijun , "Yigit, Ferruh" CC: "dev@dpdk.org" , "linuxarm@openeuler.org" Thread-Topic: [PATCH 2/3] app/testpmd: remove forwarding config from parsing Rx and Tx Thread-Index: AQHXEaldDfAva4xisEaALSlRIYLxeKqRMteQgAE8B4CAAAufEIABqS8AgAYz1eA= Date: Mon, 29 Mar 2021 01:53:40 +0000 Message-ID: References: <1614939741-63927-1-git-send-email-oulijun@huawei.com> <1614939741-63927-3-git-send-email-oulijun@huawei.com> <6091bdaf-6d23-5471-ff3b-7af673fca23f@huawei.com> In-Reply-To: <6091bdaf-6d23-5471-ff3b-7af673fca23f@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.51] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 459e5779-e3f1-424d-16fc-08d8f25579fe x-ms-traffictypediagnostic: DM4PR11MB5392: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4125; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: JPp1fjFDPUbx7HA8tgHrcqkOB2IEhMsBmWOKd93GCByhQoOac+ALnX5cEhn9R0YMVRvh15gE8vsya+YRGMOYeF++fsiLvtObtaFnDs4pLq6PNNuntFsh2Uy02ZCzKFU5umySNHJoEdDvP6Jytx1cNlHkH1qfAGIMa6DYEeU45uJdWXsYSIqRk6n1HWPLpXpxDy2a2PM5QINYqG+9FuX0VN2LA9hsvNyJbZ2IeOtOY6P4g5Xh4hwAv20gDWCfhHUZ5+rqi4lqVQf2q+PlJmIdxMRqZTBA4kq9volfRxx2wWY+5cVI/XEA9Na2PLUhzafo5D3nMR65QFWD9KW62g7bEtKN2xhkJe6uCmC5iFIApsgl8LHlFhR8hQfMdtZiX5yQHezfpg8FXfTXRi9ObvZoOh4A4A2NuhqHXZHQxNholf3BKGcHF7sgTfO+0+NdgOBRqCPsGV9ZyvLMTWJwGgbUInUPLUSAYGJ7LWTzHwTYr5sDoIe2bqtlSBucWAF41Yk/XkhCCyV6rCr+qHUffb90StU5b7gpIQno/04hIg5SlLWC+r9NlP+6v4zOFvjjqxJxXTSDP194lo3WNIqmHIXAtx+mit5l4A/mO7E3Pm9uixGLrn+XvLXCFC6GOFB1pFCJD+gRhB2df1+gqZ67tl8DD3rGuCX5BGpHUc2BzewCt8A= 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:(376002)(346002)(136003)(39860400002)(366004)(396003)(52536014)(316002)(6636002)(5660300002)(54906003)(110136005)(33656002)(26005)(9686003)(186003)(4326008)(55016002)(478600001)(83380400001)(38100700001)(86362001)(71200400001)(64756008)(76116006)(66476007)(66446008)(7696005)(66556008)(2906002)(6506007)(8676002)(66946007)(53546011)(8936002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: =?iso-2022-jp?B?NkxzQmpKbHFCVUVmL01LNTFsM2RvOFVtL3lCZ1FHY2dYdkEvZWllbmRw?= =?iso-2022-jp?B?NW1OdEU3MUVxeUJVTlVvTlh0OStKanBwcTBtakIyc2UzQVVXOEFQR0Jv?= =?iso-2022-jp?B?OFpyeE1GQmZTUkthbG92SlFPS2hFYXJwano2UUYvVkNzLy80Q3hZR2du?= =?iso-2022-jp?B?VzJPUjFWQzZJbXBkZUpqb0d4RzR4UkJPK2F2ZGpOYUVNdkdPTmkxSE4x?= =?iso-2022-jp?B?TGJzU3ZDVXB5bGRnZUpIMTdTTzljZVFZWUdFWkFROVV5QlVGTTdOeW4w?= =?iso-2022-jp?B?ajlyVmpsNGt6UHQrcTNWcExVd3JFWnc4RG1UazJ0V2FzVXFxczJoTW9K?= =?iso-2022-jp?B?T1FOV0NtQzUxcTFxVU5RNU5QZmZXcHpVNm5CMndxc2srMmZIRlpQNFBn?= =?iso-2022-jp?B?b242aHBtMW5OZnZDNm81TmtXYytWVDdXOWVPTEVtQnZwSVZkc2oxVi91?= =?iso-2022-jp?B?RTA4ZHd6RVBFbzY4M215Rk9UWm1HcFZXMWpBeUp5VFg1M2xxUHFW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DhWbTkwSy9x?= =?iso-2022-jp?B?S2xKL1puZEF0aEx6czFUVytVRGZvUHFNTkFGTGxRdk5NQzB6VlhoSGNq?= =?iso-2022-jp?B?U28yZ21iYjNWRFdSRFgvMmVrWm9Sckp4MjRudjhBYURScnVCRzBtKytm?= =?iso-2022-jp?B?MUxDSlhQMzJzRXhZU2IxbmQ4YWFQMURZVzBnYWtZbk94SUlZRXVvblRw?= =?iso-2022-jp?B?ejhRcXFwTElVVm14cWRrL2FlMW05MU1kR3VMVms3ZE94N3BURUJQeCtX?= =?iso-2022-jp?B?YXF6bE1wS1RrK1JRTXdSbWV5VGhrZ01Md2ljSDRXaGtTU0VwRW1jWHZS?= =?iso-2022-jp?B?WTYxdmFZaWx0eGdCMVBDaDdCdlpwS0E1eGhFTXlqOW0zVVkwNC9SVXhW?= =?iso-2022-jp?B?STNyYVd0VlptK1VWbVJxTEtVNTg3c1VGNFlWOWUvYjRlSDRsNy9TWUIy?= =?iso-2022-jp?B?cnZBK1U5eTZBdURBM00zMVB3R0tGMkFjRTJ5SEFzWHZyK3lrVHpRbnM1?= Content-Type: text/plain; charset="iso-2022-jp" 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: 459e5779-e3f1-424d-16fc-08d8f25579fe X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Mar 2021 01:53:40.4706 (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: wOAx2eH0CCENitHXHGYPjcrbaoVQ+YPuRXCzY8tV+BFsnjPzNjObc3G1OdQDF7ck1mVR6sFWyO9Be771j+dDCg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR11MB5392 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > -----Original Message----- > From: oulijun > Sent: Thursday, March 25, 2021 11:04 > To: Li, Xiaoyun ; Yigit, Ferruh > Cc: dev@dpdk.org; linuxarm@openeuler.org > Subject: Re: [PATCH 2/3] app/testpmd: remove forwarding config from parsi= ng > Rx and Tx >=20 >=20 >=20 > =1B$B:_=1B(B 2021/3/24 9:44, Li, Xiaoyun =1B$B > > > > >> -----Original Message----- > >> From: oulijun > >> Sent: Wednesday, March 24, 2021 09:01 > >> To: Li, Xiaoyun ; Yigit, Ferruh > >> > >> Cc: dev@dpdk.org; linuxarm@openeuler.org > >> Subject: Re: [PATCH 2/3] app/testpmd: remove forwarding config from > >> parsing Rx and Tx > >> > >> > >> > >> =1B$B:_=1B(B 2021/3/23 15:50, Li, Xiaoyun =1B$B >>> Hi > >>> > >>>> -----Original Message----- > >>>> From: Lijun Ou > >>>> Sent: Friday, March 5, 2021 18:22 > >>>> To: Yigit, Ferruh > >>>> Cc: Li, Xiaoyun ; dev@dpdk.org; > >>>> linuxarm@openeuler.org > >>>> Subject: [PATCH 2/3] app/testpmd: remove forwarding config from > >>>> parsing Rx and Tx > >>>> > >>>> From: Huisong Li > >>>> > >>> > >>> The commit message should be more simple and avoids grammar mistakes. > >>> > >> All right, I will simply it. > >>>> 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 command 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 > >> fwd streams map may change. > >>> Then it's common to check the fwd streams after this command using > >>> "show > >> config fwd". > >>> If you remove this fwd stream update, users can't get the correct > >>> new fwd > >> streams until they start the traffic. > >>> But they may change a lot of things and want to check if the setting > >>> is correct > >> before they start the traffic. > >>> > >> Yes, you are right. It's really unfriendly. > >>>> > >>>> In addition, the forwarding stream under one TC is configured based > >>>> on number of queues allocated to TC. And number of queues allocated > >>>> to TC is updated 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 stream under the DCB mode based on the o= ld TC > information. > >>>> As a result, null pointer 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 > >> dcb_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. > >>> > >> Thank you for your advice. But the above adjustments may still not > >> work for some drivers. The mapping between queues and TCs in these > >> drivers is updated in the dev_start stage. > >> > >> I have an idea. We can move fwd_config_setup() to start_port(), which > >> is called by main() and after starting ports This not only solves the > >> segment fault, but also does not have the problem you mentioned above.= I > test it and it is ok. > >> > >> What do you think, xiaoyun? > > > > How can you fix the issue I mentioned? > > You still need to start port first to see the updated fwd config. > Yes. But it can make sure that users get the correct new fwd streams befo= re > executing the 'start' command. > > And for those drivers, why does the mapping has to be updated in dev_st= art > stage? > > What does it need? Can't it be moved to dev_configure? > The framework does not require that the configuration parameters transfer= red > by the dev_configure API must be updated in the interface of driver. The = driver > can verify the correctness of these parameters in the interface, and the= n > complete the update in the dev_start stage. It depends on the design and = need > of the driver. Maybe it's more appropriate to put it in dev_configure, bu= t now > we can't ask all these drivers to modify the operation. I still think it's driver's responsibility to configure DCB in dev_configur= e. Calling fwd_config_setup here is because this command changes queue number.= Users just change queue number so want to check fwd setup. It's a normal a= nd reasonable behavior. Starting port will be called in many situations. I don't think it's appropr= iate to call fwd_config_setup every time calling port_start. And you can't = expect users know the fwd setup only change after port_start. These are only my thoughts. If anyone else agrees you, they can give you ac= k. > >> > >> > >>>> > >>>> 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 > >>>> > >>>> At the moment, a segmentation fault occurs. > >>>> > >>>> Fixes: ce8d561418d4 ("app/testpmd: add port configuration > >>>> settings") > >>>> Cc: stable@dpdk.org > >>>> > >>>> Signed-off-by: Huisong Li > >>>> Signed-off-by: Lijun Ou > >>>> --- > >>>> V1->V2: > >>>> - use stream instead of flow > >>>> --- > >>>> app/test-pmd/cmdline.c | 2 -- > >>>> 1 file changed, 2 deletions(-) > >>>> > >>>> 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; > >>>> } > >>>> > >>>> - fwd_config_setup(); > >>>> - > >>>> init_port_config(); > >>>> > >>>> cmd_reconfig_device_queue(RTE_PORT_ALL, 1, 1); > >>>> -- > >>>> 2.7.4 > >>> > >>> . > >>> > > . > >