From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi0-f45.google.com (mail-oi0-f45.google.com [209.85.218.45]) by dpdk.org (Postfix) with ESMTP id BCE398E93 for ; Thu, 29 Oct 2015 15:15:37 +0100 (CET) Received: by oies66 with SMTP id s66so34304587oie.1 for ; Thu, 29 Oct 2015 07:15:37 -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:date:message-id:subject:from:to :cc:content-type; bh=XghFWEUvO+RvsoKQZ2WNf08i5ObOWcQXR7L1Ywjtn5g=; b=ZXR7t45V/JpYeoI2pjXpUTZdz/VVm5YoTgqqtEi3v+05RrRVhP1gZhwe5yA99n27Dp OBDzs81cvx1ARCgFEP78i9thTXbXIaQGNiDzyT89dUwJ3E7/6xrTfp76aXVDMPrvuqx7 l1ZT01WyQ2nldhYhSmCpf7yCTfSsodiAxk8uv6D+gPlfA103ChqpbTDe2756dN5UgtXA J2cuCAhmpq6K8rpn+VBmFYKrhkkC8baHlc3y4lK2ZAkrWHl9Hys59iJnft593Ilpz6hU W7DPI7p2S91ewaTidzeELof6TO1lKEaaRHwiPJJmejElaYZxuru7Iug0fkfn34zCAojD oOKw== 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:date :message-id:subject:from:to:cc:content-type; bh=XghFWEUvO+RvsoKQZ2WNf08i5ObOWcQXR7L1Ywjtn5g=; b=Wuue19EI+L0eaeuVRcXwA07ITYMkCVCg0CKd2hyRfnAGmzdUULo/LM8vEqNApjAwlu J5mGV/IpdR26+pZUQVjR0IegNWb6q6QIrL2BWEIT9JQyxjfbuVriU19GyYQG8Q8eqAMh 3Lls3d92Nk9A3uyw5qdWuDVupyq99V2PpRXLhH6JkzC83orvrjv97uYvj7GGTMgBucXT fgBxG5/RBTf26K4lIAFaO/5jCAZ0Y1+0/+SLlbqJVNg4fZeHe+nLKILAd1FlPz9T0mHi rvhnoGYyJv4jgnr6kK3jSCnREihDxvjDuzJxfUrSvm0NpKmkwNm/7r2cG1Ygfvri520l DQsw== X-Gm-Message-State: ALoCoQlxFoN1FGZlamOmfEKlFMaAYm74xtdxf7HvxKf4B8cnoNtRejmn2eTip+bUQrN+l8Y4ogmP MIME-Version: 1.0 X-Received: by 10.182.130.234 with SMTP id oh10mr1294623obb.58.1446128136832; Thu, 29 Oct 2015 07:15:36 -0700 (PDT) Received: by 10.76.131.166 with HTTP; Thu, 29 Oct 2015 07:15:36 -0700 (PDT) In-Reply-To: <1445402801-27806-6-git-send-email-jijiang.liu@intel.com> References: <1445402801-27806-1-git-send-email-jijiang.liu@intel.com> <1445402801-27806-6-git-send-email-jijiang.liu@intel.com> Date: Thu, 29 Oct 2015 15:15:36 +0100 Message-ID: From: David Marchand To: "Liu, Jijiang" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH 5/8] driver/virtio:enqueue vhost TX offload 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: Thu, 29 Oct 2015 14:15:38 -0000 On Wed, Oct 21, 2015 at 6:46 AM, Jijiang Liu wrote: > @@ -221,6 +277,11 @@ virtqueue_enqueue_xmit(struct virtqueue *txvq, struct > rte_mbuf *cookie) > dxp->cookie = (void *)cookie; > dxp->ndescs = needed; > > + if (vtpci_with_feature(txvq->hw, VIRTIO_NET_F_CSUM)) { > + if (virtqueue_enqueue_offload(txvq, cookie, idx, > head_size) < 0) > + return -EPERM; > + } > + > start_dp = txvq->vq_ring.desc; > start_dp[idx].addr = > txvq->virtio_net_hdr_mem + idx * head_size; > If the driver correctly reports negotiated offload capabilities (see my previous comment on patch 3), there is no need for the test on VIRTIO_NET_F_CSUM, because application is not supposed to ask for offloads on driver that do not support them. Same logic would apply to virtqueue_enqueue_offload() function. In the end, we could always call this function (or move the code here). -- David Marchand