Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp2623300rwl; Mon, 26 Dec 2022 19:02:53 -0800 (PST) X-Google-Smtp-Source: AMrXdXuKnQvGGVE9vbMN2JVCvs2bKgO++0Z/2+zFjDlXGtfUBD+PWrPi/tARbvEN4tWOA/NOwkZ6 X-Received: by 2002:a05:6a20:548e:b0:9d:efd3:66ca with SMTP id i14-20020a056a20548e00b0009defd366camr31708749pzk.17.1672110173295; Mon, 26 Dec 2022 19:02:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672110173; cv=none; d=google.com; s=arc-20160816; b=v7FoKX7szaSwSu7xThLU6NurwUt6LAqKUbOh61QPexqfLFD/1KFJRbzvZWs4d2QmsO U94bjc6HZfxmpqVfMcv8cUC+Im7UUq6PzpyR2HGHKdrKvnit36uc7x++EI4AJz7dLLqn eLXrH139WetSZlzVTKvJjIzXJxV58u5Kr8vbdzCDGOtaYOhS+kmx8d7WnFBmV4MZ5UdU ObVz4TQeqAEVO5gWjGT6t7qYFFwHeOHqfVb+FMQgNZl79GpdXw3//ioUkeeS6DVv+IJj FXqpo0KshN1Y7RJ+C9g1aTUhI6HGAapUb7J87KPeHsZk2WmpcpipAbkVy88ZJnqpzeF9 5nnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=DvMG7HI+MNWsEUIqh/BKpMAFptkHeZ7mWrh2CvuyciY=; b=zv+Y6DpDBQMQw4vVk4ZSiwTDDnO4SA4NQZmMVHP+xu4phMyW/iFgFVda3wmHzolF+s NqkbdLZB/2FD7w6CPxfCBN+o6HF4f8KAyOKA70EiY1O7TR1Z+wFRjGcR+BZTwC21uxJG x98d4om9/yyscLvf3avAPqVYXdQ7Y444u1wDM1qBN6FLSTphbn99LT87zmlwQ763/9w5 /OVgVlelLOmj55DSZ/H7ABA57KCTf3qVfQkv+lOndnOEpw70XCIUyvz3duwX1UO9STCe fbO5UH9/YqyuEI0lK93UHuF5/TS0mk6XkUkJrbaG/YtBhLl67AOVJPZP1/VQAj5EWGOJ B5Nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@igel-co-jp.20210112.gappssmtp.com header.s=20210112 header.b=7HVylYQ0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 10-20020a63174a000000b0046e96b9ecfdsi12892305pgx.801.2022.12.26.19.02.44; Mon, 26 Dec 2022 19:02:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@igel-co-jp.20210112.gappssmtp.com header.s=20210112 header.b=7HVylYQ0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232617AbiL0C0z (ORCPT + 66 others); Mon, 26 Dec 2022 21:26:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232660AbiL0CZy (ORCPT ); Mon, 26 Dec 2022 21:25:54 -0500 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4026CCD for ; Mon, 26 Dec 2022 18:25:50 -0800 (PST) Received: by mail-pj1-x1034.google.com with SMTP id u4-20020a17090a518400b00223f7eba2c4so12021834pjh.5 for ; Mon, 26 Dec 2022 18:25:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=igel-co-jp.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=DvMG7HI+MNWsEUIqh/BKpMAFptkHeZ7mWrh2CvuyciY=; b=7HVylYQ0632scSj+HTgHmiMQ9nmof478HLpvsoucgyabAEQZNGTPT3Z/qsis+kC59W z35iuuygucSkTPXxU2rQzouhhLGAIzGkvF3m7pk5+8xBSsGt+CbSN0lbq8ILUybz57yy cLyKQLDjZ6MgxEg4kRt1+iYywQ7HR8xyrDuFAzQVwnJcLNyWbuKPoxsVqhr721slS4Za O9+JHGODB/C27e+6KSmMqvmV9uRuZbcKyXuSTupy/YfskVRR+/DQMQ21jpFiz/NpFOp6 qAegzBRb6C6gPU9eBEYbHN/r+zXNOUUvJ1CgMxl8Ye95yh50MnJl1XQGHGC7x49OYu+h WUlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DvMG7HI+MNWsEUIqh/BKpMAFptkHeZ7mWrh2CvuyciY=; b=BOv8rjM2HGUsyJm1H2ctfNIAiKiy5G1duW5nEwvuW2ytnuyZ0J45BpMMSCJkivP3b2 iWBSQOg8KveXhqeBU7L2IQQLeyxLqEVtQqghN6wrni4fDwZe53TvnzL4tmE7nP8A0Fix gIZnO1gD7CHNUbKCtDJrDy/Br7Ling01XBJjKFi90ez7YpbPzkQAt6t6DMdC4G6RbKXX f2/WtEh/HF1Yv0r435mXA2BxvxDU98sR2GwoLK1mdf2bynzgJzQlYDKHiVoEFcKepjPV ZqoPTB5wcuj9LHO1nrnE++rI6XycvymrjlBLlGwNHKeUcsQgYZpJnJpIEOqIJVBNxRmm 1vPw== X-Gm-Message-State: AFqh2kqmvQdb4XDjYV7nGfuXOGzCF36wyZk9E4mvHI+GWGbyMq3TTtV7 cOr9yEhzSTzl8JZIyIVuJ8PGzQ== X-Received: by 2002:a17:902:a584:b0:18f:ac9f:29f6 with SMTP id az4-20020a170902a58400b0018fac9f29f6mr21116232plb.50.1672107950201; Mon, 26 Dec 2022 18:25:50 -0800 (PST) Received: from tyrell.hq.igel.co.jp (napt.igel.co.jp. [219.106.231.132]) by smtp.gmail.com with ESMTPSA id w15-20020a1709026f0f00b001870dc3b4c0sm2465014plk.74.2022.12.26.18.25.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Dec 2022 18:25:49 -0800 (PST) From: Shunsuke Mie To: "Michael S. Tsirkin" , Jason Wang , Rusty Russell Cc: kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Shunsuke Mie Subject: [RFC PATCH 6/9] caif_virtio: convert to new unified vringh APIs Date: Tue, 27 Dec 2022 11:25:28 +0900 Message-Id: <20221227022528.609839-7-mie@igel.co.jp> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221227022528.609839-1-mie@igel.co.jp> References: <20221227022528.609839-1-mie@igel.co.jp> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org vringh_*_kern APIs are being removed without vringh_init_kern(), so change to use new APIs. Signed-off-by: Shunsuke Mie --- drivers/net/caif/caif_virtio.c | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/drivers/net/caif/caif_virtio.c b/drivers/net/caif/caif_virtio.c index 0b0f234b0b50..f9dd79807afa 100644 --- a/drivers/net/caif/caif_virtio.c +++ b/drivers/net/caif/caif_virtio.c @@ -265,18 +265,12 @@ static int cfv_rx_poll(struct napi_struct *napi, int quota) */ if (riov->i == riov->used) { if (cfv->ctx.head != USHRT_MAX) { - vringh_complete_kern(cfv->vr_rx, - cfv->ctx.head, - 0); + vringh_complete(cfv->vr_rx, cfv->ctx.head, 0); cfv->ctx.head = USHRT_MAX; } - err = vringh_getdesc_kern( - cfv->vr_rx, - riov, - NULL, - &cfv->ctx.head, - GFP_ATOMIC); + err = vringh_getdesc(cfv->vr_rx, riov, NULL, + &cfv->ctx.head); if (err <= 0) goto exit; @@ -317,9 +311,9 @@ static int cfv_rx_poll(struct napi_struct *napi, int quota) /* Really out of packets? (stolen from virtio_net)*/ napi_complete(napi); - if (unlikely(!vringh_notify_enable_kern(cfv->vr_rx)) && + if (unlikely(!vringh_notify_enable(cfv->vr_rx)) && napi_schedule_prep(napi)) { - vringh_notify_disable_kern(cfv->vr_rx); + vringh_notify_disable(cfv->vr_rx); __napi_schedule(napi); } break; @@ -329,7 +323,7 @@ static int cfv_rx_poll(struct napi_struct *napi, int quota) dev_kfree_skb(skb); /* Stop NAPI poll on OOM, we hope to be polled later */ napi_complete(napi); - vringh_notify_enable_kern(cfv->vr_rx); + vringh_notify_enable(cfv->vr_rx); break; default: @@ -337,12 +331,12 @@ static int cfv_rx_poll(struct napi_struct *napi, int quota) netdev_warn(cfv->ndev, "Bad ring, disable device\n"); cfv->ndev->stats.rx_dropped = riov->used - riov->i; napi_complete(napi); - vringh_notify_disable_kern(cfv->vr_rx); + vringh_notify_disable(cfv->vr_rx); netif_carrier_off(cfv->ndev); break; } out: - if (rxcnt && vringh_need_notify_kern(cfv->vr_rx) > 0) + if (rxcnt && vringh_need_notify(cfv->vr_rx) > 0) vringh_notify(cfv->vr_rx); return rxcnt; } @@ -352,7 +346,7 @@ static void cfv_recv(struct virtio_device *vdev, struct vringh *vr_rx) struct cfv_info *cfv = vdev->priv; ++cfv->stats.rx_kicks; - vringh_notify_disable_kern(cfv->vr_rx); + vringh_notify_disable(cfv->vr_rx); napi_schedule(&cfv->napi); } @@ -460,7 +454,7 @@ static int cfv_netdev_close(struct net_device *netdev) /* Disable interrupts, queues and NAPI polling */ netif_carrier_off(netdev); virtqueue_disable_cb(cfv->vq_tx); - vringh_notify_disable_kern(cfv->vr_rx); + vringh_notify_disable(cfv->vr_rx); napi_disable(&cfv->napi); /* Release any TX buffers on both used and available rings */ -- 2.25.1