From owner-svn-src-head@freebsd.org Thu May 30 13:12:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3EB6715C1E26; Thu, 30 May 2019 13:12:15 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D45FE885C3; Thu, 30 May 2019 13:12:14 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ADDD819906; Thu, 30 May 2019 13:12:14 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4UDCEFE060782; Thu, 30 May 2019 13:12:14 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4UDCEE5060781; Thu, 30 May 2019 13:12:14 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201905301312.x4UDCEE5060781@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 30 May 2019 13:12:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348389 - head/sys/dev/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/ena X-SVN-Commit-Revision: 348389 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D45FE885C3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2019 13:12:15 -0000 Author: mw Date: Thu May 30 13:12:14 2019 New Revision: 348389 URL: https://svnweb.freebsd.org/changeset/base/348389 Log: Remove RSS support in ENA Receive Side Scaling is optional feature that could be enabled in kernel configuration by defining flag RSS. Kernel uses hash to store and find protocol control block which is stored in hash tables. Kernel and NIC hash functions must be consistent. Otherwise case lookup fails. To achieve this kernel provides API to set proper hash key to NIC. As it is not possible to change key for virtual ENA NIC, this driver cannot support RSS function. ENA is designed to work in virtual environments so supporting hardware version of this card is unnecessary. Submitted by: Rafal Kozik Obtained from: Semihalf Sponsored by: Amazon, Inc. Modified: head/sys/dev/ena/ena.c Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Thu May 30 13:09:53 2019 (r348388) +++ head/sys/dev/ena/ena.c Thu May 30 13:12:14 2019 (r348389) @@ -59,11 +59,9 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include -#include #include #include #include @@ -585,9 +583,6 @@ ena_setup_tx_resources(struct ena_adapter *adapter, in struct ena_que *que = &adapter->que[qid]; struct ena_ring *tx_ring = que->tx_ring; int size, i, err; -#ifdef RSS - cpuset_t cpu_mask; -#endif size = sizeof(struct ena_tx_buffer) * tx_ring->ring_size; @@ -638,16 +633,8 @@ ena_setup_tx_resources(struct ena_adapter *adapter, in goto err_buf_info_unmap; } - /* RSS set cpu for thread */ -#ifdef RSS - CPU_SETOF(que->cpu, &cpu_mask); - taskqueue_start_threads_cpuset(&tx_ring->enqueue_tq, 1, PI_NET, - &cpu_mask, "%s tx_ring enq (bucket %d)", - device_get_nameunit(adapter->pdev), que->cpu); -#else /* RSS */ taskqueue_start_threads(&tx_ring->enqueue_tq, 1, PI_NET, "%s txeq %d", device_get_nameunit(adapter->pdev), que->cpu); -#endif /* RSS */ return (0); @@ -780,9 +767,6 @@ ena_setup_rx_resources(struct ena_adapter *adapter, un struct ena_que *que = &adapter->que[qid]; struct ena_ring *rx_ring = que->rx_ring; int size, err, i; -#ifdef RSS - cpuset_t cpu_mask; -#endif size = sizeof(struct ena_rx_buffer) * rx_ring->ring_size; @@ -836,16 +820,8 @@ ena_setup_rx_resources(struct ena_adapter *adapter, un rx_ring->cmpl_tq = taskqueue_create_fast("ena RX completion", M_WAITOK, taskqueue_thread_enqueue, &rx_ring->cmpl_tq); - /* RSS set cpu for thread */ -#ifdef RSS - CPU_SETOF(que->cpu, &cpu_mask); - taskqueue_start_threads_cpuset(&rx_ring->cmpl_tq, 1, PI_NET, &cpu_mask, - "%s rx_ring cmpl (bucket %d)", - device_get_nameunit(adapter->pdev), que->cpu); -#else taskqueue_start_threads(&rx_ring->cmpl_tq, 1, PI_NET, "%s rx_ring cmpl %d", device_get_nameunit(adapter->pdev), que->cpu); -#endif return (0); @@ -1908,12 +1884,9 @@ ena_setup_io_intr(struct ena_adapter *adapter) adapter->msix_entries[irq_idx].vector; ena_trace(ENA_INFO | ENA_IOQ, "ena_setup_io_intr vector: %d\n", adapter->msix_entries[irq_idx].vector); -#ifdef RSS - adapter->que[i].cpu = adapter->irq_tbl[irq_idx].cpu = - rss_getcpu(i % rss_getnumbuckets()); -#else + /* - * We still want to bind rings to the corresponding cpu + * We want to bind rings to the corresponding cpu * using something similar to the RSS round-robin technique. */ if (unlikely(last_bind_cpu < 0)) @@ -1921,7 +1894,6 @@ ena_setup_io_intr(struct ena_adapter *adapter) adapter->que[i].cpu = adapter->irq_tbl[irq_idx].cpu = last_bind_cpu; last_bind_cpu = CPU_NEXT(last_bind_cpu); -#endif } } @@ -2010,13 +1982,8 @@ ena_request_io_irq(struct ena_adapter *adapter) } irq->requested = true; -#ifdef RSS - ena_trace(ENA_INFO, "queue %d - RSS bucket %d\n", - i - ENA_IO_IRQ_FIRST_IDX, irq->cpu); -#else ena_trace(ENA_INFO, "queue %d - cpu %d\n", i - ENA_IO_IRQ_FIRST_IDX, irq->cpu); -#endif } return (rc); @@ -2952,16 +2919,7 @@ ena_mq_start(if_t ifp, struct mbuf *m) * It should improve performance. */ if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) { -#ifdef RSS - if (rss_hash2bucket(m->m_pkthdr.flowid, - M_HASHTYPE_GET(m), &i) == 0) { - i = i % adapter->num_queues; - - } else -#endif - { - i = m->m_pkthdr.flowid % adapter->num_queues; - } + i = m->m_pkthdr.flowid % adapter->num_queues; } else { i = curcpu % adapter->num_queues; } @@ -3017,9 +2975,6 @@ ena_calc_io_queue_num(struct ena_adapter *adapter, /* 1 IRQ for for mgmnt and 1 IRQ for each TX/RX pair */ io_queue_num = min_t(int, io_queue_num, pci_msix_count(adapter->pdev) - 1); -#ifdef RSS - io_queue_num = min_t(int, io_queue_num, rss_getnumbuckets()); -#endif return (io_queue_num); } @@ -3077,12 +3032,7 @@ ena_rss_init_default(struct ena_adapter *adapter) } for (i = 0; i < ENA_RX_RSS_TABLE_SIZE; i++) { -#ifdef RSS - qid = rss_get_indirection_to_bucket(i); - qid = qid % adapter->num_queues; -#else qid = i % adapter->num_queues; -#endif rc = ena_com_indirect_table_fill_entry(ena_dev, i, ENA_IO_RXQ_IDX(qid)); if (unlikely((rc != 0) && (rc != EOPNOTSUPP))) {