Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp387425ybc; Tue, 19 Nov 2019 03:04:50 -0800 (PST) X-Google-Smtp-Source: APXvYqyEDL92J1N5YP2byRGPfbKvXzJ54J2+icnrcLLgE0jiNXDpvCGoJu87oxkSM68MNvRxNyzL X-Received: by 2002:a17:906:cca:: with SMTP id l10mr34294177ejh.161.1574161490128; Tue, 19 Nov 2019 03:04:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574161490; cv=none; d=google.com; s=arc-20160816; b=JF4ThuMkvpp+QwC9ZIZRbKpMgVhkFHd6VNg28LcroGP7c1x8ad5TD1Alfr2gqMHTeu kdyraGFGKWVrEqI5akhNgC4YJl4HCSvTwoaHAq+Y9N5Q1cnl/kFj++zN7InClYJDjvi/ 6wdneNJLhR+Yx/6Lp3jux6fBQI3C/Fd9Iz4JQDVamUXk0ky2UgK7OwnUAfLCh+D7qSiE S0n6nsyoWTrjO6VdBP+99DEzYm8N+ylHqw8ZC9VJ+aIubqjDCp+wTtfHyITD0Dn+PuNu xyBhFlNB9cXNbOijCYTeAWfyIFBs1JoNP73JSzwxGmtRGJZQUlucvCO5h2/71wfpFOZj oQIw== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=T66mtYm8lDvmwsPXa8hv/C73lP40srzfZe7JrCqVWC4=; b=0Ehct94yuJr3KxBxFiOohuHQn1anoPM+Mz0bzTi77dk/OpEXC0ii1MLOIwVR03WBD0 P4G6eCHjDEvonF2SVkfUpBDGMfbf3lKUnJbiAnucVcqdg5aXX4UT8XuNjImlgoY/rogk KEplA/9Sw/uDvOzoChzbVyHNt8AGR613w13wdjiDLGLCHYxgzd1jpW96YUEkX4WlVr/i /b7XKCOmUdvKBLC8Mhqro7EXKBklWFeBGbPbguUzo1dH0CYpHuCePxI/GuxXcUQWUq0W nI0WveZzRIFGPyAqh0y6VnRrMcnrnECMOBPcXTPWtW7Gei6gOfbX2siC5Dttqn3aFjj8 dZxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=RmHjFvax; 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=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q18si15423164eju.333.2019.11.19.03.04.26; Tue, 19 Nov 2019 03:04:50 -0800 (PST) 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=@redhat.com header.s=mimecast20190719 header.b=RmHjFvax; 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=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727737AbfKSLBj (ORCPT + 99 others); Tue, 19 Nov 2019 06:01:39 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:49745 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727738AbfKSLBi (ORCPT ); Tue, 19 Nov 2019 06:01:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574161297; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=T66mtYm8lDvmwsPXa8hv/C73lP40srzfZe7JrCqVWC4=; b=RmHjFvaxHvwzWzyOJiBVvsezAIv0r/OB43GPB5pVK4BCvJyJUaHHAZq8Md7iDUP0xkyghN uvCp46v4fbDTJSi0dvUlmxN6kNq/vE7s5AfQ3+XZ3FKnZMkVIfLW+S4iE6c2ftdJCkTann ipNDJ4h+oIZGDo9MzU29hmyM+zDBw9Y= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-270-eXNRSMGfNiiN3YXcMwWmdQ-1; Tue, 19 Nov 2019 06:01:33 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 216D51005511; Tue, 19 Nov 2019 11:01:32 +0000 (UTC) Received: from steredhat.redhat.com (ovpn-117-41.ams2.redhat.com [10.36.117.41]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3C5AB60BE0; Tue, 19 Nov 2019 11:01:30 +0000 (UTC) From: Stefano Garzarella To: netdev@vger.kernel.org Cc: virtualization@lists.linux-foundation.org, Dexuan Cui , Stefan Hajnoczi , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, "David S. Miller" , Jorgen Hansen Subject: [PATCH net-next 2/6] vsock: add VMADDR_CID_LOCAL definition Date: Tue, 19 Nov 2019 12:01:17 +0100 Message-Id: <20191119110121.14480-3-sgarzare@redhat.com> In-Reply-To: <20191119110121.14480-1-sgarzare@redhat.com> References: <20191119110121.14480-1-sgarzare@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: eXNRSMGfNiiN3YXcMwWmdQ-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The VMADDR_CID_RESERVED (1) was used by VMCI, but now it is not used anymore, so we can reuse it for local communication (loopback) adding the new well-know CID: VMADDR_CID_LOCAL. Cc: Jorgen Hansen Signed-off-by: Stefano Garzarella --- include/uapi/linux/vm_sockets.h | 8 +++++--- net/vmw_vsock/vmci_transport.c | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/include/uapi/linux/vm_sockets.h b/include/uapi/linux/vm_socket= s.h index 68d57c5e99bc..fd0ed7221645 100644 --- a/include/uapi/linux/vm_sockets.h +++ b/include/uapi/linux/vm_sockets.h @@ -99,11 +99,13 @@ =20 #define VMADDR_CID_HYPERVISOR 0 =20 -/* This CID is specific to VMCI and can be considered reserved (even VMCI - * doesn't use it anymore, it's a legacy value from an older release). +/* Use this as the destination CID in an address when referring to the + * local communication (loopback). + * (This was VMADDR_CID_RESERVED, but even VMCI doesn't use it anymore, + * it was a legacy value from an older release). */ =20 -#define VMADDR_CID_RESERVED 1 +#define VMADDR_CID_LOCAL 1 =20 /* Use this as the destination CID in an address when referring to the hos= t * (any process other than the hypervisor). VMCI relies on it being 2, bu= t diff --git a/net/vmw_vsock/vmci_transport.c b/net/vmw_vsock/vmci_transport.= c index 644d32e43d23..4b8b1150a738 100644 --- a/net/vmw_vsock/vmci_transport.c +++ b/net/vmw_vsock/vmci_transport.c @@ -648,7 +648,7 @@ static int vmci_transport_recv_dgram_cb(void *data, str= uct vmci_datagram *dg) static bool vmci_transport_stream_allow(u32 cid, u32 port) { =09static const u32 non_socket_contexts[] =3D { -=09=09VMADDR_CID_RESERVED, +=09=09VMADDR_CID_LOCAL, =09}; =09int i; =20 --=20 2.21.0