From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yw0-f173.google.com (mail-yw0-f173.google.com [209.85.161.173]) by dpdk.org (Postfix) with ESMTP id 70B133977 for ; Mon, 4 Jul 2016 13:34:55 +0200 (CEST) Received: by mail-yw0-f173.google.com with SMTP id l125so37637737ywb.2 for ; Mon, 04 Jul 2016 04:34:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=1S9GvkCAZzO/NV8hCI3py1D16Wr/42+WdQpIuncirKI=; b=l9U8c4cPQ9iOXM/3zfebABQM20DwwE3fEHm+lnnYItwGQc71lyXn75bKznNLwRAmRI TkNtuYLQYxHv1bcbOLUQhNYZUZnv0ii9tPwr/IQlxmG8oUl/PNop35YBk/6+gC+eNyCl vE17Y5HZl2RvUNf4qxkzclZU0D1Ig/skbSXsTTb2ql5Ic8DpCcnv3lFC0YqnOaBjloAW 4XNT8B/a7XOXYHBEm2XCf2YerhozB6q+9MePxD/Ch8xkl2d4CHJKUNNhIO0b+yeXhIy5 N71LXfc7xuIaSiESR8CYS62NHv4XV5UauE3WJTiT/xYZ+eQFkMxZD0iM5UrE7HLgvNft g1iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=1S9GvkCAZzO/NV8hCI3py1D16Wr/42+WdQpIuncirKI=; b=OJpKdYnflSFUFTDaRetIlrG9Wjv0f1+WEk2fWqMaRg3UKOTtHmfWAylmplB6Bojnek EcGygX7hjU6RM7cdfXmlT4ryhqXW0/+bv6DTFBZVboV6JdBBie40uWtfahe1Pw8l5zZx TJzdSdOUDty5dphgqCjXr2v3KSpXVw7cFalwlZYXqQLAx53SGekZWujTeA8ZRwY54Vf3 x7xQ0qClXocAm8cou+YSHU5qquFpbdFXdJx9HGgG+A3KKSJLChgXS0uvYN0TyZFsafwF KYI7Sfw9t4I6tm97y3DoXE5wU9CcdN4zh0hj4hX3qGwJZ1rQX0ogQaKsORziO0S78BEi uNCg== X-Gm-Message-State: ALyK8tLwVXm78gRziLOqP9hJgM78BqV50D7wgg2MMmxA8jM0c2m1jt03E988wc4F3y5Eve0onGuPVojSB+hWJQ== X-Received: by 10.37.5.201 with SMTP id 192mr6697217ybf.174.1467632094950; Mon, 04 Jul 2016 04:34:54 -0700 (PDT) MIME-Version: 1.0 Received: by 10.37.36.7 with HTTP; Mon, 4 Jul 2016 04:34:54 -0700 (PDT) In-Reply-To: References: <1466688410-13826-1-git-send-email-zr@semihalf.com> <1467615087-20510-1-git-send-email-zr@semihalf.com> From: Zyta Szpak Date: Mon, 4 Jul 2016 13:34:54 +0200 Message-ID: To: Remy Horton Cc: Thomas Monjalon , wenzhuo.lu@intel.com, helin.zhang@intel.com, konstantin.ananyev@intel.com, jingjing.wu@intel.com, "Jacob, Jerin" , rahul.lakkireddy@chelsio.com, dev@dpdk.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH v5 1/2] ethdev: remove get_reg_length callback 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: Mon, 04 Jul 2016 11:34:55 -0000 Very good point.. this one and the other :) THere comes fixed version. 2016-07-04 12:38 GMT+02:00 Remy Horton : > > +++ b/drivers/net/cxgbe/cxgbe_ethdev.c >> @@ -934,7 +934,15 @@ static int cxgbe_get_regs(struct rte_eth_dev >> *eth_dev, >> struct port_info *pi =3D (struct port_info >> *)(eth_dev->data->dev_private); >> struct adapter *adapter =3D pi->adapter; >> >> - regs->length =3D cxgbe_get_regs_len(eth_dev); >> + if (regs->data =3D=3D NULL) { >> + regs->length =3D cxgbe_get_regs_len(eth_dev); >> + regs->width =3D sizeof(uint32_t); >> + regs->version =3D >> CHELSIO_CHIP_VERSION(adapter->params.chip) | >> + (CHELSIO_CHIP_RELEASE(adapter->params.chip) << >> 10) | >> + (1 << 16); >> + return 0; >> + } >> + >> regs->version =3D CHELSIO_CHIP_VERSION(adapter->params.chip) | >> (CHELSIO_CHIP_RELEASE(adapter->params.chip) << >> 10) | >> (1 << 16); >> > > Code duplication.. > > Rest looks ok and passed a quick compile test. Might need to keep an eye > out for other driver changes. > --=20 Zyta Szpak Software Development Engineer Semihalf sp. z o.o. ul. Krakusa 11 30-535 Krak=C3=B3w