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 9D751A0C47; Thu, 2 Dec 2021 06:33:36 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 22F0A406FF; Thu, 2 Dec 2021 06:33:36 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 94E9640692; Thu, 2 Dec 2021 06:33:34 +0100 (CET) X-IronPort-AV: E=McAfee;i="6200,9189,10185"; a="217321562" X-IronPort-AV: E=Sophos;i="5.87,281,1631602800"; d="scan'208";a="217321562" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Dec 2021 21:33:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,281,1631602800"; d="scan'208";a="460315105" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by orsmga006.jf.intel.com with ESMTP; 01 Dec 2021 21:33:32 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) 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; Wed, 1 Dec 2021 21:33:32 -0800 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.2308.20 via Frontend Transport; Wed, 1 Dec 2021 21:33:32 -0800 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.57.40) 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.2308.20; Wed, 1 Dec 2021 21:33:31 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=L2qwt7rOLLvifIW08JrCgd90GTzoH0BGrnnqo/UCgVK3FxBjD0iiZ8/AbxPT63DLgsmDSMzlHIfk1cHt4VrTxclO3ChAeflJIlDLm+dHB6XfSwFkYWnduJcrAbDjOVoLPYAufeE7AYq7kKX4hmvn1l5Hy7azPsMwyRb/mmWS/uhYkIiy0btNonYfJIulVAU0fSXaDnVieYSQwdHeaPt8GYLlC9TKrD37YPPD7NqH4wXTrLEdW087xy3lmNmBtfrA3WtlDorTTHTlAzBDDOjjKy51yBXMbNKnEMBojwC3T8EqrU2dVrKdWO/rPryqN4SqI5W9c3VPsoZuTw6aDJDrRQ== 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=vKOKKKcQxqNv09v42yA0dHDJyLuAn4UxID2BrIM8Ufw=; b=Dxhy4VmSYAVSGsb/jDZToPI01izZzJt72EN1U7QjEmtFyEqnWwcmfrrfI9AgejtTmAdyvlg6J/RaII68fjZYeXhP/dx5dt5lar6WMal/S3/v9HWqYMwiIPzbCVu34OIPpbHSeR0snZ+2xhV2VXbQvwNVU8dWvvUbo1P2qc6yXZmHCCHgfmwTMZk1GjAJ4akIS6rpRcgJ5zBlbft+DtfCPpqxA61O3BXZgstElrQkGkPGWL2xH1uChdHGdeMRoS6OKnp4W4D9caHqQTR4PBWbJ37S5rJJLpoAabVgZ/ceX4UCBp4LXlZgGbZD59lUDSzTZm4blVoInCm0TgvMf8DuNQ== 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=vKOKKKcQxqNv09v42yA0dHDJyLuAn4UxID2BrIM8Ufw=; b=MFclxYtvJyvwv84wxcNtduTTqJpzFNQ/YuXrOMjPjbtbVYJOM5shyAnrbTwKajEHKjP3qfoLsAdS/Vw2v8Du2PrfbbYRthUdPZNUYTXzi8BJ7jRZVPRKONpHZK1mqwuEUyfjvWqMzKVwBVlyU2f2Qi89BC5ADHt6TBrHbbUAHgs= Received: from DM4PR11MB5518.namprd11.prod.outlook.com (2603:10b6:5:39f::18) by DM5PR11MB1881.namprd11.prod.outlook.com (2603:10b6:3:113::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4734.22; Thu, 2 Dec 2021 05:33:25 +0000 Received: from DM4PR11MB5518.namprd11.prod.outlook.com ([fe80::e03e:d9f2:f8df:43a8]) by DM4PR11MB5518.namprd11.prod.outlook.com ([fe80::e03e:d9f2:f8df:43a8%7]) with mapi id 15.20.4690.027; Thu, 2 Dec 2021 05:33:25 +0000 From: "Wang, Haiyue" To: Bin Zheng , "dev@dpdk.org" CC: "liangma@liangbit.com" , "stable@dpdk.org" Subject: RE: [PATCH] net/ixgbe: add vector Rx parameter check Thread-Topic: [PATCH] net/ixgbe: add vector Rx parameter check Thread-Index: AQHX5ytkpku9WmaYAES6y7bEHwq+HKweraRg Date: Thu, 2 Dec 2021 05:33:25 +0000 Message-ID: References: <20211202031857.1808705-1-zhengbin.89740@bytedance.com> In-Reply-To: <20211202031857.1808705-1-zhengbin.89740@bytedance.com> Accept-Language: zh-CN, 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: b2bc583c-2489-4c4b-4722-08d9b555435b x-ms-traffictypediagnostic: DM5PR11MB1881: 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: tSPPjevLye1FNHMe49qhSByvk838DGzaZzgQxPLJtn3ZumgLUcsx6G1/91irMP7GPO+D+IzAMjmL7GJjFBQx02AD2lReYEL3sqtD8+HG7L3gjfxX3I1+TQI1BNsL8/JkfdAG2laM7KarcPm20zZw3ndo/eSScrGNkKlD80RMYLhKOEFLfkW3fgYwmoJObAIaOeemPTkGyDf3R/3ffVYucTL8fJXbgRNBsUeYGI9jD0DP9fOsyh0Cp2YMgSlNQ+HB3HfOQ3A2k9AXs56xZGYrvr5ax1t7MJwW/WqPo4C8vWeFUabCInQobJaiyouKX3O6CL9vPDZ4e5Um+UxlZoLQaDt6U/hfbK39pXEj8lBwS+4sBKg/J3VXKv5tFm6d6ENbfRWYKlJzhn+11VB7BBH+hpV2t7lPbdFbq/4V0m6TTvn01qK8xASO7SBKazwaN90l0OhnG/kPE87qXgGUDfjgnp1fe6qztDHyEf8AXPBhTHEBHmnB0wgCcf/sIi02lQvEFvcebCiJ754ma3195q6GaEGH5tALAtKujf9Xni7t7ppK036psT1FdQoh5DFhYRbD+l7IqVk6wEHf66MJKtGMj3H1MnWxK0GgzA0e81Umze/5Ao/RytBnYobUnOpBrk0QflqtnEtX/ElwbLbUQyYFKtLn62IjGf6x51io1BYGrztpUtnnAmMvIEJZI1ndzCiflm7Cu7CLDYCxJtXNa7xJ2d2Hm7RPdndUyE2q+6Acr/cJ6ZHbI7esinwzea5gN12CGqAam1KkMN3h65WItK8pe44RKX8CE3S/6NqJ8hQN4GAHKrPgB4grRxPC3SgjD1048gWqn8HnYAFxsurK7ghrow== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR11MB5518.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(52536014)(8676002)(86362001)(66446008)(110136005)(54906003)(33656002)(66476007)(82960400001)(2906002)(53546011)(122000001)(7696005)(38100700002)(66946007)(55016003)(6506007)(316002)(76116006)(8936002)(508600001)(83380400001)(64756008)(66556008)(71200400001)(38070700005)(186003)(966005)(5660300002)(26005)(9686003)(4326008); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?kjdcGrOyO9ghP+NRn7+746JNYg0lvn2FJaZbt9QQA7BBuaMfVJyrW2M+soOC?= =?us-ascii?Q?1sgQIYVIsycPVkysdFiXq5NbWqlhDdPMeDNUNEnvBd/09ip7zHVNVbqAOwIn?= =?us-ascii?Q?q8Ml+WKbLhTWiC9bg11lFsncKhJLbnanTVCWI72JBHnAjfmcOQhWsdVBNpiT?= =?us-ascii?Q?KvJ3LOb2T2z6DbYMsg7RBxlOooIoShIfkwLAf2Wscw3VB8dPW3BCZWAslrtO?= =?us-ascii?Q?YG9fU9BYYc4BoJ3yBPUhXeWvbAUHr0ZVWEaKYFTKdpjbqfLP/68SBYmkXN/F?= =?us-ascii?Q?iGBL+USvNfMfKCDFykatRW1dyp00O2D362GrYkOXVEEiOGh8OJEaBvc36yFl?= =?us-ascii?Q?3d1OQGsA3Y+W78gzZrDjSDB+j16t2X3Y1oJRkJjLDaWrqJncKnBVV0J8iSuo?= =?us-ascii?Q?ur8rLfLjQ/anIaQ5ONoJwa70bjBXK34bRo8SPOq/cbzm3W8lVv9KRgKFUNzZ?= =?us-ascii?Q?G5FK9opmv4/Qh74rVnUwHEyhF1uECOSgNAhpGgiUQ8xV4LEKmVMeXx5uPNR3?= =?us-ascii?Q?u6z8WZ4CgJP8es03XLnNGkRxtgJluB5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ywM3QavFI2Vjs+Ztm54TUCnIbAhY91gpjjxWXjzi1VQe/BIE?= =?us-ascii?Q?CxhJ4USuxNwZNUCZIorTmv53jDIFnTrXTyzAx6qw1myvjjB7Lqaj59vgadP4?= =?us-ascii?Q?N6aJbIIv/Eg5A97bUQ40st98F43Oup02GUvhm3OLbCnzXdM/HTaqogKY5UJp?= =?us-ascii?Q?AvNhb3O2eZ2GFGs+pyQ8snU=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: DM4PR11MB5518.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b2bc583c-2489-4c4b-4722-08d9b555435b X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Dec 2021 05:33:25.5901 (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: Lnkw7g5ptZqFLFXLp3ShH27gUj/m/kivcinhr/gCnGl93ucI6EScfinC6u5UyNE/xk53uEGdE7KOI1xfBAYLxw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR11MB1881 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: Thursday, December 2, 2021 11:19 > To: dev@dpdk.org > Cc: Wang, Haiyue ; liangma@liangbit.com; Bin Zheng > ; jia.guo@intel.com; stable@dpdk.org > Subject: [PATCH] net/ixgbe: add vector Rx parameter check >=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 applicaion. >=20 > So we need to make some restrictions to ensure that > `rx_tail` will not exceed `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 applicaion ! >=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 Both ? Or ? https://patchwork.dpdk.org/project/dpdk/patch/20211202031530.1808112-1-zhen= gbin.89740@bytedance.com/ https://patchwork.dpdk.org/project/dpdk/patch/20211202031857.1808705-1-zhen= gbin.89740@bytedance.com/ > diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c b/drivers/net/ixgbe/i= xgbe_rxtx_vec_sse.c > index 1eed949495..5811749b95 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, struc= t 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 applicaion. > + * > + * 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