Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7187735ybi; Mon, 8 Jul 2019 16:29:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqxSYq3YMr6pberrTF+FgP6QxlSnzcuuYyIYTj84L8NTwTGWrzsP7fOqfpokJFF3QQd7wxie X-Received: by 2002:a17:902:f216:: with SMTP id gn22mr27460333plb.118.1562628578132; Mon, 08 Jul 2019 16:29:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562628578; cv=none; d=google.com; s=arc-20160816; b=GMNCX3bzkY2HbRi5tpbQBMVO5usUUjvrmDzQjIQ0UCeafTQk6BAWnEEfmccIXs/c12 j57do0zNqsNPtG63lPMvrfIU0x0jr2ZdGKkkFL66/fDA+pvvJVnYbwsL7r3cXhbsoyu4 nrNWNjBwnlLMMs3HfgJ0j13IAnqbSVjIwVOagUJ3ZQFkXIaNne8KuEmbMtwCggnjef9L jHOqPJ+JtdInBheqOu82r5d15Ayvn6tSu0SsJvweAoey+SJ+RAkFz8hFnGHf45hNq25u BZX1Be8oBe/rHd7DaKL1adZWgUCxDuyZuSYFjlAiy7X996/HGTqfe3QAEExjkCW7Abz5 cQgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=YdeqtZytdEyqoIG26b8RfEFGIJ1HXoW9pGi40CoP3hY=; b=PrmeRhMAN93qimxdKvWNfRuz/03ViDt0wN2rnRI4AG8aXBubOPqWW465Ir55NC4q9j Rs6CT6UtlbQZJCZM12pi49DcJuxCUStXxcw1TjiDGHHJv371Si/Q0XGQEeT01Ln9b2a8 ymiaLib90NHJnbsxF5BJB9/KvW5fU33Jq0yQzLTjGg3nxIwcGAVaOLzVWmEGGjd5LkhQ gyMaaZXbtamfPJlF7V0Hpod10HulY+fiqJd8xR3m44g/6qUgS7NK1vZzHSJHiKgmmSgV WCcmaxcs1fwFwxz9RovRi/Oa/7JbPfG17UyJAPS0AcqeGHWGLAI4EhnKbOvhCXEJ8UMI TT4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="rWWOnVX/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s29si22036216pfd.147.2019.07.08.16.29.23; Mon, 08 Jul 2019 16:29:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="rWWOnVX/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405342AbfGHVZ6 (ORCPT + 99 others); Mon, 8 Jul 2019 17:25:58 -0400 Received: from mail-qk1-f196.google.com ([209.85.222.196]:33973 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729474AbfGHVZ5 (ORCPT ); Mon, 8 Jul 2019 17:25:57 -0400 Received: by mail-qk1-f196.google.com with SMTP id t8so14504149qkt.1; Mon, 08 Jul 2019 14:25:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=YdeqtZytdEyqoIG26b8RfEFGIJ1HXoW9pGi40CoP3hY=; b=rWWOnVX/gGIKyfUtaGpmot+HNvA3cWtH0kVO0h4nl6tXbcIquARDq4K26S34Z+yLSt KEymIIbwKOsR2MSPrTptFunTkS886ieLQW8eLX4xHg4NImEfiwT9bZ/2qohqwFF/l2Lr ayJvIuw6+8NpOTb6k0WbGIy/YCs/BHvl2cDlDYf9A74AylUKTwivq2or6XJpYn4UHJih 6qf5VXPpM9Iy8rffFKoXRWB04wHiXVNE8HC5XIlzb7ovwrP7Gjc6Sce3Z50iit7CDHVu rRCyn8hXPB7LGtdY/BUIJHdfKtA31poSQtFyzaDW81y0biywXp/wAE1SLCQqu4gP9Pku 7Rig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=YdeqtZytdEyqoIG26b8RfEFGIJ1HXoW9pGi40CoP3hY=; b=scBuc1+xmHvWbbDJ/BDG6a6c/dmzdepPZHhaOXoF/t9WfI62d3bbO0VpL9y+YdNZQl d0z9nYMCqWPHQ361TDps0izE53nytbLPY2gwjYZXkidVhhl8q+WM/LHwNNhbHg87r6VK uQdC+GsELLpw7FpMaie8hpRSirYFT/BIN4x5ZPBaHCK0zL6zE2Kenwh2I/qwA3frdkZz gwK977gmvn+4BRSNC/GfyZL/Lkgfv0d8JdLRZtV1Nsz29bzKgOzVqC6aAWj05H8TKyvP QNEkBhMl6iZkJU2oa7zjnOo4D+cW9AHFCjEh8YXf2VilSARGz+C/QyGn6ZP6nJm6A5nO GJxA== X-Gm-Message-State: APjAAAUZid8i28aEvFuSF7obdHZYDWF2BOE+5CQpf9Z4vkkTOOMRE1jW 9IkcYNa7g+loTTAlZkj9ZRH1vQ54hMf01Rx6dtY= X-Received: by 2002:ae9:de05:: with SMTP id s5mr13692127qkf.184.1562621156638; Mon, 08 Jul 2019 14:25:56 -0700 (PDT) MIME-Version: 1.0 References: <20190704142503.23501-1-i.maximets@samsung.com> In-Reply-To: From: William Tu Date: Mon, 8 Jul 2019 14:25:20 -0700 Message-ID: Subject: Re: [PATCH bpf] xdp: fix possible cq entry leak To: =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= Cc: Ilya Maximets , Netdev , LKML , bpf , Xdp , "David S. Miller" , =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , Magnus Karlsson , Jonathan Lemon , Jakub Kicinski , Alexei Starovoitov , Daniel Borkmann Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 4, 2019 at 11:49 PM Bj=C3=B6rn T=C3=B6pel wrote: > > On Thu, 4 Jul 2019 at 16:25, Ilya Maximets wrote= : > > > > Completion queue address reservation could not be undone. > > In case of bad 'queue_id' or skb allocation failure, reserved entry > > will be leaked reducing the total capacity of completion queue. > > > > Fix that by moving reservation to the point where failure is not > > possible. Additionally, 'queue_id' checking moved out from the loop > > since there is no point to check it there. > > > > Good catch, Ilya! Thanks for the patch! > > Acked-by: Bj=C3=B6rn T=C3=B6pel > Thanks Tested-by: William Tu