From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f51.google.com (mail-wm0-f51.google.com [74.125.82.51]) by dpdk.org (Postfix) with ESMTP id 5294728BF for ; Fri, 15 Apr 2016 09:41:01 +0200 (CEST) Received: by mail-wm0-f51.google.com with SMTP id u206so19652773wme.1 for ; Fri, 15 Apr 2016 00:41:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=7frZLtRp99Wl3WtsUamV1030TO4cgEJi/8dB/bsFDP0=; b=1t4UpPBZO5vN1r2Se5mh3YdHsBuBdcw795KIoTQZtsK+rJGX9qn66+jKu+4AhoRrRr 8IDCuXfIJktGpz0djbzkk2kpk+fMZByEL9zZruB4jxkR8kOu3USTcYEhj2JHSPt/IKim iIr2pwn8/YxzDdztmL0qsU4adk75pc6xxXTszD+sNl6PyzI2i7weZTdhruKbXeXmbKjp ISLImPr6neKaGeyw/dr1MdcR3WcpB2AwnLgPPPLeLgW9zgc4eZqHwgdVgJz/+G0hP7d1 EqjK43WtcwdwK0akFDf/0raIXPrgEOvQx3bf5gxoQsIVjPnSStfMmqTgu2t5zTGZRJqV Q0Mg== 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:content-transfer-encoding; bh=7frZLtRp99Wl3WtsUamV1030TO4cgEJi/8dB/bsFDP0=; b=fgQdGnOdoZCDts0P4z3I/EI70QUjRCTZJ8cbBB05nQnghFViW3jhbQcctbpeY05qrB jbXKWHH7wzEZmaL+hj00BES0V1tZuLs7JgapF/iFfK6iW63HDzJoiY9dV1jYMgsKIzj0 l+UkGLEdhq00gX91ro/wQ0HjricrAdI4vltW5SZxlDJGgsle7ZlAjHPcF3Q+rHvZNYNk J3mhTLXufeUP/G62ezCuTZu4Q6Xss7kmhLqviOfj0jnAFv+S7RjpTNn75mc4gsM/9zl5 8kwvINl1SRpjYc5ZW2mDeW2qgN6iqJLlFPEValkNW8NPvR0GqgD89TZxTE+epmhJa8+Y fN9A== X-Gm-Message-State: AOPr4FV8CXV7zEePDDViZLwNUjhCqOsztoD8taa/zcUKp3vpcGXfFL1xHf/fMYUV3B0GH1XNzO2Vqrq4QBtYy/10 X-Received: by 10.194.14.130 with SMTP id p2mr21797282wjc.173.1460706061114; Fri, 15 Apr 2016 00:41:01 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.96.2 with HTTP; Fri, 15 Apr 2016 00:40:41 -0700 (PDT) In-Reply-To: <1460645904-19565-1-git-send-email-bjorn.topel@intel.com> References: <1460645904-19565-1-git-send-email-bjorn.topel@intel.com> From: David Marchand Date: Fri, 15 Apr 2016 09:40:41 +0200 Message-ID: To: =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= Cc: "dev@dpdk.org" , "Zhang, Helin" , "Wu, Jingjing" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [dpdk-dev] [PATCH] i40evf: Ignore disabled HW CRC strip for Linux PF hosts 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: Fri, 15 Apr 2016 07:41:01 -0000 CC maintainers. On Thu, Apr 14, 2016 at 4:58 PM, Bj=C3=B6rn T=C3=B6pel wrote: > On Linux PF hosts, the VF has no means of changing the HW CRC strip > setting for a RX queue. It's implicitly enabled. > > This patch ignores, and warns, if HW CRC stripping was disabled. > > Signed-off-by: Bj=C3=B6rn T=C3=B6pel > --- > drivers/net/i40e/i40e_ethdev_vf.c | 15 +++++++++++++++ > 1 file changed, 15 insertions(+) > > diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_et= hdev_vf.c > index 2bce69b..f88eb79 100644 > --- a/drivers/net/i40e/i40e_ethdev_vf.c > +++ b/drivers/net/i40e/i40e_ethdev_vf.c > @@ -1567,6 +1567,8 @@ i40evf_dev_configure(struct rte_eth_dev *dev) > { > struct i40e_adapter *ad =3D > I40E_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private); > + struct rte_eth_conf *conf =3D &dev->data->dev_conf; > + struct i40e_vf *vf; > > /* Initialize to TRUE. If any of Rx queues doesn't meet the bulk > * allocation or vector Rx preconditions we will reset it. > @@ -1576,6 +1578,19 @@ i40evf_dev_configure(struct rte_eth_dev *dev) > ad->tx_simple_allowed =3D true; > ad->tx_vec_allowed =3D true; > > + /* For Linux PF hosts, VF has no ability to disable HW CRC strip, > + * and is implicitly enabled by the PF. > + */ > + if (!conf->rxmode.hw_strip_crc) { > + vf =3D I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private); > + if ((vf->version_major =3D=3D I40E_VIRTCHNL_VERSION_MAJOR= ) && > + (vf->version_minor <=3D I40E_VIRTCHNL_VERSION_MINOR))= { > + /* Peer is Linux PF host. */ > + PMD_INIT_LOG(NOTICE, "VF can't disable HW CRC Str= ip."); > + conf->rxmode.hw_strip_crc =3D 1; > + } > + } > + > return i40evf_init_vlan(dev); > } Not sure this is the right way to handle it. The driver should return an error rather than silently discard what the application asked. > > -- > 2.7.4 > > ---------------------------------------------------------------------- > Intel Sweden AB > Registered Office: Isafjordsgatan 30B, 164 40 Kista, Stockholm, Sweden > Registration Number: 556189-6027 > > This e-mail and any attachments may contain confidential material for > the sole use of the intended recipient(s). Any review or distribution > by others is strictly prohibited. If you are not the intended > recipient, please contact the sender and delete all copies. Please, remove this. --=20 David Marchand