From patchwork Wed Jan 10 09:17:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "John Daley (johndale)" X-Patchwork-Id: 33391 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A2A411B1F9; Wed, 10 Jan 2018 10:17:57 +0100 (CET) Received: from rcdn-iport-5.cisco.com (rcdn-iport-5.cisco.com [173.37.86.76]) by dpdk.org (Postfix) with ESMTP id 7CAE61B1E2 for ; Wed, 10 Jan 2018 10:17:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=3234; q=dns/txt; s=iport; t=1515575866; x=1516785466; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=QBoGReIrVs4mjmT/kzEIqFVZUJhOq5gF/dDX5CDb0fc=; b=SXPdeRbBa5Vd9oAQUhiDxM1/879os3PF7cS1Bx0iaOIUO7/9ieWQOXGq LyPkobUI2CLtLM8maI5j4oT7VZ6uCS2MiCFroFTK5Ar3PqlHtgq2HH926 d58xUZ99SnEW2j1GEbnWgxjQb0sg7EDDr7uzp3iXYIa3SCbyyNcaTnqQ8 c=; X-IronPort-AV: E=Sophos;i="5.46,339,1511827200"; d="scan'208";a="123493818" Received: from alln-core-2.cisco.com ([173.36.13.135]) by rcdn-iport-5.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Jan 2018 09:17:45 +0000 Received: from cisco.com (savbu-usnic-a.cisco.com [10.193.184.48]) by alln-core-2.cisco.com (8.14.5/8.14.5) with ESMTP id w0A9HjPi014951; Wed, 10 Jan 2018 09:17:45 GMT Received: by cisco.com (Postfix, from userid 392789) id 817F920F2001; Wed, 10 Jan 2018 01:17:45 -0800 (PST) From: John Daley To: ferruh.yigit@intel.com Cc: dev@dpdk.org, Hyong Youb Kim Date: Wed, 10 Jan 2018 01:17:03 -0800 Message-Id: <20180110091712.32198-3-johndale@cisco.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180110091712.32198-1-johndale@cisco.com> References: <20180110091712.32198-1-johndale@cisco.com> Subject: [dpdk-dev] [PATCH] net/enic: use the new ethdev offloads API X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Hyong Youb Kim The following commits deprecate the use of the offload bit fields (e.g. header_split) in rte_eth_rxmode and txq_flags in rte_eth_txconf. commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API") commit cba7f53b717d ("ethdev: introduce Tx queue offloads API") For enic, the required changes are mechanical. Use the new 'offloads' field in rxmode instead of the bit fields. And, no changes required with respect to txq_flags, as enic does not use it at all. Per-queue RX offload capabilities are not set, as all offloads are per-port at the moment. Signed-off-by: Hyong Youb Kim Reviewed-by: John Daley --- drivers/net/enic/enic_ethdev.c | 9 ++++++--- drivers/net/enic/enic_main.c | 6 ++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c index 669dbf336..59834f3c8 100644 --- a/drivers/net/enic/enic_ethdev.c +++ b/drivers/net/enic/enic_ethdev.c @@ -370,7 +370,8 @@ static int enicpmd_vlan_offload_set(struct rte_eth_dev *eth_dev, int mask) ENICPMD_FUNC_TRACE(); if (mask & ETH_VLAN_STRIP_MASK) { - if (eth_dev->data->dev_conf.rxmode.hw_vlan_strip) + if (eth_dev->data->dev_conf.rxmode.offloads & + DEV_RX_OFFLOAD_VLAN_STRIP) enic->ig_vlan_strip_en = 1; else enic->ig_vlan_strip_en = 0; @@ -407,13 +408,15 @@ static int enicpmd_dev_configure(struct rte_eth_dev *eth_dev) } if (eth_dev->data->dev_conf.rxmode.split_hdr_size && - eth_dev->data->dev_conf.rxmode.header_split) { + (eth_dev->data->dev_conf.rxmode.offloads & + DEV_RX_OFFLOAD_HEADER_SPLIT)) { /* Enable header-data-split */ enic_set_hdr_split_size(enic, eth_dev->data->dev_conf.rxmode.split_hdr_size); } - enic->hw_ip_checksum = eth_dev->data->dev_conf.rxmode.hw_ip_checksum; + enic->hw_ip_checksum = !!(eth_dev->data->dev_conf.rxmode.offloads & + DEV_RX_OFFLOAD_CHECKSUM); ret = enicpmd_vlan_offload_set(eth_dev, ETH_VLAN_STRIP_MASK); return ret; diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c index 8af0ccd3c..bd85f344f 100644 --- a/drivers/net/enic/enic_main.c +++ b/drivers/net/enic/enic_main.c @@ -634,7 +634,8 @@ int enic_alloc_rq(struct enic *enic, uint16_t queue_idx, mbuf_size = (uint16_t)(rte_pktmbuf_data_room_size(mp) - RTE_PKTMBUF_HEADROOM); - if (enic->rte_dev->data->dev_conf.rxmode.enable_scatter) { + if (enic->rte_dev->data->dev_conf.rxmode.offloads & + DEV_RX_OFFLOAD_SCATTER) { dev_info(enic, "Rq %u Scatter rx mode enabled\n", queue_idx); /* ceil((mtu + ETHER_HDR_LEN + 4)/mbuf_size) */ mbufs_per_pkt = ((mtu + ETHER_HDR_LEN + 4) + @@ -1208,7 +1209,8 @@ int enic_set_mtu(struct enic *enic, uint16_t new_mtu) /* The easy case is when scatter is disabled. However if the MTU * becomes greater than the mbuf data size, packet drops will ensue. */ - if (!enic->rte_dev->data->dev_conf.rxmode.enable_scatter) { + if (!(enic->rte_dev->data->dev_conf.rxmode.offloads & + DEV_RX_OFFLOAD_SCATTER)) { eth_dev->data->mtu = new_mtu; goto set_mtu_done; }