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 1E0E9A04F3 for ; Fri, 3 Jan 2020 02:20:18 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AAF2B1C1E7; Fri, 3 Jan 2020 02:20:17 +0100 (CET) Received: from mail-pg1-f171.google.com (mail-pg1-f171.google.com [209.85.215.171]) by dpdk.org (Postfix) with ESMTP id DE33D1C1E5 for ; Fri, 3 Jan 2020 02:20:15 +0100 (CET) Received: by mail-pg1-f171.google.com with SMTP id x7so22696935pgl.11 for ; Thu, 02 Jan 2020 17:20:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WdSaEdb4A+nqdYIKb7tchw6r2oxjrgiXGJ2H7mWMr3A=; b=B2GV3MQOfjEHJpQ1rlIB+LIJDDFd10sPQrFG+SAwWiccxNsWlYz4xeE7J28i6SU1dv ojI3RSGR3xCOwjZe6Xb2wa0Di1YHN40bH1D2AF2m+GstDM9q1iz4IhR8K396VMwxzzQx t4yzI7HpSNi0W+h6JXIOUJOC+pyJJcaeA5mC4yEtlFW4bJhXE09rh9LqlPBtL7dFCxQT 9RxDdarhA3e7tmp7wESf6k9TzUGnxsW+pjOXtWWpaDbREvxMHSGqwtx/TX7B8zuTpYaU aXT11rf0NvmhoC3BYhqrk7YRxnfkdMfmwp8j3kpX1nLBjDWR6lyk7Fno3gIXzMDurhua Kaew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=WdSaEdb4A+nqdYIKb7tchw6r2oxjrgiXGJ2H7mWMr3A=; b=mzSU/hIs/XdvBLQinyBQQ1rDNeCtjetu/tGw7zgiOCdxQHypNjcg7kmbJCaqdaeioZ JME1kfJbcZqwjARg4R06cEWfKGpphncKag/aomoy5T7FvggeY0xdg7xpGPDHKmuM6CHL N5ZAA1eCk8pOmRS1hE1SGEYHVuA/LiSWD0Q2+TOrJcGklJE2VtR2D6wdOsFqy2jw4Qcx 69zv8IMmVL6a8a5ixIkHU1QlyMox8Hxo+EcBieW5nT73P4hg1uXct4LtnwUZE2F7PHn5 M+tVSHuCIRV9Bj02+e+kEG9WLqPG3ghS5e8UzbA+iX1wYsYayT+IKzRVeCNJjjID1VT6 9KmQ== X-Gm-Message-State: APjAAAUERe+NcAb0Tv4pas1Wz2/sJKHQnQbnnaX0YjREEj+2g5E59doI hJEdtj+AWX043asS2BuCHkM3lw== X-Google-Smtp-Source: APXvYqwcL7i2Owl1+Q+guKMOVwDeHzJeOFhLbdtcPOtUMnsGPgtS2fX1daqYwbR37V/gFUuCdmrfqw== X-Received: by 2002:a63:338e:: with SMTP id z136mr93836085pgz.60.1578014414917; Thu, 02 Jan 2020 17:20:14 -0800 (PST) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id h3sm66176536pfr.15.2020.01.02.17.20.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jan 2020 17:20:14 -0800 (PST) Date: Thu, 2 Jan 2020 17:20:06 -0800 From: Stephen Hemminger To: JeongHwan Kim Cc: users@dpdk.org Message-ID: <20200102172006.5b9eb3e4@hermes.lan> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-users] Attatching global memory pointer to mbuf and sending it to ethernet port. 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" On Fri, 3 Jan 2020 09:11:46 +0900 JeongHwan Kim wrote: > Hi, everyone > > I'd like to send the contents of global memory through ethernet port > without memory copying to mbuf. > So, I attached the pointer of global memory to mbuf's buffer address, but > segfault occurs when I send it to ethernet port. > I 'm using dpdk version 2019.11 and eal config with "--iova-mode=pa" > option. > My hw platform is NXP ls2088a. > > My routine is like this: > > int buf_len = 100; > struct rte_mbuf *m = rte_pktmbuf_alloc(mbuf_pool); > struct rte_mbuf_ext_shared_info *shinfo = > rte_pktmbuf_ext_shinfo_init_helper(buf_addr, &buf_len, free_cb, fcb_arg); > rte_pktmbuf_attach_extbuf(m, buf_addr, buf_iova, buf_len, shinfo); > rte_pktmbuf_reset_headroom(m); > ... > and sent "m" to ethernet, the result was > > Thread 4 "lcore-slave-1" received signal SIGSEGV, Segmentation fault. > [Switching to Thread 0xffffbdb0c910 (LWP 10614)] > 0x0000aaaaaab73f58 in eth_mbuf_to_sg_fd () > > The buffer was created as follows : > user_mz = rte_memzone_reserve_aligned("user_mz", size, rte_socket_id(), > RTE_MEMZONE_1GB|RTE_MEMZONE_IOVA_CONTIG, > RTE_CACHE_LINE_SIZE); > buf_addr = user_mz->addr; > buf_iova = user_mz->iova; > > Please give me a hint for this problem. > Thanks in advance. > > Jeong-Hwa Kim. Are you using primary/secondary process model? Is the memory zone being created in the primary process?