From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f194.google.com (mail-pf0-f194.google.com [209.85.192.194]) by dpdk.org (Postfix) with ESMTP id 966B21B021 for ; Tue, 16 Jan 2018 19:38:04 +0100 (CET) Received: by mail-pf0-f194.google.com with SMTP id y26so2574649pfi.10 for ; Tue, 16 Jan 2018 10:38:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=FhoXVY0x9x2YpyfzqeyLC1bd3Wuf0KS6G5ssOw2tOqM=; b=CfNcj2YklPoSuU4IjQtr+8sDigfrTDF+kG5krd2GaCW+TQJLPMQpZB9PSiwycoA4qx Du36K2E7CcGIfn/SjOxyazpdFuxkQW5kmIE6Jwv+ueTYk2wGsI3strYIKW5usNScCtrG mrgwA54xDqSpHaKJAboP3U/FoZupDLMRBgd5HBkw0kAtms7w0NKJqq1Exr7UBjXrMVWY kkfO8sP1M0vPq8TYtAzlCdet9NY6QjUigQ7qyKrA7JQNttnglW76vQwHH+9kWcX43AP5 2adXtXDdHGNfHIStsGclZ8AqSce09XMh3OOBwYm5dJVtODk9wYYqbYm3GOCI/bMednkO 9yPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=FhoXVY0x9x2YpyfzqeyLC1bd3Wuf0KS6G5ssOw2tOqM=; b=UgGgCrfaZ/Wo835gboTXT9BLkpA9D7mi+B9Zi0m/UPA1tgB0oOsfINSegSbHJ7+Gxy DkMRy3Vpfa+u8Gynh00/gfrILvQKINyxeqn3gpyXcPbO+Tz2ZHPFd/gMiQ/mWTXcs5N0 9ll8w76zGGgfZvcD+HEnQv7JPQvmeYgopbXUt6iUEheEkzPrV8jd+dwUlrwGY9Julrx6 8ZKJnw18BbA/oV0Z8T+3quIqE3n8oppUby1urorr6oNkm1aSQCXH5Jo30NvvYSMnyfca a9bnHB4DIlrsi8kSzC8bZWBOZYyFPYLuWco1fOmz/eq1SJG2dzGsrVEnq0hGOy2NLvzm QFQw== X-Gm-Message-State: AKGB3mJac1v6EqymeiKCKh/l8NnkSPrhYH/QRIk+mWQG9cWCZRqov7if FNCTNk+b3UloMIJydFyzLOzKQ4Rqo3U= X-Google-Smtp-Source: ACJfBosLwgcXnref2U8wu2ba0L2G5oN3/9xfXaNJ7lH4wwWXZwEoSooJIx8RuytleG1s1yrUsH0T7Q== X-Received: by 10.99.111.193 with SMTP id k184mr24199343pgc.378.1516127883034; Tue, 16 Jan 2018 10:38:03 -0800 (PST) Received: from xeon-e3.lan (204-195-18-133.wavecable.com. [204.195.18.133]) by smtp.gmail.com with ESMTPSA id 77sm4560351pfc.187.2018.01.16.10.38.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Jan 2018 10:38:02 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Tue, 16 Jan 2018 10:37:40 -0800 Message-Id: <20180116183755.24542-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.15.1 Subject: [dpdk-dev] [PATCH v5 00/15] common ethdev linkstatus functions 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, 16 Jan 2018 18:38:04 -0000 While reviewing drivers, noticed a lot of unnecessary duplication of code in drivers for handling the eth_dev link status information. While consolidating this, it also became obvious that some drivers behave differently for no good reason. It also was a good chance to introduce atomic exchange primitives in EAL because there are other places using cmpset where not necessary (such as bonding). Mostly only compile tested only, don't have all of the hardware available (except ixgbe and virtio) to test. Note: the eth_dev_link_update function return value is inconsistent across drivers. Should be changed to be void. v5 - checkpatch whitespace cleanup v4 - incorporate review feedback - rename _rte_linkstatus to rte_linkstatus - change return value of _rte_linkstatus - optimize get on 64bit platforms - change return value of rte_linkstatus_set v3 - align rte_linkstatus_get with rte_atomic64_read - virtio use ETH_SPEED_NUM_10G - add net/ v2 - function names changed - rebased to current master Stephen Hemminger (15): eal: introduce atomic exchange operation ethdev: add linkstatus get/set helper functions net/virtio: use eth_linkstatus_set net/vmxnet3: use rte_eth_linkstatus_set net/dpaa2: use rte_eth_linkstatus_set net/nfp: use rte_eth_linkstatus functions net/e1000: use rte_eth_linkstatus helpers net/ixgbe: use rte_eth_linkstatus functions net/sfc: use new rte_eth_linkstatus functions net/i40e: use rte_eth_linkstatus functions net/liquidio: use rte_eth_linkstatus_set net/thunderx: use rte_eth_linkstatus_set net/szedata: use _rte_eth_linkstatus_set net/octeontx: use rte_eth_linkstatus_set net/enic: use rte_eth_linkstatus_set drivers/net/dpaa2/dpaa2_ethdev.c | 75 ++--------------- drivers/net/e1000/em_ethdev.c | 69 ++-------------- drivers/net/e1000/igb_ethdev.c | 70 ++-------------- drivers/net/enic/enic_ethdev.c | 5 +- drivers/net/enic/enic_main.c | 17 ++-- drivers/net/i40e/i40e_ethdev.c | 43 ++-------- drivers/net/i40e/i40e_ethdev_vf.c | 18 +--- drivers/net/ixgbe/ixgbe_ethdev.c | 96 ++++------------------ drivers/net/liquidio/lio_ethdev.c | 53 ++---------- drivers/net/nfp/nfp_net.c | 77 ++--------------- drivers/net/octeontx/octeontx_ethdev.c | 17 +--- drivers/net/sfc/sfc_ethdev.c | 21 +---- drivers/net/sfc/sfc_ev.c | 20 +---- drivers/net/szedata2/rte_eth_szedata2.c | 19 ++--- drivers/net/thunderx/nicvf_ethdev.c | 18 +--- drivers/net/virtio/virtio_ethdev.c | 65 +++------------ drivers/net/vmxnet3/vmxnet3_ethdev.c | 86 ++++--------------- .../common/include/arch/x86/rte_atomic.h | 24 ++++++ .../common/include/arch/x86/rte_atomic_32.h | 12 +++ .../common/include/arch/x86/rte_atomic_64.h | 12 +++ lib/librte_eal/common/include/generic/rte_atomic.h | 78 ++++++++++++++++++ lib/librte_ether/rte_ethdev.c | 22 +---- lib/librte_ether/rte_ethdev.h | 62 ++++++++++++++ 23 files changed, 302 insertions(+), 677 deletions(-) -- 2.15.1