From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 85AD4A0471 for ; Fri, 19 Jul 2019 18:15:55 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 477032BA8; Fri, 19 Jul 2019 18:15:54 +0200 (CEST) Received: from mail-pg1-f196.google.com (mail-pg1-f196.google.com [209.85.215.196]) by dpdk.org (Postfix) with ESMTP id 61CA62AB for ; Fri, 19 Jul 2019 18:15:52 +0200 (CEST) Received: by mail-pg1-f196.google.com with SMTP id n9so8456635pgc.1 for ; Fri, 19 Jul 2019 09:15:52 -0700 (PDT) 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=kzfEuxnOAByZB50M+IsEvsrrfpcmDaeuxePOjdEkci0=; b=hyXuT+HiKmwukjESrX62hQkO7cHlH74HWbid0jBxYw7+ph05Ppgo3A2lvevAIGtHar yakKC3HnKY21q4mhUsksi7hydxh1a18Sb8za4/cT7yJ4dreNW9LKxwAVbOGMogysdCzB QMpoZRTT/bW0JJFJxqdwHSATuQg18/DwH+0zfWsSUg8XCbpfg3DreRFbw97g6V7t9RK4 xjE/nVYAhHUEFXgEAId2p0UWrYZQL97lIVhQcElI4Ri+mJnXFAeR7Olxizn9zzDHIg5X kowdeBbPVMbxcSYTkUKNT4OhkX7I9Q7YHR8bWtuGRKR3XCG67a2DM0kMUQWCVxRkuLDo 7UAg== 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=kzfEuxnOAByZB50M+IsEvsrrfpcmDaeuxePOjdEkci0=; b=qLCvGfofmucHbrpsyHOabfF5o3Zr9e385h0pWr93ZAppQiakoGK5y1wrU9iFATvlSR Ng7oiwZgOmZtHiAGSjDukVC/+25wgtPhDgAjA0Uxw0KUpctL2bT8cidZUZMDwP9U+PGX ywaDF3Ur9DfxG3TP0AmhioLOfiRbfKpaksgZ5wqVBqKykrPnpGIVVrq2La8kFs4G0ICT ZvondjyvSFx5CqQpbe1+wem1WwzGYixK37rzGr168t5HOql5++FGBFqOLoJX36TAk2td B2+RKOHkmfq1v9jW8OyhRdHfBBsDbUVwA2fP9Y/BgEV+zm2ezH90oyC+tupr3XZVdEbH Rf2g== X-Gm-Message-State: APjAAAXd6l23KsHQB4ly6VijsrmJb+HvquEGIuJimBhrXkGMjFBMEgeb cIEn4iW39+/HFWT/4EXd3JA= X-Google-Smtp-Source: APXvYqxJYH2xtQ0vkYRtAZhg8rJpohO7ETFeZZsYGh0kQg1lb704ejsK3tBhnURUp8HYoJxfnxcntw== X-Received: by 2002:a63:755e:: with SMTP id f30mr55310053pgn.246.1563552951335; Fri, 19 Jul 2019 09:15:51 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id v184sm29210173pgd.34.2019.07.19.09.15.51 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 19 Jul 2019 09:15:51 -0700 (PDT) Date: Fri, 19 Jul 2019 09:15:44 -0700 From: Stephen Hemminger To: Viacheslav Ovsiienko Cc: dev@dpdk.org, yskoh@mellanox.com, shahafs@mellanox.com Message-ID: <20190719091544.40294c43@hermes.lan> In-Reply-To: <1563514305-27405-2-git-send-email-viacheslavo@mellanox.com> References: <20190712205425.17781-3-stephen@networkplumber.org> <1563514305-27405-1-git-send-email-viacheslavo@mellanox.com> <1563514305-27405-2-git-send-email-viacheslavo@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH 1/2] net/mlx5: cache the associated network device ifindex 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Fri, 19 Jul 2019 05:31:44 +0000 Viacheslav Ovsiienko wrote: > + /* > + * Store associated network device interface index. This index > + * is permanent throughout the lifetime of device. We do not spawn > + * rte_eth_dev ports without associated network device, and if > + * network device is being unbound we get the remove notification > + * message and rte_eth_dev port is also detached. So, we may store > + * the ifindex here and use the cached value further. The network > + * device name can be changed dynamically and should not be cached. > + */ > + assert(spawn->ifindex); > + priv->if_index = spawn->ifindex; This correct, but overkill. 1. The comment is way too wordy. Please stick to only a couple of lines. If you feel more explanation is necessary put that in the commit log. 2. It is perfectly okay to return 0 as a value in dev_info. Therefore the assert is unnecessary. 3. Where is "Reported-by:" 4. What was wrong with my simpler patch?