From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 031D1C4CEC7 for ; Sat, 14 Sep 2019 11:37:54 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id 5D1E220693 for ; Sat, 14 Sep 2019 11:37:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5D1E220693 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=solarflare.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 92C421D418; Sat, 14 Sep 2019 13:37:51 +0200 (CEST) Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [67.231.154.164]) by dpdk.org (Postfix) with ESMTP id 2E4211D161 for ; Sat, 14 Sep 2019 13:37:50 +0200 (CEST) X-Virus-Scanned: Proofpoint Essentials engine Received: from webmail.solarflare.com (webmail.solarflare.com [12.187.104.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mx1-us5.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id 63E164C005B; Sat, 14 Sep 2019 11:37:47 +0000 (UTC) Received: from ocex03.SolarFlarecom.com (10.20.40.36) by ocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Sat, 14 Sep 2019 04:37:43 -0700 Received: from opal.uk.solarflarecom.com (10.17.10.1) by ocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server (TLS) id 15.0.1395.4 via Frontend Transport; Sat, 14 Sep 2019 04:37:43 -0700 Received: from ukv-loginhost.uk.solarflarecom.com (ukv-loginhost.uk.solarflarecom.com [10.17.10.39]) by opal.uk.solarflarecom.com (8.13.8/8.13.8) with ESMTP id x8EBbgq8015390; Sat, 14 Sep 2019 12:37:42 +0100 Received: from ukv-loginhost.uk.solarflarecom.com (localhost [127.0.0.1]) by ukv-loginhost.uk.solarflarecom.com (Postfix) with ESMTP id 5E8AD1613D1; Sat, 14 Sep 2019 12:37:42 +0100 (BST) From: Andrew Rybchenko To: Thomas Monjalon , Ferruh Yigit , Rasesh Mody , Shahed Shaikh , Wenzhuo Lu CC: , Ivan Ilchenko Date: Sat, 14 Sep 2019 12:37:20 +0100 Message-ID: <1568461055-16472-1-git-send-email-arybchenko@solarflare.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1567699852-31693-1-git-send-email-arybchenko@solarflare.com> References: <1567699852-31693-1-git-send-email-arybchenko@solarflare.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-Product-Ver: SMEX-12.5.0.1300-8.5.1010-24910.005 X-TM-AS-Result: No-4.481900-4.000000-10 X-TMASE-MatchedRID: FXGKkZg/B/FpokC3EjW38LmQWToO0X1/oUIbLcCfRuBvn11REP3xnj6P hj6DfZCEPsa/G6kD6DvwyYmEHRk+zytg+qZmq1X/zNIobH2DzGHLvfc3C6SWwiNGK7UC7ElM9WX m+yhJKyj29o+lBuZryKwV5EAxfN52274GmCcL38ZOHhVJB+QhXDal66Y6k2O0Yy6fApvL8BfaRs ciQavS5g1X/MXQ9QK3mJ3WjvKDsUM5a3culOT8ZZ1U1lojafr/W1eClGWYNyjiYlKox3ryNOeyW MLRVf2LK2peykPiuRxWONK17dF3K1tNf1tGHBMOz5CYDcN91JvLRD51bz5RZPye4dYLIdaEdYJ3 pC9XNt7+t3Nakn1H8JzfXTU1r/ZCujLES8Prn94+NrfDUTEXxJUqYZRn9aeRhFgfIrshqgmMFiE Zi1VqucaV2ECx/4/WeOYn0R2HkjpVyim4K7cofGFzg+No/uuNTEFC0zV7bKQLdlFydSqqSopbwG 9fIuITrG5C5h2IgWkZ3apdb7QrApMKhvRh/ZfengIgpj8eDcAZ1CdBJOsoY8RB0bsfrpPInxMye YT53RnfrpDxOwhIKnUCRSS/DXnh5tltc5pQPpst/158Ee7RVeMUu5zTTeipgbZgGazfEZct0Azu jlS7k/X+NglM+Pb5BmF/9OgqDmKTdSRXlCnjBIjjlF305EnAWUm8SESyzd+8353hqEyjk1Zca9R SYo/b X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--4.481900-4.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.5.1010-24910.005 X-MDID: 1568461069-xHpym0cNACqa Subject: [dpdk-dev] [PATCH v3 00/13] ethdev: change promiscuous mode functions to return status 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" It is the second patch series to get rid of void returning functions in ethdev in accordance with deprecation notice [1]. It should be applied on top of the first one [2] which is already applied to dpdk-next-net, but not in main DPDK repo. It could be applied separately, but few simple conflicts should be resolved. Functions which return void are bad since they do not provide explicit information to the caller if everything is OK or not. It is especially painful in the case of promiscuous mode since it is not always supported, there are real cases when it fails to apply and it affects traffic which is received by the port. Driver maintainrs are encouraged to review the patch which changes driver callbacks prototype. Changes are not always trivial when I tried to provide real status of the operation. I used -EAGAIN when I failed to choose better error code. The following two drivers ignore status of internal functions and definitely could be improved: net/bnx2x: bnx2x_set_rx_mode() can report failure, but it is used in other places and should be updated carefully. net/igbvf: e1000_promisc_set_vf() provides return status, but it is unclear how handle it properly. [1] https://patches.dpdk.org/patch/56969/ [2] https://patches.dpdk.org/project/dpdk/list/?series=6391 v3: - list and describe return values of promiscuous mode enable/disalbe callbacks - improve net/failsafe logging in the case of rollback failure to distinguish operation and rollback failure cases - fix build issue in AF_XDP PMD - fix build issue in mlx4 PMD - do not use goto and return error directly in mlx5 - return -E_RTE_SECONDARY in net/enic in the case of secondary process - fix examples/vm_power_manager build v2: - minor style fix in app/testpmd - use fs_err() in net/failsafe in accordance with review from Gaetan - fix net/mvpp2 build - use eth_err() in ethdev Andrew Rybchenko (2): ethdev: change promiscuous callbacks to return status ethdev: do nothing if promiscuous mode is applied again Ivan Ilchenko (11): ethdev: change promiscuous mode controllers to return errors net/failsafe: check code of promiscuous mode switch net/bonding: check code of promiscuous mode switch app/pipeline: check code of promiscuous mode switch app/testpmd: check code of promiscuous mode switch app/eventdev: check code of promiscuous mode switch app/pdump: check code of promiscuous mode switch app/test: check code of promiscuous mode switch kni: check code of promiscuous mode switch test/bonding: check code of promiscuous mode switch examples: take promiscuous mode switch result into account app/pdump/main.c | 8 +- app/test-eventdev/test_perf_common.c | 7 +- app/test-eventdev/test_pipeline_common.c | 7 +- app/test-pipeline/init.c | 5 +- app/test-pmd/cmdline.c | 23 +++--- app/test-pmd/testpmd.c | 14 +++- app/test-pmd/testpmd.h | 1 + app/test-pmd/util.c | 16 ++++ app/test/test_event_eth_rx_adapter.c | 4 +- app/test/test_event_eth_tx_adapter.c | 4 +- app/test/test_kni.c | 7 +- app/test/test_link_bonding.c | 55 +++++++++++--- app/test/test_link_bonding_mode4.c | 16 +++- app/test/test_pmd_perf.c | 6 +- app/test/virtual_pmd.c | 12 ++- doc/guides/rel_notes/deprecation.rst | 1 - doc/guides/rel_notes/release_19_11.rst | 4 + doc/guides/sample_app_ug/flow_classify.rst | 6 +- doc/guides/sample_app_ug/flow_filtering.rst | 15 +++- doc/guides/sample_app_ug/rxtx_callbacks.rst | 5 +- doc/guides/sample_app_ug/skeleton.rst | 6 +- drivers/net/af_packet/rte_eth_af_packet.c | 22 ++++-- drivers/net/af_xdp/rte_eth_af_xdp.c | 22 ++++-- drivers/net/atlantic/atl_ethdev.c | 12 ++- drivers/net/avp/avp_ethdev.c | 12 ++- drivers/net/axgbe/axgbe_ethdev.c | 12 ++- drivers/net/bnx2x/bnx2x_ethdev.c | 8 +- drivers/net/bnxt/bnxt_ethdev.c | 26 +++++-- drivers/net/bonding/rte_eth_bond_8023ad.c | 17 ++++- drivers/net/bonding/rte_eth_bond_pmd.c | 74 +++++++++++++++--- drivers/net/cxgbe/cxgbe_ethdev.c | 12 +-- drivers/net/cxgbe/cxgbe_pfvf.h | 4 +- drivers/net/dpaa/dpaa_ethdev.c | 8 +- drivers/net/dpaa2/dpaa2_ethdev.c | 12 ++- drivers/net/e1000/em_ethdev.c | 12 ++- drivers/net/e1000/igb_ethdev.c | 24 ++++-- drivers/net/enetc/enetc_ethdev.c | 8 +- drivers/net/enic/enic.h | 2 +- drivers/net/enic/enic_ethdev.c | 22 ++++-- drivers/net/enic/enic_main.c | 4 +- drivers/net/failsafe/failsafe_ether.c | 8 +- drivers/net/failsafe/failsafe_ops.c | 52 +++++++++++-- drivers/net/fm10k/fm10k_ethdev.c | 24 ++++-- drivers/net/hinic/hinic_pmd_ethdev.c | 16 +++- drivers/net/i40e/i40e_ethdev.c | 35 ++++++--- drivers/net/i40e/i40e_ethdev_vf.c | 20 +++-- drivers/net/i40e/i40e_vf_representor.c | 8 +- drivers/net/iavf/iavf_ethdev.c | 20 +++-- drivers/net/ice/ice_ethdev.c | 27 +++++-- drivers/net/ipn3ke/ipn3ke_ethdev.h | 4 +- drivers/net/ipn3ke/ipn3ke_representor.c | 8 +- drivers/net/ixgbe/ixgbe_ethdev.c | 50 +++++++++--- drivers/net/liquidio/lio_ethdev.c | 30 +++++--- drivers/net/mlx4/mlx4.h | 4 +- drivers/net/mlx4/mlx4_ethdev.c | 28 +++++-- drivers/net/mlx5/mlx5.h | 4 +- drivers/net/mlx5/mlx5_rxmode.c | 38 ++++++++-- drivers/net/mvneta/mvneta_ethdev.c | 22 ++++-- drivers/net/mvpp2/mrvl_ethdev.c | 28 +++++-- drivers/net/netvsc/hn_ethdev.c | 8 +- drivers/net/netvsc/hn_var.h | 4 +- drivers/net/netvsc/hn_vf.c | 22 +++++- drivers/net/nfb/nfb_rxmode.c | 10 ++- drivers/net/nfb/nfb_rxmode.h | 8 +- drivers/net/nfp/nfp_net.c | 30 +++++--- drivers/net/octeontx/octeontx_ethdev.c | 16 ++-- drivers/net/octeontx2/otx2_ethdev.h | 4 +- drivers/net/octeontx2/otx2_ethdev_ops.c | 8 +- drivers/net/qede/qede_ethdev.c | 16 ++-- drivers/net/sfc/sfc_ethdev.c | 14 ++-- drivers/net/szedata2/rte_eth_szedata2.c | 6 +- drivers/net/tap/rte_eth_tap.c | 52 ++++++++++--- drivers/net/thunderx/nicvf_ethdev.c | 3 +- drivers/net/virtio/virtio_ethdev.c | 24 ++++-- drivers/net/vmxnet3/vmxnet3_ethdev.c | 12 ++- examples/bbdev_app/main.c | 7 +- examples/bond/main.c | 8 +- examples/distributor/main.c | 4 +- examples/eventdev_pipeline/main.c | 4 +- examples/exception_path/main.c | 5 +- examples/flow_classify/flow_classify.c | 4 +- examples/flow_filtering/main.c | 7 +- examples/ip_fragmentation/main.c | 6 +- examples/ip_pipeline/link.c | 7 +- examples/ip_reassembly/main.c | 6 +- examples/ipsec-secgw/ipsec-secgw.c | 9 ++- examples/kni/main.c | 9 ++- examples/l2fwd-cat/l2fwd-cat.c | 4 +- examples/l2fwd-crypto/main.c | 7 +- examples/l2fwd-jobstats/main.c | 9 ++- examples/l2fwd-keepalive/main.c | 6 +- examples/l2fwd/main.c | 6 +- examples/l3fwd-acl/main.c | 9 ++- examples/l3fwd-power/main.c | 9 ++- examples/l3fwd/main.c | 9 ++- examples/link_status_interrupt/main.c | 6 +- examples/load_balancer/init.c | 6 +- .../client_server_mp/mp_server/init.c | 4 +- examples/multi_process/symmetric_mp/main.c | 4 +- examples/netmap_compat/bridge/bridge.c | 6 +- examples/packet_ordering/main.c | 4 +- .../performance-thread/l3fwd-thread/main.c | 9 ++- examples/ptpclient/ptpclient.c | 7 +- examples/qos_meter/main.c | 12 ++- examples/qos_sched/init.c | 6 +- examples/quota_watermark/qw/init.c | 6 +- examples/rxtx_callbacks/main.c | 5 +- examples/server_node_efd/server/init.c | 4 +- examples/skeleton/basicfwd.c | 4 +- examples/vhost/main.c | 11 ++- examples/vm_power_manager/main.c | 4 +- lib/librte_ethdev/rte_ethdev.c | 76 +++++++++++++++---- lib/librte_ethdev/rte_ethdev.h | 14 +++- lib/librte_ethdev/rte_ethdev_core.h | 52 ++++++++++++- lib/librte_kni/rte_kni.c | 14 +++- 115 files changed, 1202 insertions(+), 385 deletions(-) -- 2.17.1