From patchwork Wed Sep 26 02:54:17 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: 45344 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 68D721B0FA; Wed, 26 Sep 2018 04:54:37 +0200 (CEST) Received: from alln-iport-5.cisco.com (alln-iport-5.cisco.com [173.37.142.92]) by dpdk.org (Postfix) with ESMTP id 3CD327CD2 for ; Wed, 26 Sep 2018 04:54:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=1912; q=dns/txt; s=iport; t=1537930476; x=1539140076; h=from:to:cc:subject:date:message-id; bh=wLN1Md5lbv0S66EOnwFLtba97PTRE0uS0cuBbUhb1M8=; b=Ay7n2n/xjkPWxp3/24usjjiE1qvT5/01V4wCjL1Y4Lgla3YvmD7mhuQk 3C4lwbjTl4pfxf/fu7D2av1X0vVRJZkQf787HwcNGBFgqshSUcRJzVsKo hWalpmzeWG73QPXUDPlQ3wBCjAbTtAhM4DowVfyGVekzx+Nu+Y5Yfmrsw M=; X-IronPort-AV: E=Sophos;i="5.54,304,1534809600"; d="scan'208";a="176165187" Received: from rcdn-core-4.cisco.com ([173.37.93.155]) by alln-iport-5.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Sep 2018 02:54:35 +0000 Received: from cisco.com (savbu-usnic-a.cisco.com [10.193.184.48]) by rcdn-core-4.cisco.com (8.15.2/8.15.2) with ESMTP id w8Q2sYtp005340; Wed, 26 Sep 2018 02:54:35 GMT Received: by cisco.com (Postfix, from userid 392789) id C6D3F20F2001; Tue, 25 Sep 2018 19:54:34 -0700 (PDT) From: John Daley To: ferruh.yigit@intel.com Cc: dev@dpdk.org, Hyong Youb Kim Date: Tue, 25 Sep 2018 19:54:17 -0700 Message-Id: <20180926025422.21912-1-johndale@cisco.com> X-Mailer: git-send-email 2.16.2 X-Outbound-SMTP-Client: 10.193.184.48, savbu-usnic-a.cisco.com X-Outbound-Node: rcdn-core-4.cisco.com Subject: [dpdk-dev] [PATCH 1/6] net/enic: do not use non-standard integer types 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 Bugzilla ID: 39 Fixes: 9913fbb91df0 ("enic/base: common code") Fixes: 322b355f2183 ("net/enic/base: bring NIC interface functions up to date") Signed-off-by: Hyong Youb Kim Reviewed-by: John Daley --- drivers/net/enic/base/vnic_devcmd.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/net/enic/base/vnic_devcmd.h b/drivers/net/enic/base/vnic_devcmd.h index a22d8a76c..fffe307e0 100644 --- a/drivers/net/enic/base/vnic_devcmd.h +++ b/drivers/net/enic/base/vnic_devcmd.h @@ -875,7 +875,7 @@ struct filter_action_v2 { u32 rq_idx; u32 flags; /* use FILTER_ACTION_XXX_FLAG defines */ u16 filter_id; - u_int8_t reserved[32]; /* for future expansion */ + uint8_t reserved[32]; /* for future expansion */ } __attribute__((packed)); /* Specifies the filter type. */ @@ -941,9 +941,9 @@ enum { }; struct filter_tlv { - u_int32_t type; - u_int32_t length; - u_int32_t val[0]; + uint32_t type; + uint32_t length; + uint32_t val[0]; }; /* Data for CMD_ADD_FILTER is 2 TLV and filter + action structs */ @@ -957,10 +957,10 @@ struct filter_tlv { * drivers should use this instead of "sizeof (struct filter_v2)" when * computing length for TLV. */ -static inline u_int32_t +static inline uint32_t vnic_filter_size(struct filter_v2 *fp) { - u_int32_t size; + uint32_t size; switch (fp->type) { case FILTER_USNIC_ID: @@ -999,10 +999,10 @@ enum { * drivers should use this instead of "sizeof (struct filter_action_v2)" * when computing length for TLV. */ -static inline u_int32_t +static inline uint32_t vnic_action_size(struct filter_action_v2 *fap) { - u_int32_t size; + uint32_t size; switch (fap->type) { case FILTER_ACTION_RQ_STEERING: From patchwork Wed Sep 26 02:54:18 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: 45345 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 0A93D1B152; Wed, 26 Sep 2018 04:54:56 +0200 (CEST) Received: from rcdn-iport-1.cisco.com (rcdn-iport-1.cisco.com [173.37.86.72]) by dpdk.org (Postfix) with ESMTP id 202331B0F9 for ; Wed, 26 Sep 2018 04:54:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=1008; q=dns/txt; s=iport; t=1537930494; x=1539140094; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=Zj3mI1FmL6yLe/zHNED1Wxr9R/+gSkdfKgH3BPXz+AU=; b=Vmrne4flaClYjwOZmP0F1s6+LkC0NLNEbViR48UExiyMFEYmV0dBIu0j 6oQLjY0j73lU7WwWWjDvrpXFenkZ4Uq+O1VjFp63OB/8T362fDCOlPWll +NdTJFmAVvTu0vFMhgr1l0EtsVuh9ORzRI4PyfVuxkSbPaNOSIB4TwpPU Q=; X-IronPort-AV: E=Sophos;i="5.54,304,1534809600"; d="scan'208";a="457341899" Received: from rcdn-core-11.cisco.com ([173.37.93.147]) by rcdn-iport-1.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Sep 2018 02:54:53 +0000 Received: from cisco.com (savbu-usnic-a.cisco.com [10.193.184.48]) by rcdn-core-11.cisco.com (8.15.2/8.15.2) with ESMTP id w8Q2sq6L030410; Wed, 26 Sep 2018 02:54:53 GMT Received: by cisco.com (Postfix, from userid 392789) id D88C020F2001; Tue, 25 Sep 2018 19:54:52 -0700 (PDT) From: John Daley To: ferruh.yigit@intel.com Cc: dev@dpdk.org, Hyong Youb Kim Date: Tue, 25 Sep 2018 19:54:18 -0700 Message-Id: <20180926025422.21912-2-johndale@cisco.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180926025422.21912-1-johndale@cisco.com> References: <20180926025422.21912-1-johndale@cisco.com> X-Outbound-SMTP-Client: 10.193.184.48, savbu-usnic-a.cisco.com X-Outbound-Node: rcdn-core-11.cisco.com Subject: [dpdk-dev] [PATCH 2/6] net/enic: enable IOVA mode 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 Cisco VIC models support RTE_IOVA_VA, so enable it. This change allows the driver to work properly when --no-huge is used, in combination with vfio and iommu. Signed-off-by: Hyong Youb Kim Reviewed-by: John Daley --- drivers/net/enic/enic_ethdev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c index b3d57771f..65333c47a 100644 --- a/drivers/net/enic/enic_ethdev.c +++ b/drivers/net/enic/enic_ethdev.c @@ -1044,7 +1044,8 @@ static int eth_enic_pci_remove(struct rte_pci_device *pci_dev) static struct rte_pci_driver rte_enic_pmd = { .id_table = pci_id_enic_map, - .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC, + .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC | + RTE_PCI_DRV_IOVA_AS_VA, .probe = eth_enic_pci_probe, .remove = eth_enic_pci_remove, }; From patchwork Wed Sep 26 02:54:19 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: 45346 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 0DFF81B156; Wed, 26 Sep 2018 04:55:16 +0200 (CEST) Received: from alln-iport-3.cisco.com (alln-iport-3.cisco.com [173.37.142.90]) by dpdk.org (Postfix) with ESMTP id 86E7C7CD2; Wed, 26 Sep 2018 04:55:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=1154; q=dns/txt; s=iport; t=1537930514; x=1539140114; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=l4CwjRm1antfpYIwyFDbYeX3J3Gb7AraLI5ezRMS3fU=; b=REIZotFkzhSEaXLv2694Sl/Cy4EcWe2yApVyEOzpplekSFG9dXiXikll t/MiwMrD8zWbAKtbhm6L4OF+uX5XeHtiJC1ck7Q0OBRsiEl6jEeCZFGKr JO8KtiJnGK3ae9NtI25G8/Jzp6eJuRzlNU0EtwdcdChh7NN02Abm8G6tj o=; X-IronPort-AV: E=Sophos;i="5.54,304,1534809600"; d="scan'208";a="177008716" Received: from alln-core-8.cisco.com ([173.36.13.141]) by alln-iport-3.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Sep 2018 02:55:13 +0000 Received: from cisco.com (savbu-usnic-a.cisco.com [10.193.184.48]) by alln-core-8.cisco.com (8.15.2/8.15.2) with ESMTP id w8Q2tDhr004046; Wed, 26 Sep 2018 02:55:13 GMT Received: by cisco.com (Postfix, from userid 392789) id 9165E20F2001; Tue, 25 Sep 2018 19:55:13 -0700 (PDT) From: John Daley To: ferruh.yigit@intel.com Cc: dev@dpdk.org, Hyong Youb Kim , stable@dpdk.org Date: Tue, 25 Sep 2018 19:54:19 -0700 Message-Id: <20180926025422.21912-3-johndale@cisco.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180926025422.21912-1-johndale@cisco.com> References: <20180926025422.21912-1-johndale@cisco.com> X-Outbound-SMTP-Client: 10.193.184.48, savbu-usnic-a.cisco.com X-Outbound-Node: alln-core-8.cisco.com Subject: [dpdk-dev] [PATCH 3/6] net/enic: set Rx VLAN offload flag for non-stripped packets 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 NIC indicates VLAN TCI to the driver even when VLAN stripping is disabled. The driver sets mbuf's vlan_tci but not PKT_RX_VLAN. Set PKT_RX_VLAN to indicate that vlan_tci is valid. Fixes: c6f455507411 ("net/enic: add ethernet VLAN packet type") Cc: stable@dpdk.org Signed-off-by: Hyong Youb Kim Reviewed-by: John Daley --- drivers/net/enic/enic_rxtx.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/enic/enic_rxtx.c b/drivers/net/enic/enic_rxtx.c index 7129e1217..0eb113d75 100644 --- a/drivers/net/enic/enic_rxtx.c +++ b/drivers/net/enic/enic_rxtx.c @@ -233,10 +233,12 @@ enic_cq_rx_to_pkt_flags(struct cq_desc *cqd, struct rte_mbuf *mbuf) pkt_flags |= PKT_RX_VLAN | PKT_RX_VLAN_STRIPPED; mbuf->packet_type |= RTE_PTYPE_L2_ETHER; } else { - if (vlan_tci != 0) + if (vlan_tci != 0) { + pkt_flags |= PKT_RX_VLAN; mbuf->packet_type |= RTE_PTYPE_L2_ETHER_VLAN; - else + } else { mbuf->packet_type |= RTE_PTYPE_L2_ETHER; + } } mbuf->vlan_tci = vlan_tci; From patchwork Wed Sep 26 02:54:20 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: 45347 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 5A8701B0FA; Wed, 26 Sep 2018 04:55:49 +0200 (CEST) Received: from alln-iport-8.cisco.com (alln-iport-8.cisco.com [173.37.142.95]) by dpdk.org (Postfix) with ESMTP id 69F941B0F9 for ; Wed, 26 Sep 2018 04:55:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=1716; q=dns/txt; s=iport; t=1537930547; x=1539140147; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=sP8pq53vP74pOyUcwKS+vYNesMVhkfr5PhRfr18CKfg=; b=R2C+lLetVb90UKRUCBfKtfNTxtIc7CrveHpWgIsOaxnJAnDFzWyjy7b/ J5InrITjh78Wmz9Nf12DH2lukDtOQvs2gDWbOvKADRWt12oDCC9yDFUCl M0RxEG5tb77kHSg+6iekap1diVx80VcNwu+49551Cs2CJZGlP3cpu3Gd8 0=; X-IronPort-AV: E=Sophos;i="5.54,304,1534809600"; d="scan'208";a="176296361" Received: from alln-core-7.cisco.com ([173.36.13.140]) by alln-iport-8.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Sep 2018 02:55:46 +0000 Received: from cisco.com (savbu-usnic-a.cisco.com [10.193.184.48]) by alln-core-7.cisco.com (8.15.2/8.15.2) with ESMTP id w8Q2tk6S005818; Wed, 26 Sep 2018 02:55:46 GMT Received: by cisco.com (Postfix, from userid 392789) id 46B7A20F2001; Tue, 25 Sep 2018 19:55:46 -0700 (PDT) From: John Daley To: ferruh.yigit@intel.com Cc: dev@dpdk.org, Hyong Youb Kim Date: Tue, 25 Sep 2018 19:54:20 -0700 Message-Id: <20180926025422.21912-4-johndale@cisco.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180926025422.21912-1-johndale@cisco.com> References: <20180926025422.21912-1-johndale@cisco.com> X-Outbound-SMTP-Client: 10.193.184.48, savbu-usnic-a.cisco.com X-Outbound-Node: alln-core-7.cisco.com Subject: [dpdk-dev] [PATCH 4/6] net/enic: do not use deprecated Tx VLAN packet flag 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 Replace PKT_TX_VLAN_PKT (deprecated) with PKT_TX_VLAN. Signed-off-by: Hyong Youb Kim Reviewed-by: John Daley --- drivers/net/enic/enic_res.c | 2 +- drivers/net/enic/enic_rxtx.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/enic/enic_res.c b/drivers/net/enic/enic_res.c index abe004b24..84486cace 100644 --- a/drivers/net/enic/enic_res.c +++ b/drivers/net/enic/enic_res.c @@ -200,7 +200,7 @@ int enic_get_vnic_config(struct enic *enic) DEV_RX_OFFLOAD_UDP_CKSUM | DEV_RX_OFFLOAD_TCP_CKSUM; enic->tx_offload_mask = - PKT_TX_VLAN_PKT | + PKT_TX_VLAN | PKT_TX_IP_CKSUM | PKT_TX_L4_MASK | PKT_TX_TCP_SEG; diff --git a/drivers/net/enic/enic_rxtx.c b/drivers/net/enic/enic_rxtx.c index 0eb113d75..8d57c418f 100644 --- a/drivers/net/enic/enic_rxtx.c +++ b/drivers/net/enic/enic_rxtx.c @@ -709,7 +709,7 @@ uint16_t enic_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, wq_desc_avail = vnic_wq_desc_avail(wq); head_idx = wq->head_idx; desc_count = wq->ring.desc_count; - ol_flags_mask = PKT_TX_VLAN_PKT | PKT_TX_IP_CKSUM | PKT_TX_L4_MASK; + ol_flags_mask = PKT_TX_VLAN | PKT_TX_IP_CKSUM | PKT_TX_L4_MASK; tx_oversized = &enic->soft_stats.tx_oversized; nb_pkts = RTE_MIN(nb_pkts, ENIC_TX_XMIT_MAX); @@ -737,7 +737,7 @@ uint16_t enic_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, mss = 0; vlan_id = tx_pkt->vlan_tci; - vlan_tag_insert = !!(ol_flags & PKT_TX_VLAN_PKT); + vlan_tag_insert = !!(ol_flags & PKT_TX_VLAN); bus_addr = (dma_addr_t) (tx_pkt->buf_iova + tx_pkt->data_off); From patchwork Wed Sep 26 02:54:21 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: 45348 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 6A1311B0F9; Wed, 26 Sep 2018 04:56:55 +0200 (CEST) Received: from rcdn-iport-1.cisco.com (rcdn-iport-1.cisco.com [173.37.86.72]) by dpdk.org (Postfix) with ESMTP id 4E3337CBC for ; Wed, 26 Sep 2018 04:56:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=3073; q=dns/txt; s=iport; t=1537930613; x=1539140213; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=qt5chTvLKeoz9Jf7B/k5hUvrDEhoPY5p0W1duoaaV2A=; b=Be8PSy3yLFZM7rooDzgoIL0L9ncZBbsSRffQNY2qI3oTkjawVlkMo4nx A0IX23WInReyXBL8FkslTnOkU3eM1Ok0fto7BjSKqZ1XPeFirGGG8vjKJ Bd7q0Zhoe/UYUTUM7yFjYGZ5kfC3Q9AurOeoTBZmN3YDJDu5pqOGP43u4 E=; X-IronPort-AV: E=Sophos;i="5.54,304,1534809600"; d="scan'208";a="457342278" Received: from rcdn-core-9.cisco.com ([173.37.93.145]) by rcdn-iport-1.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Sep 2018 02:56:52 +0000 Received: from cisco.com (savbu-usnic-a.cisco.com [10.193.184.48]) by rcdn-core-9.cisco.com (8.15.2/8.15.2) with ESMTP id w8Q2uqSH015728; Wed, 26 Sep 2018 02:56:52 GMT Received: by cisco.com (Postfix, from userid 392789) id 140C020F2001; Tue, 25 Sep 2018 19:56:52 -0700 (PDT) From: John Daley To: ferruh.yigit@intel.com Cc: dev@dpdk.org, Hyong Youb Kim Date: Tue, 25 Sep 2018 19:54:21 -0700 Message-Id: <20180926025422.21912-5-johndale@cisco.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180926025422.21912-1-johndale@cisco.com> References: <20180926025422.21912-1-johndale@cisco.com> X-Outbound-SMTP-Client: 10.193.184.48, savbu-usnic-a.cisco.com X-Outbound-Node: rcdn-core-9.cisco.com Subject: [dpdk-dev] [PATCH 5/6] net/enic: add VLAN and csum offloads to simple Tx handler 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 Currently the simple Tx handler supports no offloads, which makes it usable only for a small number of benchmarks. Add vlan and checksum offloads to the handler, as cycles/packet increases only by about 3 cycles, and applications commonly use those offloads. Signed-off-by: Hyong Youb Kim Reviewed-by: John Daley --- drivers/net/enic/enic_main.c | 14 +++++++++++--- drivers/net/enic/enic_rxtx.c | 21 +++++++++++++++++++++ 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c index fd940c583..03c5ef741 100644 --- a/drivers/net/enic/enic_main.c +++ b/drivers/net/enic/enic_main.c @@ -534,6 +534,7 @@ int enic_enable(struct enic *enic) unsigned int index; int err; struct rte_eth_dev *eth_dev = enic->rte_dev; + uint64_t simple_tx_offloads; eth_dev->data->dev_link.link_speed = vnic_dev_port_speed(enic->vdev); eth_dev->data->dev_link.link_duplex = ETH_LINK_FULL_DUPLEX; @@ -572,10 +573,17 @@ int enic_enable(struct enic *enic) } /* - * Use the simple TX handler if possible. All offloads must be - * disabled. + * Use the simple TX handler if possible. Only checksum offloads + * and vlan insertion are supported. */ - if (eth_dev->data->dev_conf.txmode.offloads == 0) { + simple_tx_offloads = enic->tx_offload_capa & + (DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM | + DEV_TX_OFFLOAD_VLAN_INSERT | + DEV_TX_OFFLOAD_IPV4_CKSUM | + DEV_TX_OFFLOAD_UDP_CKSUM | + DEV_TX_OFFLOAD_TCP_CKSUM); + if ((eth_dev->data->dev_conf.txmode.offloads & + ~simple_tx_offloads) == 0) { PMD_INIT_LOG(DEBUG, " use the simple tx handler"); eth_dev->tx_pkt_burst = &enic_simple_xmit_pkts; for (index = 0; index < enic->wq_count; index++) diff --git a/drivers/net/enic/enic_rxtx.c b/drivers/net/enic/enic_rxtx.c index 8d57c418f..276a2e559 100644 --- a/drivers/net/enic/enic_rxtx.c +++ b/drivers/net/enic/enic_rxtx.c @@ -842,12 +842,33 @@ static void enqueue_simple_pkts(struct rte_mbuf **pkts, struct enic *enic) { struct rte_mbuf *p; + uint16_t mss; while (n) { n--; p = *pkts++; desc->address = p->buf_iova + p->data_off; desc->length = p->pkt_len; + /* VLAN insert */ + desc->vlan_tag = p->vlan_tci; + desc->header_length_flags &= + ((1 << WQ_ENET_FLAGS_EOP_SHIFT) | + (1 << WQ_ENET_FLAGS_CQ_ENTRY_SHIFT)); + if (p->ol_flags & PKT_TX_VLAN) { + desc->header_length_flags |= + 1 << WQ_ENET_FLAGS_VLAN_TAG_INSERT_SHIFT; + } + /* + * Checksum offload. We use WQ_ENET_OFFLOAD_MODE_CSUM, which + * is 0, so no need to set offload_mode. + */ + mss = 0; + if (p->ol_flags & PKT_TX_IP_CKSUM) + mss |= ENIC_CALC_IP_CKSUM << WQ_ENET_MSS_SHIFT; + if (p->ol_flags & PKT_TX_L4_MASK) + mss |= ENIC_CALC_TCP_UDP_CKSUM << WQ_ENET_MSS_SHIFT; + desc->mss_loopback = mss; + /* * The app should not send oversized * packets. tx_pkt_prepare includes a check as From patchwork Wed Sep 26 02:54:22 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: 45349 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 5572F1B183; Wed, 26 Sep 2018 04:57:33 +0200 (CEST) Received: from alln-iport-6.cisco.com (alln-iport-6.cisco.com [173.37.142.93]) by dpdk.org (Postfix) with ESMTP id 7D5E57CD2; Wed, 26 Sep 2018 04:57:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=1573; q=dns/txt; s=iport; t=1537930651; x=1539140251; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=ci903krzIO5Rp7Yyn5BBsTAXoqcuxJnJru34n9UWnJE=; b=S5lW5Imbjwhiz2uKqY5Qwx26wh6i6owWZOJ0z+es8M20HMu7W7wfJStP fNSc0lG2W+QCreUXiWfujn/R1uYw1uMucbbqSO76b70luhYWzWupssuaU qL4O5mL3Yu52UBGClcoa+cPPO8ui7wVjMTM2j1jyw7CE4hWGNd4TGtrHX s=; X-IronPort-AV: E=Sophos;i="5.54,304,1534809600"; d="scan'208";a="176148429" Received: from rcdn-core-6.cisco.com ([173.37.93.157]) by alln-iport-6.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Sep 2018 02:57:30 +0000 Received: from cisco.com (savbu-usnic-a.cisco.com [10.193.184.48]) by rcdn-core-6.cisco.com (8.15.2/8.15.2) with ESMTP id w8Q2vUaZ010009; Wed, 26 Sep 2018 02:57:30 GMT Received: by cisco.com (Postfix, from userid 392789) id 44B8720F2001; Tue, 25 Sep 2018 19:57:30 -0700 (PDT) From: John Daley To: ferruh.yigit@intel.com Cc: dev@dpdk.org, Hyong Youb Kim , stable@dpdk.org Date: Tue, 25 Sep 2018 19:54:22 -0700 Message-Id: <20180926025422.21912-6-johndale@cisco.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180926025422.21912-1-johndale@cisco.com> References: <20180926025422.21912-1-johndale@cisco.com> X-Outbound-SMTP-Client: 10.193.184.48, savbu-usnic-a.cisco.com X-Outbound-Node: rcdn-core-6.cisco.com Subject: [dpdk-dev] [PATCH 6/6] net/enic: explicitly disable overlay offload 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 Reopening vNIC does not automatically disable overlay offload. If it is previously enabled, it remains enabled even when the user restarts DPDK and requests overlay offload to be disabled via devarg disable-overlay=1. So explicitly disable overlay offload when requested. Fixes: 93fb21fdbe23 ("net/enic: enable overlay offload for VXLAN and GENEVE") Cc: stable@dpdk.org Signed-off-by: Hyong Youb Kim Reviewed-by: John Daley --- drivers/net/enic/enic_main.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c index 03c5ef741..af29f9d90 100644 --- a/drivers/net/enic/enic_main.c +++ b/drivers/net/enic/enic_main.c @@ -1652,6 +1652,19 @@ static int enic_dev_init(struct enic *enic) vnic_dev_notify_set(enic->vdev, -1); /* No Intr for notify */ enic->overlay_offload = false; + if (enic->disable_overlay && enic->vxlan) { + /* + * Explicitly disable overlay offload as the setting is + * sticky, and resetting vNIC does not disable it. + */ + if (vnic_dev_overlay_offload_ctrl(enic->vdev, + OVERLAY_FEATURE_VXLAN, + OVERLAY_OFFLOAD_DISABLE)) { + dev_err(enic, "failed to disable overlay offload\n"); + } else { + dev_info(enic, "Overlay offload is disabled\n"); + } + } if (!enic->disable_overlay && enic->vxlan && /* 'VXLAN feature' enables VXLAN, NVGRE, and GENEVE. */ vnic_dev_overlay_offload_ctrl(enic->vdev,