From nobody Tue Oct 24 19:00:33 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SFLwx5dnfz4yNDq; Tue, 24 Oct 2023 19:00:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SFLwx54rCz4HcZ; Tue, 24 Oct 2023 19:00:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1698174033; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WfxNU7jUTtQh+CdSEmC5YWjYlOEK8FVB+cdTiQae44A=; b=B7/M9rIgJ7qvNobjKTjqkzzLEHYV2SdzpoNfD9mOJTS0EsT+MtdPi+PZZoNovQxTKiv3gK tK6sufVheabHWYLzJfP3UD4UnksY9SVdmWxkGjgTsu2Gt7AlndsvToTij/SMIKgKnaYoXE 3FOLhNSLNWz9vYxC+vRWKf1kJo5hRnq/2Ld6tlXuQhiCaQa5v54bcakS+xL/SVILVO0Deu SYoDPO4/iCL9z71j6VS7vTxls7vcCW+igIq3StWV2CSdBBy1UdJ2TWhFPP18eFv4ndC+1h MeFcPaUYfvHKQF1i9DfJN0Qx7pTkOev/KJKbQP/ZFE0/dGj7bN4WTNqrFFa0Zw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1698174033; a=rsa-sha256; cv=none; b=at6iQw4CKG0aSBzdvGWEkPM5ONfIwKhTWkaEv8jv135SJ//sSnOFdYngYeOK5mvqBvlg4H ytvZ7QEqrzbQ7N3jxWubJBA7n2qD0d7iPMdBmYcovJzbxwatjRl/bnkRBhao4+qICByUiL BdcXK7kYzycnHyAwnEWwLSrkyw9Gv+FAdxXrvwaDRdkgbyH+sye+MaYYTRttWyT9580C8R +uGHemoyQn2NVfU8SI6goR313KJAxSN+jTp0QmBunRIV4mYAsvxrmb94qSI626mg87+k0z XM3O/C00gq2foh5HRoRnzWgxWO6GrunCGRSuJt81tiX44sd3VByr4bH82jaNlQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1698174033; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WfxNU7jUTtQh+CdSEmC5YWjYlOEK8FVB+cdTiQae44A=; b=yvvWwfYGEGnk8I1Aj9HbFHuuXMHCWhOa+CxZM+HBEPybuZ9AWwvZqGCTyBsuZhdCV+A8q4 qRnPleEWg2izMbSb6uOznln0lXayEvr7982oQrOAEVJIC6foCnSx6bIlO8aCtR27hBxwTC r944wU4mw0zKFBJvC80Xyohzyuqw4UXrZJ6ZJs0El6Ck5Y2SMuR7k+v6f4+NVMNsOX86mn CZIHiiATRjxIchQInRxoluRqmb5VzKSxVAHsXGBQdmQXo9Gl11Qn/yb30B/j3rYmzoEsjo g/RZG5F+NPm27UV2kVPh3MRR8B8+51cV+Q2sP2ApnJxN6cJsXmYi9webifZrDA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SFLwx4BjwzZWb; Tue, 24 Oct 2023 19:00:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 39OJ0XxA033347; Tue, 24 Oct 2023 19:00:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 39OJ0XV2033344; Tue, 24 Oct 2023 19:00:33 GMT (envelope-from git) Date: Tue, 24 Oct 2023 19:00:33 GMT Message-Id: <202310241900.39OJ0XV2033344@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 148119e858cb - stable/13 - bhyve: Some fwctl simplifications. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 148119e858cb7adab5d904fec8d176f4f82bf337 Auto-Submitted: auto-generated The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=148119e858cb7adab5d904fec8d176f4f82bf337 commit 148119e858cb7adab5d904fec8d176f4f82bf337 Author: John Baldwin AuthorDate: 2023-10-13 19:26:22 +0000 Commit: John Baldwin CommitDate: 2023-10-24 18:43:49 +0000 bhyve: Some fwctl simplifications. - Collapse IDENT_SEND/IDENT_WAIT states down to a single state. - Remove unused 'len' argument to op_data callback. The value passed in (total amount of remaining data to receive) didn't seem very useful and no op_data implementations used it. Reviewed by: corvink, markj Differential Revision: https://reviews.freebsd.org/D41286 (cherry picked from commit f0852344e7abf4d74508185e67a1b98d6cdbd026) --- usr.sbin/bhyve/fwctl.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/usr.sbin/bhyve/fwctl.c b/usr.sbin/bhyve/fwctl.c index 01b16c38f3a7..5e930cdb2051 100644 --- a/usr.sbin/bhyve/fwctl.c +++ b/usr.sbin/bhyve/fwctl.c @@ -63,8 +63,7 @@ * Back-end state-machine */ static enum state { - IDENT_WAIT, - IDENT_SEND, + IDENT, REQ, RESP } be_state; @@ -75,7 +74,7 @@ static u_int ident_idx; struct op_info { int op; int (*op_start)(uint32_t len); - void (*op_data)(uint32_t data, uint32_t len); + void (*op_data)(uint32_t data); int (*op_result)(struct iovec **data); void (*op_done)(struct iovec *data); }; @@ -120,7 +119,7 @@ errop_start(uint32_t len __unused) } static void -errop_data(uint32_t data __unused, uint32_t len __unused) +errop_data(uint32_t data __unused) { /* ignore */ @@ -192,7 +191,7 @@ fget_start(uint32_t len) } static void -fget_data(uint32_t data, uint32_t len __unused) +fget_data(uint32_t data) { assert(fget_cnt + sizeof(uint32_t) <= sizeof(fget_str)); @@ -347,7 +346,7 @@ fwctl_request_data(uint32_t value) else rinfo.req_size -= sizeof(uint32_t); - (*rinfo.req_op->op_data)(value, rinfo.req_size); + (*rinfo.req_op->op_data)(value); if (rinfo.req_size < sizeof(uint32_t)) { fwctl_request_done(); @@ -360,7 +359,6 @@ fwctl_request_data(uint32_t value) static int fwctl_request(uint32_t value) { - int ret; ret = 0; @@ -451,12 +449,11 @@ fwctl_reset(void) /* Discard partially-received request. */ memset(&rinfo, 0, sizeof(rinfo)); break; - case IDENT_WAIT: - case IDENT_SEND: + case IDENT: break; } - be_state = IDENT_SEND; + be_state = IDENT; ident_idx = 0; } @@ -472,7 +469,7 @@ fwctl_inb(void) retval = 0xff; switch (be_state) { - case IDENT_SEND: + case IDENT: retval = sig[ident_idx++]; if (ident_idx >= sizeof(sig)) be_state = REQ; @@ -580,5 +577,5 @@ fwctl_init(void) ops[OP_GET_LEN] = &fgetlen_info; ops[OP_GET] = &fgetval_info; - be_state = IDENT_WAIT; + be_state = IDENT; }