From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6A5ADC43387 for ; Thu, 17 Jan 2019 13:39:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3A0B1205C9 for ; Thu, 17 Jan 2019 13:39:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726517AbfAQNjX convert rfc822-to-8bit (ORCPT ); Thu, 17 Jan 2019 08:39:23 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36010 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725868AbfAQNjW (ORCPT ); Thu, 17 Jan 2019 08:39:22 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 46F719E63F; Thu, 17 Jan 2019 13:39:22 +0000 (UTC) Received: from localhost (ovpn-200-21.brq.redhat.com [10.40.200.21]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3C1F85C554; Thu, 17 Jan 2019 13:39:14 +0000 (UTC) Date: Thu, 17 Jan 2019 14:39:13 +0100 From: Jesper Dangaard Brouer To: Jason Wang Cc: Toshiaki Makita , "David S. Miller" , "Michael S. Tsirkin" , netdev@vger.kernel.org, virtualization@lists.linux-foundation.org, brouer@redhat.com Subject: Re: [PATCH net 6/7] virtio_net: Use xdp_return_frame to free xdp_frames on destroying vqs Message-ID: <20190117143913.7c178e2f@redhat.com> In-Reply-To: References: <1547724045-2726-1-git-send-email-makita.toshiaki@lab.ntt.co.jp> <1547724045-2726-7-git-send-email-makita.toshiaki@lab.ntt.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 17 Jan 2019 13:39:22 +0000 (UTC) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Thu, 17 Jan 2019 20:56:39 +0800 Jason Wang wrote: > On 2019/1/17 下午7:20, Toshiaki Makita wrote: > > put_page() can work as a fallback for freeing xdp_frames, but the > > appropriate way is to use xdp_return_frame(). > > > > Fixes: cac320c850ef ("virtio_net: convert to use generic xdp_frame and xdp_return_frame API") > > Signed-off-by: Toshiaki Makita > > --- > > drivers/net/virtio_net.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c > > index ae93f0e..996de69 100644 > > --- a/drivers/net/virtio_net.c > > +++ b/drivers/net/virtio_net.c > > @@ -2668,7 +2668,7 @@ static void free_unused_bufs(struct virtnet_info *vi) > > if (!is_xdp_raw_buffer_queue(vi, i)) > > dev_kfree_skb(buf); > > else > > - put_page(virt_to_head_page(buf)); > > + xdp_return_frame(buf); I assume the is_xdp_raw_buffer_queue() test assures that this void *buf is a struct xdp_frame. > > } > > } > > > > > Acked-by: Jason Wang Acked-by: Jesper Dangaard Brouer -- Best regards, Jesper Dangaard Brouer MSc.CS, Principal Kernel Engineer at Red Hat LinkedIn: http://www.linkedin.com/in/brouer