From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f170.google.com (mail-wi0-f170.google.com [209.85.212.170]) by dpdk.org (Postfix) with ESMTP id 3201E2C7A for ; Tue, 14 Jul 2015 00:27:52 +0200 (CEST) Received: by wibud3 with SMTP id ud3so41306446wib.1 for ; Mon, 13 Jul 2015 15:27:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=EMKVipiZFolsfk4e54hn6fOn5SKVmWPfH+rAApdV/a0=; b=eldkkn43a2r3aCwRq0DYX1W19RCxSTUvWPzurLZnPO9r8YV06QNIpjatHMHkn6dBJx 70/tSY8p3VCHt6XLWm4/5eyIVLqypDnXZASy83Azn/XYuN2+XytCOSVBljfPYGI9wz9C pe/rKfQvxDRoeC7lIuW2FcIINMjvwMR1Mx8sJ/qH43FJPPlVNJRREpV50zE2dwq4Ts8b oTa6Y9f+cTkhkhCtuqSE21K+Hz4IfVoW5xyMxAJDGGQsmjjNl/FD7SdFBbQVWT6JsLex NgfvKrDiviFaTKrjiXemzNh4xkmEHYq0qBwnfLLUHzyh9UZHTKvNWSU4/l7CKEMaj+zw 390g== X-Gm-Message-State: ALoCoQlUfIbUmxZclU8u7O8CYumJ+kBPPS6QChV3FhSSDeEzvQS9J2MyHQ73LqgC3JRlaLosQTIp X-Received: by 10.180.10.200 with SMTP id k8mr27227330wib.52.1436826471976; Mon, 13 Jul 2015 15:27:51 -0700 (PDT) Received: from xps13.localnet (136-92-190-109.dsl.ovh.fr. [109.190.92.136]) by smtp.gmail.com with ESMTPSA id ma15sm17024786wic.20.2015.07.13.15.27.50 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Jul 2015 15:27:50 -0700 (PDT) From: Thomas Monjalon To: Liang-Min Larry Wang Date: Tue, 14 Jul 2015 00:26:38 +0200 Message-ID: <27632259.laExyItStL@xps13> Organization: 6WIND User-Agent: KMail/4.14.8 (Linux/4.0.4-2-ARCH; KDE/4.14.8; x86_64; ; ) In-Reply-To: <1436736155-9748-2-git-send-email-liang-min.wang@intel.com> References: <1432946276-9424-1-git-send-email-liang-min.wang@intel.com> <1436736155-9748-1-git-send-email-liang-min.wang@intel.com> <1436736155-9748-2-git-send-email-liang-min.wang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v14 1/4] ethdev: add apis to support access device info X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jul 2015 22:27:52 -0000 2015-07-12 17:22, Liang-Min Larry Wang: > --- a/lib/librte_ether/rte_ethdev.c > +++ b/lib/librte_ether/rte_ethdev.c > @@ -2542,6 +2542,30 @@ rte_eth_dev_mac_addr_remove(uint8_t port_id, struct ether_addr *addr) > } > > int > +rte_eth_dev_default_mac_addr_set(uint8_t port_id, struct ether_addr *addr) > +{ > + struct rte_eth_dev *dev; > + > + if (!rte_eth_dev_is_valid_port(port_id)) { > + PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id); > + return -ENODEV; > + } > + > + if (!is_valid_assigned_ether_addr(addr)) > + return -EINVAL; > + > + dev = &rte_eth_devices[port_id]; > + FUNC_PTR_OR_ERR_RET(*dev->dev_ops->mac_addr_set, -ENOTSUP); > + > + /* Update default address in NIC data structure */ > + ether_addr_copy(addr, &dev->data->mac_addrs[0]); > + > + (*dev->dev_ops->mac_addr_set)(dev, addr); > + > + return 0; > +} It would be cleaner/clearer in a separate patch. Why not using VALID_PORTID_OR_ERR_RET instead of rte_eth_dev_is_valid_port? > +int > +rte_eth_dev_reg_length(uint8_t port_id) [...] > + return (*dev->dev_ops->get_reg_length)(dev); > +} [...] > +int > +rte_eth_dev_reg_info(uint8_t port_id, struct rte_dev_reg_info *info) [...] > + return (*dev->dev_ops->get_reg)(dev, info); > +} [...] > +int > +rte_eth_dev_eeprom_length(uint8_t port_id) [...] > + return (*dev->dev_ops->get_eeprom_length)(dev); > +} These functions should have the "get" word in their names. > --- a/lib/librte_ether/rte_ether_version.map > +++ b/lib/librte_ether/rte_ether_version.map > @@ -102,6 +102,12 @@ DPDK_2.0 { > rte_eth_tx_queue_setup; > rte_eth_xstats_get; > rte_eth_xstats_reset; > + rte_eth_dev_default_mac_addr_set; > + rte_eth_dev_reg_length; > + rte_eth_dev_reg_info; > + rte_eth_dev_eeprom_length; > + rte_eth_dev_get_eeprom; > + rte_eth_dev_set_eeprom; The new symbols should be in a new node for DPDK 2.1.