From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl0-f48.google.com (mail-pl0-f48.google.com [209.85.160.48]) by dpdk.org (Postfix) with ESMTP id 20DEF1B345 for ; Tue, 16 Jan 2018 19:26:03 +0100 (CET) Received: by mail-pl0-f48.google.com with SMTP id bd8so6800302plb.9 for ; Tue, 16 Jan 2018 10:26:02 -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=iWlf/Ids+hKF1zbMwuwWzg3VkY0gMhcf3F1x+MoLiVI=; b=PZH7OrOogingAOvf65aoceb84npATqSPhQN4u7nUW660Oa9FKWyqHyc3tAvCfea0Zl IQ+ljJRwWNuUuSvheKwBizlnWZxlrR5M/bU17P9rVfKqXKOH5mu11vcZmnTsB3BLlcLl rq2/qiIOvavxlZ0VucLENEq6E9c3TD3num5TDi9lL/WCUemjm7bJNgEOglokk3+zopN3 2doiIxA0KQhTBlLnuYiFVvZ9DjnhXZKCICQ204VtJvgnvF3ouMKlGWFuVWvwvAE3Kf8n eGnay3uHtrUYqvx7Mzoi/FIbX+S3UHTeu39FUGBBPX9cEUsCfm1CyNfiJDM90vbL1wHu e+kg== 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=iWlf/Ids+hKF1zbMwuwWzg3VkY0gMhcf3F1x+MoLiVI=; b=uRRt82bKsRF/hndG9LMOojle7ueUVMGeLbStW40KqtszRhu8a6VS3pBtAx9P1U3KqE V+aRA0XkoA8qnGnwcOCFOrjMr0wi8RNZBYfV7lcORvWkNZ7p8hCo78FpMBlvgsAonieH aVV5bF4bll1h8MWMhN4a0i8GTqczCsTAjB6KMPyZqaMzgIkQsm9lk5EGfEdbCcy2EqPi dMLU/Jr3/OBUzKlk6lg7M49uzOBdSxbxWSdupGXadpYJGAM4IICW8+OGoLzytI5Xwajy YqYPlVyp2uqNjsOcoAQoiiyYSKk6jc1fZNHyz/dK6lDqPZjkO00Kv0g+ZaCDabKynGXZ yQcg== X-Gm-Message-State: AKwxytdBFqFCMyJCuzikVb3CCVNfcvWNpSbXZhUqfFfV5oZeo0nRjGX4 GMCA0O81QKnORuHRU5W2fLphP/DJfo4= X-Google-Smtp-Source: ACJfBouNCzKavazXdUaeeLGRmicHTp/P9GLJLEV1T0GoxFQoFee+B6IpP/naEk1tZmv6Tt2HIqA2ZQ== X-Received: by 10.159.203.197 with SMTP id r5mr3821178plo.213.1516127161942; Tue, 16 Jan 2018 10:26:01 -0800 (PST) Received: from xeon-e3.lan (204-195-18-133.wavecable.com. [204.195.18.133]) by smtp.gmail.com with ESMTPSA id x17sm3940497pge.50.2018.01.16.10.26.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Jan 2018 10:26:01 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Tue, 16 Jan 2018 10:25:43 -0800 Message-Id: <20180116182558.6254-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.15.1 Subject: [dpdk-dev] [PATCH v4 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:26:03 -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. 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 | 71 ++-------------- 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 | 67 +++------------ 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, 304 insertions(+), 679 deletions(-) -- 2.15.1