From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f170.google.com (mail-pf0-f170.google.com [209.85.192.170]) by dpdk.org (Postfix) with ESMTP id 20C037CC9 for ; Wed, 31 May 2017 17:13:58 +0200 (CEST) Received: by mail-pf0-f170.google.com with SMTP id e193so12048013pfh.0 for ; Wed, 31 May 2017 08:13:57 -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=NreDd1S44PW6GMUzR5Wir1RqH486hvwEmD9Mp1uIbHo=; b=W0qbK/Z3xnm4tbYleXV1xpzKuaGdLD6aTVSHUkX3aiYm7Zv49WjDbVxXAj59okODre YFjFpE9f/Cx37jCO/OGPyWBi3olTrNSA1bKh5B1owGRxIMY6ak2SmnijAAASBCgefWZ2 9dmUvhSKMVX5mJxhL0M7Zr5MNWn6fts0vVwHcV7XRl+PZ9vJUOQELw/k2UTIf8O4BFjY p7uHR41avdMNudkXQNMa8Sl1ZrWtbBEzng240b22pL2jRxgIkMZWI3+mfk+uM13cavcT zKYdOnx+vG9pU9SI9th8ZI92/pU7E7T/XFuUTXDdhsT21UbOVgG/3SrPwOuHSlcnEIs7 ukfg== 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=NreDd1S44PW6GMUzR5Wir1RqH486hvwEmD9Mp1uIbHo=; b=swWaA5AGBkj/ItNOEHadBWHAnmyJolmyN/xfqJoztWYmAh9yo+i5ufCLpZZi02lf10 fKqqwxenQVIqp3ZRA81IoCW2OvQRqozVLQ0ScnqJ9VdmHpAzb5oyOCzP5VA9msM59jMc 51GP8x16ppvN0sI/MUj4MEJ0CUBRfI7NcXBkkox1xKlA0+q17x92XTXAlcexIG7+Fwd3 auAGRRhV+nzgxdYdz26kMiPhy1nMIb9Ns4XmJW8tgG0NEK1/iKciDCF1UTgiB4pZ7kuM +07HXMM6USK8ENskxEmIU23a4K4Em5WA4fJj4GEpQUZz6Qa56ObJ57mGlEiyzLO/nH7f CYTw== X-Gm-Message-State: AODbwcB5j155PG+vwX4jsiWhR6XcxF/geA/xUOslvhl03Td9/pVWHvOx Kg/im5Sedf8bZDF+kLIuaw== X-Received: by 10.98.76.140 with SMTP id e12mr31155675pfj.142.1496243637163; Wed, 31 May 2017 08:13:57 -0700 (PDT) Received: from xeon-e3 (76-14-207-240.or.wavecable.com. [76.14.207.240]) by smtp.gmail.com with ESMTPSA id p186sm5248085pga.32.2017.05.31.08.13.56 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 31 May 2017 08:13:57 -0700 (PDT) Date: Wed, 31 May 2017 08:13:53 -0700 From: Stephen Hemminger To: Gaetan Rivet Cc: dev@dpdk.org Message-ID: <20170531081353.2103a676@xeon-e3> In-Reply-To: <22f681327bdff42db58d880fd2238d1fbfb2730d.1496065002.git.gaetan.rivet@6wind.com> References: <22f681327bdff42db58d880fd2238d1fbfb2730d.1496065002.git.gaetan.rivet@6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v4 04/12] net/failsafe: add fail-safe PMD 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, 31 May 2017 15:13:58 -0000 On Mon, 29 May 2017 15:42:16 +0200 Gaetan Rivet wrote: > +Fail-safe poll mode driver library > +================================== > + > +The Fail-safe poll mode driver library (**librte_pmd_failsafe**) is a virtual > +device that allows using any device supporting hotplug (sudden device removal > +and plugging on its bus), without modifying other components relying on such > +device (application, other PMDs). What about the case of Hyper-V where the components of the Fail Safe PMD may arrive later. An example would be a NFV server that starts on boot. The synthetic device will be present at boot, but the associated VF device may be plugged in later (by checking SR-IOV on host console) or removed (by unchecking). There doesn't appear to be a way to manage slave devices that get added and removed through CLI management model. > +Using the Fail-safe PMD from the EAL command line > +------------------------------------------------- > + > +The Fail-safe PMD can be used like most other DPDK virtual devices, by passing a > +``--vdev`` parameter to the EAL when starting the application. The device name > +must start with the *net_failsafe* prefix, followed by numbers or letters. This > +name must be unique for each device. Each fail-safe instance must have at least one > +sub-device, up to ``RTE_MAX_ETHPORTS-1``. > + > +A sub-device can be any legal DPDK device, including possibly another fail-safe > +instance. Configuring fail-safe (or any other device) from command line is difficult in a real world application. The EAL command line is difficult API to manipulate programmatically. Why not have a real API? > +static int > +fs_link_update(struct rte_eth_dev *dev, > + int wait_to_complete) > +{ > + struct sub_device *sdev; > + uint8_t i; > + int ret; > + > + FOREACH_SUBDEV_ST(sdev, i, dev, DEV_ACTIVE) { > + DEBUG("Calling link_update on sub_device %d", i); > + ret = (SUBOPS(sdev, link_update))(ETH(sdev), wait_to_complete); > + if (ret && ret != -1) { > + ERROR("Link update failed for sub_device %d with error %d", > + i, ret); > + return ret; > + } > + } > + if (TX_SUBDEV(dev)) { > + struct rte_eth_link *l1; > + struct rte_eth_link *l2; > + > + l1 = &dev->data->dev_link; > + l2 = Ð(TX_SUBDEV(dev))->data->dev_link; > + if (memcmp(l1, l2, sizeof(*l1))) { > + *l1 = *l2; > + return 0; > + } > + } > + return -1; > +} memcmp here is a potential problem since rte_eth_link maybe padded and have holes. Why compare anyway? if *l1 == *l2 the assignment would be a nop. What if links are down? > +static void > +fs_stats_get(struct rte_eth_dev *dev, > + struct rte_eth_stats *stats) > +{ > + memset(stats, 0, sizeof(*stats)); memset here is unnecessary, already done by rte_eth_stats_get