Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Jul 2014 13:25:45 -0400
From:      John Baldwin <jhb@freebsd.org>
To:        freebsd-net@freebsd.org
Cc:        "Russell L. Carter" <rcarter@pinyon.org>, Rick Macklem <rmacklem@uoguelph.ca>
Subject:   Re: NFS client READ performance on -current
Message-ID:  <201407101325.46156.jhb@freebsd.org>
In-Reply-To: <870285181.7082888.1404435061501.JavaMail.root@uoguelph.ca>
References:  <870285181.7082888.1404435061501.JavaMail.root@uoguelph.ca>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thursday, July 03, 2014 8:51:01 pm Rick Macklem wrote:
> Russell L. Carter wrote:
> > 
> > 
> > On 07/02/14 19:09, Rick Macklem wrote:
> > 
> > > Could you please post the dmesg stuff for the network interface,
> > > so I can tell what driver is being used? I'll take a look at it,
> > > in case it needs to be changed to use m_defrag().
> > 
> > em0: <Intel(R) PRO/1000 Network Connection 7.4.2> port 0xd020-0xd03f
> > mem
> > 0xfe4a0000-0xfe4bffff,0xfe480000-0xfe49ffff irq 44 at device 0.0 on
> > pci2
> > em0: Using an MSI interrupt
> > em0: Ethernet address: 00:15:17:bc:29:ba
> > 001.000007 [2323] netmap_attach             success for em0 tx 1/1024
> > rx
> > 1/1024 queues/slots
> > 
> > This is one of those dual nic cards, so there is em1 as well...
> > 
> Well, I took a quick look at the driver and it does use m_defrag(), but
> I think that the "retry:" label it does a goto after doing so might be in
> the wrong place.
> 
> The attached untested patch might fix this.
> 
> Is it convenient to build a kernel with this patch applied and then try
> it with TSO enabled?
> 
> rick
> ps: It does have the transmit segment limit set to 32. I have no idea if
>     this is a hardware limitation.

I think the retry is not in the wrong place, but the overhead of all those
pullups is apparently quite severe.  It would be interesting to test the
following in addition to your change to see if it improves performance
further:

Index: if_em.c
===================================================================
--- if_em.c	(revision 268495)
+++ if_em.c	(working copy)
@@ -1959,7 +1959,9 @@ retry:
 	if (error == EFBIG && remap) {
 		struct mbuf *m;
 
-		m = m_defrag(*m_headp, M_NOWAIT);
+		m = m_collapse(*m_headp, M_NOWAIT, EM_MAX_SCATTER);
+		if (m == NULL)
+			m = m_defrag(*m_headp, M_NOWAIT);
 		if (m == NULL) {
 			adapter->mbuf_alloc_failed++;
 			m_freem(*m_headp);


-- 
John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201407101325.46156.jhb>