From owner-svn-src-all@freebsd.org Tue Oct 20 19:28:31 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6D0AA18AC5; Tue, 20 Oct 2015 19:28:30 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-yk0-f171.google.com (mail-yk0-f171.google.com [209.85.160.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AD785159A; Tue, 20 Oct 2015 19:28:30 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by ykdr3 with SMTP id r3so27262765ykd.1; Tue, 20 Oct 2015 12:28:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type:content-transfer-encoding; bh=STCo66s7AUXTu2yJR6vbbvAaQfhYTch2HqTvXml1eEI=; b=j2iIk/qODH5BEvyr0vUkZcB0rZzYGWPe8tJ/M9x86Ozba44a6IhqIpJob85GVe922f hwa0HdjnXvAdz5I5YLVODF3BFUHYF9GzbgA8ledTq5O/1o5vyTfrhFifjoHcJMou5LS1 VSnpewTFDVJNXav27LPD0XRh8/XX2Aa0cLWuM4hH/q3RDieHDYuK6NmfKfKSao8lQLtl 5f8y9yz71ETFRrYJlzH99ljbH/hmZ9iqsVE2btR4PTe7ajcKZNJL4CY/nAA7hKj2iABq /sq5hfLzBiEwTTxxWUyCclmwnOgEXhHN1HYdMKbBJyaa+HFyJ0B5nImAwrwwZIT2WV4N Ut4Q== X-Received: by 10.129.124.8 with SMTP id x8mr3731775ywc.44.1445369303828; Tue, 20 Oct 2015 12:28:23 -0700 (PDT) Received: from mail-yk0-f177.google.com (mail-yk0-f177.google.com. [209.85.160.177]) by smtp.gmail.com with ESMTPSA id f205sm2843511ywc.7.2015.10.20.12.28.23 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Oct 2015 12:28:23 -0700 (PDT) Received: by ykaz22 with SMTP id z22so27331728yka.2; Tue, 20 Oct 2015 12:28:23 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.13.212.82 with SMTP id w79mr3727090ywd.272.1445369303350; Tue, 20 Oct 2015 12:28:23 -0700 (PDT) Reply-To: cem@FreeBSD.org Received: by 10.37.203.75 with HTTP; Tue, 20 Oct 2015 12:28:23 -0700 (PDT) In-Reply-To: <201510201921.t9KJL1Hx037997@repo.freebsd.org> References: <201510201921.t9KJL1Hx037997@repo.freebsd.org> Date: Tue, 20 Oct 2015 12:28:23 -0700 Message-ID: Subject: Re: svn commit: r289653 - head/sys/dev/ntb/if_ntb From: Conrad Meyer To: svn-src-head@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2015 19:28:31 -0000 This catches us up to Linus' master branch as of today (the most recent NTB patch there is from Sep 7, 2015) =E2=80=94 modulo no DMA offload= in if_ntb, no debugfs-equivalent statistics, and neither of Linux' NTB test drivers. Also we don't make any attempt to allocate memory in the device-local NUMA zone, because that API doesn't exist yet. Nor do we push back on the upper network stack layers to stop sending when our queues are full, for the same reason. That's not quite finished, though; Intel and EMC (ex-Isilon) have some patches queued up waiting to go into Linux that should be applied too. Thanks, Conrad On Tue, Oct 20, 2015 at 12:21 PM, Conrad E. Meyer wrote: > Author: cem > Date: Tue Oct 20 19:21:01 2015 > New Revision: 289653 > URL: https://svnweb.freebsd.org/changeset/base/289653 > > Log: > if_ntb: Diff-reduce with Linux; add queue index type > > Add ntb_q_idx_t so it is more clear which struct members are of the sam= e > type (some bogus uint64_ts snuck in that should have been unsigned int)= . > > Add tx_err_no_buf and s/ENOMEM/EBUSY/ in tx_enqueue to match Linux. > > Sponsored by: EMC / Isilon Storage Division > > Modified: > head/sys/dev/ntb/if_ntb/if_ntb.c > > Modified: head/sys/dev/ntb/if_ntb/if_ntb.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/ntb/if_ntb/if_ntb.c Tue Oct 20 19:20:52 2015 (= r289652) > +++ head/sys/dev/ntb/if_ntb/if_ntb.c Tue Oct 20 19:21:01 2015 (= r289653) > @@ -105,6 +105,8 @@ SYSCTL_UINT(_hw_ntb, OID_AUTO, max_num_c > > STAILQ_HEAD(ntb_queue_list, ntb_queue_entry); > > +typedef unsigned ntb_q_idx_t; > + > struct ntb_queue_entry { > /* ntb_queue list reference */ > STAILQ_ENTRY(ntb_queue_entry) entry; > @@ -117,11 +119,11 @@ struct ntb_queue_entry { > > struct ntb_transport_qp *qp; > struct ntb_payload_header *x_hdr; > - unsigned index; > + ntb_q_idx_t index; > }; > > struct ntb_rx_info { > - unsigned int entry; > + ntb_q_idx_t entry; > }; > > struct ntb_transport_qp { > @@ -143,8 +145,8 @@ struct ntb_transport_qp { > struct mtx ntb_tx_free_q_lock; > void *tx_mw; > bus_addr_t tx_mw_phys; > - uint64_t tx_index; > - uint64_t tx_max_entry; > + ntb_q_idx_t tx_index; > + ntb_q_idx_t tx_max_entry; > uint64_t tx_max_frame; > > void (*rx_handler)(struct ntb_transport_qp *qp, void *qp_data, > @@ -157,8 +159,8 @@ struct ntb_transport_qp { > struct task rx_completion_task; > struct task rxc_db_work; > void *rx_buff; > - uint64_t rx_index; > - uint64_t rx_max_entry; > + ntb_q_idx_t rx_index; > + ntb_q_idx_t rx_max_entry; > uint64_t rx_max_frame; > > void (*event_handler)(void *data, enum ntb_link_event status); > @@ -178,6 +180,7 @@ struct ntb_transport_qp { > uint64_t tx_bytes; > uint64_t tx_pkts; > uint64_t tx_ring_full; > + uint64_t tx_err_no_buf; > }; > > struct ntb_queue_handlers { > @@ -842,7 +845,8 @@ ntb_transport_tx_enqueue(struct ntb_tran > entry =3D ntb_list_rm(&qp->ntb_tx_free_q_lock, &qp->tx_free_q); > if (entry =3D=3D NULL) { > CTR0(KTR_NTB, "TX: could not get entry from tx_free_q"); > - return (ENOMEM); > + qp->tx_err_no_buf++; > + return (EBUSY); > } > CTR1(KTR_NTB, "TX: got entry %p from tx_free_q", entry); > > @@ -961,7 +965,7 @@ static void > ntb_transport_rxc_db(void *arg, int pending __unused) > { > struct ntb_transport_qp *qp =3D arg; > - uint64_t i; > + ntb_q_idx_t i; > int rc; > > /* > @@ -1346,7 +1350,7 @@ ntb_transport_setup_qp_mw(struct ntb_tra > struct ntb_transport_qp *qp =3D &nt->qp_vec[qp_num]; > struct ntb_transport_mw *mw; > void *offset; > - uint64_t i; > + ntb_q_idx_t i; > size_t rx_size; > unsigned num_qps_mw, mw_num, mw_count; > > @@ -1473,7 +1477,8 @@ ntb_qp_link_down_reset(struct ntb_transp > qp->rx_ring_empty =3D 0; > qp->tx_ring_full =3D 0; > > - qp->rx_err_no_buf =3D qp->rx_err_oflow =3D qp->rx_err_ver =3D 0; > + qp->rx_err_no_buf =3D qp->tx_err_no_buf =3D 0; > + qp->rx_err_oflow =3D qp->rx_err_ver =3D 0; > } > > static void >