From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io1-f51.google.com (mail-io1-f51.google.com [209.85.166.51]) by dpdk.org (Postfix) with ESMTP id E89C21B10A for ; Sat, 29 Sep 2018 12:19:30 +0200 (CEST) Received: by mail-io1-f51.google.com with SMTP id w11-v6so6000756iob.2 for ; Sat, 29 Sep 2018 03:19:30 -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=yJOJ71N3OcdBlO6liV5PdKFD8uugIudsYOSrIvlGIAA=; b=sjmi5NKb0OooxIJS1wo7UASykd/jPlpFfwxthtB3wx4R3af6kANRAAQKm/A6GxkFQl 8Jts8UFey0blyX0Tf6P/dfOEYoxnRFlvwnRaNnXdpDzpicwuCe86AxY4QZ9yiVPLObCG zIK76icruBavcTO7PUwiY9ZlUh/WVcPa8RpDhQFOmeBRBunUSmxw/2A/NyY8aMWBWPRV BrxTEooTml6yGgb2ptMhnWY0hTYHwFLEcxP0KsVvGH4Cv94ybR5uhnQppzmBDHCQQAot kVTycY6JNXWwSIbqnDNSU/w1AJdSaNmECCkl7qP/IZwe4gEjP4aZGQuDR4J+02TaEHP7 +s8Q== 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=yJOJ71N3OcdBlO6liV5PdKFD8uugIudsYOSrIvlGIAA=; b=R6dfJ8eGpQB2JRE1chx34VNqX3rHFXSTzVJqtXo9KcydhveABgVkH1CwL57OeO9LCU U0OmeU4hxdVso17SjTzwyOz8QP66eXe599nP98f9khbFSyWvNAYnZgXy1gKW6cHPay9R anMbq+e1yKVu0ipeRCbJgfM1DG7wJ8N344KDT26CiAWzQTD6L1I1q0VRnBUxpkG7ZceY NcMqUgrNdv9B2HowHfyq+WAyX1jiSxrTYhHZd//Y3tsjWV1WrjwqivTB0+6wwqTDG6ID DyiQOUwUk+xWRGwgfR05U00Um54lysji1NS7dNf93ubH5mtEiZCZJfP0ncdpp+BMgy16 u5kw== X-Gm-Message-State: ABuFfogVMtPG3+XVoNrkriem1lPpK7WOEdmiJDS/xKKxdThqGr6UHo0q LH7lhlsQ5cjnAOhyhfET/vj9YKwJKygte+OehWk1E66h X-Google-Smtp-Source: ACcGV61bWfKVJRDQurf8XZeqe2UDGdWfsBhh2dZwGm5jkU2VzdLcxHrRD1XJJJduZETE2DxRahCIpNPQ0VKW0ZI1TZE= X-Received: by 2002:a6b:fb18:: with SMTP id h24-v6mr1439321iog.270.1538216369871; Sat, 29 Sep 2018 03:19:29 -0700 (PDT) MIME-Version: 1.0 From: Michael Barker Date: Sat, 29 Sep 2018 22:19:18 +1200 Message-ID: To: users@dpdk.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [dpdk-users] Calculating Packet Length 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: , X-List-Received-Date: Sat, 29 Sep 2018 10:19:31 -0000 Hi, I've new to DPDK and have been started by sending ARP packets. I have a question around how to set the mbuf data_len and pkt_size. I Initially did the following: struct rte_mbuf* arp_pkt = rte_pktmbuf_alloc(mbuf_pool); const size_t pkt_size = sizeof(struct ether_addr) + sizeof(struct arp_hdr); arp_pkt->data_len = pkt_size; arp_pkt->pkt_len = pkt_size; Which is based on ptpclient.c sample code. However after setting all of the fields, the packet either doesn't get sent or has some of the data truncated from the end of the packet when viewed in Wireshark. If I modify the size to be the following: const size_t pkt_size = sizeof(struct ether_addr) + sizeof(struct arp_hdr) + 8; It works as expected. I'm wondering where the extra 8 bytes come from? Is there a better way to calculate the packet length? Using dpdk 18.08, Linux - kernel 4.15.0-33. Mike.