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 06502A053A for ; Tue, 4 Aug 2020 11:14:27 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 51F842BE2; Tue, 4 Aug 2020 11:14:27 +0200 (CEST) Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00094.outbound.protection.outlook.com [40.107.0.94]) by dpdk.org (Postfix) with ESMTP id 2601C2BE2 for ; Tue, 4 Aug 2020 11:14:26 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ANci6nZlsOmGDcuPQVZZ55sno4R0DnSnSUPxA+HtGF86JHuHT0aFJyNc83aVM/BcbMRwkUI4ee4KhH57/PcIcCLqteeiqbBpUStNR0VYjMsQyG9AhUR6DBZHAVzpsFqbE0WulqhK1oM3v655suFhbnN570wFPA5vPcrNwGPHNZmywBrTcLxoK7b/ggpfVlW0pobU2b1aBiFfPLleKF8sanK84O4zpF5t0B4ZkgZTxZQGFJIJ9DuHOOrrXaclmuM74xK04e48j2JX8g4vfm03ANO+7bhw0QDKnc+K++kQTqYCGFhfp8+C+dY1PSnomXiKUNWCXFpE9kuE78zVcTRa4w== 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=SpT3+7rViyQuIfh9twYxu3+RYrid6KDJreI+a5iBEXo=; b=BxKAZpkIvaQAC1INAv+vLJyUI89AMpuleKp2mDjEPGe5gHCXP744u8JV9+eiVZxB4PAFu+7Bo8TTkuYZ2+/jS74w/mXxdU/cNEEDeXMOpjZq02BmuiPAZ1UnOvH9oOCyTNWD/4jAEbEMZnBgGLBMqfE7XWXni9rMt4WgpfqC/vNiz4q0bkEss8Db4Ni9REmURAUXXNy7FEf8Q02bGajZ9IykaFqD7hmXokYfADojBE1aMJlFHKnYRxtDYRZsMkbmu2YNMAn2VbSxnpbm8gEO+qPKl0fLDJ+AVqvBxfAms9id5kbmAADIg0VHljxMUVtHJPXaqaMjBQ5Z6eBO+cW+8g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ulakhaberlesme.com.tr; dmarc=pass action=none header.from=ulakhaberlesme.com.tr; dkim=pass header.d=ulakhaberlesme.com.tr; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ulakhaber.onmicrosoft.com; s=selector2-ulakhaber-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SpT3+7rViyQuIfh9twYxu3+RYrid6KDJreI+a5iBEXo=; b=OGeDWZpM6s2fs+1SFNxLz0Q3n8u3a+YZqKjOhXBvwlS2uO/KtAdEj512HibYuvARUVeoeWRigw2JLmHa+9PqaPWduSlhvPII1Px6uK+J9e8T6VV0E/Fi0+SKoyiRtLrK2gG80ODkn1tAyFzFf1X5py+zUnaY1nG/DWwMizgo1Vw= Received: from VI1P18901MB0734.EURP189.PROD.OUTLOOK.COM (2603:10a6:800:12d::7) by VE1P189MB0847.EURP189.PROD.OUTLOOK.COM (2603:10a6:800:160::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3239.16; Tue, 4 Aug 2020 09:14:24 +0000 Received: from VI1P18901MB0734.EURP189.PROD.OUTLOOK.COM ([fe80::a5f8:4205:9a87:bdc8]) by VI1P18901MB0734.EURP189.PROD.OUTLOOK.COM ([fe80::a5f8:4205:9a87:bdc8%9]) with mapi id 15.20.3239.022; Tue, 4 Aug 2020 09:14:24 +0000 From: =?iso-8859-9?Q?Ahmet_Gen=E7?= To: "users@dpdk.org" CC: =?iso-8859-9?Q?Mehmet_Hakan_Do=F0an?= , =?iso-8859-9?Q?Volkan_Atl=FD?= Thread-Topic: How to send an mbuf packet created on secondary process without memory corruption Thread-Index: AQHWajfNlqkDk6fyr0ynVziWICH2Uw== Date: Tue, 4 Aug 2020 09:14:24 +0000 Message-ID: Accept-Language: tr-TR, en-US Content-Language: tr-TR X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=ulakhaberlesme.com.tr; x-originating-ip: [78.171.191.200] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 0cee0f7a-0148-4ccc-ff2c-08d83856c81e x-ms-traffictypediagnostic: VE1P189MB0847: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 20ndIjC4exkWiBhbo1I+eqVH2zP78WI0fHsRBejBtFXbNRfssqSxDVgydGO86l8RvGAtb5X/Gk4EpXuYwKzKG1rEKAiMsb0FgUBs12HOH5m4e0lEF3qBJkp6zUOv4HvLU4hjIUd65MRdgEdKrDBYgFqH6VFi60KeNBHqlyJ+nexT/z10EWu2h43fDJ9dVBsocV5HCnHhBpIw1YPkRr0mFsIjEwIo0MyJ0MNI5rJvPwKQTqrHYIaAF7D2PfAbHt3pkx4UjPAKQS1wTBphBFfzTtdn6kTxENtbdm5IS/WkdHdaOyRnF63hmt19HZdEY5NT x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1P18901MB0734.EURP189.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFTY:; SFS:(376002)(366004)(346002)(39850400004)(396003)(136003)(71200400001)(8676002)(6486002)(8936002)(9686003)(478600001)(6512007)(2906002)(4326008)(6916009)(19627405001)(86362001)(5660300002)(52536014)(26005)(64756008)(54906003)(186003)(66556008)(76116006)(91956017)(316002)(66476007)(6506007)(33656002)(66446008)(66946007)(83380400001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: WRA4yUh6OSghF1VHJy0CCwyLxBa6mAIWZQevwe/t8vF+RAUxvw2wyJAXik6G2wSuLgU29c4gKHThWOWi9hplDSM5UqyjnN4VHOok1vm8TV0HLjiG22V6I/Qc0/aHtJwwlUB1okzZYF+1MDALFJudxk+q0L6YvsLLI4rksV7LXHX84DN/yLgFXawiMncE+7hE0jW76BfaxnkcBm+PCODI5fL0R8wouusLSczJT+E0Buf0tQwXLTuAMlbGItP2R82vOpLXG9uyT46umNZSZWAFhqVwQX6XFgY11XTUOkTe2LbEDqVyi0cLVMcnla6c+G9IHO7ZoT6936flABYXbLtyx2B2xS8gswzvb0iBAfwlBkoJPZu4cfD9PTKyV/hJmfDlr+FTdq02nbe9XtjwSITsvor+JzKJuIY42e2RSR4aiDs6/rJS01q7XrZszLknS6zLYbNw4iESOTdzS2tN3pY1UjyufoKBhdoMdHe8n220hj0ssfVSnGcv0E4OWXOFQLEhpVqWJxib4CWDtU2QAKiyQNNtHzxvDmJcEH0Tw4LXdcFVnIaDrP8So9EwjOosytD0nkEGbPWxQIjwt1VkzXUz0zdli5GAgvjlXBVkJL4YlFosEZYMpy/fvFkFDKqosk3vc+ent3ggIRS9zt7oxersyg== MIME-Version: 1.0 X-OriginatorOrg: ulakhaberlesme.com.tr X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: VI1P18901MB0734.EURP189.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: 0cee0f7a-0148-4ccc-ff2c-08d83856c81e X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Aug 2020 09:14:24.7468 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 39e36fd9-0f21-4c96-ae71-dbd87cae7b33 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 36Hgx7xV394i5WrGaMGOYUO7FAUYwTXCZAYMpHGRvai2LA7DDoVWNi9gZSymtqSXqrfbGymwPWKK3YhHt2WjTVNXJyg62E4v9KoBZ9gLm034m0Eiw28z1jok7LQea7kZ X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1P189MB0847 Content-Type: text/plain; charset="iso-8859-9" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [dpdk-users] How to send an mbuf packet created on secondary process without memory corruption 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" Hello everyone, We are trying to run a multiprocess application over DPDK, but we are getti= ng a memory corruption error. On secondary DPDK application, we allocate an mbuf packet as below; .... struct rte_mbuf *created_pkt =3D rte_pktmbuf_alloc(mbuf_pool); // error check pkt_size =3D sizeof(struct rte_ether_hdr) + sizeof(struct rte_arp_hdr); created_pkt->data_len =3D pkt_size; created_pkt->pkt_len =3D pkt_size; eth_hdr =3D rte_pktmbuf_mtod(created_pkt, struct rte_ether_hdr *); rte_ether_addr_copy(&bond_mac_addr, ð_hdr->s_addr); memset(ð_hdr->d_addr, 0xFF, RTE_ETHER_ADDR_LEN); eth_hdr->ether_type =3D rte_cpu_to_be_16(RTE_ETHER_TYPE_ARP); arp_hdr =3D (struct rte_arp_hdr *)( (char *)eth_hdr + sizeof(struct rte_ether_hdr)); arp_hdr->arp_hardware =3D rte_cpu_to_be_16(RTE_ARP_HRD_ETHER); arp_hdr->arp_protocol =3D rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV4); arp_hdr->arp_hlen =3D RTE_ETHER_ADDR_LEN; arp_hdr->arp_plen =3D sizeof(uint32_t); arp_hdr->arp_opcode =3D rte_cpu_to_be_16(RTE_ARP_OP_REQUEST); rte_ether_addr_copy(&bond_mac_addr, &arp_hdr->arp_data.arp_sha); arp_hdr->arp_data.arp_sip =3D bond_ip; memset(&arp_hdr->arp_data.arp_tha, 0, RTE_ETHER_ADDR_LEN); arp_hdr->arp_data.arp_tip =3D ((unsigned char *)&res->ip.addr.ipv4)[0] | (((unsigned char *)&res->ip.addr.ipv4)[1] << 8) | (((unsigned char *)&res->ip.addr.ipv4)[2] << 16) | (((unsigned char *)&res->ip.addr.ipv4)[3] << 24); rte_ring_enqueue_burst(ring, (void **)&created_pkt, 1, NULL); The packet (created_pkt) is created and allocated successfully (packet_len = is not null and we don't see error line.). After that, we send out this pac= ket to the primary application over the ring. On the primary application, w= e send the packet to a physical port using rte_eth_tx_burst. However, we think that whenever the ring size reaches full (RING_SIZE 256) = secondary application tries to release the memory and we get memory corrupt= ion error. We think we are missing a point about the virtual and physical memory addre= sses between processes (setting mbuf->buf_addr or mbuf->buf_iova addresses = or something like that). Could anyone help us to resolve this issue? Thanks