From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Bader Subject: Re: [PATCH] xen-netfront: Fix handling packets on compound pages with skb_linearize Date: Mon, 08 Dec 2014 12:21:20 +0100 Message-ID: <548589B0.8050608@canonical.com> References: <1407778343-13622-1-git-send-email-zoltan.kiss@citrix.com> <547C2CFC.7060908@canonical.com> <20141208101936.GA7491@hercules> <54858753.1070801@citrix.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3438314843841265013==" Return-path: In-Reply-To: <54858753.1070801@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --===============3438314843841265013== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ae4IRf2AAiRSmt6liaxUrJtTPeC8K8w8w" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --ae4IRf2AAiRSmt6liaxUrJtTPeC8K8w8w Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 08.12.2014 12:11, David Vrabel wrote: > On 08/12/14 10:19, Luis Henriques wrote: >> On Mon, Dec 01, 2014 at 09:55:24AM +0100, Stefan Bader wrote: >>> On 11.08.2014 19:32, Zoltan Kiss wrote: >>>> There is a long known problem with the netfront/netback interface: i= f the guest >>>> tries to send a packet which constitues more than MAX_SKB_FRAGS + 1 = ring slots, >>>> it gets dropped. The reason is that netback maps these slots to a fr= ag in the >>>> frags array, which is limited by size. Having so many slots can occu= r since >>>> compound pages were introduced, as the ring protocol slice them up i= nto >>>> individual (non-compound) page aligned slots. The theoretical worst = case >>>> scenario looks like this (note, skbs are limited to 64 Kb here): >>>> linear buffer: at most PAGE_SIZE - 17 * 2 bytes, overlapping page bo= undary, >>>> using 2 slots >>>> first 15 frags: 1 + PAGE_SIZE + 1 bytes long, first and last bytes a= re at the >>>> end and the beginning of a page, therefore they use 3 * 15 =3D 45 sl= ots >>>> last 2 frags: 1 + 1 bytes, overlapping page boundary, 2 * 2 =3D 4 sl= ots >>>> Although I don't think this 51 slots skb can really happen, we need = a solution >>>> which can deal with every scenario. In real life there is only a few= slots >>>> overdue, but usually it causes the TCP stream to be blocked, as the = retry will >>>> most likely have the same buffer layout. >>>> This patch solves this problem by linearizing the packet. This is no= t the >>>> fastest way, and it can fail much easier as it tries to allocate a b= ig linear >>>> area for the whole packet, but probably easier by an order of magnit= ude than >>>> anything else. Probably this code path is not touched very frequentl= y anyway. >>>> >>>> Signed-off-by: Zoltan Kiss >>>> Cc: Wei Liu >>>> Cc: Ian Campbell >>>> Cc: Paul Durrant >>>> Cc: netdev@vger.kernel.org >>>> Cc: linux-kernel@vger.kernel.org >>>> Cc: xen-devel@lists.xenproject.org >>> >>> This does not seem to be marked explicitly as stable. Has someone alr= eady asked >>> David Miller to put it on his stable queue? IMO it qualifies quite we= ll and the >>> actual change should be simple to pick/backport. >>> >> >> Thank you Stefan, I'm queuing this for the next 3.16 kernel release. >=20 > Don't backport this yes. It's broken. It produces malformed requests > and netback will report a fatal error and stop all traffic on the VIF. Thanks David. Did this just come up? I don't remember seeing any report o= f the regression. :/ -Stefan >=20 > David >=20 > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel >=20 --ae4IRf2AAiRSmt6liaxUrJtTPeC8K8w8w Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJUhYmwAAoJEOhnXe7L7s6j75AP/31P2RjZBPGIhsVkf2s86tvn WBpGgMWNfI37tG1PCoNZs6yS/NEjdmkGd5kWqwkshgjmzJdp8MGIXAx/OYPkWWMa XVG4Vi233U3clTyhsY7azEk/ubzULIazB9mP5ZEG3v171bKgyrrgFcMjxBOU5pNJ U0z42SNUADgOLI4GLw9UwvljwdORNosgH4a388vSG4tkUQcP9dkRNY4Ul2Oa5jV0 gd07DJ4CZOPzspfVRFJ7FtSCivCVPALCr6hvXBj+thpSGFMSKlyQ1OlEsUpApJ4O s10487u0F1+QukphsjCp23ttkET+TbjpSyZLCK9DLIeR3rvgp4o/cqQ9TPBEE8F3 xel06ugijIt31fBM4Hb5wfFhWcphXzEnOaUZcnN+oojiGXGXXGru6pTfeUctmE/D zLW7YInl+rWcUm69wJt5jz/h4u/zd/anogopQT/ifWdD8HhJluUX1GAPCqDJ3Bzq HjHwCMIjxK3bXT86e03U3F0/VHjX/F42GUGmXW+sqKWispgCDyBWxYbTQ2+pPUxI h6lzsMapov//4AYg3Tpwx7COBcIMuXbUquIP2AnChBFt5ZcOv5+w4r/5E7eMiKJ5 p3dKqAKbRTmq3uc0HB0ylxs20ORqbQMZFBTsJ+Ntu7eP8IMyKj7VKW/5xb1q+uom w4QfV+KrcZtmlZ60puDC =A4qa -----END PGP SIGNATURE----- --ae4IRf2AAiRSmt6liaxUrJtTPeC8K8w8w-- --===============3438314843841265013== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --===============3438314843841265013==--