From patchwork Sat Oct 20 08:32:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hyong Youb Kim (hyonkim)" X-Patchwork-Id: 47094 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 358634CA5; Sat, 20 Oct 2018 10:33:15 +0200 (CEST) Received: from rcdn-iport-8.cisco.com (rcdn-iport-8.cisco.com [173.37.86.79]) by dpdk.org (Postfix) with ESMTP id CCB234C6C for ; Sat, 20 Oct 2018 10:33:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=1909; q=dns/txt; s=iport; t=1540024393; x=1541233993; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=2U8EBI+ixLpHMPP/XmI7eoeq7YHA9/a5XFoMH3iio1Q=; b=AUmCAswnl9bZ1kPzlrHSofIEzRPFAzsednmrjKnNjWJ0P00uMrgviieI uAkLpt8H7Wc4R1MqWfGPGNT4fSXV27ZTsJFq1wdQUrl/KQ8ZPudq2PbuS +rYCZGbZnE45V/Rpzpj0+XhpZRW8RHJ3aC/Wccq+uCW0+Zg4nQjmLuPrD k=; X-IronPort-AV: E=Sophos;i="5.54,403,1534809600"; d="scan'208";a="467128688" Received: from rcdn-core-5.cisco.com ([173.37.93.156]) by rcdn-iport-8.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Oct 2018 08:33:11 +0000 Received: from cisco.com (savbu-usnic-a.cisco.com [10.193.184.48]) by rcdn-core-5.cisco.com (8.15.2/8.15.2) with ESMTP id w9K8XBBD024053; Sat, 20 Oct 2018 08:33:11 GMT Received: by cisco.com (Postfix, from userid 508933) id 98B1D20F2001; Sat, 20 Oct 2018 01:33:11 -0700 (PDT) From: Hyong Youb Kim To: Ferruh Yigit Cc: dev@dpdk.org, John Daley , Hyong Youb Kim Date: Sat, 20 Oct 2018 01:32:47 -0700 Message-Id: <20181020083249.8187-2-hyonkim@cisco.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20181020083249.8187-1-hyonkim@cisco.com> References: <20181020083249.8187-1-hyonkim@cisco.com> X-Outbound-SMTP-Client: 10.193.184.48, savbu-usnic-a.cisco.com X-Outbound-Node: rcdn-core-5.cisco.com Subject: [dpdk-dev] [PATCH 1/3] net/enic: fix supported packet 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" The handler for dev_supported_ptypes_get currently returns null when the vectorized Rx handler is used. It is also missing tunnel packet types. Add the missing packet types to the supported list, and return the right list for the vectorized Rx handler. Fixes: 8a6ff33d6d36 ("net/enic: add AVX2 based vectorized Rx handler") Fixes: 93fb21fdbe23 ("net/enic: enable overlay offload for VXLAN and GENEVE") Signed-off-by: Hyong Youb Kim Reviewed-by: John Daley --- drivers/net/enic/enic_ethdev.c | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c index 4d450fe0c..1a129f414 100644 --- a/drivers/net/enic/enic_ethdev.c +++ b/drivers/net/enic/enic_ethdev.c @@ -522,10 +522,34 @@ static const uint32_t *enicpmd_dev_supported_ptypes_get(struct rte_eth_dev *dev) RTE_PTYPE_L4_NONFRAG, RTE_PTYPE_UNKNOWN }; + static const uint32_t ptypes_overlay[] = { + RTE_PTYPE_L2_ETHER, + RTE_PTYPE_L2_ETHER_VLAN, + RTE_PTYPE_L3_IPV4_EXT_UNKNOWN, + RTE_PTYPE_L3_IPV6_EXT_UNKNOWN, + RTE_PTYPE_L4_TCP, + RTE_PTYPE_L4_UDP, + RTE_PTYPE_L4_FRAG, + RTE_PTYPE_L4_NONFRAG, + RTE_PTYPE_TUNNEL_GRENAT, + RTE_PTYPE_INNER_L2_ETHER, + RTE_PTYPE_INNER_L3_IPV4_EXT_UNKNOWN, + RTE_PTYPE_INNER_L3_IPV6_EXT_UNKNOWN, + RTE_PTYPE_INNER_L4_TCP, + RTE_PTYPE_INNER_L4_UDP, + RTE_PTYPE_INNER_L4_FRAG, + RTE_PTYPE_INNER_L4_NONFRAG, + RTE_PTYPE_UNKNOWN + }; - if (dev->rx_pkt_burst == enic_recv_pkts || - dev->rx_pkt_burst == enic_noscatter_recv_pkts) - return ptypes; + if (dev->rx_pkt_burst != enic_dummy_recv_pkts && + dev->rx_pkt_burst != NULL) { + struct enic *enic = pmd_priv(dev); + if (enic->overlay_offload) + return ptypes_overlay; + else + return ptypes; + } return NULL; } From patchwork Sat Oct 20 08:32:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hyong Youb Kim (hyonkim)" X-Patchwork-Id: 47095 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 81ADD4CC7; Sat, 20 Oct 2018 10:33:29 +0200 (CEST) Received: from alln-iport-1.cisco.com (alln-iport-1.cisco.com [173.37.142.88]) by dpdk.org (Postfix) with ESMTP id B396D4CA7 for ; Sat, 20 Oct 2018 10:33:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=2258; q=dns/txt; s=iport; t=1540024408; x=1541234008; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=F9DtR07CHVMSFrxNQZlVla7+KmyaxxyjaL290+fCmkc=; b=Ot6EmLoToxSzIL+Ulot4ZdFPKl+17mP3TUNtEPE688WfWHrZucmxvcAN gDCiHc0JS72Or7wqwT+2x+Fq3R3Ijmjf3/MPLJznz5vLa6FhJS5Uxb7SR uqWKip3dXaBwjb5PcL7k0c7IEEU/9NLusUG6U9zsosPBAqLZKNvfJUGTe A=; X-IronPort-AV: E=Sophos;i="5.54,403,1534809600"; d="scan'208";a="188880017" Received: from rcdn-core-1.cisco.com ([173.37.93.152]) by alln-iport-1.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Oct 2018 08:33:27 +0000 Received: from cisco.com (savbu-usnic-a.cisco.com [10.193.184.48]) by rcdn-core-1.cisco.com (8.15.2/8.15.2) with ESMTP id w9K8XR9f022622; Sat, 20 Oct 2018 08:33:27 GMT Received: by cisco.com (Postfix, from userid 508933) id 865B820F2001; Sat, 20 Oct 2018 01:33:27 -0700 (PDT) From: Hyong Youb Kim To: Ferruh Yigit Cc: dev@dpdk.org, John Daley , Hyong Youb Kim Date: Sat, 20 Oct 2018 01:32:48 -0700 Message-Id: <20181020083249.8187-3-hyonkim@cisco.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20181020083249.8187-1-hyonkim@cisco.com> References: <20181020083249.8187-1-hyonkim@cisco.com> X-Outbound-SMTP-Client: 10.193.184.48, savbu-usnic-a.cisco.com X-Outbound-Node: rcdn-core-1.cisco.com Subject: [dpdk-dev] [PATCH 2/3] net/enic: add missing Tx offload flags 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" The following commit has added a number of existing offload flags such as PKT_TX_IPV4 and PKT_TX_IPV6 to PKT_TX_OFFLOAD_MASK defined in rte_mbuf.h. That change breaks the enic driver's Tx prepare handler. commit ef28cfa73822 ("mbuf: fix Tx offload mask") The enic driver keeps the supported offload flags in a local variable (tx_offload_mask), which is strictly a subset of PKT_TX_OFFLOAD_MASK. This variable is then used to compute the unsupported flags (tx_offload_notsup_mask), and the Tx prepare handler (tx_pkt_prepare) uses it to reject packets with unsupported offload flags. As is, tx_offload_notsup_mask ends up containing flags like PKT_TX_IPV4 that are actually supported by the driver, which then breaks any application that uses checksum offloads and calls the Tx prepare handler. So add the flags to tx_offload_mask that the driver supports but were missing in PKT_TX_OFFLOAD_MASK. Signed-off-by: Hyong Youb Kim Reviewed-by: John Daley --- drivers/net/enic/enic_main.c | 6 ++---- drivers/net/enic/enic_res.c | 2 ++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c index b2581322d..e81c3f3b7 100644 --- a/drivers/net/enic/enic_main.c +++ b/drivers/net/enic/enic_main.c @@ -1710,11 +1710,9 @@ static int enic_dev_init(struct enic *enic) DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM | DEV_TX_OFFLOAD_GENEVE_TNL_TSO | DEV_TX_OFFLOAD_VXLAN_TNL_TSO; - /* - * Do not add PKT_TX_OUTER_{IPV4,IPV6} as they are not - * 'offload' flags (i.e. not part of PKT_TX_OFFLOAD_MASK). - */ enic->tx_offload_mask |= + PKT_TX_OUTER_IPV6 | + PKT_TX_OUTER_IPV4 | PKT_TX_OUTER_IP_CKSUM | PKT_TX_TUNNEL_MASK; enic->overlay_offload = true; diff --git a/drivers/net/enic/enic_res.c b/drivers/net/enic/enic_res.c index 28ae823f4..24b2844f3 100644 --- a/drivers/net/enic/enic_res.c +++ b/drivers/net/enic/enic_res.c @@ -202,6 +202,8 @@ int enic_get_vnic_config(struct enic *enic) DEV_RX_OFFLOAD_UDP_CKSUM | DEV_RX_OFFLOAD_TCP_CKSUM; enic->tx_offload_mask = + PKT_TX_IPV6 | + PKT_TX_IPV4 | PKT_TX_VLAN | PKT_TX_IP_CKSUM | PKT_TX_L4_MASK | From patchwork Sat Oct 20 08:32:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hyong Youb Kim (hyonkim)" X-Patchwork-Id: 47096 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 82EAB4F94; Sat, 20 Oct 2018 10:33:37 +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 53DC74F91 for ; Sat, 20 Oct 2018 10:33:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=1246; q=dns/txt; s=iport; t=1540024416; x=1541234016; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=v2H5nh+UwFGvG2nGQa6YmZJ5QYmiPyLqWGmImjAVghw=; b=d0Dr5jDoCZPBUaGlaymBtUiW9e6qdPTZ8H6GpAKttDmrvLwWSbH1YdCT JpqLCwngznbD/k741iotPyKPrx2iMGwcQkngreJCyu0Ql4/wMOntRrVhb agoWfR9TJkH1Y5gatwzEYrIqykX3xCioAMYH6acsLMIoGcIPa7QV5wEyp o=; X-IronPort-AV: E=Sophos;i="5.54,403,1534809600"; d="scan'208";a="189133034" Received: from alln-core-2.cisco.com ([173.36.13.135]) by alln-iport-3.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Oct 2018 08:33:35 +0000 Received: from cisco.com (savbu-usnic-a.cisco.com [10.193.184.48]) by alln-core-2.cisco.com (8.15.2/8.15.2) with ESMTP id w9K8XZM2012818; Sat, 20 Oct 2018 08:33:35 GMT Received: by cisco.com (Postfix, from userid 508933) id 21D7C20F2001; Sat, 20 Oct 2018 01:33:35 -0700 (PDT) From: Hyong Youb Kim To: Ferruh Yigit Cc: dev@dpdk.org, John Daley , Hyong Youb Kim Date: Sat, 20 Oct 2018 01:32:49 -0700 Message-Id: <20181020083249.8187-4-hyonkim@cisco.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20181020083249.8187-1-hyonkim@cisco.com> References: <20181020083249.8187-1-hyonkim@cisco.com> X-Outbound-SMTP-Client: 10.193.184.48, savbu-usnic-a.cisco.com X-Outbound-Node: alln-core-2.cisco.com Subject: [dpdk-dev] [PATCH 3/3] doc: update release notes for the enic driver 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" Fixes: 8a6ff33d6d36 ("net/enic: add AVX2 based vectorized Rx handler") Fixes: 86df6c4e2fce ("net/enic: support flow counter action") Fixes: 70401fd7784d ("net/enic: add VLAN and csum offloads to simple Tx handler") Fixes: c0aae00d7da0 ("net/enic: enable IOVA mode") Signed-off-by: Hyong Youb Kim Reviewed-by: John Daley --- doc/guides/rel_notes/release_18_11.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/guides/rel_notes/release_18_11.rst b/doc/guides/rel_notes/release_18_11.rst index a6cfce4fd..ea55736a2 100644 --- a/doc/guides/rel_notes/release_18_11.rst +++ b/doc/guides/rel_notes/release_18_11.rst @@ -142,6 +142,13 @@ New Features * Support for runtime Rx and Tx queues setup. * Support multicast MAC address set. +* **Updated the enic driver.** + + * Added AVX2-based vectorized Rx handler. + * Added VLAN and checksum offloads to the simple Tx handler. + * Added the count flow action. + * Enabled the virtual address IOVA mode. + * **Added a devarg to use PCAP interface physical MAC address.** A new devarg ``phy_mac`` was introduced to allow users to use physical MAC address of the selected PCAP interface.