From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-we0-f181.google.com (mail-we0-f181.google.com [74.125.82.181]) by dpdk.org (Postfix) with ESMTP id 455785963 for ; Sun, 4 Jan 2015 09:22:16 +0100 (CET) Received: by mail-we0-f181.google.com with SMTP id q58so6364491wes.12 for ; Sun, 04 Jan 2015 00:22:16 -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 :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=MXGZzu//lJFPeozTyCtcRDAg9QhwPeYScL9WzUEbY9Q=; b=ORs6COna7lhWPYYXH1eq4YeP1qHrlZpARFbwztzj+2RK0Mt0PUHHBZXt8fZJvGMqNL attPYAWfW+zFhYeycP8aYznRVVfNTHelfIwnkqWDSxkk9sillK2hSZC+1SkHgXe9hIY9 ay3xjcgTuGFVq0svNvYK/D2wg9MqC9WDM/Zc60u60PR6N/O6Ndgznu9cS1gRoDNrLeez 6+42UjYdQDSyx8K9oz41R+ZNcDd+HrCtbSw3YqwKg3TmRPx55fs9gfEccSXYKd8gGglD q9UlZcTYz66d9BuYI6slLe1IoRo8RDIhBswVRMoFDpsRbXg50AJMH5Y7upuBwsEXAQDW Qfeg== X-Gm-Message-State: ALoCoQku+HARcKsX3HZ9tkI7d1xOUMcdwKz2ORy+5g/y8eV6KoLypHxhTp3/OKATv/iy7dcaTKU6 X-Received: by 10.180.73.206 with SMTP id n14mr13953090wiv.60.1420359736072; Sun, 04 Jan 2015 00:22:16 -0800 (PST) Received: from [10.0.0.3] (bzq-79-179-0-199.red.bezeqint.net. [79.179.0.199]) by mx.google.com with ESMTPSA id pl1sm5213292wic.16.2015.01.04.00.22.14 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 04 Jan 2015 00:22:15 -0800 (PST) Message-ID: <54A8F835.3010400@cloudius-systems.com> Date: Sun, 04 Jan 2015 10:22:13 +0200 From: Vlad Zolotarov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Ouyang Changchun , dev@dpdk.org References: <1419398584-19520-1-git-send-email-changchun.ouyang@intel.com> <1420355937-18484-1-git-send-email-changchun.ouyang@intel.com> <1420355937-18484-2-git-send-email-changchun.ouyang@intel.com> In-Reply-To: <1420355937-18484-2-git-send-email-changchun.ouyang@intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v4 1/6] ixgbe: Code cleanup 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: Sun, 04 Jan 2015 08:22:16 -0000 On 01/04/15 09:18, Ouyang Changchun wrote: > Put global register configuring out of loop for queue; also fix typo and indent; > Also fix typo and indent. > > Signed-off-by: Changchun Ouyang Reviewed-by: Vlad Zolotarov > --- > lib/librte_pmd_ixgbe/ixgbe_rxtx.c | 35 ++++++++++++++++++----------------- > 1 file changed, 18 insertions(+), 17 deletions(-) > > diff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c > index 5c36bff..f69abda 100644 > --- a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c > +++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c > @@ -3548,9 +3548,9 @@ ixgbe_dev_rx_init(struct rte_eth_dev *dev) > IXGBE_WRITE_REG(hw, IXGBE_PSRTYPE(rxq->reg_idx), psrtype); > } > srrctl = ((dev->data->dev_conf.rxmode.split_hdr_size << > - IXGBE_SRRCTL_BSIZEHDRSIZE_SHIFT) & > - IXGBE_SRRCTL_BSIZEHDR_MASK); > - srrctl |= E1000_SRRCTL_DESCTYPE_HDR_SPLIT_ALWAYS; > + IXGBE_SRRCTL_BSIZEHDRSIZE_SHIFT) & > + IXGBE_SRRCTL_BSIZEHDR_MASK); > + srrctl |= IXGBE_SRRCTL_DESCTYPE_HDR_SPLIT_ALWAYS; > } else > #endif > srrctl = IXGBE_SRRCTL_DESCTYPE_ADV_ONEBUF; > @@ -3985,7 +3985,7 @@ ixgbevf_dev_rx_init(struct rte_eth_dev *dev) > struct igb_rx_queue *rxq; > struct rte_pktmbuf_pool_private *mbp_priv; > uint64_t bus_addr; > - uint32_t srrctl; > + uint32_t srrctl, psrtype = 0; > uint16_t buf_size; > uint16_t i; > int ret; > @@ -4039,20 +4039,10 @@ ixgbevf_dev_rx_init(struct rte_eth_dev *dev) > * Configure Header Split > */ > if (dev->data->dev_conf.rxmode.header_split) { > - > - /* Must setup the PSRTYPE register */ > - uint32_t psrtype; > - psrtype = IXGBE_PSRTYPE_TCPHDR | > - IXGBE_PSRTYPE_UDPHDR | > - IXGBE_PSRTYPE_IPV4HDR | > - IXGBE_PSRTYPE_IPV6HDR; > - > - IXGBE_WRITE_REG(hw, IXGBE_VFPSRTYPE(i), psrtype); > - > srrctl = ((dev->data->dev_conf.rxmode.split_hdr_size << > - IXGBE_SRRCTL_BSIZEHDRSIZE_SHIFT) & > - IXGBE_SRRCTL_BSIZEHDR_MASK); > - srrctl |= E1000_SRRCTL_DESCTYPE_HDR_SPLIT_ALWAYS; > + IXGBE_SRRCTL_BSIZEHDRSIZE_SHIFT) & > + IXGBE_SRRCTL_BSIZEHDR_MASK); > + srrctl |= IXGBE_SRRCTL_DESCTYPE_HDR_SPLIT_ALWAYS; > } else > #endif > srrctl = IXGBE_SRRCTL_DESCTYPE_ADV_ONEBUF; > @@ -4095,6 +4085,17 @@ ixgbevf_dev_rx_init(struct rte_eth_dev *dev) > } > } > > +#ifdef RTE_HEADER_SPLIT_ENABLE > + if (dev->data->dev_conf.rxmode.header_split) > + /* Must setup the PSRTYPE register */ > + psrtype = IXGBE_PSRTYPE_TCPHDR | > + IXGBE_PSRTYPE_UDPHDR | > + IXGBE_PSRTYPE_IPV4HDR | > + IXGBE_PSRTYPE_IPV6HDR; > +#endif > + > + IXGBE_WRITE_REG(hw, IXGBE_VFPSRTYPE, psrtype); > + > if (dev->data->dev_conf.rxmode.enable_scatter) { > if (!dev->data->scattered_rx) > PMD_INIT_LOG(DEBUG, "forcing scatter mode");