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 32ACDA00E6 for ; Wed, 10 Jul 2019 14:59:20 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1A4962B99; Wed, 10 Jul 2019 14:59:20 +0200 (CEST) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60058.outbound.protection.outlook.com [40.107.6.58]) by dpdk.org (Postfix) with ESMTP id DE95C2C23 for ; Wed, 10 Jul 2019 13:44:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IJKr7a8FLlWHD83r7yx/y3BDE/wdTU+1APJWWPP0w2Y=; b=ODuRs++aI0g30YO/oqidAp+ci5TT4hOBLdb7sX2zYRKmEtt1DA0BpiTnHbKqVSIzKmw4GoG2GEe3D6KVxOOirmxSriKYksme/Qo+48RgHBmuYdOgc3rU1f8DvBCdzjyZbMk7vhfJCrTIhAfD675Pm7sTmf7zvIXUpfatTyNOmGQ= Received: from DB7PR04MB4667.eurprd04.prod.outlook.com (52.135.139.13) by DB7PR04MB5563.eurprd04.prod.outlook.com (20.178.106.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2052.18; Wed, 10 Jul 2019 11:44:17 +0000 Received: from DB7PR04MB4667.eurprd04.prod.outlook.com ([fe80::f1f7:a9ef:9ae2:3faa]) by DB7PR04MB4667.eurprd04.prod.outlook.com ([fe80::f1f7:a9ef:9ae2:3faa%4]) with mapi id 15.20.2073.008; Wed, 10 Jul 2019 11:44:17 +0000 From: Harish Kumar Ambati To: "users@dpdk.org" Thread-Topic: Virtio Crypto does not seem to work in DPDK 19.05 with default test application Thread-Index: AdU3FLmGHkKZLPDdSXiofzLecEDeAQ== Date: Wed, 10 Jul 2019 11:44:17 +0000 Message-ID: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=harish.ambati@nxp.com; x-originating-ip: [92.121.36.197] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a7db7009-ee4b-4097-0f5d-08d7052bf0e3 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(4618075)(2017052603328)(7193020); SRVR:DB7PR04MB5563; x-ms-traffictypediagnostic: DB7PR04MB5563: x-ms-exchange-purlcount: 1 x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3826; x-forefront-prvs: 0094E3478A x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(366004)(39860400002)(376002)(346002)(396003)(136003)(189003)(51234002)(199004)(71200400001)(71190400001)(26005)(8936002)(6506007)(6916009)(8676002)(102836004)(186003)(2351001)(81156014)(606006)(25786009)(316002)(2906002)(1730700003)(81166006)(14444005)(256004)(478600001)(966005)(53936002)(30864003)(66066001)(14454004)(55016002)(6436002)(86362001)(7696005)(7736002)(3846002)(33656002)(74316002)(5640700003)(486006)(5660300002)(66556008)(64756008)(66446008)(66476007)(66946007)(76116006)(52536014)(6116002)(790700001)(476003)(236005)(68736007)(2501003)(54896002)(9686003)(99286004)(6306002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB7PR04MB5563; H:DB7PR04MB4667.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: Ktk71uwrPtUNusXAnzXn7/NheALke/zUUcyYLKVCs5umP0sME0N9Yp6Htv67naA7y10mrxfZhWFgrrZFxbwauu8iuvvLHIKtHlOdh50iw19q23SwIoKhXD3Z3LVWKg58VeNwqGo+7xT3U3G7W1jzp1gsQWiZvYkqCUvB/6xoTVecsgK1SpUSZds7Css82XmnoMLS0sH2zTmyurW5yi+M9SVQRrgBxq4MvprzsLnugR2D7dBwvTaP92jzfcawuHylF47DFcs8TrHV7kzl5FK8VKyhaILOhDsOOWhXeBr8V/sEFp8fzbuXSyPTVVb8Ntr+CzKkyuETRNDKArL4nuxlRk1MKQu9wzsqQaP+fpP9vI6bwDN9fqVREL+V32Vgu7FcyGhVSot4KLxJv30neKJQrxyxRcFofpiwIjhmATX6bmM= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a7db7009-ee4b-4097-0f5d-08d7052bf0e3 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Jul 2019 11:44:17.7570 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: harish.ambati@nxp.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB5563 X-Mailman-Approved-At: Wed, 10 Jul 2019 14:59:19 +0200 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [dpdk-users] Virtio Crypto does not seem to work in DPDK 19.05 with default test application X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: users-bounces@dpdk.org Sender: "users" Hi , I am trying to verify Virtio Crypto use case on DPDK 19.05 . While runni= ng DPDK test app "cryptodev_virtio_autotest " in the VM ,I could see contro= l connection created on the vhost backend(vhost-crypto) but functionality d= oes not work/test case fails. Below is the configuration used in the setup. I have enabled debug in virt= io/crypto components. Could someone please help me here. On debugging ,I found that test_blockcipher_one_case() pauses to dequeue b= urst . Also , I see virtio_crypto_init_device(): hw->max_dataqueues is 1 = in the VM though in the backend it's initialized to 8. /* Process crypto operation */ if (rte_cryptodev_enqueue_burst(dev_id, 0, &op, 1) !=3D 1) { snprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN, "line %u FAILED: %s", __LINE__, "Error sending packet for encryption"); status =3D TEST_FAILED; goto error_exit; } printf("testsuite_setup func %s line %d \n", __func__, __LI= NE__); op =3D NULL; while (rte_cryptodev_dequeue_burst(dev_id, 0, &op, 1) =3D=3D 0) rte_pause(); Qemu command: ./bins/bin/qemu-system-x86_64 -machine accel=3Dkvm -cpu host -smp 2 -m 4G -= drive file=3Dos_compute.img,if=3Dnone,id=3Ddisk -device ide-hd,drive=3Ddisk= ,bootindex=3D0 -object memory-backend-file,id=3Dmem,size=3D4G,mem-path=3D/d= ev/hugepages,share=3Don -mem-prealloc -numa node,memdev=3Dmem -chardev sock= et,id=3Dcharcrypto0,path=3D/tmp/vm0_crypto0.sock -object cryptodev-vhost-us= er,id=3Dcryptodev0,chardev=3Dcharcrypto0 -device virtio-crypto-pci,id=3Dcry= pto0,cryptodev=3Dcryptodev0 -device e1000,netdev=3Dnetwork0,mac=3D52:55:00= :d1:55:01 -netdev tap,id=3Dnetwork0,ifname=3Dtap0,script=3Dno,downscript=3D= no VNC server running on 127.0.0.1:5901 On host : root@linux:/home/user/harish/dpdk_qs/dpdk-19.05# ./examples/vhost_crypto/build/vhost-crypto -= -socket-mem 2048,0 --legacy-mem --vdev crypto_openssl -l 1,2 -n 4 -- --= config "(1,0,0)(1,0,1)(1,0,2)(2,0,1)(2,0,2)" --socket-file 1,/tmp/vm0_crypt= o0.sock --socket-file=3D2,/tmp/vm0_crypto1.sock EAL: Detected 8 lcore(s) EAL: Detected 1 NUMA nodes EAL: Multi-process socket /var/run/dpdk/rte/mp_socket EAL: Debug dataplane logs available - lower performance EAL: Probing VFIO support... EAL: PCI device 0000:00:19.0 on NUMA socket -1 EAL: Invalid NUMA socket, default to 0 EAL: probe driver: 8086:1502 net_e1000_em EAL: PCI device 0000:02:00.0 on NUMA socket -1 EAL: Invalid NUMA socket, default to 0 EAL: probe driver: 8086:107d net_e1000_em CRYPTODEV: Creating cryptodev crypto_openssl CRYPTODEV: Initialisation parameters - name: crypto_openssl,socket id: 0, m= ax queue pairs: 8 VHOST_CONFIG: read message VHOST_USER_CRYPTO_CREATE_SESS USER1: [Vhost-Crypto] vhost_crypto_create_sess() line 391: Session 1 create= d for vdev 0. Vhost-Crypto func vhost_crypto_create_sess line 395 In the VM : # modprobe uio_pci_generic # echo -n 0000:00:03.0 > /sys/bus/pci/drivers/virtio-pci/unbind # echo "1af4 1054" > /sys/bus/pci/drivers/uio_pci_generic/new_id #echo 1024 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages root@user-Standard-PC-i440FX-PIIX-1996:/home/user/dpdk-19.05/app/test# = ./test EAL: Detected 2 lcore(s) EAL: Detected 1 NUMA nodes EAL: Multi-process socket /var/run/dpdk/rte/mp_socket EAL: Debug dataplane logs available - lower performance EAL: Probing VFIO support... EAL: WARNING: cpu flags constant_tsc=3Dyes nonstop_tsc=3Dno -> using unreli= able clock cycles ! EAL: PCI device 0000:00:03.0 on NUMA socket -1 EAL: Invalid NUMA socket, default to 0 EAL: probe driver: 1af4:1054 crypto_virtio PMD: crypto_virtio_create(): >> CRYPTODEV: Creating cryptodev 0000:00:03.0 CRYPTODEV: Initialisation parameters - name: 0000:00:03.0,socket id: 0, max= queue pairs: 0 INIT: crypto_virtio_create(): dev 0 vendorID=3D0x1af4 deviceID=3D0x1054 INIT: virtio_read_caps(): [84] cfg type: 5, bar: 0, offset: 0000, len: 0 INIT: virtio_read_caps(): [70] cfg type: 2, bar: 4, offset: 3000, len: 4096 INIT: virtio_read_caps(): [60] cfg type: 4, bar: 4, offset: 2000, len: 4096 INIT: virtio_read_caps(): [50] cfg type: 3, bar: 4, offset: 1000, len: 4096 INIT: virtio_read_caps(): [40] cfg type: 1, bar: 4, offset: 0000, len: 4096 INIT: virtio_read_caps(): found modern virtio pci device. INIT: virtio_read_caps(): common cfg mapped at: 0x1100800000 INIT: virtio_read_caps(): device cfg mapped at: 0x1100802000 INIT: virtio_read_caps(): isr cfg mapped at: 0x1100801000 INIT: virtio_read_caps(): notify base: 0x1100803000, notify off multiplier:= 4 INIT: vtpci_cryptodev_init(): modern virtio pci detected. PMD: virtio_crypto_init_device(): >> PMD: virtio_negotiate_features(): >> INIT: virtio_negotiate_features(): guest_features before negotiate =3D 1000= 00000 INIT: virtio_negotiate_features(): host_features before negotiate =3D 13000= 0000 INIT: virtio_negotiate_features(): features after negotiate =3D 100000000 INIT: virtio_crypto_init_device(): hw->max_dataqueues=3D1 EAL: PCI device 0000:00:04.0 on NUMA socket -1 EAL: Invalid NUMA socket, default to 0 EAL: probe driver: 8086:100e net_e1000_em APP: HPET is not enabled, using TSC as default timer RTE>>cryptodev_virtio_autotest + ------------------------------------------------------- + + Test Suite : Crypto VIRTIO Unit Test Suite PMD: virtio_crypto_dev_info_get(): >> PMD: virtio_crypto_dev_info_get(): >> PMD: virtio_crypto_sym_get_session_private_size(): >> CRYPTODEV: elt_size 0 is expanded to 128 PMD: virtio_crypto_dev_info_get(): >> PMD: virtio_crypto_dev_configure(): >> PMD: virtio_crypto_init_device(): >> PMD: virtio_negotiate_features(): >> INIT: virtio_negotiate_features(): guest_features before negotiate =3D 1000= 00000 INIT: virtio_negotiate_features(): host_features before negotiate =3D 13000= 0000 INIT: virtio_negotiate_features(): features after negotiate =3D 100000000 INIT: virtio_crypto_init_device(): hw->max_dataqueues=3D1 PMD: virtio_crypto_ctrlq_setup(): >> PMD: virtio_crypto_queue_setup(): >> INIT: virtio_crypto_queue_setup(): setting up queue: 1 INIT: virtio_crypto_queue_setup(): vq_size: 64 INIT: virtio_crypto_queue_setup(): ctrlq vring_size: 4612, rounded_vring_si= ze: 8192 INIT: virtio_crypto_queue_setup(): vq->vq_ring_mem(physical): 0x14469000 INIT: virtio_crypto_queue_setup(): vq->vq_ring_virt_mem: 0x100669000 PMD: virtio_crypto_vring_start(): >> INIT: modern_setup_queue(): queue 1 addresses: INIT: modern_setup_queue(): desc_addr: 14469000 INIT: modern_setup_queue(): aval_addr: 14469400 INIT: modern_setup_queue(): used_addr: 1446a000 INIT: modern_setup_queue(): notify addr: 0x1100803004 (notify offset: = 1) INIT: virtio_crypto_ctrlq_start(): VQ: - size=3D64; free=3D64; used=3D0; de= sc_head_idx=3D0; avail.idx=3D0; used_cons_idx=3D0; used.idx=3D0; avail.flag= s=3D0x1; used.flags=3D0x0 PMD: virtio_crypto_sym_get_session_private_size(): >> PMD: virtio_crypto_qp_setup(): >> PMD: virtio_crypto_queue_setup(): >> INIT: virtio_crypto_queue_setup(): setting up queue: 0 INIT: virtio_crypto_queue_setup(): vq_size: 1024 INIT: virtio_crypto_queue_setup(): dataq vring_size: 28676, rounded_vring_s= ize: 32768 INIT: virtio_crypto_queue_setup(): vq->vq_ring_mem(physical): 0x14425000 INIT: virtio_crypto_queue_setup(): vq->vq_ring_virt_mem: 0x100625000 PMD: virtio_crypto_dev_info_get(): >> PMD: virtio_crypto_dev_configure(): >> PMD: virtio_crypto_init_device(): >> PMD: virtio_negotiate_features(): >> INIT: virtio_negotiate_features(): guest_features before negotiate =3D 1000= 00000 INIT: virtio_negotiate_features(): host_features before negotiate =3D 13000= 0000 INIT: virtio_negotiate_features(): features after negotiate =3D 100000000 INIT: virtio_crypto_init_device(): hw->max_dataqueues=3D1 PMD: virtio_crypto_ctrlq_setup(): >> PMD: virtio_crypto_queue_setup(): >> INIT: virtio_crypto_queue_setup(): setting up queue: 1 INIT: virtio_crypto_queue_setup(): vq_size: 64 INIT: virtio_crypto_queue_setup(): ctrlq vring_size: 4612, rounded_vring_si= ze: 8192 INIT: virtio_crypto_queue_setup(): vq->vq_ring_mem(physical): 0x14469000 INIT: virtio_crypto_queue_setup(): vq->vq_ring_virt_mem: 0x100669000 PMD: virtio_crypto_vring_start(): >> INIT: modern_setup_queue(): queue 1 addresses: INIT: modern_setup_queue(): desc_addr: 14469000 INIT: modern_setup_queue(): aval_addr: 14469400 INIT: modern_setup_queue(): used_addr: 1446a000 INIT: modern_setup_queue(): notify addr: 0x1100803004 (notify offset: = 1) INIT: virtio_crypto_ctrlq_start(): VQ: - size=3D64; free=3D64; used=3D0; de= sc_head_idx=3D0; avail.idx=3D0; used_cons_idx=3D0; used.idx=3D0; avail.flag= s=3D0x1; used.flags=3D0x0 PMD: virtio_crypto_sym_get_session_private_size(): >> PMD: virtio_crypto_qp_setup(): >> PMD: virtio_crypto_queue_setup(): >> INIT: virtio_crypto_queue_setup(): setting up queue: 0 INIT: virtio_crypto_queue_setup(): vq_size: 1024 INIT: virtio_crypto_queue_setup(): dataq vring_size: 28676, rounded_vring_s= ize: 32768 INIT: virtio_crypto_queue_setup(): vq->vq_ring_mem(physical): 0x14425000 INIT: virtio_crypto_queue_setup(): vq->vq_ring_virt_mem: 0x100625000 PMD: virtio_crypto_dev_stats_reset(): >> PMD: virtio_crypto_dataq_start(): >> PMD: virtio_crypto_vring_start(): >> INIT: modern_setup_queue(): queue 0 addresses: INIT: modern_setup_queue(): desc_addr: 14425000 INIT: modern_setup_queue(): aval_addr: 14429000 INIT: modern_setup_queue(): used_addr: 1442a000 INIT: modern_setup_queue(): notify addr: 0x1100803000 (notify offset: = 0) INIT: virtio_crypto_dataq_start(): VQ: - size=3D1024; free=3D1024; used=3D0= ; desc_head_idx=3D0; avail.idx=3D0; used_cons_idx=3D0; used.idx=3D0; avail.= flags=3D0x1; used.flags=3D0x0 PMD: virtio_crypto_dev_info_get(): >> PMD: virtio_crypto_sym_get_session_private_size(): >> PMD: virtio_crypto_sym_configure_session(): >> PMD: virtio_crypto_check_sym_session_paras(): >> PMD: virtio_crypto_send_command(): >> INIT: virtio_crypto_send_command(): vq->vq_desc_head_idx =3D 0, vq =3D 0x10= 06248c0 INIT: virtio_crypto_send_command(): vq->vq_queue_index =3D 1 INIT: virtio_crypto_send_command(): vq->vq_free_cnt=3D64 vq->vq_desc_head_idx=3D0 Another observation is when I tried to use cryptodev-linux in the VM ,res= ults are show as pass independent of the vhost-crypto backend on the host. = Do we need to change anything in the qemu for kernel crypto to work in the= VM.. $ git clone https://github.com/cryptodev-linux/cryptodev-linux.git $ cd cryptodev-linux $ make; make install $ cd tests $ ./cipher - requested cipher CRYPTO_AES_CBC, got cbc(aes) with driver virtio_crypto_aes= _cbc AES Test passed requested cipher CRYPTO_AES_CBC, got cbc(aes) with driver virtio_crypto_aes= _cbc requested cipher CRYPTO_AES_CBC, got cbc(aes) with driver virtio_crypto_aes= _cbc Test passed Regards, Harish