From nobody Fri Nov 04 22:55:57 2022 X-Original-To: dev-commits-src-all@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 4N3wvx2wf9z4h0Ht; Fri, 4 Nov 2022 22:55:57 +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 4N3wvx1zT2z40hC; Fri, 4 Nov 2022 22:55:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667602557; 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=6dRpX7nZ8d/aLF9LGsxPkIGjL5YkHGzr4P7DDMnr+20=; b=kvdnxQw9JcJq+6sbKWWL+GqNLyqRbgz/FlWuf7heX8g+4H/OuwG/jZp8oDCU8y0Ca3xHSu y9yYOAVwDpVFTEyR8ECrKRcqhTz1A6XqZAC4qoJ0tgUt9K49mK5rrIcjycdoTwSsHnQBmw di3Jr96CZv2oDGkGas5+yS1uHAvvHvzWpyEZnOoo5+0QPUGzshP+mSID/tZvpC9zignbhe DrbidIYlB5lWPrtWFhxevack+lGCk72XMvq609Ym2KrbV3QMD3BMn7AUgURScgaiaXYN5U 2FpemZmN0f6tNLsr/EP0ps6x9ZMbzm8D5yKBwqlbLEQmawxTPhvLeFrzaZmqNQ== 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 4N3wvx0r2GzJyq; Fri, 4 Nov 2022 22:55:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2A4MtvGP032796; Fri, 4 Nov 2022 22:55:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2A4MtvIV032795; Fri, 4 Nov 2022 22:55:57 GMT (envelope-from git) Date: Fri, 4 Nov 2022 22:55:57 GMT Message-Id: <202211042255.2A4MtvIV032795@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 2ed061f08d9e - main - if_bnxt: Add support for smaller backing_store_cfg message size List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2ed061f08d9e2fe35bb8ff925cc19768d2430e77 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667602557; 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=6dRpX7nZ8d/aLF9LGsxPkIGjL5YkHGzr4P7DDMnr+20=; b=BI0e94Y5AAmkjJs8alf3O48ToV8EK9AjVssvFOGDwbp3dWUgyKK14DC7IfkHCxGDKzW8iw z2yTBQFmOxUsB50Dr/uZCTWYpODIc9r9qM6EmCqJmUptrJOavrdkjjNnogF15FbPybtZ3T rlTm/DHnik7pGhk4cr9DSS21Rt/QHpJNpCQ7freCW7kKVBJeRxzqsVPStFpi2yNM2N+HmK dJOgaXcGM6fentKEaKslGKgoAc1YgzAA74WenYRyEcBJUzZApEQHtrHqo0mXe5FM1Ca1b8 5KDpWVSq2vQapDCaRUkM9dpTurQhTK/mfRlXUm682s4X8v+cXmycmCfZWhwIlw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1667602557; a=rsa-sha256; cv=none; b=Dw9A4xGXROHrSkEyZ3UQB6saqblmRNxao+1aT0GmiiyHG8rHMsYT2Cz5RE3uJzIx2X5xwf mFk8JDXL4ioj7sBMuGxTxnUlw0SqpbmkS3+J4K2pL4MX1T2s1pWSdun1ILTM2ngirbYab7 D/eE1Z+viXnukWqsXitEX3NUgFGwQxQojH/4T43XTSCGbAlFNirSlVdwyE1GfEOO/+0YyN ki/Q8zCF2d2hcGrL6J2v+lAf4aaW35XEA0vrVcxlNVLJ+nELplJ4LEfhybuWUHzM9eibgV 5744RbUgB+A/dp8bYh9/0Pr8KAW1jKhWkVYb1uMBQMUsgXVBjQZFVLMR02Snsw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=2ed061f08d9e2fe35bb8ff925cc19768d2430e77 commit 2ed061f08d9e2fe35bb8ff925cc19768d2430e77 Author: Sumit Saxena AuthorDate: 2022-11-04 22:33:21 +0000 Commit: Warner Losh CommitDate: 2022-11-04 22:33:21 +0000 if_bnxt: Add support for smaller backing_store_cfg message size Add compat logic to fallback to the older/smaller backing_store_cfg message size. Reviewed by: imp Differentil Revision: https://reviews.freebsd.org/D36447 --- sys/dev/bnxt/bnxt_hwrm.c | 8 ++++++-- sys/dev/bnxt/bnxt_hwrm.h | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/sys/dev/bnxt/bnxt_hwrm.c b/sys/dev/bnxt/bnxt_hwrm.c index 9d74b1ebf65b..46dd8f34a6c5 100644 --- a/sys/dev/bnxt/bnxt_hwrm.c +++ b/sys/dev/bnxt/bnxt_hwrm.c @@ -394,7 +394,7 @@ int bnxt_hwrm_func_backing_store_cfg(struct bnxt_softc *softc, uint32_t enables) struct hwrm_func_backing_store_cfg_input req = {0}; struct bnxt_ctx_mem_info *ctx = softc->ctx_mem; struct bnxt_ctx_pg_info *ctx_pg; - uint32_t *num_entries; + uint32_t *num_entries, req_len = sizeof(req); uint64_t *pg_dir; uint8_t *pg_attr; int i, rc; @@ -481,7 +481,11 @@ int bnxt_hwrm_func_backing_store_cfg(struct bnxt_softc *softc, uint32_t enables) *num_entries = htole32(ctx_pg->entries); bnxt_hwrm_set_pg_attr(&ctx_pg->ring_mem, pg_attr, pg_dir); } - rc = hwrm_send_message(softc, &req, sizeof(req)); + + if (req_len > softc->hwrm_max_ext_req_len) + req_len = BNXT_BACKING_STORE_CFG_LEGACY_LEN; + + rc = hwrm_send_message(softc, &req, req_len); if (rc) rc = -EIO; return rc; diff --git a/sys/dev/bnxt/bnxt_hwrm.h b/sys/dev/bnxt/bnxt_hwrm.h index 8033ddb50136..dde82c0aaff8 100644 --- a/sys/dev/bnxt/bnxt_hwrm.h +++ b/sys/dev/bnxt/bnxt_hwrm.h @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #define BNXT_AUTO_PAUSE_AUTONEG_PAUSE \ (HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAUSE_AUTONEG_PAUSE) #define BNXT_HWRM_SHORT_REQ_LEN sizeof(struct hwrm_short_input) +#define BNXT_BACKING_STORE_CFG_LEGACY_LEN 256 /* HWRM Function Prototypes */ int bnxt_alloc_hwrm_dma_mem(struct bnxt_softc *softc);