From nobody Tue Jul 02 08:06:22 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 4WCwTp3C37z5Phk4; Tue, 02 Jul 2024 08:06:22 +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 4WCwTp2H0nz4J3f; Tue, 2 Jul 2024 08:06:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1719907582; 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=CHMJaftQvhG6oxSSG7znWtI4VPwLWfr6+eLrqTJbwxQ=; b=w7OG4GfGUvT//5I/P0fi9tkaUv3fsIy/f8OlQfTvDy9nFAQKt+l+VGt3/REyXY8pLObd6i bcueTc7tF0zDcAvdfcv6LfJFzXDHLUGYGGsEKL+hZQJ0yMubWFng2d74+tjwNxlkV6xNIv SXfcTsCJ7krabu65YUUdW8TXANv8PaEwR0by3jPqio2OrPnPuY+rxWAP3szOP+0UnYzQ6a s3NrHA/sK07n04gyIyFQZ5OzZFoq+NvyxJunUuhVGG4Z8JAV099eVNALieMCQQh+gdHJ6B KF2G5v5iYKMDKMvGzuA5+OP6D+ph6dOaywtY0aH9O3lL6sSGE+NxLPOKHzRXVA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1719907582; a=rsa-sha256; cv=none; b=I2XLf7iUrpGIiW1NL6FqY38UgGbG8r+RSuwjnmTp02UY4uZA1FNqxn3SPkftxGzMHRKzsO J+vqVy9IQjlhpmXcej4zxRlFHiKSRo213eGc1N5C1//cS1h1nZezDZoGEAutgt5LfCf0gF 48ozn3IlhQ6zT2VbOR1i6ZxAlBMXaRMbXWBYClB7S/d5dwHTg33naYPlQ1Cul3EBu/UHMX T8A3U14KGhqhi8wZOYPlZPrxoULrSkCEEMFQ+plwvYC/44bP15PXTr3Wf2p+2f5t1UbEWy jaUU5I0ntWdQEJTTgq/dTwuZS5V4PJnrdyWiZGqGrChq0lN2+kEPxtKsmVYwPQ== 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=1719907582; 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=CHMJaftQvhG6oxSSG7znWtI4VPwLWfr6+eLrqTJbwxQ=; b=Im+2TRFNqNg5zxnQQj9RX8xaRfnJSYbOziYHvSTqA+tMYxTLNZogx4zWoc7h0sAAoByT3N qQ3ro5GC+bc8DthOTJKqngY4fkPHMFS+MzJdTAlZNrDiA0qc/MtZYi8tFqWQjRtxCswsgT xnuaxPdIB8DK8BqUQNAcFfBjsnOxUfwk3KxxuGWShO9oZk1glACV5mx+aeDGCPVwGKjlTp 927Vx0F/AviaBBABaAzKDoTOOL0CHt5cU5L8I5BSByHM5/euTVKYpBhKjd/VC9hd6WC7/3 Xu0MApeuuxImSKBvWpBXP4FnWx9Qi1Jkl1D+ILYiN+RcYDGGlaKJf5e1Os/tfg== 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 4WCwTp1WlJzgNn; Tue, 2 Jul 2024 08:06:22 +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 46286MRr083253; Tue, 2 Jul 2024 08:06:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46286M6w083250; Tue, 2 Jul 2024 08:06:22 GMT (envelope-from git) Date: Tue, 2 Jul 2024 08:06:22 GMT Message-Id: <202407020806.46286M6w083250@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: 5d49a46b845a - stable/14 - 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/14 X-Git-Reftype: branch X-Git-Commit: 5d49a46b845afecee95781c826223f2570ce69b6 Auto-Submitted: auto-generated The branch stable/14 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=5d49a46b845afecee95781c826223f2570ce69b6 commit 5d49a46b845afecee95781c826223f2570ce69b6 Author: Navdeep Parhar AuthorDate: 2024-06-12 22:24:25 +0000 Commit: Kristof Provost CommitDate: 2024-07-01 16:08:06 +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; +}