From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 63BF25A6E for ; Wed, 14 Nov 2018 11:17:53 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Nov 2018 02:17:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,232,1539673200"; d="scan'208";a="104267691" Received: from aburakov-mobl1.ger.corp.intel.com (HELO [10.237.220.124]) ([10.237.220.124]) by fmsmga002.fm.intel.com with ESMTP; 14 Nov 2018 02:17:51 -0800 To: Sam Cc: dev@dpdk.org References: <9f22d7f1-080e-1663-df8d-a3893248a93d@intel.com> From: "Burakov, Anatoly" Message-ID: <4a1e4ea9-e75a-0615-dcc8-c762817f4d2e@intel.com> Date: Wed, 14 Nov 2018 10:17:49 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] Where is the padding code in DPDK? X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2018 10:17:54 -0000 On 14-Nov-18 5:45 AM, Sam wrote: > OK, then shortly speaking, DPDK will NOT care about padding. > NIC will care about padding while send and recv with NIC. > kernel will care about while send and recv with vhostuser port. > > Is that right? I cannot speak for virtio/vhost user since i am not terribly familiar with them. For regular packets, generally speaking, packets shorter than 60 bytes are invalid. Whether DPDK does or does not care about padding is irrelevant, because *you* are attempting to transmit packets that are not valid. You shouldn't rely on this behavior. > > > Burakov, Anatoly > 于2018年11月13日周二 下午5:29写道: > > 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 > -- Thanks, Anatoly