From nobody Wed Nov 27 20:52:51 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1697378692; cv=none; d=zohomail.com; s=zohoarc; b=fbZ5WR0tOTJ5NDRS2EE8K9eSodT6x0SC9/Jjod9JtU7n3iG7I0hMsTb3AxmN+n2LtjMmXnbWUX9zJL/42Npy4wKJ6+I2uE8OP2ox+ZJubnIFPWjinheRYpsQE1L7bO/znGVikV5wos+GQsh+kQAaAymCKFIOrPxvicjX27WA5bg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697378692; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:Message-Id:Reply-To:To; bh=3g8IJT6uWVVctIq1l77oTeOIaQXbUPqE/HwHsGc+XSA=; b=SJG142NDYI6y9vodN5KUsea25FcLhjRT+IfYVjK4B7HnfLwGnjld35OvvuWHRSil/wqhkntk3GeBUJpe7GE+m0bUj0+SIEfgsgPiX2Ck9wtj+VKUmsEdqCS/mkwSkzNsxXKxPDkBYh6Dl08qBHdgYUjq03wzp8JO4sJUD4161Xg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1697378692255586.2160558659967; Sun, 15 Oct 2023 07:04:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qs1iK-0001Ls-GJ; Sun, 15 Oct 2023 10:03:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qs1iI-0001LC-LQ for qemu-devel@nongnu.org; Sun, 15 Oct 2023 10:03:26 -0400 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qs1iG-0007iR-VN for qemu-devel@nongnu.org; Sun, 15 Oct 2023 10:03:26 -0400 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-1c9d7a98abbso23829175ad.1 for ; Sun, 15 Oct 2023 07:03:24 -0700 (PDT) Received: from localhost ([2400:4050:a840:1e00:78d2:b862:10a7:d486]) by smtp.gmail.com with UTF8SMTPSA id x11-20020a1709028ecb00b001c3721897fcsm6778042plo.277.2023.10.15.07.03.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 15 Oct 2023 07:03:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1697378603; x=1697983403; darn=nongnu.org; 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=3g8IJT6uWVVctIq1l77oTeOIaQXbUPqE/HwHsGc+XSA=; b=S8KfYbavG+YYJfIXwTTX+Fqe6Zas9X1cfTe232xnHF45JKu0Yn00tAMhFIIMvui6Pp FVSkILM9BJZ+OdNi862BifHzuao6p6Ez2sLN86ZgiYASLuCZUwAn1101qXMawg2k6SYC gc1C9zqqOfZktT849+kHp59NMmZD+Lj3x0+y3TtD+BzzwSCR7nfW4cs+vVqSikrgEuzJ HECThriALXHaJBX1eVXOoo4DL8Jp1hTsyALS1Q9JwjF6P+RkUi8H4v177jKMNhdWFNoT 7V2hV42jqgm6iOY/gTDXZBaoz1yLxuZ1CHdylNLbPT8msRralnyiMUmziihDn2QGPP60 NSRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697378603; x=1697983403; 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=3g8IJT6uWVVctIq1l77oTeOIaQXbUPqE/HwHsGc+XSA=; b=P7BY8XQ+XkFBcxHXjxNMQIUi00PhC1oZDZvn9uEUxEG2gg275CIrUhvWTjmgyheROT +57TzDAdHIXQc6aN78rX0zCJvSx0toy7wtF1S8uFRXJdMNvDYT0sLGtupKE99fmMtJsf RZp05FMsBEtDvwTg7eS7c/y6zo73FctMRKmVtJnPXO/Kj3scGUVLZ8WrhzaQ3jCFzoTi mu70ABZfqDZOBOSkzUNha/EH1kuqnOKVk5Pe3TwMRsdrZrrm/tZFlFFqnuPFrcVYav1x i5qHF72zMG7TTh70G2ZqVz0zoRHoEeTpUoeg7ezCXh/pGspsQs1c+Vd9eTOw0xVBE+OS WIEg== X-Gm-Message-State: AOJu0YzdEjGEHdXkJZoZdP338O5bOQF24kc0+LWlX7kQS497hXByu8/1 jtFujuj20ZuAjI2QX5//vOxTZFMTlkKhl56tY0M2lA== X-Google-Smtp-Source: AGHT+IGBZHYWEuoALtK83el65uFn9YN4sC/d1R6xfERsS6cKoX6N/OgTvo21L8g0kiyHmxPIvUsdyQ== X-Received: by 2002:a17:902:9b8e:b0:1c6:2780:3adc with SMTP id y14-20020a1709029b8e00b001c627803adcmr24350587plp.24.1697378603646; Sun, 15 Oct 2023 07:03:23 -0700 (PDT) From: Akihiko Odaki To: Cc: qemu-devel@nongnu.org, Yuri Benditovich , Andrew Melnychenko , "Michael S . Tsirkin" , Jason Wang , Akihiko Odaki Subject: [PATCH v4 05/20] tap: Remove tap_receive() Date: Sun, 15 Oct 2023 23:02:37 +0900 Message-ID: <20231015140259.259434-6-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231015140259.259434-1-akihiko.odaki@daynix.com> References: <20231015140259.259434-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::62b; envelope-from=akihiko.odaki@daynix.com; helo=mail-pl1-x62b.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20230601.gappssmtp.com) X-ZM-MESSAGEID: 1697378694221100005 Content-Type: text/plain; charset="utf-8" The receive member of NetClientInfo is only for legacy clients and the receive_iov member is always used when it is set. Signed-off-by: Akihiko Odaki --- net/tap.c | 36 ------------------------------------ 1 file changed, 36 deletions(-) diff --git a/net/tap.c b/net/tap.c index 087b2d3bc6..668d69c0de 100644 --- a/net/tap.c +++ b/net/tap.c @@ -131,41 +131,6 @@ static ssize_t tap_receive_iov(NetClientState *nc, con= st struct iovec *iov, return tap_write_packet(s, iovp, iovcnt); } =20 -static ssize_t tap_receive_raw(NetClientState *nc, const uint8_t *buf, siz= e_t size) -{ - TAPState *s =3D DO_UPCAST(TAPState, nc, nc); - struct iovec iov[2]; - int iovcnt =3D 0; - struct virtio_net_hdr_mrg_rxbuf hdr =3D { }; - - if (s->host_vnet_hdr_len) { - iov[iovcnt].iov_base =3D &hdr; - iov[iovcnt].iov_len =3D s->host_vnet_hdr_len; - iovcnt++; - } - - iov[iovcnt].iov_base =3D (char *)buf; - iov[iovcnt].iov_len =3D size; - iovcnt++; - - return tap_write_packet(s, iov, iovcnt); -} - -static ssize_t tap_receive(NetClientState *nc, const uint8_t *buf, size_t = size) -{ - TAPState *s =3D DO_UPCAST(TAPState, nc, nc); - struct iovec iov[1]; - - if (s->host_vnet_hdr_len && !s->using_vnet_hdr) { - return tap_receive_raw(nc, buf, size); - } - - iov[0].iov_base =3D (char *)buf; - iov[0].iov_len =3D size; - - return tap_write_packet(s, iov, 1); -} - #ifndef __sun__ ssize_t tap_read_packet(int tapfd, uint8_t *buf, int maxlen) { @@ -355,7 +320,6 @@ int tap_get_fd(NetClientState *nc) static NetClientInfo net_tap_info =3D { .type =3D NET_CLIENT_DRIVER_TAP, .size =3D sizeof(TAPState), - .receive =3D tap_receive, .receive_iov =3D tap_receive_iov, .poll =3D tap_poll, .cleanup =3D tap_cleanup, --=20 2.42.0