Message ID | 20240307151849.394962-4-amorenoz@redhat.com |
---|---|
State | RFC |
Headers | show
Return-Path: <ovs-dev-bounces@openvswitch.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=AQrGDle3; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TrCdF1z1qz23hR for <incoming@patchwork.ozlabs.org>; Fri, 8 Mar 2024 02:19:13 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 1566141BB4; Thu, 7 Mar 2024 15:19:11 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lfqUGkIGm4wU; Thu, 7 Mar 2024 15:19:08 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.9.56; helo=lists.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=<UNKNOWN> DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 8E1FA41B98 Authentication-Results: smtp4.osuosl.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=AQrGDle3 Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp4.osuosl.org (Postfix) with ESMTPS id 8E1FA41B98; Thu, 7 Mar 2024 15:19:08 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id D0986C0DD5; Thu, 7 Mar 2024 15:19:07 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 1AA26C0DD7 for <dev@openvswitch.org>; Thu, 7 Mar 2024 15:19:05 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id E4E2041BEF for <dev@openvswitch.org>; Thu, 7 Mar 2024 15:19:04 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id goq7ae-sKuEB for <dev@openvswitch.org>; Thu, 7 Mar 2024 15:19:04 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=170.10.129.124; helo=us-smtp-delivery-124.mimecast.com; envelope-from=amorenoz@redhat.com; receiver=<UNKNOWN> DMARC-Filter: OpenDMARC Filter v1.4.2 smtp2.osuosl.org 35D1C41BCD Authentication-Results: smtp2.osuosl.org; dmarc=pass (p=none dis=none) header.from=redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 35D1C41BCD Authentication-Results: smtp2.osuosl.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=AQrGDle3 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by smtp2.osuosl.org (Postfix) with ESMTPS id 35D1C41BCD for <dev@openvswitch.org>; Thu, 7 Mar 2024 15:19:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1709824743; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gIW3JyZh1fUFBM3pmhtVMUMIH3+B+DvwKnOOaDtsKkY=; b=AQrGDle3pZXg2Cc1rPvCDVQL47QSAYkWVE/BMlebX2PwbfFaQCSoSTo/O1hfkqwD/QAdgg iKu8swsToufR91CI3MdsVewk+eByMg3TnKl7yIV+lHd0HpaBNjXe9vl+NNa+n7tZe/N+D0 XxzQ3YcvSuTAVdqwH7dWleJ0oR/CvQQ= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-689-gU3X7Bb4M6qhkm3DDtoInA-1; Thu, 07 Mar 2024 10:18:58 -0500 X-MC-Unique: gU3X7Bb4M6qhkm3DDtoInA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 34FB08007A7; Thu, 7 Mar 2024 15:18:58 +0000 (UTC) Received: from antares.redhat.com (unknown [10.39.194.51]) by smtp.corp.redhat.com (Postfix) with ESMTP id AFD152166AF0; Thu, 7 Mar 2024 15:18:56 +0000 (UTC) From: Adrian Moreno <amorenoz@redhat.com> To: netdev@vger.kernel.org, dev@openvswitch.org Date: Thu, 7 Mar 2024 16:18:47 +0100 Message-ID: <20240307151849.394962-4-amorenoz@redhat.com> In-Reply-To: <20240307151849.394962-1-amorenoz@redhat.com> References: <20240307151849.394962-1-amorenoz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.6 Cc: yotam.gi@gmail.com, i.maximets@ovn.org, horms@kernel.org Subject: [ovs-dev] [RFC PATCH 3/4] net:openvswitch: Avoid extra copy if no listeners. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: <ovs-dev.openvswitch.org> List-Unsubscribe: <https://mail.openvswitch.org/mailman/options/ovs-dev>, <mailto:ovs-dev-request@openvswitch.org?subject=unsubscribe> List-Archive: <http://mail.openvswitch.org/pipermail/ovs-dev/> List-Post: <mailto:ovs-dev@openvswitch.org> List-Help: <mailto:ovs-dev-request@openvswitch.org?subject=help> List-Subscribe: <https://mail.openvswitch.org/mailman/listinfo/ovs-dev>, <mailto:ovs-dev-request@openvswitch.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" <ovs-dev-bounces@openvswitch.org> |
Series |
net: openvswitch: Add sample multicasting.
|
expand
|
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c index 5a2c0b3b4112..5171aefa6a7c 100644 --- a/net/openvswitch/datapath.c +++ b/net/openvswitch/datapath.c @@ -455,6 +455,10 @@ static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb, if (!dp_ifindex) return -ENODEV; + if (upcall_info->portid == MCAST_PID && + !genl_has_listeners(&dp_packet_genl_family, ovs_dp_get_net(dp), 0)) + return 0; + if (skb_vlan_tag_present(skb)) { nskb = skb_clone(skb, GFP_ATOMIC); if (!nskb)
If there are no listeneres in the multicast group, there is no need for building the upcall packet. Exit early in that case. Signed-off-by: Adrian Moreno <amorenoz@redhat.com> --- net/openvswitch/datapath.c | 4 ++++ 1 file changed, 4 insertions(+)