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 7387845FD9; Fri, 3 Jan 2025 20:06:49 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 30861402B4; Fri, 3 Jan 2025 20:06:49 +0100 (CET) Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) by mails.dpdk.org (Postfix) with ESMTP id DFA814021E for ; Fri, 3 Jan 2025 20:06:47 +0100 (CET) Received: by mail-pj1-f44.google.com with SMTP id 98e67ed59e1d1-2ef714374c0so15064868a91.0 for ; Fri, 03 Jan 2025 11:06:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1735931207; x=1736536007; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=kMoBYb2NBJt+EsMReXEN+T8kBPJntTwFluIlbtBqDGw=; b=e7H/LuIskfxBg7Ghh3nQ8i7+gC1hv54jCNTF3mU2Uo2i7Wd1dFSLYdXyzcehRu9DOo 92n1qqDQdfa6ooylFa/PipxqpOGegGg9uXlGXyJO9rVF6Fw6ABFWl6G/vkvtEG3EmIWg hpPNiAe861QIPJby0npekVeZxeUBvdhDVPDwpgpHcBhhSQsXOi5cRTfuaBOvw1yHFnLS nw2eOCmCZRnUm9VwUfNEG/PksPTTs7ElRO/M7ubFhe7XQf9o49xypBiAYDyQ8wscI57g ZuplZQGts62enmWQeJKSlZz9Vho+L4k4LFVVxY0pQU3XJkdqHLh69I7W2DSllG9WX2O3 Yttg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735931207; x=1736536007; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kMoBYb2NBJt+EsMReXEN+T8kBPJntTwFluIlbtBqDGw=; b=pqa787VtYF194SUglIrJorT6T2YivC4LMkMaPr/WwBK11lxOaDW00oIvViUSbEYngo 3Bs6Ap43f36IZ74rvIsAjFODNeRCzHLj6aIZW4daV4UDJ+5VT1YnvEiAMndoGYnxOqZa jTP7Nu7xgbdY4l56uIRVTXODuuG+yRivnfPwJUdE8Xpo2dX97qJtx+TK3LHoZAzCMgou 5gBVAOd/7jLxiv600z25hs0ekw00McNGqjRHqdg6T2T7coG1dyCHHo2m1Yg+SdUHNpw0 pG2lDF8KqbE8U0rV7eNu2UaD+zfbETqnDWGDxfEfrQgOJpALaEjc0aSGtFQd/NYiV63/ vSnw== X-Gm-Message-State: AOJu0YzrsPcaNgglcjMMzuCybo0+MosDMagLq7G6TsTOiz+WYr7s/ewE 6+t4NvQgpuAGR2SQyFSP59KowxXXgKwj5XqtEx8tQHJX/PSLQekpZUJKyxNitdKkkzs/4DncZ12 Lr2g= X-Gm-Gg: ASbGncuyr08ZAtnQK1uF/mrrzTvbhqpBF40NtaI4cMsF75uEzzLGVJnhjjtr0lQjNcC 3sr9D94p9KtNjtQVMft3IH/jyRTczFYsZavoiR52HqObvyV+QGa6eN3oE7U2VzJNkBZI0c5nvyh d7f13uUIYz9sxZyZUwWQ9biYl8HMLH2LvzhWE5qGyZP0KCAFP/fiangFYIksG6VKYQCqnr4225S EfMQ0eqf81gRYFlAG5oNjbE54bRLEAa9z9cOEHcUslZidYC8wf+VDXuj72+H9kXxE0QAWb8e4zK 7d0ka9i6 X-Google-Smtp-Source: AGHT+IG43+kANhBWXreMZHpHeo5A6DW2lq61FqaWdnM6+O3E/J9D98iu4doaK6OomEUuS8xMINToVA== X-Received: by 2002:a17:90b:544f:b0:2ee:8253:9a9f with SMTP id 98e67ed59e1d1-2f4437bf7c4mr80979164a91.11.1735931207098; Fri, 03 Jan 2025 11:06:47 -0800 (PST) Received: from pi5 (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f4478aaa74sm28820104a91.45.2025.01.03.11.06.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jan 2025 11:06:46 -0800 (PST) Date: Fri, 3 Jan 2025 11:06:44 -0800 From: Stephen Hemminger To: "WanRenyong" Cc: , , , , , , , , , Subject: Re: [PATCH v4 04/15] net/xsc: add xsc dev ops to support VFIO driver Message-ID: <20250103110644.7f6c9e0b@pi5> In-Reply-To: <20250103150411.1529663-5-wanry@yunsilicon.com> References: <20250103150404.1529663-1-wanry@yunsilicon.com> <20250103150411.1529663-5-wanry@yunsilicon.com> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; aarch64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII 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 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