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 B6FEFA0353 for ; Thu, 6 Aug 2020 19:35:39 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1B33837B4; Thu, 6 Aug 2020 19:35:39 +0200 (CEST) Received: from mail-il1-f172.google.com (mail-il1-f172.google.com [209.85.166.172]) by dpdk.org (Postfix) with ESMTP id 039702BF2 for ; Thu, 6 Aug 2020 19:35:37 +0200 (CEST) Received: by mail-il1-f172.google.com with SMTP id z3so30924011ilh.3 for ; Thu, 06 Aug 2020 10:35:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=9czs4jbfYKdWVw4StMrtWEucFIgbN5rmk+jAf2NDr9U=; b=WdX/CMqTTzX3BqDYz0AEl18fWrb4ud8AOJP6nqHyOOVnOMUAiXtLASgHcLbNirKyKk xXMmVWZ4BUL42AOfuXiIsS0K0uI4ubc4OHF5G+Y5PvCB7QGCD/N5EKPg396iv4mZllM3 +gAyduCJZnj7iwf8okjRdxBTMU4enNLn+TetrnDkAdYFGCp1hkFo2Z4q5LKrmGvQ4vxa c0oCIup/fR/4wA1yFh4OkjRDP/tFvVVHdmKpuy6ZzoGlVx66p7NOP2xxs6GadjZr7Diu E+0Y1wMLGe0ZzWsRwJ5hFf1TelJwHcfyK1/ra6Bpf6a1thpIASHcAUwYrHCIHa/J/59W iIuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=9czs4jbfYKdWVw4StMrtWEucFIgbN5rmk+jAf2NDr9U=; b=laoyNWbzCEWSDS6/6hKe1edVlVgC5x8zYv65yofziFNZr0Db4Xt9ArX/5+d+Gq6uSX NQh1Djn7qN8f6ZDYtmbsBekEOM2qzCNBpsW7GkeirkO9FNtTkl387q6UHe3wIOn/dsXg US89h0sbesUkKTt8JTm4d13q3BW3Uz7vsds80ahhQt0jT13X/fSSMVTGf4EtbRjATmjx 5RKmihsKxKlvHjrYn1Za0lbp6rB40VVYjBoJAGVo7fKd9llXq00HUzIWk/v4f83K0Wij KomE5ROiqBaVzWlz9UdYGYlQlxNbBpih9FETHqeAx9lBVw7kpm9ccoUghduJSOiZf1/L WdRw== X-Gm-Message-State: AOAM530OAw55w+CqbzSqtqzXWhZSDJvL6qdjB9cuf+W7Mfw+iycixj2s JEUKY8jI+z6U+cly0iZJYzGMQG27p1KMPRciETlfOzH95t4= X-Google-Smtp-Source: ABdhPJw0WVlfCoUasZFgNb9MOyERkbrnifjmNuOvNpDZDYXdN182NReonUmakUN5JtYsfvd+EYp99/aRrMKCFtu7uaw= X-Received: by 2002:a92:89da:: with SMTP id w87mr8938ilk.236.1596735337138; Thu, 06 Aug 2020 10:35:37 -0700 (PDT) MIME-Version: 1.0 From: David Aldrich Date: Thu, 6 Aug 2020 18:35:26 +0100 Message-ID: To: users Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [dpdk-users] How to fix segmentation fault with large mempool (to support jumbo packets) ? 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 have a problem with transmitting jumbo packets with DPDK. The code snippets below show how I create a mempool and then how I send the packet. (This is highly simplified - I haven't shown how I allocate the mbuf or assign the packet data). My problem is that this works fine for small mbufs (BUF_SIZE == 2048), but I need to send jumbo packets (9000 octets). My understanding is that I need to set the mbuf size to accommodate the largest packet I need to send. But as soon as I increase BUF_SIZE beyond 2048 (say to 4096) the pointer returned by rte_pktmbuf_prepend() is invalid - I get a segmentation fault at the line shown below. I don't know how to fix this. Am I setting the parameters to rte_mempool_create() incorrectly? Is the mempool too large? Any advice would be appreciated. I am using dpdk-stable-18.11.9. //================ // Initialisation //================ #define BUF_SIZE 4096 #define MBUF_SIZE (BUF_SIZE + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM) #define NB_MBUF 8192 // (I do check the return value of this call) rte_mempool_create(buf, NB_MBUF/2, MBUF_SIZE, 0, sizeof(struct rte_pktmbuf_pool_private), rte_pktmbuf_pool_init, NULL, rte_pktmbuf_init, NULL, 4, 0); //============= // Send packet //============= // Allocate mbuf from mempool and assign to p_mbuf, assign packet data then set headers ... struct udp_hdr* p_udp_hdr = (struct udp_hdr*)rte_pktmbuf_prepend(p_mbuf, (uint16_t)sizeof(struct udp_hdr)); struct ipv4_hdr* p_ip_hdr = (struct ipv4_hdr*)rte_pktmbuf_prepend(p_mbuf, (uint16_t)sizeof(struct ipv4_hdr)); if (p_ip_hdr != NULL) { p_ip_hdr->version_ihl = 0x45; <=== SEGMENTATION FAULT HERE Best regards David