From nobody Fri Jul 18 19:16:22 2025 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 4bkKK33C5nz62g2h; Fri, 18 Jul 2025 19:16:23 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bkKK240xgz42JG; Fri, 18 Jul 2025 19:16:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752866182; 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=rjXHpSSHkHcUbsL/o3L74bhzxTUgI1y/qpuvJwRj99o=; b=ZzvzLzQN3PxnON/QEEfo/gzNkaSwU4/tT6dIOQgUKT70SC6SvM61zkSiOanzOq+hH/baA5 S9e9Wox6x7tfvHZE2ESRhQrlc+vYo4alJ5BleWI9q7Wrd4ZADQa60AwJtsjZ9rCmuy0t5F lddNC2UOrCucPS4kU8s+rvFzF/10M/2Mh//z1Pbn/tJjtSWsQqkK/LhQeU4CXzqi7y28HQ fCoqhrin8KU9Rjjk7RJfGfK3YEaPSlY78aCpWFCLHSc+OyUzCpetZTTkWNfNsLkh7IwPR/ Whk9pRLWA8on3NZvhnpFsTW2cHPrctubRfYm+dsDEmwdMn5DxSfPEdihJYsCAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752866182; 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=rjXHpSSHkHcUbsL/o3L74bhzxTUgI1y/qpuvJwRj99o=; b=gtAC/QZNpr3nRXPbioS5ci8lapJEUUGqaWL5cjk5oeCMaOlshnBfqGE4+FeAl+8azPNk8g 7X1D6JHEZGl2hx+aT5tXyiStwnuTzOFcPnzhZM5qgngEgu/azFezrBs/MEvqg/7gjJnhGk y6HpKSrbsZd9PNIUcDfLAgMLyWfiaG5wpjYT+f5Jr9WBqoDxSgjue1ABaUD4weDG9kPk+a R6ji/QBYbotA3sW8507NuKzbbndTSzQauLOIPq5RfZZD6/wcFpW6/2xa3kwarj77jLlDyz idlMU6EvwzKjC3jdwXB7+gbPas3n2cVKe07r8paGTUoVw9vqugvodRVCKlnU1w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752866182; a=rsa-sha256; cv=none; b=TWd9QEPKneaeU6qmR0w5TmjOFZPWrFNk8eNGgYf9VSU3ec/goflBmvu8Ehau2cQvmwzZAj dHKgVNITuCu7MH59dOWOm11MFy/YqWCQippEZ5csCtjaDL9p9maS1xvMRu5izSN6dfR7ul U0D02ax9Ddmc8ilIE7ybXAefVTAwhnoLPfCaO9AIrptzQ0fzpAEi2V8TcpzOCBQI370XL6 rVOmdIoviOm9igVzbdzg0hNvu76PUJ1L+amqUEtDLMAsILT1rTiHwVdHVRmbfHuUq8E06R 7HC8r2IK//wEIxrZezaq1eYuWvQk2cAg1dZ43UJ6/1tfWAq60Q23FtrNZ2YzkQ== 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 4bkKK23HPmztl6; Fri, 18 Jul 2025 19:16: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 56IJGMr2001158; Fri, 18 Jul 2025 19:16:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56IJGMCk001155; Fri, 18 Jul 2025 19:16:22 GMT (envelope-from git) Date: Fri, 18 Jul 2025 19:16:22 GMT Message-Id: <202507181916.56IJGMCk001155@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: 046472590365 - main - ice(4): Fix setting VF MAC address 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 046472590365c3bf1e076efa49471d52a033da35 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=046472590365c3bf1e076efa49471d52a033da35 commit 046472590365c3bf1e076efa49471d52a033da35 Author: Krzysztof Galazka AuthorDate: 2025-06-17 15:01:34 +0000 Commit: Warner Losh CommitDate: 2025-07-18 19:16:17 +0000 ice(4): Fix setting VF MAC address MAC address assigned to a Virtual Function using iovctl configuration was not passed to the VF, but its presence caused ICE to reject random address generated by the VF. This lead to VF not being able to send or recieve traffic. Send the administratively assigned MAC address to a VF in a response to the 'Get VF Resources' virtual channel command. While at that replace bcopy with memcpy for consistency, and shorten an over 80 characters line. Signed-off-by: Krzysztof Galazka Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1573 --- sys/dev/ice/ice_iov.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/sys/dev/ice/ice_iov.c b/sys/dev/ice/ice_iov.c index e06c7eb56f7a..c5a3e1060e44 100644 --- a/sys/dev/ice/ice_iov.c +++ b/sys/dev/ice/ice_iov.c @@ -345,7 +345,7 @@ ice_iov_add_vf(struct ice_softc *sc, uint16_t vfnum, const nvlist_t *params) if (nvlist_exists_binary(params, "mac-addr")) { mac = nvlist_get_binary(params, "mac-addr", &size); - bcopy(mac, vf->mac, ETHER_ADDR_LEN); + memcpy(vf->mac, mac, ETHER_ADDR_LEN); if (nvlist_get_bool(params, "allow-set-mac")) vf->vf_flags |= VF_FLAG_SET_MAC_CAP; @@ -617,12 +617,14 @@ ice_vc_get_vf_res_msg(struct ice_softc *sc, struct ice_vf *vf, u8 *msg_buf) { struct ice_hw *hw = &sc->hw; struct virtchnl_vf_resource *vf_res; + struct virtchnl_vsi_resource *vsi_res; u16 vf_res_len; u32 vf_caps; /* XXX: Only support one VSI per VF, so this size doesn't need adjusting */ vf_res_len = sizeof(struct virtchnl_vf_resource); - vf_res = (struct virtchnl_vf_resource *)malloc(vf_res_len, M_ICE, M_WAITOK | M_ZERO); + vf_res = (struct virtchnl_vf_resource *)malloc(vf_res_len, M_ICE, + M_WAITOK | M_ZERO); vf_res->num_vsis = 1; vf_res->num_queue_pairs = vf->vsi->num_tx_queues; @@ -643,10 +645,13 @@ ice_vc_get_vf_res_msg(struct ice_softc *sc, struct ice_vf *vf, u8 *msg_buf) vf_res->vf_cap_flags |= VIRTCHNL_VF_OFFLOAD_WB_ON_ITR; } - vf_res->vsi_res[0].vsi_id = vf->vsi->idx; - vf_res->vsi_res[0].num_queue_pairs = vf->vsi->num_tx_queues; - vf_res->vsi_res[0].vsi_type = VIRTCHNL_VSI_SRIOV; - vf_res->vsi_res[0].qset_handle = 0; + vsi_res = &vf_res->vsi_res[0]; + vsi_res->vsi_id = vf->vsi->idx; + vsi_res->num_queue_pairs = vf->vsi->num_tx_queues; + vsi_res->vsi_type = VIRTCHNL_VSI_SRIOV; + vsi_res->qset_handle = 0; + if (!ETHER_IS_ZERO(vf->mac)) + memcpy(vsi_res->default_mac_addr, vf->mac, ETHER_ADDR_LEN); ice_aq_send_msg_to_vf(hw, vf->vf_num, VIRTCHNL_OP_GET_VF_RESOURCES, VIRTCHNL_STATUS_SUCCESS, (u8 *)vf_res, vf_res_len, NULL);