From patchwork Thu Jun 16 01:05:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Delevoryas X-Patchwork-Id: 1644052 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=fb.com header.i=@fb.com header.a=rsa-sha256 header.s=facebook header.b=CBiMrnuR; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LNkXV5Gykz9sFx for ; Thu, 16 Jun 2022 11:06:49 +1000 (AEST) Received: from localhost ([::1]:43820 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o1dy9-0005ZR-Gw for incoming@patchwork.ozlabs.org; Wed, 15 Jun 2022 21:06:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44136) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1dx6-0005Xv-6L for qemu-devel@nongnu.org; Wed, 15 Jun 2022 21:05:40 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:47772 helo=mx0a-00082601.pphosted.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1dx4-0006AP-6T for qemu-devel@nongnu.org; Wed, 15 Jun 2022 21:05:39 -0400 Received: from pps.filterd (m0089730.ppops.net [127.0.0.1]) by m0089730.ppops.net (8.17.1.5/8.17.1.5) with ESMTP id 25FLplPM003593 for ; Wed, 15 Jun 2022 18:05:35 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : content-transfer-encoding : mime-version; s=facebook; bh=6SE2UytxxoqHLN05KdARAYhWf1xRfEDsja6swOsc3cA=; b=CBiMrnuRRyPMzUKbZf2CsmcnN8nCndQvVpnJB4g5BH3xn1RCIJVZR0QZQ/NwyveuTAiA OZHKdeg5lbh57cAcazDiFvMywxiWXKqE4DQk9ckCKFTwifjEXOMH1oEEfey1ytSf63lS ELWLftzMn2X45dRl7ROyD9jNTXiChkntsYI= Received: from mail.thefacebook.com ([163.114.132.120]) by m0089730.ppops.net (PPS) with ESMTPS id 3gpr0eht67-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Wed, 15 Jun 2022 18:05:35 -0700 Received: from twshared18213.14.prn3.facebook.com (2620:10d:c085:208::11) by mail.thefacebook.com (2620:10d:c085:11d::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Wed, 15 Jun 2022 18:05:33 -0700 Received: by devvm9194.prn0.facebook.com (Postfix, from userid 385188) id 002CB8092C5C; Wed, 15 Jun 2022 18:05:27 -0700 (PDT) From: Peter Delevoryas To: CC: , , , , , Subject: [PATCH 1/4] slirp: Update submodule to include NC-SI updates Date: Wed, 15 Jun 2022 18:05:23 -0700 Message-ID: <20220616010526.1895564-2-pdel@fb.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220616010526.1895564-1-pdel@fb.com> References: <20220616010526.1895564-1-pdel@fb.com> X-FB-Internal: Safe X-Proofpoint-ORIG-GUID: G9QwjNmqmS6C6VkWH7lfc3YfBJJZ-9ay X-Proofpoint-GUID: G9QwjNmqmS6C6VkWH7lfc3YfBJJZ-9ay X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.874,Hydra:6.0.517,FMLib:17.11.64.514 definitions=2022-06-15_17,2022-06-15_01,2022-02-23_01 Received-SPF: pass client-ip=67.231.153.30; envelope-from=prvs=7166425211=pdel@fb.com; helo=mx0a-00082601.pphosted.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" There hasn't been a new libslirp release yet, but I don't see any reason in particular why we couldn't update to this commit to support the new NC-SI functionality added in !122 and !125, as long as it doesn't break backwards compatibility with anything. [1] https://gitlab.freedesktop.org/slirp/libslirp/-/merge_requests/122 [2] https://gitlab.freedesktop.org/slirp/libslirp/-/merge_requests/125 Signed-off-by: Peter Delevoryas --- slirp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slirp b/slirp index 9d59bb775d..baf336047c 160000 --- a/slirp +++ b/slirp @@ -1 +1 @@ -Subproject commit 9d59bb775d6294c8b447a88512f7bb43f12a25a8 +Subproject commit baf336047c3bb869b3103a6b1b3d8b15e5f1c58d From patchwork Thu Jun 16 01:05:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Delevoryas X-Patchwork-Id: 1644054 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=fb.com header.i=@fb.com header.a=rsa-sha256 header.s=facebook header.b=jEqQAlwb; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LNkXY6KH3z9sFx for ; Thu, 16 Jun 2022 11:06:53 +1000 (AEST) Received: from localhost ([::1]:44048 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o1dyF-0005jZ-Oi for incoming@patchwork.ozlabs.org; Wed, 15 Jun 2022 21:06:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44178) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1dxA-0005h6-G4 for qemu-devel@nongnu.org; Wed, 15 Jun 2022 21:05:44 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:20600 helo=mx0a-00082601.pphosted.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1dx8-0006B7-Tr for qemu-devel@nongnu.org; Wed, 15 Jun 2022 21:05:44 -0400 Received: from pps.filterd (m0089730.ppops.net [127.0.0.1]) by m0089730.ppops.net (8.17.1.5/8.17.1.5) with ESMTP id 25FLpmSi003637 for ; Wed, 15 Jun 2022 18:05:41 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=facebook; bh=kuvJ8lrUMWXw92FcIL6LJKE9GUEqx7TLn/iEjCM07co=; b=jEqQAlwbMQppNkaVHQohbgVA/Sasvfae4DR32SDreUAibpHufKfK9F9SmGKgNQWPyYH+ mQ9L6FdQcqUG4/GRx8ez90ku1uLjDZ8R/lZL7sHAI3wrzetWnyccbOZ5MVxOx4Hl7Ytr JedWIjpkujdX7lv/xvK9q6Vj7gwbhg+vGvg= Received: from mail.thefacebook.com ([163.114.132.120]) by m0089730.ppops.net (PPS) with ESMTPS id 3gpr0eht9n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Wed, 15 Jun 2022 18:05:41 -0700 Received: from twshared31479.05.prn5.facebook.com (2620:10d:c085:108::4) by mail.thefacebook.com (2620:10d:c085:21d::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Wed, 15 Jun 2022 18:05:39 -0700 Received: by devvm9194.prn0.facebook.com (Postfix, from userid 385188) id 0806C8092C5E; Wed, 15 Jun 2022 18:05:28 -0700 (PDT) From: Peter Delevoryas To: CC: , , , , , Subject: [PATCH 2/4] slirp: Update SlirpConfig version to 5 Date: Wed, 15 Jun 2022 18:05:24 -0700 Message-ID: <20220616010526.1895564-3-pdel@fb.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220616010526.1895564-1-pdel@fb.com> References: <20220616010526.1895564-1-pdel@fb.com> MIME-Version: 1.0 X-FB-Internal: Safe X-Proofpoint-ORIG-GUID: Gy2XHAWDCJ6sw9qZoZUuqrG9emzo8N2o X-Proofpoint-GUID: Gy2XHAWDCJ6sw9qZoZUuqrG9emzo8N2o X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.874,Hydra:6.0.517,FMLib:17.11.64.514 definitions=2022-06-15_17,2022-06-15_01,2022-02-23_01 Received-SPF: pass client-ip=67.231.153.30; envelope-from=prvs=7166425211=pdel@fb.com; helo=mx0a-00082601.pphosted.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" I think we probably need a new Slirp release (4.8.0) and a switch statement here instead, right? So that we can preserve the behavior for 4.7.0? Signed-off-by: Peter Delevoryas --- net/slirp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/slirp.c b/net/slirp.c index 8679be6444..75e5ccafd9 100644 --- a/net/slirp.c +++ b/net/slirp.c @@ -617,7 +617,7 @@ static int net_slirp_init(NetClientState *peer, const char *model, s = DO_UPCAST(SlirpState, nc, nc); - cfg.version = SLIRP_CHECK_VERSION(4,7,0) ? 4 : 1; + cfg.version = SLIRP_CHECK_VERSION(4, 7, 0) ? 5 : 1; cfg.restricted = restricted; cfg.in_enabled = ipv4; cfg.vnetwork = net; From patchwork Thu Jun 16 01:05:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Delevoryas X-Patchwork-Id: 1644056 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=fb.com header.i=@fb.com header.a=rsa-sha256 header.s=facebook header.b=RcoP1I/R; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LNkc159sNz9sFx for ; Thu, 16 Jun 2022 11:09:53 +1000 (AEST) Received: from localhost ([::1]:50644 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o1e17-0001mX-PO for incoming@patchwork.ozlabs.org; Wed, 15 Jun 2022 21:09:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44190) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1dxC-0005l1-2C for qemu-devel@nongnu.org; Wed, 15 Jun 2022 21:05:46 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:30134) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1dxA-0006DO-6G for qemu-devel@nongnu.org; Wed, 15 Jun 2022 21:05:45 -0400 Received: from pps.filterd (m0148460.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 25FLptYS020294 for ; Wed, 15 Jun 2022 18:05:43 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : content-transfer-encoding : mime-version; s=facebook; bh=kMA2m3pCu+76vVAwTXXezag0fOdyLjIOWKRvxPwCYLc=; b=RcoP1I/RU4gr6TM/iQC8Of9QmjLXJiu3DgMuYU2UErYjwnQPdmkP27AI1qpRyXnXDwq+ Hb1H721DFA2A7r8+0TjNutCeruKKIvzTol/17OuiCyuY9k9klK4iyDid0wk7JYMbr+1z +KvYnxgcv+2Ey5FWl7tSpPMhP/xGHq/WeXQ= Received: from mail.thefacebook.com ([163.114.132.120]) by mx0a-00082601.pphosted.com (PPS) with ESMTPS id 3gp8awp8ky-13 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Wed, 15 Jun 2022 18:05:43 -0700 Received: from twshared6447.05.prn5.facebook.com (2620:10d:c085:208::f) by mail.thefacebook.com (2620:10d:c085:11d::4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Wed, 15 Jun 2022 18:05:40 -0700 Received: by devvm9194.prn0.facebook.com (Postfix, from userid 385188) id 0FA588092C60; Wed, 15 Jun 2022 18:05:28 -0700 (PDT) From: Peter Delevoryas To: CC: , , , , , Subject: [PATCH 3/4] slirp: Add mfr-id to -netdev options Date: Wed, 15 Jun 2022 18:05:25 -0700 Message-ID: <20220616010526.1895564-4-pdel@fb.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220616010526.1895564-1-pdel@fb.com> References: <20220616010526.1895564-1-pdel@fb.com> X-FB-Internal: Safe X-Proofpoint-GUID: BYJwH5eaycw5D0AvNQBOJ3ZNxfYDdJKW X-Proofpoint-ORIG-GUID: BYJwH5eaycw5D0AvNQBOJ3ZNxfYDdJKW X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.874,Hydra:6.0.517,FMLib:17.11.64.514 definitions=2022-06-15_17,2022-06-15_01,2022-02-23_01 Received-SPF: pass client-ip=67.231.153.30; envelope-from=prvs=7166425211=pdel@fb.com; helo=mx0b-00082601.pphosted.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" This lets you set the manufacturer's ID for a slirp netdev, which can be queried from the guest through the Get Version ID NC-SI command. For example, by setting the manufacturer's ID to 0x8119: wget https://github.com/facebook/openbmc/releases/download/openbmc-e2294ff5d31d/fby35.mtd qemu-system-arm -machine fby35-bmc \ -drive file=fby35.mtd,format=raw,if=mtd -nographic \ -netdev user,id=nic,mfr-id=0x8119,hostfwd=::2222-:22 \ -net nic,model=ftgmac100,netdev=nic ... username: root password: 0penBmc ... root@bmc-oob:~# ncsi-util 0x15 NC-SI Command Response: cmd: GET_VERSION_ID(0x15) Response: COMMAND_COMPLETED(0x0000) Reason: NO_ERROR(0x0000) Payload length = 40 20: 0xf1 0xf0 0xf0 0x00 24: 0x00 0x00 0x00 0x00 28: 0x00 0x00 0x00 0x00 32: 0x00 0x00 0x00 0x00 36: 0x00 0x00 0x00 0x00 40: 0x00 0x00 0x00 0x00 44: 0x00 0x00 0x00 0x00 48: 0x00 0x00 0x00 0x00 52: 0x00 0x00 0x81 0x19 Signed-off-by: Peter Delevoryas Signed-off-by: Peter Delevoryas > --- net/slirp.c | 5 +++-- qapi/net.json | 5 ++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/net/slirp.c b/net/slirp.c index 75e5ccafd9..231068c1e2 100644 --- a/net/slirp.c +++ b/net/slirp.c @@ -413,7 +413,7 @@ static int net_slirp_init(NetClientState *peer, const char *model, const char *vnameserver, const char *vnameserver6, const char *smb_export, const char *vsmbserver, const char **dnssearch, const char *vdomainname, - const char *tftp_server_name, + const char *tftp_server_name, uint32_t mfr_id, Error **errp) { /* default settings according to historic slirp */ @@ -636,6 +636,7 @@ static int net_slirp_init(NetClientState *peer, const char *model, cfg.vnameserver6 = ip6_dns; cfg.vdnssearch = dnssearch; cfg.vdomainname = vdomainname; + cfg.mfr_id = mfr_id; s->slirp = slirp_new(&cfg, &slirp_cb, s); QTAILQ_INSERT_TAIL(&slirp_stacks, s, entry); @@ -1172,7 +1173,7 @@ int net_init_slirp(const Netdev *netdev, const char *name, user->bootfile, user->dhcpstart, user->dns, user->ipv6_dns, user->smb, user->smbserver, dnssearch, user->domainname, - user->tftp_server_name, errp); + user->tftp_server_name, user->mfr_id, errp); while (slirp_configs) { config = slirp_configs; diff --git a/qapi/net.json b/qapi/net.json index d6f7cfd4d6..efc5cb3fb6 100644 --- a/qapi/net.json +++ b/qapi/net.json @@ -167,6 +167,8 @@ # # @tftp-server-name: RFC2132 "TFTP server name" string (Since 3.1) # +# @mfr-id: Manufacturer ID (Private Enterprise Number: IANA) +# # Since: 1.2 ## { 'struct': 'NetdevUserOptions', @@ -192,7 +194,8 @@ '*smbserver': 'str', '*hostfwd': ['String'], '*guestfwd': ['String'], - '*tftp-server-name': 'str' } } + '*tftp-server-name': 'str', + '*mfr-id': 'uint32' } } ## # @NetdevTapOptions: From patchwork Thu Jun 16 01:05:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Delevoryas X-Patchwork-Id: 1644055 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=fb.com header.i=@fb.com header.a=rsa-sha256 header.s=facebook header.b=Ez99gHf9; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LNkbt69skz9sFx for ; Thu, 16 Jun 2022 11:09:46 +1000 (AEST) Received: from localhost ([::1]:50554 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o1e12-0001jA-Ek for incoming@patchwork.ozlabs.org; Wed, 15 Jun 2022 21:09:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44172) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1dxA-0005gY-7u for qemu-devel@nongnu.org; Wed, 15 Jun 2022 21:05:44 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:42124) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1dx8-0006Ax-6g for qemu-devel@nongnu.org; Wed, 15 Jun 2022 21:05:43 -0400 Received: from pps.filterd (m0109334.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 25FLpm0C016703 for ; Wed, 15 Jun 2022 18:05:40 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : content-transfer-encoding : mime-version; s=facebook; bh=fQuZO+deAy8H8ePCJOQ5ayuz8vSU8mN54OiO4QQFUrI=; b=Ez99gHf9Pcg0kjF7vCDfo8egyQG4mt3Ln9QJ3BikzrYuK+IkcCi2PZ/Yjk0Q7pDttpC4 Pe+rruOL1UzfC6k+IvJGOScRPVGGSM+3UB2YNkW8GpfSKrW4l92Y2v6dfuHLNuZrMYEf jjCsNvSH4PEI3oSvDzXz0UvkAn8ZXaT5uu8= Received: from maileast.thefacebook.com ([163.114.130.16]) by mx0a-00082601.pphosted.com (PPS) with ESMTPS id 3gqd2bjccj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Wed, 15 Jun 2022 18:05:40 -0700 Received: from twshared16308.14.prn3.facebook.com (2620:10d:c0a8:1b::d) by mail.thefacebook.com (2620:10d:c0a8:83::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Wed, 15 Jun 2022 18:05:38 -0700 Received: by devvm9194.prn0.facebook.com (Postfix, from userid 385188) id 182308092C62; Wed, 15 Jun 2022 18:05:28 -0700 (PDT) From: Peter Delevoryas To: CC: , , , , , Subject: [PATCH 4/4] slirp: Add oob-eth-addr to -netdev options Date: Wed, 15 Jun 2022 18:05:26 -0700 Message-ID: <20220616010526.1895564-5-pdel@fb.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220616010526.1895564-1-pdel@fb.com> References: <20220616010526.1895564-1-pdel@fb.com> X-FB-Internal: Safe X-Proofpoint-GUID: aALStbiWUMWjNO19CJeXUQ6aQFkxw-gA X-Proofpoint-ORIG-GUID: aALStbiWUMWjNO19CJeXUQ6aQFkxw-gA X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.874,Hydra:6.0.517,FMLib:17.11.64.514 definitions=2022-06-15_17,2022-06-15_01,2022-02-23_01 Received-SPF: pass client-ip=67.231.145.42; envelope-from=prvs=7166425211=pdel@fb.com; helo=mx0a-00082601.pphosted.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" With this change, you can now request the out-of-band MAC address from slirp in fby35-bmc: wget https://github.com/facebook/openbmc/releases/download/openbmc-e2294ff5d31d/fby35.mtd qemu-system-arm -machine fby35-bmc \ -drive file=fby35.mtd,format=raw,if=mtd \ -nographic \ -netdev user,id=nic,mfr-id=0x8119,oob-eth-addr=de:ad:be:ef:ca:fe,hostfwd=::2222-:22 \ -net nic,model=ftgmac100,netdev=nic ... username: root password: 0penBmc ... root@bmc-oob:~# ncsi-util -n eth0 -c 0 0x50 0 0 0x81 0x19 0 0 0x1b 0 NC-SI Command Response: cmd: NCSI_OEM_CMD(0x50) Response: COMMAND_COMPLETED(0x0000) Reason: NO_ERROR(0x0000) Payload length = 24 20: 0x00 0x00 0x81 0x19 24: 0x01 0x00 0x1b 0x00 28: 0x00 0x00 0x00 0x00 32: 0xde 0xad 0xbe 0xef 36: 0xca 0xfe 0x00 0x00 root@bmc-oob:~# ifconfig eth0 Link encap:Ethernet HWaddr DE:AD:BE:EF:CA:FE inet addr:10.0.2.15 Bcast:10.0.2.255 Mask:255.255.255.0 inet6 addr: fec0::dcad:beff:feef:cafe/64 Scope:Site inet6 addr: fe80::dcad:beff:feef:cafe/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:253 errors:0 dropped:0 overruns:0 frame:0 TX packets:271 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:24638 (24.0 KiB) TX bytes:18876 (18.4 KiB) Interrupt:32 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:2 errors:0 dropped:0 overruns:0 frame:0 TX packets:2 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:120 (120.0 B) TX bytes:120 (120.0 B) Signed-off-by: Peter Delevoryas --- net/slirp.c | 13 +++++++++++-- qapi/net.json | 5 ++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/net/slirp.c b/net/slirp.c index 231068c1e2..858d3da859 100644 --- a/net/slirp.c +++ b/net/slirp.c @@ -414,7 +414,7 @@ static int net_slirp_init(NetClientState *peer, const char *model, const char *smb_export, const char *vsmbserver, const char **dnssearch, const char *vdomainname, const char *tftp_server_name, uint32_t mfr_id, - Error **errp) + uint8_t oob_eth_addr[ETH_ALEN], Error **errp) { /* default settings according to historic slirp */ struct in_addr net = { .s_addr = htonl(0x0a000200) }; /* 10.0.2.0 */ @@ -637,6 +637,7 @@ static int net_slirp_init(NetClientState *peer, const char *model, cfg.vdnssearch = dnssearch; cfg.vdomainname = vdomainname; cfg.mfr_id = mfr_id; + memcpy(cfg.oob_eth_addr, oob_eth_addr, ETH_ALEN); s->slirp = slirp_new(&cfg, &slirp_cb, s); QTAILQ_INSERT_TAIL(&slirp_stacks, s, entry); @@ -1142,6 +1143,7 @@ int net_init_slirp(const Netdev *netdev, const char *name, const NetdevUserOptions *user; const char **dnssearch; bool ipv4 = true, ipv6 = true; + MACAddr oob_eth_addr = {}; assert(netdev->type == NET_CLIENT_DRIVER_USER); user = &netdev->u.user; @@ -1166,6 +1168,12 @@ int net_init_slirp(const Netdev *netdev, const char *name, net_init_slirp_configs(user->hostfwd, SLIRP_CFG_HOSTFWD); net_init_slirp_configs(user->guestfwd, 0); + if (user->has_oob_eth_addr && + net_parse_macaddr(oob_eth_addr.a, user->oob_eth_addr) < 0) { + error_setg(errp, "invalid syntax for OOB ethernet address"); + return -1; + } + ret = net_slirp_init(peer, "user", name, user->q_restrict, ipv4, vnet, user->host, ipv6, user->ipv6_prefix, user->ipv6_prefixlen, @@ -1173,7 +1181,8 @@ int net_init_slirp(const Netdev *netdev, const char *name, user->bootfile, user->dhcpstart, user->dns, user->ipv6_dns, user->smb, user->smbserver, dnssearch, user->domainname, - user->tftp_server_name, user->mfr_id, errp); + user->tftp_server_name, user->mfr_id, oob_eth_addr.a, + errp); while (slirp_configs) { config = slirp_configs; diff --git a/qapi/net.json b/qapi/net.json index efc5cb3fb6..7b2c3c205c 100644 --- a/qapi/net.json +++ b/qapi/net.json @@ -169,6 +169,8 @@ # # @mfr-id: Manufacturer ID (Private Enterprise Number: IANA) # +# @oob-eth-addr: Out-of-band ethernet address for BMC +# # Since: 1.2 ## { 'struct': 'NetdevUserOptions', @@ -195,7 +197,8 @@ '*hostfwd': ['String'], '*guestfwd': ['String'], '*tftp-server-name': 'str', - '*mfr-id': 'uint32' } } + '*mfr-id': 'uint32', + '*oob-eth-addr': 'str' } } ## # @NetdevTapOptions: