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 E126743DFA; Thu, 4 Apr 2024 17:57:22 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D086D402E8; Thu, 4 Apr 2024 17:57:22 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) by mails.dpdk.org (Postfix) with ESMTP id CEAF6402BC for ; Thu, 4 Apr 2024 17:57:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1712246241; x=1743782241; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=mG1cu/IwZ7a2wkJV2OK0sVr2IIbO/SO8VglGRvQINfM=; b=DQ5ScfLzjZcHMdxu8nJyLbnkI0KR7SN6MB3jjdcMKuJ1z4OPx2ftv3Un 4mpP5vn6Sa1p7ZCTaTpXMtYe/a8jcCnUuGSXpp05A7KOs1bklI/K6bvO+ KnVr2YJX661I8yQKZWchf351GuL+/n1cIdjEhbU8vlPTqztUrOUMjQnfJ bDowjzDXy42gnhcVxAQjaqry19L3EHLAhKso+f7aEci7AyRNioVNe8eWK 4l9dohD8QN9rBBIOA+mip+93pCRkRE2lpx4YsukLw7E2OtEDuZQJadny2 fIcAAMvV+vARDaYpv7nFIcYbsEDccCDDzsXLPPtcnjiPdCYsOfgCdulqt A==; X-CSE-ConnectionGUID: nGO/5tVASXWoNHOcy8sAeQ== X-CSE-MsgGUID: lHiCVH+nRjm5N3OpRjXlLg== X-IronPort-AV: E=McAfee;i="6600,9927,11034"; a="7778127" X-IronPort-AV: E=Sophos;i="6.07,179,1708416000"; d="scan'208";a="7778127" Received: from orviesa003.jf.intel.com ([10.64.159.143]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Apr 2024 08:57:19 -0700 X-CSE-ConnectionGUID: HBFr2ZTMQe2aM7xnSbFPiw== X-CSE-MsgGUID: XDdAqSrjSYKa9yDfssu/5Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,179,1708416000"; d="scan'208";a="23510851" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by orviesa003.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 04 Apr 2024 08:57:20 -0700 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) 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.2507.35; Thu, 4 Apr 2024 08:57:19 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 4 Apr 2024 08:57:18 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Thu, 4 Apr 2024 08:57:18 -0700 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.57.41) 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.2507.35; Thu, 4 Apr 2024 08:57:18 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GW1hn8VifsDUf+wJbOo4MFq9xnLWUqgqmnQv5Lal+niVs6pEygfsQEsh0ApGyjK+TqLPh4qU3JWYNL8SV2dkzuoVfKlTKUgP35CNK5fmLYf76Iq1RVi4ybKILCeqikVim1c1iAXBJD0Hoe94Rj1HxevAZsUCUbyJnNrVLhUy6e6aKimb5TOLnfKGZ1I96OFq6oxxhGxiuvt6AC9IuYgyizj+lyhaq1PLdm2L81tZ9pmkX566N7/HYFt/KYG32DQMBwBlR42tyu8PzWdNdiHOoEGp8SCcWhycWQUlLa/i7gmSuKTap0pNI7Z8hHpeZvExuV8pJIKAJr9Ljg269Ee85w== 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=cGLVp/gKUGwsyFnvhIW2LYPHhbqZeUqWjDivhW+2OkI=; b=XZOcN59rO1n7kUDgiwyOqEOtV/zBtiPFdqHOm3dDTKTDYTwbCFmZEoGSC2IsjakKqK1gnTZaGdpaAFvK00yqtaQiZYe3GkangE8oH6ouujlDb+dEBGR+RNBG2hV9dZ9/Hvr+xHvU89affweepjoWQaNP+obBiEsLj9QMyki691qjhhPXqmyY6TvEHvdHWRJGuGRVWuOsi2x3ife2l66dZGy8rtDei9c/DETt5jEtg2X4N2YY4m28bPMRE5yASuuLxUcVnEeUwIuNr9kWMRBZpnHd+8fgOjwKDJxKuttq5de6Cvw3Y/j94hppEB1nav0MdAg66X47k2VmQ6iDosIJzg== 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 Received: from DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) by SJ0PR11MB5895.namprd11.prod.outlook.com (2603:10b6:a03:42b::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.26; Thu, 4 Apr 2024 15:57:16 +0000 Received: from DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::487e:e20c:ad88:9c0f]) by DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::487e:e20c:ad88:9c0f%7]) with mapi id 15.20.7452.019; Thu, 4 Apr 2024 15:57:15 +0000 Date: Thu, 4 Apr 2024 16:57:11 +0100 From: Bruce Richardson To: keivinwang CC: , , , Subject: Re: [PATCH] net/ixgbe: add param check when tx_queue or rx_queqe is null Message-ID: References: <20240323144842.12331-1-keivinwang@126.com> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20240323144842.12331-1-keivinwang@126.com> X-ClientProxiedBy: DB9PR05CA0014.eurprd05.prod.outlook.com (2603:10a6:10:1da::19) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|SJ0PR11MB5895:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: a4k8KNKPeClqRVs5DJqJ4bXrItZvYbHPlX+lM+PJ7qTVC1/ybSZGYpfVNPcIxhVd5nw+Oxgac5jPX59zDe+M/H08CR8xwoFJyU3QlI7qLpMxdTgfhepCER8qX49eK1roUx8NMRxiwvWZr0YyxrL1vZH6jmnsxJ9h36WiV/7XcXP/3OzYGdG4DGsG+U3zvtznRkW2mZPDQxZ1nDncV9208t0Vtugc2iYWraX2JNrtCG2ZceFYDsCAJj0s1NjLTH2FMAkhCHQQeN+NnOafiACeuTi+wyo50zXU1Civudvb+mMxin1OGadK9mcAprnlx5ILN5a5J92l3zt0XPFZbBe3IW0ZcQ+nF7NOIz9JwPtsjmXVnwbGBphZZNThzs6GNu0Q3vNbByQmw1LI2Hd4WEkMH7rZblZH0j36yxkBpvLE0cwvmYWTpE7fTMCLMd6H+1gKnYIghm99TYV6E2oDpnjQ0fTAgp0neyI2aUGTYhFr+m7boHRrNReIskHoQrIxHr/XdH/gVnqhaPbsG1mGdfgsI48DquzcKZy8ycBzfrwdAR+b5l3TkUMsPbOvczSaKvcZpsArYeuZJe0PMB4qCQ9jqzQmqrY1qj10p8USROH45TnQxg0q5TgIWpb+jCrEXclZ2i0VHRTJSV2RItR6T4Kw2mqMGxoiJ9vdMk6+OPEmwRc= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DS0PR11MB7309.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376005)(1800799015)(366007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?wffgEHUJ/4CRr3PWX39TYYtxGEqcnce9ge3OHVF+k+iNySwmtUnBMVWWr/Vp?= =?us-ascii?Q?35Oixnjh8of43X9jDQ+ZexKvaC4atvuXeon3UiMVPlcMmJoP2IZ6pOJGnMqF?= =?us-ascii?Q?kJpPsS4JrkaRQnx0uOkWveoPYDorP6+X5PZJwjl//2NNwiU3DqdPMS9qLLs2?= =?us-ascii?Q?shbn4by3MfND9ATLFgWXixqRoa+D3+J1K3ru9uXrwrtY+Yj8dpTO0YwBy8lQ?= =?us-ascii?Q?sO6GmGVeAqYLsh9IjyK1/5me79jDrQ48oDI5OZPQtQC5I+dg4thBv343aC9D?= =?us-ascii?Q?iYvTczp0So1oDAKBM0rOIouwZk/9VGdEKEHBRFp13R5Qs0Xfs8rHYOsjUliH?= =?us-ascii?Q?+MntfjaVmd4ATeqWL1WVJ2A0rnR6VJ+JjWnuhzlaBfiym/OsiClB/svpiJLC?= =?us-ascii?Q?uFOQAyzKwtDrGA1OGdq4TPPf3ogftXHj+xefm4SeBEQyOrlh3h/L4voKwsBo?= =?us-ascii?Q?X32tv0gWINcv3U39qhwlneS3gYnP3t2YQg4Y4n/K8WgWIZQ2KrKZb2Yi6Kb+?= =?us-ascii?Q?u/A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e338OsKNtWCo9cUCL3m?= =?us-ascii?Q?/RzHmjRU8SyJBkOswlLio+X6nmNU8Z+2lGnHvSloKjpwQZkzIJVWuoCf0BwB?= =?us-ascii?Q?MvsE6cQl+moTgOqP5QK9waOT/qeyE2LVpKu+ffOP/3Uo8H7RISJYy6eUjOhn?= =?us-ascii?Q?muVik1nlvVqzLiF36hA37NxsBuo3QgZESbBhcyR+cxnLIJnAMVw2AcSO+91D?= =?us-ascii?Q?rQ=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: b500cd1d-e9bd-48e5-8f88-08dc54bfe621 X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Apr 2024 15:57:15.8262 (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: lcuSDvcXJGBi5HLkKhUC3TIfpoG0vSJHeOhvPyTCV4tOXmUL8VehebhPrRvgrn+q/IF+gpX7vY9l0IrQ3RIoPe2/RXBKSI81OsjNmMrccOw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB5895 X-OriginatorOrg: intel.com 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 Sat, Mar 23, 2024 at 10:48:42PM +0800, keivinwang wrote: > add param check when tx_queue or rx_queqe is null. > Hi, trying to get some context on this patch. Have you encountered a situation where there are actually NULL parameters getting passed to the functions, or where an rx queue is unexpectedly NULL? If so, while adding NULL checks is not a big issue in itself, the values being NULL may indicate a more serious underlying issue we need to investigate. > Signed-off-by: keivinwang For a sign-off, the general format is to have both firstname and second/family name given as separate words. Thanks, /Bruce > --- > drivers/net/ixgbe/ixgbe_rxtx.c | 11 +++++++---- > 1 file changed, 7 insertions(+), 4 deletions(-) > > diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c > index f6c17d4efb..245b3527db 100644 > --- a/drivers/net/ixgbe/ixgbe_rxtx.c > +++ b/drivers/net/ixgbe/ixgbe_rxtx.c > @@ -2539,6 +2539,8 @@ static const struct ixgbe_txq_ops def_txq_ops = { > void __rte_cold > ixgbe_set_tx_function(struct rte_eth_dev *dev, struct ixgbe_tx_queue *txq) > { > + if (txq == NULL) > + return; Have you encountered a situation where this function can be given a null parameter? > /* Use a simple Tx queue (no offloads, no multi segs) if possible */ > if ((txq->offloads == 0) && > #ifdef RTE_LIB_SECURITY > @@ -4953,12 +4955,13 @@ ixgbe_set_rx_function(struct rte_eth_dev *dev) > > for (i = 0; i < dev->data->nb_rx_queues; i++) { > struct ixgbe_rx_queue *rxq = dev->data->rx_queues[i]; > - Similarly here, if nb_rx_queues == X, is it possible a queue between 0..X-1 to be NULL? > - rxq->rx_using_sse = rx_using_sse; > + if (rxq) { > + rxq->rx_using_sse = rx_using_sse; > #ifdef RTE_LIB_SECURITY > - rxq->using_ipsec = !!(dev->data->dev_conf.rxmode.offloads & > - RTE_ETH_RX_OFFLOAD_SECURITY); > + rxq->using_ipsec = !!(dev->data->dev_conf.rxmode.offloads & > + RTE_ETH_RX_OFFLOAD_SECURITY); > #endif > + } > }