From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from office2.cesnet.cz (office2.cesnet.cz [195.113.144.244]) by dpdk.org (Postfix) with ESMTP id 8F25C9A8E for ; Tue, 16 Feb 2016 11:28:02 +0100 (CET) Received: from [IPv6:2001:67c:1220:8b2:f111:de98:b3c0:29c4] (unknown [IPv6:2001:67c:1220:8b2:f111:de98:b3c0:29c4]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by office2.cesnet.cz (Postfix) with ESMTPSA id 12C27ECB34D; Tue, 16 Feb 2016 11:28:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cesnet.cz; s=office2; t=1455618482; bh=05IFjaf7VZ7YmxQKYCGfuinM81Zp5/Pqgj/c6Z8MVIc=; h=Subject:To:References:From:Message-ID:Date:MIME-Version: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=JZHHZ70oEV8x43hax5DGi+CmpmjHxRU/Gc9gqeHQkI/kOR0tOIc6pw4tNJ3Cq6iyh 8ZdevsbfX0Pg96gUopGoUflbIYmEbBS/WTrSzedil77KI2bu2IltAMHUmHchMjJPOA /eNN3G5g5Q7cF+VEqOr7e8LGZ+AtvQf3EFGi2Lqo= To: Marc Sune , dev@dpdk.org, Wenzhuo Lu , Helin Zhang , Harish Patil , Jing Chen References: <1454028127-10401-1-git-send-email-marcdevel@gmail.com> <1455488259-1000-1-git-send-email-marcdevel@gmail.com> <1455488259-1000-4-git-send-email-marcdevel@gmail.com> From: Matej Vido Message-ID: <56C2F9B0.5080204@cesnet.cz> Date: Tue, 16 Feb 2016 11:28:00 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <1455488259-1000-4-git-send-email-marcdevel@gmail.com> Content-Type: text/plain; charset=windows-1250; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH v8 3/4] ethdev: redesign link speed config API 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: Tue, 16 Feb 2016 10:28:02 -0000 Dňa 14.02.2016 o 23:17 Marc Sune napísal(a): > This patch redesigns the API to set the link speed/s configure > for an ethernet port. Specifically: > > - it allows to define a set of advertised speeds for > auto-negociation. > - it allows to disable link auto-negociation (single fixed speed). > - default: auto-negociate all supported speeds. > > Other changes: > > * Added utility MACROs ETH_SPEED_NUM_XXX with the numeric > values of all supported link speeds, in Mbps. > * Converted link_speed to uint64_t to accomodate 100G speeds > and beyond (bug). > * Added autoneg flag in struct rte_eth_link to indicate if > link speed was a result of auto-negociation or was fixed > by configuration. > * Added utility function to convert numeric speeds to bitmap > fields. > * Added rte_eth_speed_to_bm_flag() to version map. > > Signed-off-by: Marc Sune > --- > app/test-pipeline/init.c | 2 +- > app/test-pmd/cmdline.c | 124 +++++++++++++++--------------- > app/test-pmd/config.c | 4 +- > app/test/virtual_pmd.c | 4 +- > drivers/net/af_packet/rte_eth_af_packet.c | 5 +- > drivers/net/bnx2x/bnx2x_ethdev.c | 8 +- > drivers/net/bonding/rte_eth_bond_8023ad.c | 14 ++-- > drivers/net/cxgbe/base/t4_hw.c | 8 +- > drivers/net/cxgbe/cxgbe_ethdev.c | 2 +- > drivers/net/e1000/em_ethdev.c | 116 ++++++++++++++-------------- > drivers/net/e1000/igb_ethdev.c | 111 +++++++++++++------------- > drivers/net/fm10k/fm10k_ethdev.c | 8 +- > drivers/net/i40e/i40e_ethdev.c | 73 +++++++++--------- > drivers/net/i40e/i40e_ethdev_vf.c | 11 +-- > drivers/net/ixgbe/ixgbe_ethdev.c | 78 ++++++++----------- > drivers/net/mlx4/mlx4.c | 6 +- > drivers/net/mpipe/mpipe_tilegx.c | 6 +- > drivers/net/nfp/nfp_net.c | 4 +- > drivers/net/null/rte_eth_null.c | 5 +- > drivers/net/pcap/rte_eth_pcap.c | 9 ++- > drivers/net/ring/rte_eth_ring.c | 5 +- > drivers/net/virtio/virtio_ethdev.c | 2 +- > drivers/net/virtio/virtio_ethdev.h | 2 - > drivers/net/vmxnet3/vmxnet3_ethdev.c | 5 +- > drivers/net/xenvirt/rte_eth_xenvirt.c | 5 +- > examples/ip_pipeline/config_parse.c | 3 +- > lib/librte_ether/rte_ethdev.c | 49 ++++++++++++ > lib/librte_ether/rte_ethdev.h | 113 +++++++++++++++++---------- > lib/librte_ether/rte_ether_version.map | 6 ++ > 29 files changed, 443 insertions(+), 345 deletions(-) > > [...] Hi, some drivers (at least: e1000, i40e, ixgbe, mpipe, nfp, virtio, vmxnet3) use rte_atomic64_cmpset() to read and write link state like: static inline int rte_em_dev_atomic_read_link_status(struct rte_eth_dev *dev, struct rte_eth_link *link) { struct rte_eth_link *dst = link; struct rte_eth_link *src = &(dev->data->dev_link); if (rte_atomic64_cmpset((uint64_t *)dst, *(uint64_t *)dst, *(uint64_t *)src) == 0) return -1; return 0; } static inline int rte_em_dev_atomic_write_link_status(struct rte_eth_dev *dev, struct rte_eth_link *link) { struct rte_eth_link *dst = &(dev->data->dev_link); struct rte_eth_link *src = link; if (rte_atomic64_cmpset((uint64_t *)dst, *(uint64_t *)dst, *(uint64_t *)src) == 0) return -1; return 0; } When link_speed is changed to uint64_t, struct rte_eth_link exceeds 64 bits. Shouldn't these functions be adapted in this patch series? Szedata2 PMD will also use rte_atomic64_cmpset() after patch [1]. I can take care of this change in szedata2 PMD when patch [1] is accepted together with adjusting speeds in szedata2 PMD. [1] http://dpdk.org/ml/archives/dev/2016-January/032281.html Regards, Matej