From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1158745FF7; Mon, 6 Jan 2025 03:03:05 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E7D0C40649; Mon, 6 Jan 2025 03:03:04 +0100 (CET) Received: from lf-1-14.ptr.blmpb.com (lf-1-14.ptr.blmpb.com [103.149.242.14]) by mails.dpdk.org (Postfix) with ESMTP id 96D584014F for ; Mon, 6 Jan 2025 03:03:02 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=feishu2403070942; d=yunsilicon.com; t=1736128977; h=from:subject: mime-version:from:date:message-id:subject:to:cc:reply-to:content-type: mime-version:in-reply-to:message-id; bh=IB4ACmaAlZP+Uj2vxRsbGKUQAUWJS543kk7mTmq1yIU=; b=Z+jVr8cFqR2Dg05n+nq4dJIKUlzg0NXKxQnSoPXpIe2TjxgTyydr/cZGO2/s0j/OZtTAc0 5R+U1iae3ptwXR1dF7BIxRBfukC0g1/wzMjT2bNyiK7uB6TWC62Er8DCT8ljGA1cOSVp5T +Inb7YTErTrwYvgTSPsjzP4ay4z1jLTfFbdGX14djc+vuw8Os/zi8T4hYsvl5Lwg0vAMnh YKdpGcnciUbMcRhibr/xAl69uAHxYZPXtW4+f9SnDxnOnAOb0e8BkKGK4lertjItboU8nT +w9vijkkJiBn+KApHsJa4V9dehdMzLluAerdrK0IhYy+O8DcANX2CKijNKZ0lA== Subject: Re: [PATCH v4 04/15] net/xsc: add xsc dev ops to support VFIO driver X-Lms-Return-Path: References: <20250103150404.1529663-1-wanry@yunsilicon.com> <20250103150411.1529663-5-wanry@yunsilicon.com> <20250103110644.7f6c9e0b@pi5> To: "Stephen Hemminger" User-Agent: Mozilla Thunderbird X-Original-From: WanRenyong Cc: , , , , , , , , , Date: Mon, 6 Jan 2025 10:02:56 +0800 Message-Id: <577d91ff-c196-4b64-bdd6-a3ada9747f26@yunsilicon.com> Mime-Version: 1.0 Received: from [127.0.0.1] ([116.231.104.97]) by smtp.feishu.cn with ESMTPS; Mon, 06 Jan 2025 10:02:54 +0800 In-Reply-To: <20250103110644.7f6c9e0b@pi5> From: "WanRenyong" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On 2025/1/4 3:06, Stephen Hemminger wrote: > On Fri, 03 Jan 2025 23:04:13 +0800 > "WanRenyong" wrote: > >> +static int >> +xsc_vfio_get_mac(struct xsc_dev *xdev, uint8_t *mac) >> +{ >> + struct xsc_cmd_query_eth_mac_mbox_in in; >> + struct xsc_cmd_query_eth_mac_mbox_out out; >> + int ret; >> + >> + memset(&in, 0, sizeof(in)); >> + memset(&out, 0, sizeof(out)); >> + in.hdr.opcode = rte_cpu_to_be_16(XSC_CMD_OP_QUERY_ETH_MAC); >> + ret = xsc_vfio_mbox_exec(xdev, &in, sizeof(in), &out, sizeof(out)); >> + if (ret != 0 || out.hdr.status != 0) { >> + PMD_DRV_LOG(ERR, "Failed to get mtu, port=%d, err=%d, out.status=%u", >> + xdev->port_id, ret, out.hdr.status); >> + rte_errno = ENOEXEC; >> + return -rte_errno; >> + } >> + >> + memcpy(mac, out.mac, 6); > Prefer to use RTE_ETHER_ADDR_LEN rather than 6. > Or use rte_ether_addr_copy will fix it in the next version. -- Thanks, WanRenyong