From nobody Tue Jul 02 08:06:20 2024 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 4WCwTn48b2z5PhbG; Tue, 02 Jul 2024 08:06:21 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WCwTn1XL1z4J3R; Tue, 2 Jul 2024 08:06:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1719907581; 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=pBIjz7A3XqS16fUD5NaRk+E/Sqr7Wjuah59OwdkLAFI=; b=l1sbYoZCU7ND8kolhsTNKRVc5O7UN+XnAyft8Ad5tiY+e3efEihzOjAuf72CQmCyw0OO3m /oQgEKEmqgxFQVa4Mz5960fiuyZhUhzmjE9itSf64WUWyrVS51SjeojYBasUhMuZ3/q94X xJnTrhMbMZhwNAhJ6vF1Y4dKuV6X6NU2vjPGEECqUDnCI6sBKRHX7TcaGfwySEFTZz5GYs jJkbdyC3z64gCdMRK6CC0NltPOMgCYgt4RYVPSAZbW7w5gU+YHjBEMlJ1/WEcpwA0M4p0I Ma91sTI3kC2HwWkwR165NWLPb1J1a1lDJ8ehdffcG9gX3xipeRNVzw0MVD/SXA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1719907581; a=rsa-sha256; cv=none; b=c/+FolaT23V8vbqm3YCTbaJwAawAeEq4RrFsI7QvAB/DmsnAUwwsF3rDCVuFn6ACNyaY6D LkxpngjrM5wJ82796+w7ref4lSPQoc1PyEb6XgMAhNEtaeeTsA1IPHLV7/wUUqbUmuyQ+1 deCh/yKtuiW1A5Y3ZCUblcfTAYjtiBJn/Vj5eCVV2h47pQvY2SyFx6AjtBTInsrFlUKOWL uYbRq0f4lYhgvQYxXA54Yp25/2DczLVrUd/9Uw3DTMOZVVD/ZTS62PSZOwkV/bZMtgpYI6 CZi7Dt4PnTCrgIXnJcCf64IQd//FzJRq8oxGPHZuqczrZoMn9QVfH7t6ewurHw== 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=1719907581; 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=pBIjz7A3XqS16fUD5NaRk+E/Sqr7Wjuah59OwdkLAFI=; b=diySeE+IDskghdtgs8a9tOQG1pIl8mB+wDz2QI4VWt3J993y28iJpioLIVygS2chcCk2sH +A5LaBAiTmpjcankWY+8gjicGRHE2CASxekv16WzejXv4Qt/82SeGGfz20IkOvm6w6RmuZ 771irrG0YH0svas5O/c0D7yzYxguoN9IHYtCMr9q5nf+8iV6F++1fn5atEs44UUzdKpOLK RnNGI3yCXRJO2m23D9hzoIywW2bHdC9U5N1t5z/qB1lz9W816PIrBiu4aB1lMiEoxjJMlb ksk6N46vKIz83Yqn95aG8c6ZU/J9rq2MJCIWHmuvvHyBjDmiyt/gpKC52fybvA== 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 4WCwTn118Bzgb6; Tue, 2 Jul 2024 08:06:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46286K1x083130; Tue, 2 Jul 2024 08:06:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46286K2g083127; Tue, 2 Jul 2024 08:06:20 GMT (envelope-from git) Date: Tue, 2 Jul 2024 08:06:20 GMT Message-Id: <202407020806.46286K2g083127@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: d4fd7d7978f0 - stable/13 - cxgbev(4): Shared code for the VF driver to query a VF's VLAN config. 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d4fd7d7978f03510422a87dcf78edd4a58265150 Auto-Submitted: auto-generated The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=d4fd7d7978f03510422a87dcf78edd4a58265150 commit d4fd7d7978f03510422a87dcf78edd4a58265150 Author: Navdeep Parhar AuthorDate: 2024-06-12 22:24:25 +0000 Commit: Kristof Provost CommitDate: 2024-07-02 07:45:55 +0000 cxgbev(4): Shared code for the VF driver to query a VF's VLAN config. MFC after: 1 week Sponsored by: Chelsio Communications (cherry picked from commit 4471ff11969ec6bd2e5d3c745fc5ba90fda596ed) --- sys/dev/cxgbe/common/common.h | 1 + sys/dev/cxgbe/common/t4vf_hw.c | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/sys/dev/cxgbe/common/common.h b/sys/dev/cxgbe/common/common.h index 0861e3df4bee..0871ca8c40f1 100644 --- a/sys/dev/cxgbe/common/common.h +++ b/sys/dev/cxgbe/common/common.h @@ -944,6 +944,7 @@ int t4vf_get_vfres(struct adapter *adapter); int t4vf_prep_adapter(struct adapter *adapter); int t4vf_get_vf_mac(struct adapter *adapter, unsigned int port, unsigned int *naddr, u8 *addr); +int t4vf_get_vf_vlan(struct adapter *adapter); int t4_bar2_sge_qregs(struct adapter *adapter, unsigned int qid, enum t4_bar2_qtype qtype, int user, u64 *pbar2_qoffset, unsigned int *pbar2_qid); diff --git a/sys/dev/cxgbe/common/t4vf_hw.c b/sys/dev/cxgbe/common/t4vf_hw.c index a0c2eb5f60b3..8091eb5db2f9 100644 --- a/sys/dev/cxgbe/common/t4vf_hw.c +++ b/sys/dev/cxgbe/common/t4vf_hw.c @@ -429,3 +429,30 @@ int t4vf_get_vf_mac(struct adapter *adapter, unsigned int port, return ret; } + +/* + * t4vf_get_vf_vlan - Get the VLAN ID to be set to the VI of this VF. + * @adapter: The adapter + * + * Find the VLAN ID to be set to the VF's VI. The requested VLAN ID + * is from the host OS via callback in the PF driver. + */ +int t4vf_get_vf_vlan(struct adapter *adapter) +{ + struct fw_acl_vlan_cmd cmd = {0}; + int vlan = 0; + int ret = 0; + + cmd.op_to_vfn = htonl(V_FW_CMD_OP(FW_ACL_VLAN_CMD) | + F_FW_CMD_REQUEST | F_FW_CMD_READ); + + /* Note: Do not enable the ACL */ + cmd.en_to_len16 = htonl((unsigned int)FW_LEN16(cmd)); + + ret = t4vf_wr_mbox(adapter, &cmd, sizeof(cmd), &cmd); + + if (!ret) + vlan = be16_to_cpu(cmd.vlanid[0]); + + return vlan; +}