From: Didier Pallard Subject: Re: [PATCH 2/8] net/vmxnet3: return unknown IPv4 extension len ptype Date: Tue, 17 Apr 2018 11:09:01 +0200 Message-ID: References: <20180328154349.24976-1-didier.pallard@6wind.com> <20180328154349.24976-3-didier.pallard@6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit To: Yong Wang , "dev@dpdk.org" Return-path: Received: from mail-wr0-f195.google.com (mail-wr0-f195.google.com [209.85.128.195]) by dpdk.org (Postfix) with ESMTP id A2D32AA97 for ; Tue, 17 Apr 2018 11:09:15 +0200 (CEST) Received: by mail-wr0-f195.google.com with SMTP id v60so29449746wrc.7 for ; Tue, 17 Apr 2018 02:09:15 -0700 (PDT) In-Reply-To: Content-Language: fr List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi wang, Indeed, this one is not strictly needed and does not fix anything, anyway: - If application does not need the information (ethernet bridge, for example), this access is not needed and it will never be done, so application performance will be improved. - If application needs the information, you're true, the parsing will justĀ  be shifted to the application procedure, but I think that data access locality will be increased since the application will certainly do other stuff around the same memory location. And in this case, final performance figures should be at worst the same than before the patch. Didier On 04/16/2018 09:46 PM, Yong Wang wrote: >> -----Original Message----- >> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Didier Pallard >> Sent: Wednesday, March 28, 2018 8:44 AM >> To: dev@dpdk.org >> Subject: [dpdk-dev] [PATCH 2/8] net/vmxnet3: return unknown IPv4 >> extension len ptype >> >> Rather than parsing IP header to get proper ptype to return, just return >> RTE_PTYPE_L3_IPV4_EXT_UNKNOWN, that tells application that we have an >> IP >> packet with unknown header length. > Any specific reason of doing this? I can image there are applications that depend on this and the cost of parsing is simply shifted to the app or via rte_eth_add_rx_callback(). > >> Signed-off-by: Didier Pallard >> --- >> drivers/net/vmxnet3/vmxnet3_rxtx.c | 8 +------- >> 1 file changed, 1 insertion(+), 7 deletions(-) >> >> diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c >> b/drivers/net/vmxnet3/vmxnet3_rxtx.c >> index 3a8c62fc1..156dc8e52 100644 >> --- a/drivers/net/vmxnet3/vmxnet3_rxtx.c >> +++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c >> @@ -659,13 +659,7 @@ vmxnet3_rx_offload(const Vmxnet3_RxCompDesc >> *rcd, struct rte_mbuf *rxm) >> >> /* Check packet type, checksum errors, etc. Only support IPv4 for >> now. */ >> if (rcd->v4) { >> - struct ether_hdr *eth = rte_pktmbuf_mtod(rxm, struct >> ether_hdr *); >> - struct ipv4_hdr *ip = (struct ipv4_hdr *)(eth + 1); >> - >> - if (((ip->version_ihl & 0xf) << 2) > (int)sizeof(struct ipv4_hdr)) >> - rxm->packet_type = RTE_PTYPE_L3_IPV4_EXT; >> - else >> - rxm->packet_type = RTE_PTYPE_L3_IPV4; >> + rxm->packet_type = RTE_PTYPE_L3_IPV4_EXT_UNKNOWN; >> >> if (!rcd->cnc) { >> if (!rcd->ipc) >> -- >> 2.11.0