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 B96CC42C12; Fri, 2 Jun 2023 22:20:01 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 53D76427E9; Fri, 2 Jun 2023 22:19:58 +0200 (CEST) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2047.outbound.protection.outlook.com [40.107.220.47]) by mails.dpdk.org (Postfix) with ESMTP id 2573742D35; Fri, 2 Jun 2023 22:19:57 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QTY+G2Mus4nepFl7xyse3GQz/s4Vj1HgUuHWVNDZblq45oQvGdHjH/64bNZW0Cc3Wi/tvhS3kd0EFl8Mf7lE4ch8F+adAaFWBqd1sskJsFD2d1eQiRlL1njS+62GwJFwEqYae+KwtpG9udPd5zNpIFliEbVwO55YBqgevDNPqbvGOeHr72rfh+A+nm9zYjTtJmLDys6jESa+6GpaVFiaqZ3sP5Ey7G1BWF7EqVqdVndQvYEgHuzVcdnwEbAE/MBszmtada+gF0jaEkn5Dl1C/FwSlkLYMgr591qNM64bDLin7gKiQlN6inOQ5vp3nydzNWEztdD0QMB4IigyLHEVcw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=xqAFfoJ6DReXTIIwm1UdMk84C8QhlFW/1qSVJRPgodw=; b=bHnxLicLQX3jDMK2tTqskt0JpD5WetBtG1JOMjEEM6XTl4gVaaOPv2FeoxqviTmDvK1gAb/W/uANUV7pxlVEEevuP3tWIIHjmVdeL+lZfRStRDz73UlH2BhWX/etN7LSexidbqi9sFJl2op2q2dDn2lM08pOWLIVv5GKYk7b0wEx4cCrUpUUtnOWtfRzRma9cl2iWQ2YAdK8k7pMlGZnATbAeoyGyw1R2WFzAIomnw0MZOfPNZ9IwzDVYpUnto45eTPYWoUA1Y5/LUvZ82HUlfLdTzUmJdx0v33QMNIqxhcaDN3dsLp9QySc3j9xodb1Btqh7ON5xxO2EdVz0XiJxQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xqAFfoJ6DReXTIIwm1UdMk84C8QhlFW/1qSVJRPgodw=; b=5KLRhdnGwT+U/kmn2cMfQO9+pV/NvgcOlBdE3+w7f3P+4QfiXxi30YanNtpw7gbRJeErSjDt+Yp59OXaK4SfZddUQWqMPQh1ufLqpIdo4yWscKWYJH49sOJcAZ9Gwk1fSUE7qDRUTSyWzpduowRHNLUlWdMyjOAy7PbXspS+JPg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) by SJ2PR12MB8738.namprd12.prod.outlook.com (2603:10b6:a03:548::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.23; Fri, 2 Jun 2023 20:19:54 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::7957:641d:6aba:3f9a]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::7957:641d:6aba:3f9a%4]) with mapi id 15.20.6433.022; Fri, 2 Jun 2023 20:19:54 +0000 Message-ID: <5c0b4937-2c5c-9d94-2145-eb88a69384ee@amd.com> Date: Fri, 2 Jun 2023 21:19:47 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.11.2 Content-Language: en-US To: Dongdong Liu , dev@dpdk.org, thomas@monjalon.net, andrew.rybchenko@oktetlabs.ru, reshma.pattan@intel.com Cc: stable@dpdk.org, yisen.zhuang@huawei.com, Jie Hai , Maryam Tahhan , Vipin Varghese , John McNamara References: <20230315110033.30143-1-liudongdong3@huawei.com> <20230315110033.30143-4-liudongdong3@huawei.com> From: Ferruh Yigit Subject: Re: [PATCH 3/5] app/proc-info: fix never show RSS info In-Reply-To: <20230315110033.30143-4-liudongdong3@huawei.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0571.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:276::10) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|SJ2PR12MB8738:EE_ X-MS-Office365-Filtering-Correlation-Id: f110d759-4657-4598-e69c-08db63a6ba13 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QTSx8xkxdXeBMHM7plazxoIU9x7S9y4Dc2gFeSYyVWZ5eUCx8oCwSQdrFz5gqtgnxbibEKb+Q6MKCqphKVd6V4U7JrCaizOtiSgQYOXPIEW/ND7yeGue+HbsMxkQd1c0bD13ZG6eWMh+so1PtYXXIh1FN3Cy/iWh1EAJot2xggFrdCmZ1ZprQEf+oCRdalQscebGWAzpE8xOZ+FJ44KzBP40z+pOuDmSVhnMRdCOrq19shjjKVIQTmoV52y00bKRArYGE1XKswi25v06fqh/EZNa7jnEEmybyTxldc1SwsoPmQ+InNxWXUFhaaAdUfeHKyWjQ/vbOi1v5hoBS3AK8xxP1+MkbvZSdoPjqfeufVzkoIyNdArdNMMH7bVfXoOrrCibQp94BtoEm+m+srPq7c7a0ScaHbJpHrx2LxEyfJT3KK52hsBtqVJIinjVLEmaXlOGGCLo9FJVexx41WhSDRziR5I2jkO5lTQVeGi13XBYARuagqTbFKgVFd0mVrLHX79hCgRHSLAzdg9DFvQNfKCtsRqZ7mF1Y+Uypmlw+sZvrPjroAyHNrN5qJ48tB9+tR/Ec5TBUQ/sOx1pXMZ1kr36mbNSNQP+f0W9zBTDzvYKNGXCG43XZtiOvJAaF3TxnBlsmCXFMFwI5aK0GIPoXQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(4636009)(39860400002)(376002)(396003)(136003)(346002)(366004)(451199021)(31686004)(31696002)(478600001)(66476007)(66556008)(4326008)(66946007)(54906003)(316002)(86362001)(36756003)(6512007)(83380400001)(6506007)(186003)(53546011)(41300700001)(8936002)(8676002)(2906002)(5660300002)(26005)(44832011)(6666004)(7416002)(6486002)(38100700002)(2616005)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?Z0hCTWVDRWFQT0xDaU84VWlZaHdVWEx1djN0WnVWQnVWMnYxc1podUZ6MlZE?= =?utf-8?B?YzRIV016RmUwcVJFTHhoYTZnUmROWHllSWxiMmZnTG9UcDQ4S0RBaGczVUFR?= =?utf-8?B?UytIT2VTZkFHTkJLajFQT2FpUkJsR0ZESlF4OVFTUGhyWUdDcGhKbEljeTB3?= =?utf-8?B?Y1NLbEVVN3dQK0c1NUViM3BlckltK2h0dllqZGlFTWk4TjdDWVh2Q3VLL3hB?= =?utf-8?B?Wkt4dCtwWkVWckRMV0pGNnVwVWl4YmxTenlmYjE1eTNLRlFPMVlkbTBZR1RS?= =?utf-8?B?TTZYNzl6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bmtIZzJGUk1FSjBKWnFRdVpuTmNRdWFhdGxE?= =?utf-8?Q?9uDCYDJETBQhkp4N5BK3Wyoc9?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: f110d759-4657-4598-e69c-08db63a6ba13 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jun 2023 20:19:54.3088 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 6SwbUMPg4s3+hMvSLDN6TOiE/cYV5HtF+xWmib6l2Dj8Hzobz7PHWGKCTUmd/lse X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB8738 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 On 3/15/2023 11:00 AM, Dongdong Liu wrote: > From: Jie Hai > > Command show-port shows rss info only if rss_conf.rss_key > is not null but it will never be true. This patch allocates > memory for rss_conf.rss_key and makes it possible to show > rss info. > Why 'rss_conf.rss_key == NULL' case is never true? 'rss_key' is pointer and 'rte_eth_dev_rss_hash_conf_get()' doesn't allocate it, so can't it be NULL? > Fixes: 8a37f37fc243 ("app/procinfo: add --show-port") > Cc: stable@dpdk.org > > Signed-off-by: Jie Hai > Signed-off-by: Dongdong Liu > --- > app/proc-info/main.c | 26 +++++++++++++++++--------- > 1 file changed, 17 insertions(+), 9 deletions(-) > > diff --git a/app/proc-info/main.c b/app/proc-info/main.c > index 53e852a07c..878ce37e8b 100644 > --- a/app/proc-info/main.c > +++ b/app/proc-info/main.c > @@ -823,6 +823,7 @@ show_port(void) > struct rte_eth_fc_conf fc_conf; > struct rte_ether_addr mac; > struct rte_eth_dev_owner owner; > + uint8_t *rss_key; > > /* Skip if port is not in mask */ > if ((enabled_port_mask & (1ul << i)) == 0) > @@ -981,19 +982,26 @@ show_port(void) > printf("\n"); > } > > + rss_key = rte_malloc(NULL, > + dev_info.hash_key_size * sizeof(uint8_t), 0); > + if (rss_key == NULL) > + return; > + > + rss_conf.rss_key = rss_key; > + rss_conf.rss_key_len = dev_info.hash_key_size; > ret = rte_eth_dev_rss_hash_conf_get(i, &rss_conf); > if (ret == 0) { > - if (rss_conf.rss_key) { > - printf(" - RSS\n"); > - printf("\t -- RSS len %u key (hex):", > - rss_conf.rss_key_len); > - for (k = 0; k < rss_conf.rss_key_len; k++) > - printf(" %x", rss_conf.rss_key[k]); > - printf("\t -- hf 0x%"PRIx64"\n", > - rss_conf.rss_hf); > - } > + printf(" - RSS\n"); > + printf("\t -- RSS len %u key (hex):", > + rss_conf.rss_key_len); > + for (k = 0; k < rss_conf.rss_key_len; k++) > + printf(" %x", rss_conf.rss_key[k]); > + printf("\t -- hf 0x%"PRIx64"\n", > + rss_conf.rss_hf); > } > > + rte_free(rss_key); > + > #ifdef RTE_LIB_SECURITY > show_security_context(i, true); > #endif > -- > 2.22.0 >