From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3137BA00C2 for ; Tue, 8 Mar 2022 15:15:53 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2CB204068B; Tue, 8 Mar 2022 15:15:53 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 4361D40E03 for ; Tue, 8 Mar 2022 15:15:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1646748951; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=onuXwNzzIY3LJssS7qo3azX34EnELoIj2jT2ccEgWyU=; b=Ap8oAc2h6tr/3cuGLHqgg/JibeqWh2WtmQ3HJFZFqn1Ay4wW+XJnCNe6Pl1bglhKlLtEXo JYSyD4hKkQmqq8REq+X3sLehpuqh9b3Zee87iUjFNcwX5I2Rsgw6U1bMiaPn+z4SHzjKCM KLMDaqM4QrK/pdEeeeMAEb9jpUAFTt8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-278-V-kcZEyjPgO3cPTPIZEw6Q-1; Tue, 08 Mar 2022 09:15:48 -0500 X-MC-Unique: V-kcZEyjPgO3cPTPIZEw6Q-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E07321091DA1; Tue, 8 Mar 2022 14:15:47 +0000 (UTC) Received: from rh.Home (unknown [10.39.195.190]) by smtp.corp.redhat.com (Postfix) with ESMTP id E826085EE5; Tue, 8 Mar 2022 14:15:46 +0000 (UTC) From: Kevin Traynor To: Steve Yang Cc: Qi Zhang , dpdk stable Subject: patch 'net/iavf: fix function pointer in multi-process' has been queued to stable release 21.11.1 Date: Tue, 8 Mar 2022 14:14:31 +0000 Message-Id: <20220308141500.286915-16-ktraynor@redhat.com> In-Reply-To: <20220308141500.286915-1-ktraynor@redhat.com> References: <20220308141500.286915-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ktraynor@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 21.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 03/14/22. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/c431fe062378e7f3453aa41ffd7686230f63be8f Thanks. Kevin --- >From c431fe062378e7f3453aa41ffd7686230f63be8f Mon Sep 17 00:00:00 2001 From: Steve Yang Date: Mon, 28 Feb 2022 09:48:59 +0000 Subject: [PATCH] net/iavf: fix function pointer in multi-process [ upstream commit 0ed16e01313e1f8930dc6a52b22159b20269d4e0 ] This patch uses the index value to call the function, instead of the function pointer assignment to save the selection of Receive Flex Descriptor profile ID. Otherwise the secondary process will run with wrong function address from primary process. Fixes: 12b435bf8f2f ("net/iavf: support flex desc metadata extraction") Signed-off-by: Steve Yang Acked-by: Qi Zhang --- drivers/net/iavf/iavf_rxtx.c | 40 +++++++++++++++++++----------------- drivers/net/iavf/iavf_rxtx.h | 2 -- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c index 29ab1b84f2..60d6b20004 100644 --- a/drivers/net/iavf/iavf_rxtx.c +++ b/drivers/net/iavf/iavf_rxtx.c @@ -477,52 +477,54 @@ iavf_rxd_to_pkt_fields_by_comms_aux_v2(struct iavf_rx_queue *rxq, } +static const +iavf_rxd_to_pkt_fields_t rxd_to_pkt_fields_ops[] = { + [IAVF_RXDID_COMMS_AUX_VLAN] = iavf_rxd_to_pkt_fields_by_comms_aux_v1, + [IAVF_RXDID_COMMS_AUX_IPV4] = iavf_rxd_to_pkt_fields_by_comms_aux_v1, + [IAVF_RXDID_COMMS_AUX_IPV6] = iavf_rxd_to_pkt_fields_by_comms_aux_v1, + [IAVF_RXDID_COMMS_AUX_IPV6_FLOW] = + iavf_rxd_to_pkt_fields_by_comms_aux_v1, + [IAVF_RXDID_COMMS_AUX_TCP] = iavf_rxd_to_pkt_fields_by_comms_aux_v1, + [IAVF_RXDID_COMMS_AUX_IP_OFFSET] = + iavf_rxd_to_pkt_fields_by_comms_aux_v2, + [IAVF_RXDID_COMMS_IPSEC_CRYPTO] = + iavf_rxd_to_pkt_fields_by_comms_aux_v2, + [IAVF_RXDID_COMMS_OVS_1] = iavf_rxd_to_pkt_fields_by_comms_ovs, +}; + static void iavf_select_rxd_to_pkt_fields_handler(struct iavf_rx_queue *rxq, uint32_t rxdid) { + rxq->rxdid = rxdid; + switch (rxdid) { case IAVF_RXDID_COMMS_AUX_VLAN: rxq->xtr_ol_flag = rte_pmd_ifd_dynflag_proto_xtr_vlan_mask; - rxq->rxd_to_pkt_fields = - iavf_rxd_to_pkt_fields_by_comms_aux_v1; break; case IAVF_RXDID_COMMS_AUX_IPV4: rxq->xtr_ol_flag = rte_pmd_ifd_dynflag_proto_xtr_ipv4_mask; - rxq->rxd_to_pkt_fields = - iavf_rxd_to_pkt_fields_by_comms_aux_v1; break; case IAVF_RXDID_COMMS_AUX_IPV6: rxq->xtr_ol_flag = rte_pmd_ifd_dynflag_proto_xtr_ipv6_mask; - rxq->rxd_to_pkt_fields = - iavf_rxd_to_pkt_fields_by_comms_aux_v1; break; case IAVF_RXDID_COMMS_AUX_IPV6_FLOW: rxq->xtr_ol_flag = rte_pmd_ifd_dynflag_proto_xtr_ipv6_flow_mask; - rxq->rxd_to_pkt_fields = - iavf_rxd_to_pkt_fields_by_comms_aux_v1; break; case IAVF_RXDID_COMMS_AUX_TCP: rxq->xtr_ol_flag = rte_pmd_ifd_dynflag_proto_xtr_tcp_mask; - rxq->rxd_to_pkt_fields = - iavf_rxd_to_pkt_fields_by_comms_aux_v1; break; case IAVF_RXDID_COMMS_AUX_IP_OFFSET: rxq->xtr_ol_flag = rte_pmd_ifd_dynflag_proto_xtr_ip_offset_mask; - rxq->rxd_to_pkt_fields = - iavf_rxd_to_pkt_fields_by_comms_aux_v2; break; case IAVF_RXDID_COMMS_IPSEC_CRYPTO: rxq->xtr_ol_flag = rte_pmd_ifd_dynflag_proto_xtr_ipsec_crypto_said_mask; - rxq->rxd_to_pkt_fields = - iavf_rxd_to_pkt_fields_by_comms_aux_v2; break; case IAVF_RXDID_COMMS_OVS_1: - rxq->rxd_to_pkt_fields = iavf_rxd_to_pkt_fields_by_comms_ovs; break; default: /* update this according to the RXDID for FLEX_DESC_NONE */ - rxq->rxd_to_pkt_fields = iavf_rxd_to_pkt_fields_by_comms_ovs; + rxq->rxdid = IAVF_RXDID_COMMS_OVS_1; break; } @@ -1485,5 +1487,5 @@ iavf_recv_pkts_flex_rxd(void *rx_queue, iavf_flex_rxd_to_ipsec_crypto_status(rxm, &rxd, &rxq->stats.ipsec_crypto); - rxq->rxd_to_pkt_fields(rxq, rxm, &rxd); + rxd_to_pkt_fields_ops[rxq->rxdid](rxq, rxm, &rxd); pkt_flags = iavf_flex_rxd_error_to_pkt_flags(rx_stat_err0); rxm->ol_flags |= pkt_flags; @@ -1629,5 +1631,5 @@ iavf_recv_scattered_pkts_flex_rxd(void *rx_queue, struct rte_mbuf **rx_pkts, iavf_flex_rxd_to_ipsec_crypto_status(first_seg, &rxd, &rxq->stats.ipsec_crypto); - rxq->rxd_to_pkt_fields(rxq, first_seg, &rxd); + rxd_to_pkt_fields_ops[rxq->rxdid](rxq, first_seg, &rxd); pkt_flags = iavf_flex_rxd_error_to_pkt_flags(rx_stat_err0); @@ -1887,5 +1889,5 @@ iavf_rx_scan_hw_ring_flex_rxd(struct iavf_rx_queue *rxq) iavf_flex_rxd_to_ipsec_crypto_status(mb, &rxdp[j], &rxq->stats.ipsec_crypto); - rxq->rxd_to_pkt_fields(rxq, mb, &rxdp[j]); + rxd_to_pkt_fields_ops[rxq->rxdid](rxq, mb, &rxdp[j]); stat_err0 = rte_le_to_cpu_16(rxdp[j].wb.status_error0); pkt_flags = iavf_flex_rxd_error_to_pkt_flags(stat_err0); diff --git a/drivers/net/iavf/iavf_rxtx.h b/drivers/net/iavf/iavf_rxtx.h index b610176b30..bf8aebbce8 100644 --- a/drivers/net/iavf/iavf_rxtx.h +++ b/drivers/net/iavf/iavf_rxtx.h @@ -218,6 +218,4 @@ struct iavf_rx_queue { uint64_t xtr_ol_flag; /* flexible descriptor metadata extraction offload flag */ - iavf_rxd_to_pkt_fields_t rxd_to_pkt_fields; - /* handle flexible descriptor by RXDID */ struct iavf_rx_queue_stats stats; uint64_t offloads; -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-03-08 13:55:28.834876202 +0000 +++ 0016-net-iavf-fix-function-pointer-in-multi-process.patch 2022-03-08 13:55:28.413314934 +0000 @@ -1 +1 @@ -From 0ed16e01313e1f8930dc6a52b22159b20269d4e0 Mon Sep 17 00:00:00 2001 +From c431fe062378e7f3453aa41ffd7686230f63be8f Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 0ed16e01313e1f8930dc6a52b22159b20269d4e0 ] + @@ -14 +15,0 @@ -Cc: stable@dpdk.org @@ -24 +25 @@ -index ca54c70dd0..cb779879cb 100644 +index 29ab1b84f2..60d6b20004 100644 @@ -27 +28 @@ -@@ -476,52 +476,54 @@ iavf_rxd_to_pkt_fields_by_comms_aux_v2(struct iavf_rx_queue *rxq, +@@ -477,52 +477,54 @@ iavf_rxd_to_pkt_fields_by_comms_aux_v2(struct iavf_rx_queue *rxq, @@ -98 +99 @@ -@@ -1484,5 +1486,5 @@ iavf_recv_pkts_flex_rxd(void *rx_queue, +@@ -1485,5 +1487,5 @@ iavf_recv_pkts_flex_rxd(void *rx_queue, @@ -105 +106 @@ -@@ -1628,5 +1630,5 @@ iavf_recv_scattered_pkts_flex_rxd(void *rx_queue, struct rte_mbuf **rx_pkts, +@@ -1629,5 +1631,5 @@ iavf_recv_scattered_pkts_flex_rxd(void *rx_queue, struct rte_mbuf **rx_pkts, @@ -112 +113 @@ -@@ -1886,5 +1888,5 @@ iavf_rx_scan_hw_ring_flex_rxd(struct iavf_rx_queue *rxq) +@@ -1887,5 +1889,5 @@ iavf_rx_scan_hw_ring_flex_rxd(struct iavf_rx_queue *rxq)