From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Burakov, Anatoly" Subject: Re: Where is the padding code in DPDK? Date: Tue, 13 Nov 2018 09:29:02 +0000 Message-ID: <9f22d7f1-080e-1663-df8d-a3893248a93d@intel.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit To: Sam , dev@dpdk.org Return-path: Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id A578C2BD5 for ; Tue, 13 Nov 2018 10:29:04 +0100 (CET) In-Reply-To: Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 13-Nov-18 7:16 AM, Sam wrote: > Hi all, > > As we know, ethernet frame must longer then 64B. > > So if I create rte_mbuf and fill it with just 60B data, will > rte_eth_tx_burst add padding data, let the frame longer then 64B > > If it does, where is the code? > Others can correct me if i'm wrong here, but specifically in case of 64-byte packets, these are the shortest valid packets that you can send, and a 64-byte packet will actually carry only 60 bytes' worth of packet data, because there's a 4-byte CRC frame at the end (see Ethernet frame format). If you enabled CRC offload, then your NIC will append the 4 bytes at transmit. If you haven't, then it's up to each individual driver/NIC to accept/reject such a packet because it can rightly be considered malformed. In addition, your NIC may add e.g. VLAN tags or other stuff, again depending on hardware offloads that you have enabled in your TX configuration, which may push the packet size beyond 64 bytes while having only 60 bytes of actual packet data. -- Thanks, Anatoly