From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f48.google.com (mail-wm0-f48.google.com [74.125.82.48]) by dpdk.org (Postfix) with ESMTP id A2AFF8DAF for ; Wed, 20 Jan 2016 16:49:23 +0100 (CET) Received: by mail-wm0-f48.google.com with SMTP id r129so136633694wmr.0 for ; Wed, 20 Jan 2016 07:49:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=cTRasv0um41B4Bztb+VWwUv7j6qlOBvijp32I3nXuAY=; b=ZuqAOIY2kWf7yhPZhuGka1TBITKsBD3Y9DIIxMRJ6H0BSXO7gNvt8do/lNQxKPwSoR VezUbTN/i/iPN8abN4JLZxWi7zeBcwaALw0GS8+4A1JUTDDry41NDzoe+FAHhQ7NjlTI k63vRgCN9C0mM6dd+RYmVobnT/TjjYHzrhbmq1LqUG+h5LIo/rd7ocHfxwfThwapiU+e NSs4Q4UPtOwA/c6MG2NwdqYYhrgXyZig/aTw5Ruoiaa1rTm9/0mvRwgoKjDx6YTcxUGF tk8MCId85wknYR1s9RupHKk6fjvc30M4eDEgZ6sOyLZzldsnSvLtZInpaYwYNDW49mD+ V2AA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=cTRasv0um41B4Bztb+VWwUv7j6qlOBvijp32I3nXuAY=; b=HyYQ2K+jBxuXWugVAHv/R47XZ70HlBPZYWECehAWBaOcVVW5QVVyYXJ1IKZGRbaoZv hshG2VOQzslgDKNlk4awuJKonjtwqfvA1mKi6T5NCGrUBeQ5ikovuK++79x4N/+Yj0GC 3D3tVPW1IIIgn1T0VqOP/xH5z5/BWdLmSdyiS+dlDfaEh/ljOHarN4hpAAgWH97wGeHC CcsriGCQSgb0ONlgwI9wF9Khfd/Zn9VJsj4BcZRZYWC9a09XjuyemElSCoWRplosy9S4 nhVs1uBOKiM6KE1JqpUK4f2uuto0wnig4iz7ePDd/AOt4atjJrqFLYmO2kiqyF5O1OYM bBbw== X-Gm-Message-State: AG10YORXK5WkPLuUa267aU7m1WQQQNQdMA69vtw/jyJW8Q9uuKxC57Bjl7u1uhoYGTw9PMPs X-Received: by 10.28.189.197 with SMTP id n188mr5069093wmf.22.1453304963452; Wed, 20 Jan 2016 07:49:23 -0800 (PST) Received: from [10.16.0.189] (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by smtp.gmail.com with ESMTPSA id w23sm25777850wmd.1.2016.01.20.07.49.21 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 20 Jan 2016 07:49:22 -0800 (PST) To: "Montorsi, Francesco" , "dev@dpdk.org" References: <30b91c74ca26434daac041713cffa153@bilemail1.empirix.com> From: Ivan Boule Message-ID: <569FAC72.3090001@6wind.com> Date: Wed, 20 Jan 2016 16:49:06 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.5.0 MIME-Version: 1.0 In-Reply-To: <30b91c74ca26434daac041713cffa153@bilemail1.empirix.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] where to find ethernet CRC when stripping is off X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2016 15:49:23 -0000 On 01/20/2016 04:02 PM, Montorsi, Francesco wrote: > Hi all, > > I need to get access to the Ethernet CRC of received packets. > To do this, I'm configuring: > > port_conf.rxmode.hw_strip_crc = 0; > > Now my question is: how am I supposed to access the Ethernet CRC from a DPDK mbuf? > Is the CRC just the 4 final bytes of the packets? > > Is this correct: > > uint32_t crc = rte_pktmbuf_mtod_offset (mymbuf, uint32_t*, mymbuf->pkt_len) ; > > ? > > Thanks, > Francesco Montorsi > Hi Francesco, You would be right... if the PMDs did not transparently strip the CRC in software when hardware CRC stripping is disabled at port configuration (as described above). See for instance how the function ixgbe_recv_pkts_lro() in file drivers/net/ixgbe/ixgbe_rxtx.c deals with crc_len. Considering your need, I think now that PMDs should keep the CRC that are stored in received packets when hardware CRC stripping is disabled by the application, so that the application can access it as needed. Note that this would impose that the input packet processing of such DPDK applications be aware of the CRC presence (+4 in the packet length , for instance). Let's see what others, if any, that might care think about such a change into the CRC stripping semantics. Ivan -- Ivan Boule 6WIND Development Engineer