From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com [209.85.212.178]) by dpdk.org (Postfix) with ESMTP id 933C25A56 for ; Wed, 11 Feb 2015 16:15:34 +0100 (CET) Received: by mail-wi0-f178.google.com with SMTP id em10so4461220wid.5 for ; Wed, 11 Feb 2015 07:15:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=VxwCIx5fIzdsXoeP2tVMb3gRA+PJWibZw/d8gC1a0/s=; b=XsiSus7hd9vQCUwLXMDw1RD+B4HxHtQt/8Tfpc0eXQE36rcbe7793YdPNmm8htsl6Q 1cXosrLxvvjF8ArwRdFAm6lLGrNIF3iSt5Glj290w6zFYdbFYVhqaTR266kLhyCnkQtd C4b/MWe1ObimUus2AnJHAcmcPOobQs9NauvU6zvJaxaW6hnxcKwidttNsVtT4STOdMVe X+VeLpJw1Qhir1+b8Jp8M4fCRyK4ly5OYC3efxNnA8PvqCFZwkQxIkfG0twb+lnM9gcE J7Cmdg3tUS/kyTwuKYvvi0XYFFuLHL04fKBNtUYvEuKMUhFkUvINLTXbmniyN+CLz/tB bh3g== X-Gm-Message-State: ALoCoQkr9ooRh1P2Te7fAawj1MjCnm0ZJR8hYTmurij8sl6+VSEYHMBTKoW5BmDQOHOoZLFpZyrY X-Received: by 10.180.182.67 with SMTP id ec3mr56934273wic.58.1423667734403; Wed, 11 Feb 2015 07:15:34 -0800 (PST) Received: from [10.16.0.195] (6wind.net2.nerim.net. [213.41.180.237]) by mx.google.com with ESMTPSA id yy9sm1676734wjc.20.2015.02.11.07.15.33 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Feb 2015 07:15:33 -0800 (PST) Message-ID: <54DB7215.5020008@6wind.com> Date: Wed, 11 Feb 2015 16:15:33 +0100 From: Olivier MATZ User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.2.0 MIME-Version: 1.0 To: "Liu, Jijiang" References: <1422623775-8050-1-git-send-email-olivier.matz@6wind.com> <1423041925-26956-1-git-send-email-olivier.matz@6wind.com> <1423041925-26956-3-git-send-email-olivier.matz@6wind.com> <1ED644BD7E0A5F4091CF203DAFB8E4CC01DDA2CF@SHSMSX101.ccr.corp.intel.com> In-Reply-To: <1ED644BD7E0A5F4091CF203DAFB8E4CC01DDA2CF@SHSMSX101.ccr.corp.intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH v2 02/20] mbuf: enhance the API documentation of offload flags 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, 11 Feb 2015 15:15:34 -0000 Hi Jijiang, On 02/11/2015 08:15 AM, Liu, Jijiang wrote: >>> diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c index >>> 41711fd..4b438d1 100644 >>> --- a/app/test-pmd/csumonly.c >>> +++ b/app/test-pmd/csumonly.c >>> @@ -183,16 +183,15 @@ process_inner_cksums(void *l3_hdr, uint16_t >>> ethertype, uint16_t l3_len, >>> ipv4_hdr = l3_hdr; >>> ipv4_hdr->hdr_checksum = 0; >>> >>> + ol_flags |= PKT_TX_IPV4; >>> if (tso_segsz != 0 && l4_proto == IPPROTO_TCP) { >>> ol_flags |= PKT_TX_IP_CKSUM; >>> } else { >>> if (testpmd_ol_flags & >> TESTPMD_TX_OFFLOAD_IP_CKSUM) >>> ol_flags |= PKT_TX_IP_CKSUM; >>> - else { >>> + else >>> ipv4_hdr->hdr_checksum = >>> rte_ipv4_cksum(ipv4_hdr); >>> - ol_flags |= PKT_TX_IPV4; >>> - } >>> } >>> } else if (ethertype == _htons(ETHER_TYPE_IPv6)) >>> ol_flags |= PKT_TX_IPV6; >>> @@ -261,6 +260,7 @@ process_outer_cksums(void *outer_l3_hdr, uint16_t >>> outer_ethertype, >>> >>> if (outer_ethertype == _htons(ETHER_TYPE_IPv4)) { >>> ipv4_hdr->hdr_checksum = 0; >>> + ol_flags |= PKT_TX_OUTER_IPV4; >>> > > Look at the codes again, you should extend process_outer_cksums() to support other tunneling packet. > > The code changes like below, > process_outer_cksums(void *outer_l3_hdr, struct testpmd_offload_info *info, > uint16_t testpmd_ol_flags, uint16_t l4_proto) // add the l4_proto parameter here. > ... > /* outer UDP checksum is always done in software as we have no > * hardware supporting it today, and no API for it. */ > if (l4_proto == IPPROTO_UDP) > udp_hdr = (struct udp_hdr *)((char *)outer_l3_hdr + info->outer_l3_len); > /* do not recalculate udp cksum if it was 0 */ > if (udp_hdr->dgram_cksum != 0) { > udp_hdr->dgram_cksum = 0; > if (info->outer_ethertype == _htons(ETHER_TYPE_IPv4)) > udp_hdr->dgram_cksum = > rte_ipv4_udptcp_cksum(ipv4_hdr, udp_hdr); > else > udp_hdr->dgram_cksum = > rte_ipv6_udptcp_cksum(ipv6_hdr, udp_hdr); > } > } // nothing need to do for GRE tunneling packet now > } That's correct, I'll update the code accordingly. Thanks, Olivier