From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2883BA0528; Fri, 17 Jul 2020 05:20:08 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AE4551BEB4; Fri, 17 Jul 2020 05:20:07 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 431342C4F for ; Fri, 17 Jul 2020 05:20:06 +0200 (CEST) IronPort-SDR: djJ9jIEXjt2+tl45skFOo3iPrK5xohEAT6Ra2DZcN5NpeGCKEAKeg+WvKuA7R1TFvpwQb2Z1eO Xw1C0gSaSZbQ== X-IronPort-AV: E=McAfee;i="6000,8403,9684"; a="129615345" X-IronPort-AV: E=Sophos;i="5.75,361,1589266800"; d="scan'208";a="129615345" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jul 2020 20:20:05 -0700 IronPort-SDR: cM0HSx9kvSSBINX+gOjOnrxMeLmvxDSDdsGEBa8bw3bYtknyhIkPFxdBIMIuPsOZRj2iwzhBRN ODV4FN0Ov88g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,361,1589266800"; d="scan'208";a="486334937" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by fmsmga006.fm.intel.com with ESMTP; 16 Jul 2020 20:20:04 -0700 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) 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.1713.5; Thu, 16 Jul 2020 20:20:04 -0700 Received: from ORSEDG002.ED.cps.intel.com (10.7.248.5) by orsmsx609.amr.corp.intel.com (10.22.229.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Thu, 16 Jul 2020 20:20:04 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.109) by edgegateway.intel.com (134.134.137.101) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 16 Jul 2020 20:20:00 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OMd/lXKU5iuveep8HSr3nCypajdradd4il5PYA65p8m9llswYhcXQCifVo3MXW2P9XgnGzUPaa5p1gNeTPN1Xh6/d5WwDldyntJMhqifNkLEMF4KWYekdpFLCNAFU6Bi1RgxHTNJdygIK09XuQ8BcoeqtpHRBWIg2jxsCgeAecuAV7gQcjfHYwcld1ljzo/67oasBKlbpDF9Da+MDyzYn9WwYTblFur2YvGl+lEylWomD9TFMpAiL/fm+amZEIWIOn5VlXEjZ1XKGYSVEhEdwvcpoJcXEFGc3fxbN5TSqEYbSPnC6guJmDUbBqETmtWlVHuv1M2M2OzlGK3mXfUctg== 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=s6067NQomTJs79QvNUGuCWn8DIhCjAtgzDi67joZ6Jo=; b=i5iEI6Sm2HovTlc//DTf3Ps1YWA2PqmFkMWSJS3V/9xRgB0VsSXIY483j3pMH05P8DWuH9DJOMHgcGaPbCASDbU1810bBQaHGcTXqGscl2eLhKQp9g8sUPsZR8m4zFWyHdI8aii76BeFdXjPRCOUvzFGAVjUQi2JcxloxhDMH5LJtF+gTRjEasv0Q6DcXA03ZzJixO1zFsGv/0zjXVYyhBbzGyUn0/4F4ynSMbHkUu+D0BDb6DF/3IfevSHqOmPFXOi+KbsABsOkmFn/Rkfdo7AD9MIDN2oT2zZx0AbC3ysWV5noI/phQ6VIJtCwv+o0oaqBwa4H3rmKJUTzyJgk2Q== 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=s6067NQomTJs79QvNUGuCWn8DIhCjAtgzDi67joZ6Jo=; b=eUzOQ9uURa0KsmCzCh9NK8Kghg9CSCQSrIrM5w01p2W96KZWYvQcgBWY2wRO11GVp0Jqlcia6L2E7MClZCllfgXG/f7GAyFQ18QbdxRDicg6sOchHHCt5Ep219APOrNZcS3QTO0BLAwox3R+IFyoBdgZsQJarQAjpXAU+ccpGZ8= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) by MN2PR11MB3949.namprd11.prod.outlook.com (2603:10b6:208:138::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.22; Fri, 17 Jul 2020 03:19:58 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::7cde:8326:5010:c47e]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::7cde:8326:5010:c47e%7]) with mapi id 15.20.3174.025; Fri, 17 Jul 2020 03:19:58 +0000 From: "Xia, Chenbo" To: "Fu, Patrick" , "dev@dpdk.org" , "maxime.coquelin@redhat.com" CC: "Wang, Yinan" Thread-Topic: [PATCH v1] vhost: set zmbufs to NULL when freed Thread-Index: AQHWWnZttpB9OT27DUCIHndbyRdUR6kLHQBQ Date: Fri, 17 Jul 2020 03:19:58 +0000 Message-ID: References: <20200715155848.9501-1-patrick.fu@intel.com> In-Reply-To: <20200715155848.9501-1-patrick.fu@intel.com> Accept-Language: en-US, zh-CN Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.198.147.217] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 013c244c-a96f-4142-54cb-08d82a0048ef x-ms-traffictypediagnostic: MN2PR11MB3949: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1388; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: eeOAyXlXNA/h/gPeYhuQNIZV9xqlnHnadMxqFrSXbpRfIpTiki327DXHHMTJZQmh13eKuWaVbCwMgSa/1G9CQeIcesLFvmujPzoqveE0jjlyhbIxIdehvM3gkQmiSqbwJvFwDVlGDzjr+e7Pczx6OOfaLSJvFI+jtEfUQpq5AWUI1VIWjq8doJ8AizKz/VL6/TgHU11pEDeGTEeAzZh/BmsS0R5RktB1CcB3MHJor0KF5ZU/rmiM6zi0VovyrSGcptqBdiqc4WBPohhyg9Tw8yAod+eVyee840yjvNO0HawOUZsZUKxnEitnaSg44Io3x7ew+n4xG+cnqhoS5mogXQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB4063.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(39860400002)(136003)(396003)(346002)(376002)(366004)(5660300002)(4744005)(107886003)(2906002)(9686003)(8936002)(6506007)(55016002)(8676002)(66556008)(53546011)(83380400001)(52536014)(33656002)(66476007)(76116006)(66446008)(26005)(7696005)(66946007)(316002)(478600001)(110136005)(64756008)(86362001)(186003)(4326008)(71200400001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: bx6eUZ8Nh0l66e7isB+S0694LhLkUtEXXz470xHH+r8Jxj+ock33eH1+2P+AvlzBDnGSDukd7kw7iLwwO6UPlyjmcR27ooBmnZd5B4UjRDn0tvaxIrk3lMuFVmO3xIE7dbz2l/m2y3c5P1zSPC3yBQk0BNJbyMWsiKeLSu9GRNpSd7SQKV0sBo2fOeQdxmdH5PzikCfvqnuJQTMbFKcpouu/8ql+jJ/eT1QWhQqtjAlQOip3L5RFcP9mr9OE6c/g03s1DbTgWixXVbSHP0Rh5M5ccTq6ZG4mT57wSL1CocoRBVIA/S13XynOGQ87bJb1SscChM8bVX7b1W5jaOPg+a0u1YrUF9nA/RWlQb0wco2dAWPg5dEJ+rR2Dh7VxBYQ3OhrcBnctQA9hPCbfW46DLjRSZWLJvafL1hC6YWn8MkAimwBr1cfgAdXwS8rqPa7fixDCn/BZckZ5DKXXQWo2MCi5LYkrpqupvOnI+tao5Q1rhArDDBz2n0XA6su+dvl 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: MN2PR11MB4063.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 013c244c-a96f-4142-54cb-08d82a0048ef X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Jul 2020 03:19:58.3237 (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: au48Kitks5V6F9rBFTKBLNFLT32lUaZG27gwXJ7dIKhLChdtS042yEVkuLEGAw/pPij6WemzfYvC214qxRU5+g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3949 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v1] vhost: set zmbufs to NULL when freed X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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: Fu, Patrick > Sent: Wednesday, July 15, 2020 11:59 PM > To: dev@dpdk.org; maxime.coquelin@redhat.com; Xia, Chenbo > > Cc: Wang, Yinan ; Fu, Patrick > Subject: [PATCH v1] vhost: set zmbufs to NULL when freed >=20 > From: Patrick Fu >=20 > zmbufs should be set to NULL when getting freed to avoid double free on t= he > same buffer pointer >=20 > Fixes: b0a985d1f340 ("vhost: add dequeue zero copy") >=20 > Signed-off-by: Patrick Fu > --- > lib/librte_vhost/vhost_user.c | 1 + > 1 file changed, 1 insertion(+) >=20 > diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.= c index > df0db8a07..9ddeae362 100644 > --- a/lib/librte_vhost/vhost_user.c > +++ b/lib/librte_vhost/vhost_user.c > @@ -1934,6 +1934,7 @@ free_zmbufs(struct vhost_virtqueue *vq) > drain_zmbuf_list(vq); >=20 > rte_free(vq->zmbufs); > + vq->zmbufs =3D NULL; > } >=20 > /* > -- > 2.17.1 Reviewed-by: Chenbo Xia