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 0C097424BD; Mon, 30 Jan 2023 08:51:24 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id ED41840EDE; Mon, 30 Jan 2023 08:51:23 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id 6120640C35 for ; Mon, 30 Jan 2023 08:51:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675065082; x=1706601082; h=from:to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version; bh=WTJ/xp1xibfmhFmdHJXJiDmXR1LtNTLOkpFNMfJFNYg=; b=BbO+q3vRVOvjL5qkIvoQELEC/PK3xpIHD3AULrGNaj7YvQYuipbA56l2 gySosRW1W4ny92CjMMenugzMf2mPE3Ia7D+D5W99R0LI7pTEUG5Iaho0J 80fAH+3UHBmCnQt1HTp571Vo8HKeCaubLBwYxkosfUtPCZU/XE4xw+pcl BB/HkOT4UVYef50frL3NUj+hgRED58Wi0xjRV2b+UPcJMRiuh+Y7v3t0k rgyzZyQ9R+5go2uSekdzJ2Vo90bfTkYtpAWhkFEXc17B7XPqft11uX7Ey N/Zzka15BLae6Fvz3d9V5kJTzjmw+1toeXnkMdGcfyFKzN5ilVKgx46Vt g==; X-IronPort-AV: E=McAfee;i="6500,9779,10605"; a="413717834" X-IronPort-AV: E=Sophos;i="5.97,257,1669104000"; d="scan'208";a="413717834" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jan 2023 23:51:21 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10605"; a="752723006" X-IronPort-AV: E=Sophos;i="5.97,257,1669104000"; d="scan'208";a="752723006" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by FMSMGA003.fm.intel.com with ESMTP; 29 Jan 2023 23:51:21 -0800 Received: from fmsmsx602.amr.corp.intel.com (10.18.126.82) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Sun, 29 Jan 2023 23:51:20 -0800 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16 via Frontend Transport; Sun, 29 Jan 2023 23:51:20 -0800 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.46) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Sun, 29 Jan 2023 23:51:19 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UV8kQr0gWiDHwnXiEJUgQecmLIdOmL19LgY7tiKwqJK6PXeaHvDV62JD0hz3Wq2cn4c5R7D1siZSmy08Dy7yEOzecirwIqjARHxmPQbkp4DbmO70Urn+dFIpXnmETtbz2omNZZFASOQTboTjEU7keuLyGSzPJDD1A/O0Gex04mRKDmnLpx+z9FZItHj+3MlV03qJ9RGvi1gsLr/FiJ8AucUKwoHelyPue5ni9MsT0+AZvObrPgoksNfiSiuTKNqPSsKnpqN+vw9CZSEuns5EctfKkrMHlWel03slB1dLHDv9qwIozd9eVwkACkW45QnUNVMtrbLxn+/IKteZREL/vw== 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=dIytc/AByKogRSL41W1OErRMqUkZGF3VTw8cIM0ndXc=; b=auHHPtjEqXK/O4K7qXzRc6OCdnl8KxHGkfkCHBZDr0rmJroM1XaBEGNc3Ru4e+ngZEp8Jf5ZSyHh5muYFUi1hJNJ57bkeS/mjzLICxjMt2GFeH6ulxCSegWJfrlIyRy7mpiVQtrH0NoeuWp2N54fNe2GAgtYPV2BKh6T6h0nEj5asdFBZxLG47vvOizjI4oCR6cnJ+HNP2KBw8ha19lfScIVtvhUEyEqMw/tLElAq9Lnxob/+ILWb6uwHPFourQGqty+ZMV1ydK0tYD3vujRsu01yf7872u2ZUSxXa4p04Ec7pdAHla7txfkc7Hazfn7YOVq1RV0HuQiP2XOti2UvA== 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 SN6PR11MB3504.namprd11.prod.outlook.com (2603:10b6:805:d0::17) by SJ0PR11MB4990.namprd11.prod.outlook.com (2603:10b6:a03:2d8::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.36; Mon, 30 Jan 2023 07:51:17 +0000 Received: from SN6PR11MB3504.namprd11.prod.outlook.com ([fe80::c8f8:a3e1:5b23:a9c3]) by SN6PR11MB3504.namprd11.prod.outlook.com ([fe80::c8f8:a3e1:5b23:a9c3%5]) with mapi id 15.20.6043.033; Mon, 30 Jan 2023 07:51:17 +0000 From: "Xia, Chenbo" To: "Coquelin, Maxime" , "dev@dpdk.org" , "david.marchand@redhat.com" , "eperezma@redhat.com" Subject: RE: [PATCH v1 02/21] net/virtio: introduce notify callback for control queue Thread-Topic: [PATCH v1 02/21] net/virtio: introduce notify callback for control queue Thread-Index: AQHZBNRk2vKF7BHK5Eyi4XMkmYmsQa629Y1Q Date: Mon, 30 Jan 2023 07:51:17 +0000 Message-ID: References: <20221130155639.150553-1-maxime.coquelin@redhat.com> <20221130155639.150553-3-maxime.coquelin@redhat.com> In-Reply-To: <20221130155639.150553-3-maxime.coquelin@redhat.com> Accept-Language: en-US, zh-CN Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SN6PR11MB3504:EE_|SJ0PR11MB4990:EE_ x-ms-office365-filtering-correlation-id: 44c9b4a7-3c3e-4693-ef0e-08db0296c4bc x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: nzoPdFysOKept3rV3inHiAs6WihfOtjb6d2U8G7a1CTOAHo66VxEKn/ZacNfBFRCogAqdgJWqmcOXnmqiWiTZmxSp4xQkMiywS7G7cJgg2LGUKYsbSPPizOgIqnHklasJb2N+VCqZPuo7/ewbLO2Pb9S6M//isK31S9uimFcW8YqVS/cK4i+KqXFrf9F3iWhLdiyg2QSwHYw6+j21yHQf7zzC90a2MCZh+cXTsENx+JWCcy4yY7m/7iOzOtXwRn/uaiUmAwa5vrnkQopOFvsW7rD/+zMezxYHgvEQzWxp1r/yhII5b45ibYfME12oGEs2OtiXTPjfoYJ+Q/CHH2ME0YT+xpZ9nhpiWdpHMZyNmB2noz2FRjEKORTOn3/vy7uRLHye+t6qLqYPquJWOhtaA/B2+KBERnrvrah/jx37AC0mD+nhyieFqCCsxK7d+EgxRg+UojvEwMaErgXwoZ2XmbROCC4ntfkKZG2rNsWRLc7oGLB3F//VnZsr2gxo6Jrb/bDzIJuU9L2Or4qOi47+uiKzA8ALN8yer0CYvPvS2uLjDjsT9skxgRoUiatQOPkwct+al9MjS7ogJcCH3xXUjEkbb5AZiH6KXo+BrYgta+pfzlfyvtTAoSRKOF/8AHQo8DECxvMQIMh40fYh9Fsihs7rAuPwIYXvBCGdgHz7yK2a7l3YgDCoUHYq+t0K/dpQwJCZwakn3cQUL7EInf66Q== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR11MB3504.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(136003)(39860400002)(376002)(366004)(396003)(346002)(451199018)(110136005)(316002)(66946007)(66476007)(8676002)(66556008)(66446008)(76116006)(64756008)(8936002)(52536014)(5660300002)(122000001)(38100700002)(86362001)(38070700005)(33656002)(82960400001)(41300700001)(53546011)(71200400001)(9686003)(26005)(6506007)(186003)(55016003)(2906002)(478600001)(7696005)(83380400001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?9Ceo6AD3yI8T+18FyPEU6Dv5h65/u70NYKQCudWcc39zrq2l4W+YIPIb+TWc?= =?us-ascii?Q?So1GvB0PGZNvgKro5+hQkQt3Kv5MmMypnpp7IyAWaGI9GNTPGVaRdwiHcCC3?= =?us-ascii?Q?8P3GGe//SKjhga4usDekmnJV9AD87p322c8hRrunIZQef1q1sTb5Jxp46BRD?= =?us-ascii?Q?bB6Elk02CvD2N7+DoPHUL5VuIZQF0mw9oJEEvFbS2AjQ7w74RsFme7yRBtRv?= =?us-ascii?Q?yzovua3iS0FAw87VXzrQsBZqQ0YG7xHCGc/gxm9kA+6c9CKcWuu6jbbJlLfV?= =?us-ascii?Q?pQ9ztV0drc3jXSm/Pqlxt54mUAB9SY+pgKajFZaTwBm2V0hsNs2MShuuapTh?= =?us-ascii?Q?oXgKuun2QzZLb5AvYQYv0rmZSdDfFw3sUmaCUk4V+ATtF40Vj3xrlcuCELbZ?= =?us-ascii?Q?trvpAFkohE0tj1YAs1Ia6AtfFUIs+mouHktVK90AszSdydeKpsKXQ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cEk1hrD1LEcdL5hEj/DIetZc?= =?us-ascii?Q?tOKIVDlJKyJKSizSjED2Z5ouUxyEUNIoTvwVO7IJB8SZcFKj1VoTDc//rl1k?= =?us-ascii?Q?hXOY76RyJjbNsswX+9p4HFPIrzrz7PZwbn/lvDhHLIVne8Al0DoCmxq3wNBF?= =?us-ascii?Q?EiQBIutxpgDezUkAxynu61qPptmTM8900gbqAeBDQ8UUroVslHhSnoGxP1lQ?= =?us-ascii?Q?2Jq1H6MeodnYv7CvMwa31AZe5ra2R4cbgPNnjF/a?= 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: SN6PR11MB3504.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 44c9b4a7-3c3e-4693-ef0e-08db0296c4bc X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Jan 2023 07:51:17.1967 (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: l/rCfD7Lf4GNoEE7LZeK7aO1ZFlw2QqRZrua8cZQgbah8C33zoUro7f4Q5GnUcDCuLvSerSNlUMI6yXZJCc+Mg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB4990 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: Maxime Coquelin > Sent: Wednesday, November 30, 2022 11:56 PM > To: dev@dpdk.org; Xia, Chenbo ; > david.marchand@redhat.com; eperezma@redhat.com > Cc: Maxime Coquelin > Subject: [PATCH v1 02/21] net/virtio: introduce notify callback for > control queue >=20 > This patch introduces a notification callback for the control > virtqueue as preliminary work to add shadow control virtqueue > support. >=20 > This new callback is required so that the shadow control queue > implemented in Virtio-user does not call the notifciation op > implemented for the driver layer. >=20 > Signed-off-by: Maxime Coquelin > --- > drivers/net/virtio/virtio_cvq.c | 4 ++-- > drivers/net/virtio/virtio_cvq.h | 4 ++++ > drivers/net/virtio/virtio_ethdev.c | 7 +++++++ > 3 files changed, 13 insertions(+), 2 deletions(-) >=20 > diff --git a/drivers/net/virtio/virtio_cvq.c > b/drivers/net/virtio/virtio_cvq.c > index de4299a2a7..cd25614df8 100644 > --- a/drivers/net/virtio/virtio_cvq.c > +++ b/drivers/net/virtio/virtio_cvq.c > @@ -76,7 +76,7 @@ virtio_send_command_packed(struct virtnet_ctl *cvq, > vq->hw->weak_barriers); >=20 > virtio_wmb(vq->hw->weak_barriers); > - virtqueue_notify(vq); > + cvq->notify_queue(vq, cvq->notify_cookie); >=20 > /* wait for used desc in virtqueue > * desc_is_used has a load-acquire or rte_io_rmb inside > @@ -155,7 +155,7 @@ virtio_send_command_split(struct virtnet_ctl *cvq, >=20 > PMD_INIT_LOG(DEBUG, "vq->vq_queue_index =3D %d", vq->vq_queue_index); >=20 > - virtqueue_notify(vq); > + cvq->notify_queue(vq, cvq->notify_cookie); >=20 > while (virtqueue_nused(vq) =3D=3D 0) > usleep(100); > diff --git a/drivers/net/virtio/virtio_cvq.h > b/drivers/net/virtio/virtio_cvq.h > index 139e813ffb..224dc81422 100644 > --- a/drivers/net/virtio/virtio_cvq.h > +++ b/drivers/net/virtio/virtio_cvq.h > @@ -7,6 +7,8 @@ >=20 > #include >=20 > +struct virtqueue; > + > /** > * Control the RX mode, ie. promiscuous, allmulti, etc... > * All commands require an "out" sg entry containing a 1 byte > @@ -110,6 +112,8 @@ struct virtnet_ctl { > uint16_t port_id; /**< Device port identifier. */ > const struct rte_memzone *mz; /**< mem zone to populate CTL ring. > */ > rte_spinlock_t lock; /**< spinlock for control queue. > */ > + void (*notify_queue)(struct virtqueue *vq, void *cookie); /**< > notify ops. */ > + void *notify_cookie; /**< cookie for notify ops */ > }; >=20 > #define VIRTIO_MAX_CTRL_DATA 2048 > diff --git a/drivers/net/virtio/virtio_ethdev.c > b/drivers/net/virtio/virtio_ethdev.c > index d553f89a0d..8db8771f4d 100644 > --- a/drivers/net/virtio/virtio_ethdev.c > +++ b/drivers/net/virtio/virtio_ethdev.c > @@ -253,6 +253,12 @@ virtio_init_vring(struct virtqueue *vq) > virtqueue_disable_intr(vq); > } >=20 > +static void > +virtio_control_queue_notify(struct virtqueue *vq, __rte_unused void > *cookie) > +{ > + virtqueue_notify(vq); > +} > + > static int > virtio_init_queue(struct rte_eth_dev *dev, uint16_t queue_idx) > { > @@ -421,6 +427,7 @@ virtio_init_queue(struct rte_eth_dev *dev, uint16_t > queue_idx) > memset(cvq->virtio_net_hdr_mz->addr, 0, rte_mem_page_size()); >=20 > hw->cvq =3D cvq; > + vq->cq.notify_queue =3D &virtio_control_queue_notify; > } >=20 > if (hw->use_va) > -- > 2.38.1 Reviewed-by: Chenbo Xia