From owner-svn-src-head@freebsd.org Thu May 30 13:41:40 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 993AF15C34C9; Thu, 30 May 2019 13:41:40 +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 E17068B565; Thu, 30 May 2019 13:41:39 +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 BD6E819CFC; Thu, 30 May 2019 13:41:39 +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 x4UDfdIA076295; Thu, 30 May 2019 13:41:39 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4UDfdul076294; Thu, 30 May 2019 13:41:39 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201905301341.x4UDfdul076294@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:41:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348411 - 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: 348411 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E17068B565 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] 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:41:40 -0000 Author: mw Date: Thu May 30 13:41:39 2019 New Revision: 348411 URL: https://svnweb.freebsd.org/changeset/base/348411 Log: Unify new line characters in the ENA driver Some messages were missing new line character and traces were not having unified behavior. To fix that, each trace and printout should add new line character at the end of each string - that should improve readability. Submitted by: Rafal Kozik Michal Krawczyk 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:40:51 2019 (r348410) +++ head/sys/dev/ena/ena.c Thu May 30 13:41:39 2019 (r348411) @@ -308,7 +308,7 @@ ena_probe(device_t dev) while (ent->vendor_id != 0) { if ((pci_vendor_id == ent->vendor_id) && (pci_device_id == ent->device_id)) { - ena_trace(ENA_DBG, "vendor=%x device=%x ", + ena_trace(ENA_DBG, "vendor=%x device=%x\n", pci_vendor_id, pci_device_id); sprintf(adapter_name, DEVICE_DESC); @@ -969,7 +969,7 @@ ena_alloc_rx_mbuf(struct ena_adapter *adapter, /* Map packets for DMA */ ena_trace(ENA_DBG | ENA_RSC | ENA_RXPTH, - "Using tag %p for buffers' DMA mapping, mbuf %p len: %d", + "Using tag %p for buffers' DMA mapping, mbuf %p len: %d\n", adapter->rx_buf_tag,rx_info->mbuf, rx_info->mbuf->m_len); error = bus_dmamap_load_mbuf_sg(adapter->rx_buf_tag, rx_info->map, rx_info->mbuf, segs, &nsegs, BUS_DMA_NOWAIT); @@ -1030,7 +1030,7 @@ ena_refill_rx_bufs(struct ena_ring *rx_ring, uint32_t uint32_t i; int rc; - ena_trace(ENA_DBG | ENA_RXPTH | ENA_RSC, "refill qid: %d", + ena_trace(ENA_DBG | ENA_RXPTH | ENA_RSC, "refill qid: %d\n", rx_ring->qid); next_to_use = rx_ring->next_to_use; @@ -1039,7 +1039,7 @@ ena_refill_rx_bufs(struct ena_ring *rx_ring, uint32_t struct ena_rx_buffer *rx_info; ena_trace(ENA_DBG | ENA_RXPTH | ENA_RSC, - "RX buffer - next to use: %d", next_to_use); + "RX buffer - next to use: %d\n", next_to_use); req_id = rx_ring->free_rx_ids[next_to_use]; rx_info = &rx_ring->rx_buffer_info[req_id]; @@ -1143,12 +1143,12 @@ ena_free_tx_bufs(struct ena_adapter *adapter, unsigned if (print_once) { device_printf(adapter->pdev, - "free uncompleted tx mbuf qid %d idx 0x%x", + "free uncompleted tx mbuf qid %d idx 0x%x\n", qid, i); print_once = false; } else { ena_trace(ENA_DBG, - "free uncompleted tx mbuf qid %d idx 0x%x", + "free uncompleted tx mbuf qid %d idx 0x%x\n", qid, i); } @@ -1404,7 +1404,7 @@ ena_tx_cleanup(struct ena_ring *tx_ring) tx_info->seg_mapped = false; } - ena_trace(ENA_DBG | ENA_TXPTH, "tx: q %d mbuf %p completed", + ena_trace(ENA_DBG | ENA_TXPTH, "tx: q %d mbuf %p completed\n", tx_ring->qid, mbuf); m_freem(mbuf); @@ -1429,7 +1429,7 @@ ena_tx_cleanup(struct ena_ring *tx_ring) work_done = TX_BUDGET - budget; - ena_trace(ENA_DBG | ENA_TXPTH, "tx: q %d done. total pkts: %d", + ena_trace(ENA_DBG | ENA_TXPTH, "tx: q %d done. total pkts: %d\n", tx_ring->qid, work_done); /* If there is still something to commit update ring state */ @@ -1551,7 +1551,7 @@ ena_rx_mbuf(struct ena_ring *rx_ring, struct ena_com_r return (NULL); } - ena_trace(ENA_DBG | ENA_RXPTH, "rx_info %p, mbuf %p, paddr %jx", + ena_trace(ENA_DBG | ENA_RXPTH, "rx_info %p, mbuf %p, paddr %jx\n", rx_info, rx_info->mbuf, (uintmax_t)rx_info->ena_buf.paddr); bus_dmamap_sync(adapter->rx_buf_tag, rx_info->map, @@ -1565,7 +1565,7 @@ ena_rx_mbuf(struct ena_ring *rx_ring, struct ena_com_r /* Fill mbuf with hash key and it's interpretation for optimization */ ena_rx_hash_mbuf(rx_ring, ena_rx_ctx, mbuf); - ena_trace(ENA_DBG | ENA_RXPTH, "rx mbuf 0x%p, flags=0x%x, len: %d", + ena_trace(ENA_DBG | ENA_RXPTH, "rx mbuf 0x%p, flags=0x%x, len: %d\n", mbuf, mbuf->m_flags, mbuf->m_pkthdr.len); /* DMA address is not needed anymore, unmap it */ @@ -1615,12 +1615,12 @@ ena_rx_mbuf(struct ena_ring *rx_ring, struct ena_com_r BUS_DMASYNC_POSTREAD); if (unlikely(m_append(mbuf, len, rx_info->mbuf->m_data) == 0)) { counter_u64_add(rx_ring->rx_stats.mbuf_alloc_fail, 1); - ena_trace(ENA_WARNING, "Failed to append Rx mbuf %p", + ena_trace(ENA_WARNING, "Failed to append Rx mbuf %p\n", mbuf); } ena_trace(ENA_DBG | ENA_RXPTH, - "rx mbuf updated. len %d", mbuf->m_pkthdr.len); + "rx mbuf updated. len %d\n", mbuf->m_pkthdr.len); /* Free already appended mbuf, it won't be useful anymore */ bus_dmamap_unload(rx_ring->adapter->rx_buf_tag, rx_info->map); @@ -1650,7 +1650,7 @@ ena_rx_checksum(struct ena_ring *rx_ring, struct ena_c /* ipv4 checksum error */ mbuf->m_pkthdr.csum_flags = 0; counter_u64_add(rx_ring->rx_stats.bad_csum, 1); - ena_trace(ENA_DBG, "RX IPv4 header checksum error"); + ena_trace(ENA_DBG, "RX IPv4 header checksum error\n"); return; } @@ -1661,7 +1661,7 @@ ena_rx_checksum(struct ena_ring *rx_ring, struct ena_c /* TCP/UDP checksum error */ mbuf->m_pkthdr.csum_flags = 0; counter_u64_add(rx_ring->rx_stats.bad_csum, 1); - ena_trace(ENA_DBG, "RX L4 checksum error"); + ena_trace(ENA_DBG, "RX L4 checksum error\n"); } else { mbuf->m_pkthdr.csum_flags = CSUM_IP_CHECKED; mbuf->m_pkthdr.csum_flags |= CSUM_IP_VALID; @@ -1699,7 +1699,7 @@ ena_rx_cleanup(struct ena_ring *rx_ring) io_sq = &adapter->ena_dev->io_sq_queues[ena_qid]; next_to_clean = rx_ring->next_to_clean; - ena_trace(ENA_DBG, "rx: qid %d", qid); + ena_trace(ENA_DBG, "rx: qid %d\n", qid); do { ena_rx_ctx.ena_bufs = rx_ring->ena_bufs; @@ -1716,7 +1716,7 @@ ena_rx_cleanup(struct ena_ring *rx_ring) break; ena_trace(ENA_DBG | ENA_RXPTH, "rx: q %d got packet from ena. " - "descs #: %d l3 proto %d l4 proto %d hash: %x", + "descs #: %d l3 proto %d l4 proto %d hash: %x\n", rx_ring->qid, ena_rx_ctx.descs, ena_rx_ctx.l3_proto, ena_rx_ctx.l4_proto, ena_rx_ctx.hash); @@ -1769,7 +1769,7 @@ ena_rx_cleanup(struct ena_ring *rx_ring) } if (do_if_input != 0) { ena_trace(ENA_DBG | ENA_RXPTH, - "calling if_input() with mbuf %p", mbuf); + "calling if_input() with mbuf %p\n", mbuf); (*ifp->if_input)(ifp, mbuf); } @@ -1841,7 +1841,7 @@ ena_cleanup(void *arg, int pending) if (unlikely((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0)) return; - ena_trace(ENA_DBG, "MSI-X TX/RX routine"); + ena_trace(ENA_DBG, "MSI-X TX/RX routine\n"); tx_ring = que->tx_ring; rx_ring = que->rx_ring; @@ -1908,7 +1908,7 @@ ena_enable_msix(struct ena_adapter *adapter) adapter->msix_entries = malloc(msix_vecs * sizeof(struct msix_entry), M_DEVBUF, M_WAITOK | M_ZERO); - ena_trace(ENA_DBG, "trying to enable MSI-X, vectors: %d", msix_vecs); + ena_trace(ENA_DBG, "trying to enable MSI-X, vectors: %d\n", msix_vecs); for (i = 0; i < msix_vecs; i++) { adapter->msix_entries[i].entry = i; @@ -2293,21 +2293,21 @@ ena_up(struct ena_adapter *adapter) ena_setup_io_intr(adapter); rc = ena_request_io_irq(adapter); if (unlikely(rc != 0)) { - ena_trace(ENA_ALERT, "err_req_irq"); + ena_trace(ENA_ALERT, "err_req_irq\n"); goto err_req_irq; } /* allocate transmit descriptors */ rc = ena_setup_all_tx_resources(adapter); if (unlikely(rc != 0)) { - ena_trace(ENA_ALERT, "err_setup_tx"); + ena_trace(ENA_ALERT, "err_setup_tx\n"); goto err_setup_tx; } /* allocate receive descriptors */ rc = ena_setup_all_rx_resources(adapter); if (unlikely(rc != 0)) { - ena_trace(ENA_ALERT, "err_setup_rx"); + ena_trace(ENA_ALERT, "err_setup_rx\n"); goto err_setup_rx; } @@ -2315,7 +2315,7 @@ ena_up(struct ena_adapter *adapter) rc = ena_create_io_queues(adapter); if (unlikely(rc != 0)) { ena_trace(ENA_ALERT, - "create IO queues failed"); + "create IO queues failed\n"); goto err_io_que; } @@ -2391,7 +2391,7 @@ static void ena_media_status(if_t ifp, struct ifmediareq *ifmr) { struct ena_adapter *adapter = if_getsoftc(ifp); - ena_trace(ENA_DBG, "enter"); + ena_trace(ENA_DBG, "enter\n"); mtx_lock(&adapter->global_mtx); @@ -2945,7 +2945,7 @@ ena_tx_map_mbuf(struct ena_ring *tx_ring, struct ena_t segs, &nsegs, BUS_DMA_NOWAIT); if (unlikely((rc != 0) || (nsegs == 0))) { ena_trace(ENA_WARNING, - "dmamap load failed! err: %d nsegs: %d", rc, nsegs); + "dmamap load failed! err: %d nsegs: %d\n", rc, nsegs); goto dma_error; } @@ -2992,11 +2992,11 @@ ena_xmit_mbuf(struct ena_ring *tx_ring, struct mbuf ** rc = ena_check_and_collapse_mbuf(tx_ring, mbuf); if (unlikely(rc != 0)) { ena_trace(ENA_WARNING, - "Failed to collapse mbuf! err: %d", rc); + "Failed to collapse mbuf! err: %d\n", rc); return (rc); } - ena_trace(ENA_DBG | ENA_TXPTH, "Tx: %d bytes", (*mbuf)->m_pkthdr.len); + ena_trace(ENA_DBG | ENA_TXPTH, "Tx: %d bytes\n", (*mbuf)->m_pkthdr.len); next_to_use = tx_ring->next_to_use; req_id = tx_ring->free_tx_ids[next_to_use]; @@ -3131,7 +3131,7 @@ ena_start_xmit(struct ena_ring *tx_ring) while ((mbuf = drbr_peek(adapter->ifp, tx_ring->br)) != NULL) { ena_trace(ENA_DBG | ENA_TXPTH, "\ndequeued mbuf %p with flags %#x and" - " header csum flags %#jx", + " header csum flags %#jx\n", mbuf, mbuf->m_flags, (uint64_t)mbuf->m_pkthdr.csum_flags); if (unlikely(!tx_ring->running)) {