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 17510A00C3; Mon, 13 Dec 2021 04:02:40 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B145E40140; Mon, 13 Dec 2021 04:02:38 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id BB61740042; Mon, 13 Dec 2021 04:02:36 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1639364557; x=1670900557; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=OT/vVsYevbcZiCVW6ePVFI5s6PfMTa6zPGm0iFer+/c=; b=QjGPT9o3akI0MsNY2kbW55E1q3R2uzWpJtGyHtTJwrgvIReq8C1PCuAG 4GmMYSb0CIx4ipJKeH/39lWhGHi3a/MZUoxqgxzN7S4xq2K6ASGStYcN9 wcD79V8JNZ0374Zeq46E3L93FQVv2zSr/s8E/LIq0DswGfuXdZRWOQScq 07xWLglNvJ0lmNgffTaf84kQJ3aHgOk3e/s2uqFR9D/6xxreBGRDNO4b5 IX7rm7I7ihYJXpOhZZZzPMMpHG6Jb2GaDY5HNIaecBQctALCcnd4tbWoP IXa/H7+3rAlXm9wkwf30wL5HbVAKuGtHb1nDLXTGDuV2z3rki7IkaD2Bj g==; X-IronPort-AV: E=McAfee;i="6200,9189,10196"; a="237388045" X-IronPort-AV: E=Sophos;i="5.88,201,1635231600"; d="scan'208";a="237388045" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Dec 2021 19:02:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,201,1635231600"; d="scan'208";a="751956811" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by fmsmga006.fm.intel.com with ESMTP; 12 Dec 2021 19:02:35 -0800 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.2308.20; Sun, 12 Dec 2021 19:02:34 -0800 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) 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.2308.20; Sun, 12 Dec 2021 19:02:34 -0800 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx608.amr.corp.intel.com (10.22.229.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Sun, 12 Dec 2021 19:02:34 -0800 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.169) 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.2308.20; Sun, 12 Dec 2021 19:02:34 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=E5oLDdKPKkBIKhZl7WDj3xjrQkciKuQsavl2WrmgAQKbJvRA9S0vSxUbQb/iqhNUnUKmbTnhE8Cj3uNF01rYvFvHO45MtPULReezOUYC+qMxSl053z2KgEHdwxLC65JIZYqIEmKnuY2NuhSLdRmo8Us2CYkxaJFJeDssqVGisFCACny/MpOkIkYG7oJ4daJGvrzLjHJQxJjA6t+hrFOTOPKeG/kmXA2y3t1Kt4b4JXCUu7EdKp71iqS1qj+YqLPvLj9SGbQNC+3xsgEiu+A48s74NctfI/I8P5leAyXuuYlhoNZzJJ4EdW9odUgLRxksn/R4ZNe4lftlaYfAtkcJnw== 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=V2iwvuIlQWi+wmSBo7+w1Z3bCs4S9rcaXCmznlM5XZc=; b=Uvm/IpRveKzeWeYamML071gY+P+xYSxxxIMh0YgRmIE+jqXFBeLV32IOhMFIC2Bhwu2D2KazXp3EEYqmu+YB0ltRmw+/Ti0q6SozFG8tlhm53RTQUGDyj/Su5oOyoF5njSEY03RY+hr1iN6JTorSKc4uxiSvE5WtDMywkAQcCUrx7tvdQJufPlq/viTNhdBLPQkHbCilmZ+p5HJ/3oMlYVPxwvlRQx3JGZaBCodxSKyeXoFqWjuQErzd7lh6R0mkdoav+G2HrpY1r3gnBeOIxJFu0jl44fd2YP/L8kWEpjLu63lpshgRcifcDyZXOgDVDUriL9nHL7GR8xv9wVRVHQ== 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=V2iwvuIlQWi+wmSBo7+w1Z3bCs4S9rcaXCmznlM5XZc=; b=tXnmp9Aj7C+K6lC4CETC97u6c5a9mkjYoW5aQ8ju3b033bdl+8s7WebdDlEVZOtyyO4fmziRTX3QQlysX9VDcKQjhS6863Xh/KNRvvsjLTtNkQ1vrKJU7ezo/pwPeYp2iFriOTG9ZxDQelWkZILz536b795HGoAeHQHCzocpjAM= Received: from MW4PR11MB5774.namprd11.prod.outlook.com (2603:10b6:303:182::16) by MWHPR11MB1742.namprd11.prod.outlook.com (2603:10b6:300:113::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.21; Mon, 13 Dec 2021 03:02:32 +0000 Received: from MW4PR11MB5774.namprd11.prod.outlook.com ([fe80::a9b6:c7eb:2e05:8cb2]) by MW4PR11MB5774.namprd11.prod.outlook.com ([fe80::a9b6:c7eb:2e05:8cb2%8]) with mapi id 15.20.4755.011; Mon, 13 Dec 2021 03:02:32 +0000 From: "Rong, Leyi" To: Bin Zheng , "dev@dpdk.org" CC: "Wang, Haiyue" , "liangma@liangbit.com" , "stable@dpdk.org" , "jia.guo@intel.com" Subject: RE: [PATCH v3] net/ixgbe: add vector Rx parameter check Thread-Topic: [PATCH v3] net/ixgbe: add vector Rx parameter check Thread-Index: AQHX7Z8RNHd9Dx1OkkqCtC/i4yLUAawvwCAQ Date: Mon, 13 Dec 2021 03:02:32 +0000 Message-ID: References: <20211202092001.1830481-2-zhengbin.89740@bytedance.com> <20211210082209.4102794-1-zhengbin.89740@bytedance.com> In-Reply-To: <20211210082209.4102794-1-zhengbin.89740@bytedance.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.200.16 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 5fd74419-5ff5-40bc-3f4b-08d9bde501f4 x-ms-traffictypediagnostic: MWHPR11MB1742:EE_ x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3173; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: pEuRYDOKydWDoJWdyxK1SYXJuLAxGudT4GPsoh/1A8XxygOe9x6A2JcwBfqx9WEiq3yRYw3V4D1DCHy4ZrfUhV5MPwpjdIkzUb7m6ENWS6UqlaKskyK+TV7oEKeGSJTXWjrJCQBkCLyPRk5PFGMUo5jA+VRtRxmZRLwG1vbqfGAlVEHyRkv5pCQWumLMSL51PXMVQ7MH97N6zNmvjH25VufmA/GD9cSUMINa0gWAZPzYGLzx19Jgwl1jnGOVWNBK4rBXfCbBxRBU9ArMdWKpSPrG2cI/RRTOGgRaGQ0XIReXmaBIrHmOIB8F+xtVrK4AsTv2cSQyRryRfdBK2dRSWAH2BmlFfNYfeghlWnmxQiEgZW/S6jVeTGdf7W5SFavmACdNqnY9poIUq5kA60G3+SVfo1gixfgjsTKjSr1VvBK0301OVyoDDHGiEBOYT1gAPUZsz5KYuHFtXRvgZj3KN+ptBsiX8nh/WrCComROqvXKMt63yPKCgFPlGKPcKiEnDAcnWkpHSYaEwonP4OyGolIGlf3K75E365XLx4HTR6KMcyOUcUVbLurPP2AIGJuTypeQ+AfqW4yZKwkNgJiB2QJnM6PBDR2dG9ErCHEQO1y2tG+RS2tMw/rHeQWHd5hGAC1/MmmWsettGDJ1KhaJSYYsgL3omgEvof0jTBD9nsEZoDcRu0clOB786PPcZa4VQxDAjOFvvi4Xg+mFHQZK3g== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MW4PR11MB5774.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(52536014)(26005)(71200400001)(9686003)(6506007)(53546011)(122000001)(508600001)(38070700005)(38100700002)(7696005)(5660300002)(2906002)(186003)(66476007)(66446008)(4326008)(76116006)(66946007)(66556008)(107886003)(8676002)(82960400001)(86362001)(64756008)(8936002)(55016003)(33656002)(316002)(110136005)(54906003)(83380400001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?YntWVPrYS6RdtEBTIEr8GhFhCUvNAivgQ/tQF4rYDWGg4Y3HsBD12sFjT8F+?= =?us-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NzsZPvfa1iOJMNLiN5n?= =?us-ascii?Q?yZycu/apNMdQaRdWiU2pXxiGCUpno2c8By4X+yJwEwja0SRGlWcgLQTiCfDx?= =?us-ascii?Q?askoJkqBjcl9GKAlHxmLCaEuEBN5autoNEQy8zbsU6T68GxFd9GPTKbRTiVL?= =?us-ascii?Q?TdOawVFeSgL+ne/JbD2z2L/rMi7QORrSbkfEHVkvmeagGqVqtKouQ00L2KNX?= =?us-ascii?Q?FqHTn6eVELpUnL/Ygw9oxzfckjPIpu4m/x0fS7GNTaNL1f1s+8fomREmap4s?= =?us-ascii?Q?Cz74HIsAl7WeGmNvXdWdo/V8CEnx2coSwPwpD3PEyTM/LvyfJzPdoNiCuiVm?= =?us-ascii?Q?CuoNgoP8AL9vvj+zuAHecFiLPSEEHw8eJGGxqVUcUEt6gDKFnUtz/B/zvXXI?= =?us-ascii?Q?WIugg18rQuAAFqq78Rr1bL814cny4A5kN8++NQy0obmyb3w3Wl4vOowpln3i?= =?us-ascii?Q?qH0VRERUR97zM3+D68YLjwAx8aI22VtVaUvnMjjCaybaatoUglBEExiSO1GH?= =?us-ascii?Q?R9N5CyVOiuhPGYlBh+7incQ7jURpPDhTeDdS4q9OxB1M4G58y1u12q1qQ/vG?= =?us-ascii?Q?Wp+Q5+t6sn9/d8ObZ1VArFD/xVgiv1N00tfx9ysmIfRWVsRcjmOcERPEmJ4n?= =?us-ascii?Q?x/KZ+N6R2UtsnjiVynue58cbR/hIZjnvjpjtjPbQfIAnEXIfdRGpVfAeD2YL?= =?us-ascii?Q?v7X0IzzwBsgX+lwpbQHtPT0=3D?= 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: MW4PR11MB5774.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5fd74419-5ff5-40bc-3f4b-08d9bde501f4 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Dec 2021 03:02:32.7042 (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: Q/NioFNfu4V+D/NWRt7vWubWOWdb8TLjr64cqJ+Sq2sjo9bO4rRuV4t9cy/KwwSAQ+pgYkbua0eMIJ4uJXXqXw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1742 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 > -----Original Message----- > From: Bin Zheng > Sent: Friday, December 10, 2021 4:22 PM > To: dev@dpdk.org > Cc: Wang, Haiyue ; liangma@liangbit.com; > stable@dpdk.org; Rong, Leyi ; Bin Zheng > ; jia.guo@intel.com > Subject: [PATCH v3] net/ixgbe: add vector Rx parameter check >=20 > Under the circumstance that `rx_tail` wrap back to zero and the advance s= peed > of `rx_tail` is greater than `rxrearm_start`, `rx_tail` will catch up wit= h > `rxrearm_start` and surpass it. > This may cause some mbufs be reused by application. >=20 > So we need to make some restrictions to ensure that `rx_tail` will not e= xceed > `rxrearm_start`. >=20 > e.g. >=20 > RDH: 972 RDT: 991 rxrearm_nb: 991 rxrearm_start: 992 rx_tail: 959 > RDH: 1004 RDT: 1023 rxrearm_nb: 991 rxrearm_start: 0 rx_tail: 991 > RDH: 12 RDT: 31 rxrearm_nb: 991 rxrearm_start: 32 rx_tail: 1023 > RDH: 31 RDT: 63 rxrearm_nb: 960 rxrearm_start: 64 rx_tail: 0 > RDH: 95 RDT: 95 rxrearm_nb: 1016 rxrearm_start: 96 rx_tail: 88 > RDH: 95 RDT: 127 rxrearm_nb: 991 rxrearm_start: 128 rx_tail: 95 ... > RDH: 908 RDT: 927 rxrearm_nb: 991 rxrearm_start: 928 rx_tail: 895 > RDH: 940 RDT: 959 rxrearm_nb: 991 rxrearm_start: 960 rx_tail: 927 > RDH: 980 RDT: 991 rxrearm_nb: 991 rxrearm_start: 992 rx_tail: 959 > RDH: 991 RDT: 991 rxrearm_nb: 1026 rxrearm_start: 992 rx_tail: 994 >=20 > when `rx_tail` catches up with `rxrearm_start`, > 2(994 - 992) mbufs be reused by application ! >=20 > Bugzilla ID: 882 > Fixes: 5a3cca342417 ("net/ixgbe: fix vector Rx") > Cc: jia.guo@intel.com > Cc: stable@dpdk.org >=20 > Signed-off-by: Bin Zheng > --- > drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c | 11 +++++++++++ > 1 file changed, 11 insertions(+) >=20 > diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c > b/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c > index 1eed949495..4654d0adec 100644 > --- a/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c > +++ b/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c > @@ -364,6 +364,17 @@ _recv_raw_pkts_vec(struct ixgbe_rx_queue *rxq, > struct rte_mbuf **rx_pkts, > uint8_t vlan_flags; > uint16_t udp_p_flag =3D 0; /* Rx Descriptor UDP header present */ >=20 > + /* > + * Under the circumstance that `rx_tail` wrap back to zero > + * and the advance speed of `rx_tail` is greater than `rxrearm_start`, > + * `rx_tail` will catch up with `rxrearm_start` and surpass it. > + * This may cause some mbufs be reused by application. > + * > + * So we need to make some restrictions to ensure that > + * `rx_tail` will not exceed `rxrearm_start`. > + */ > + nb_pkts =3D RTE_MIN(nb_pkts, RTE_IXGBE_RXQ_REARM_THRESH); > + > /* nb_pkts has to be floor-aligned to RTE_IXGBE_DESCS_PER_LOOP */ > nb_pkts =3D RTE_ALIGN_FLOOR(nb_pkts, RTE_IXGBE_DESCS_PER_LOOP); >=20 > -- > 2.25.1 Acked-by: Leyi Rong