From patchwork Fri Oct 30 13:00:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jijiang Liu X-Patchwork-Id: 8384 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 59A649192; Fri, 30 Oct 2015 14:01:03 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 94E848E8B for ; Fri, 30 Oct 2015 14:01:00 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 30 Oct 2015 06:00:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,218,1444719600"; d="scan'208";a="823125028" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by fmsmga001.fm.intel.com with ESMTP; 30 Oct 2015 06:00:49 -0700 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id t9UD0lop023059; Fri, 30 Oct 2015 21:00:47 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id t9UD0i97013813; Fri, 30 Oct 2015 21:00:46 +0800 Received: (from jijiangl@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t9UD0iYo013809; Fri, 30 Oct 2015 21:00:44 +0800 From: Jijiang Liu To: dev@dpdk.org Date: Fri, 30 Oct 2015 21:00:29 +0800 Message-Id: <1446210034-13750-5-git-send-email-jijiang.liu@intel.com> X-Mailer: git-send-email 1.7.12.2 In-Reply-To: <1446210034-13750-1-git-send-email-jijiang.liu@intel.com> References: <1446210034-13750-1-git-send-email-jijiang.liu@intel.com> Subject: [dpdk-dev] [PATCH v2 4/9] driver/virtio:fill virtio device info for 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Fill virtio device info for TX offload. Signed-off-by: Jijiang Liu --- drivers/net/virtio/virtio_ethdev.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c index cb5dfee..b831c02 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -1559,6 +1559,16 @@ virtio_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) dev_info->default_txconf = (struct rte_eth_txconf) { .txq_flags = ETH_TXQ_FLAGS_NOOFFLOADS }; + + if (hw->guest_features & (1u << VIRTIO_NET_F_CSUM)) + dev_info->tx_offload_capa = DEV_TX_OFFLOAD_IPV4_CKSUM | + DEV_TX_OFFLOAD_UDP_CKSUM | + DEV_TX_OFFLOAD_TCP_CKSUM | + DEV_TX_OFFLOAD_SCTP_CKSUM; + + if ((hw->guest_features & (1u << VIRTIO_NET_F_HOST_TSO4)) || + (hw->guest_features & (1u << VIRTIO_NET_F_HOST_TSO6))) + dev_info->tx_offload_capa |= DEV_TX_OFFLOAD_TCP_TSO; } /*