From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-f193.google.com (mail-pg1-f193.google.com [209.85.215.193]) by dpdk.org (Postfix) with ESMTP id E7B8827D for ; Tue, 26 Feb 2019 16:46:08 +0100 (CET) Received: by mail-pg1-f193.google.com with SMTP id h11so6411642pgl.0 for ; Tue, 26 Feb 2019 07:46:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kkpp7AfCicHfm2nwuBwPdMbdIitFxFawc+fggbG2D4Q=; b=G5cjFPHvVpnrMRAyZVmGZvfSKzvq117J35WRFb/YMWaAUsJ1Rk5dkfw77Ebx3XLuAR 2vtX+Gx5Btr4ndeLqcPPjQkpYU2IhtKy66bi7IM16jTyqwUT6M2w1DFdDlqCBB76f8mD bb2qfC4ptw4/ef6RSHgGfRrOObCTTzsYn7GmvwBSxrRebXWBBpMJvEycNikVJgwQLcj0 Wk1xfD8hXoH5OuMrwFAUBLCzQ24ADG2TqWfJzcB5Vz/1+967x0G9zd8nfTxZY7O4KwSs k1tOnhOS9ru1hP5FVQOe7AGqHGggdBjGwoDmZAvDKYVQSnRgrCDZr/bXiLfi5NvqOu9l ig2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kkpp7AfCicHfm2nwuBwPdMbdIitFxFawc+fggbG2D4Q=; b=GAxAZx+ZtGYla2fdkdXC6XYcDgblCJDysH3fdStjXl+MX12miwct/JexoLAwRCgSeh 1lbWGXcZRQDLzEF/Y9/e1Yb4T/AftWKb6auBokNlF4Ujh2/NoFasW9mWo1vlpUp8Xki/ FQblXEgad2u7tBPwFibcQUUlD7Wth2bJJzHfoYgRjuGCY8ZJ58RRuCQK7wox1ObpuHy9 WMbtPMoiF4W46peLZYSUKcUUYfl79gibTSPHn8sJ1e0EH14dBB5Xf03I/onzp3yB8nI+ I0MbdxhD4cecRB8w7QcYJps4qeKKNOhkbK2yUw5Y+WI28WaC+iOdOmKI8HtX/8AQooRJ Vqgg== X-Gm-Message-State: AHQUAuZkLrYCC3fqXVCRFCN3ZyX4QYvBpCcXrq6WrU5BmFmEgr92vjmI d1qGTrhwKDuidr1On9tD3+yq5HTsNHM= X-Google-Smtp-Source: AHgI3IbjWlGQ6DCMGJZO3zW/du8aznyuKNuEJCiIH3pn4BbP9JUHDR2B3aAUW+WZB6azZ8aYoURX8w== X-Received: by 2002:a62:3a01:: with SMTP id h1mr25982909pfa.169.1551195967796; Tue, 26 Feb 2019 07:46:07 -0800 (PST) Received: from shemminger-XPS-13-9360 (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id k74sm32079616pfb.172.2019.02.26.07.46.07 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Feb 2019 07:46:07 -0800 (PST) Date: Tue, 26 Feb 2019 07:46:04 -0800 From: Stephen Hemminger To: Rastislav Cernay Cc: dev@dpdk.org Message-ID: <20190226074604.228632d3@shemminger-XPS-13-9360> In-Reply-To: <1551185824-5501-2-git-send-email-cernay@netcope.com> References: <1551185824-5501-1-git-send-email-cernay@netcope.com> <1551185824-5501-2-git-send-email-cernay@netcope.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] net/nfb: new netcope driver X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2019 15:46:09 -0000 On Tue, 26 Feb 2019 13:57:04 +0100 Rastislav Cernay wrote: > +static void > +nfb_eth_dev_info(struct rte_eth_dev *dev, > + struct rte_eth_dev_info *dev_info) > +{ > + dev_info->if_index = 0; > + dev_info->max_mac_addrs = 1; > + dev_info->max_rx_pktlen = (uint32_t)-1; > + dev_info->max_rx_queues = dev->data->nb_rx_queues; > + dev_info->max_tx_queues = dev->data->nb_tx_queues; > + dev_info->min_rx_bufsize = 0; > + dev_info->speed_capa = ETH_LINK_SPEED_100G; > +} Minor nit, you don't need to zero entries here, the calling code (in rte_eth_dev_info_get) already does a memset. +static int +nfb_eth_link_update(struct rte_eth_dev *dev, + int wait_to_complete __rte_unused) +{ + uint16_t i; + struct rte_eth_link link; + memset(&link, 0, sizeof(link)); + + struct pmd_internals *internals = (struct pmd_internals *) + dev->data->dev_private; Since dev_private is a void * cast is unnecessary + struct nc_rxmac_status status; + status.speed = MAC_SPEED_UNKNOWN; + + link.link_speed = ETH_SPEED_NUM_NONE; + link.link_status = ETH_LINK_DOWN; + link.link_duplex = ETH_LINK_FULL_DUPLEX; + link.link_autoneg = ETH_LINK_SPEED; Don't mix declarations with code. You can use C99 structure initialization to avoid memset here.