From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-f195.google.com (mail-pg1-f195.google.com [209.85.215.195]) by dpdk.org (Postfix) with ESMTP id 922672B92 for ; Thu, 30 Aug 2018 00:01:26 +0200 (CEST) Received: by mail-pg1-f195.google.com with SMTP id m4-v6so2903968pgv.12 for ; Wed, 29 Aug 2018 15:01:26 -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=hLRbkFQ4js332A7eypivwM+cA+xYva+EO5ZX+qsHcyU=; b=NGZ9IVdt8qgJ6fSo/DTYiP4ypBoD6wvYI9k/G30C/HMOZ5IZ9en0Q7L+oljLa12lgP 6lVeQAkQBALB9o507BU00j1BqQZmf3fYx6MofjOl4WyV664LNEE+PWxFNeF+dckEYMq8 dvHNox0+GlbpR5HXW1IhNo/ucGvFzfUPtgbmWRI0eZeTc78riIMBSD25MXSiV06xCsCA Hw0UpisHltZkHvGphZvwhqkpXLEaQx/Vfg3JvHjQRXh0shJ/xn5NFdzDlV4Q8aqH37nZ hPmjIh5aptyJTXsehgGqOXilYzbMH7x987WySBFBP/EmMroSP8sHmChqC/DXK2Hb4WwQ qPZg== 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=hLRbkFQ4js332A7eypivwM+cA+xYva+EO5ZX+qsHcyU=; b=ZUXOeR3ddqkiIMZTVrTlyakbZ6kl/Kx8aT/PTkGfJUzXeC4od9PllBQ3T0uiaVAj6y XU8aRCC43yST22I8wYO1FrQntnr1NN7s+s7D0fpos18h85u22MqV3FzlaSMvNiGHvIoZ SPAxVcDytrN6znKxLd35gwKSp6JuXA6uuFD0OnPtlrzWhE++41SXfSA3EYcCR64v/Kui JxI8kmNGtF7S/tY7hrrRwF+j4ACYRDUnGpYkXEMrzcnE9vl8VoWYaRCsRl+55M1Z/jmO oo5WYdWAPJrVLF23Xyw+bfEBlUzafK2LSB8xFEuslFmayJXCpIL08OqnC6kt3D/4lcLA suQw== X-Gm-Message-State: APzg51Af4cYbGFzEvHkc+EJv1ElnHTuxV88XkN9X2OIPeuiH6TrAhN6Z 58tctaQZuC9N0BQ7KrGxDFuE6w== X-Google-Smtp-Source: ANB0VdY+JWnIprELDmaE/AQeEMjvGhI+pXq4pKwLwfsGhXYhZrp8tVnoqstj6+Q8OHZJ6i+wNciI1w== X-Received: by 2002:a65:580a:: with SMTP id g10-v6mr7155623pgr.117.1535580085693; Wed, 29 Aug 2018 15:01:25 -0700 (PDT) Received: from xeon-e3 (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id w69-v6sm13926551pgd.37.2018.08.29.15.01.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 29 Aug 2018 15:01:25 -0700 (PDT) Date: Wed, 29 Aug 2018 15:01:23 -0700 From: Stephen Hemminger To: Dan Gora Cc: Ferruh Yigit , dev@dpdk.org Message-ID: <20180829150123.05d93e27@xeon-e3> In-Reply-To: References: <20180628224513.18391-1-dg@adax.com> <20180629015508.26599-1-dg@adax.com> <20180629015508.26599-11-dg@adax.com> <06764741-fa78-3bef-f790-a4e8d20a4209@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v2 10/10] kni: add API to set link status on kernel interface 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: Wed, 29 Aug 2018 22:01:26 -0000 On Wed, 29 Aug 2018 18:10:35 -0300 Dan Gora wrote: > On Wed, Aug 29, 2018 at 8:48 AM, Ferruh Yigit wrote: > > On 6/29/2018 2:55 AM, Dan Gora wrote: > >> Add a new API function to KNI, rte_kni_update_link() to allow DPDK > >> applications to update the link state for the KNI network interfaces > >> in the linux kernel. > >> > >> Note that the default carrier state is set to off when the interface > >> is opened. > > > > Why set carrier off when interface opened? > > A couple of reasons: > > 1) That's the way every other Ethernet driver in the linux kernel does > it that I've seen. > > 2) The DPDK application may not actually be ready for the interface to > be used when it is first created. Things like NetworkManager, etc > will gladly go trying to assign IP addresses to those interfaces, add > them to the routing table, etc as soon as the interface is marked > "up". By making the default be "down", this allows the application to > finish any initialization on the DPDK side of the interface before > allowing it to be used by the kernel. > > > Although I don't see any difference > > in interface state with or without this call. > > Previously in the 'ip addr' output, the 'state' would be 'UNKNOWN' > when the interface was created. After this patch the 'state' in 'ip > addr' is 'DOWN'. > > thanks > dan There is also a better (richer) API for link status on linux via the operstate functions. Those might better match the semantics of a tunnellish interface like KNI.