From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id AD682A04B5 for ; Tue, 3 Dec 2019 19:29:19 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A3BA81BFC0; Tue, 3 Dec 2019 19:29:19 +0100 (CET) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by dpdk.org (Postfix) with ESMTP id DA1091BF97 for ; Tue, 3 Dec 2019 19:29:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575397757; 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=IlbCheYr3SKxqaNGxxQUfE0T+s7ZwtPyC5GFJPdTlPA=; b=RcVBOYaSxQz/aKoCsTbzXO6I4CdKENVp7GHfc6SCsZuR2zcseJdVBFWagY5KIa0vNFqdde srisj4gE0QlmVr+d1Uh8w2wmN/r+Kgxv3YbpauO+r4z5dNHA7XyPVOIdNGANuOeSdZNpwz erowu74HEnpMRPlWyJvZnPJJ5EfTdtU= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-438-i_puj9LWPEyCppm3VGGHpg-1; Tue, 03 Dec 2019 13:29:14 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A59B6800D41; Tue, 3 Dec 2019 18:29:12 +0000 (UTC) Received: from rh.redhat.com (ovpn-117-10.ams2.redhat.com [10.36.117.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id 092DA5C554; Tue, 3 Dec 2019 18:29:10 +0000 (UTC) From: Kevin Traynor To: Hyong Youb Kim Cc: Dirk-Holger Lenz , John Daley , dpdk stable Date: Tue, 3 Dec 2019 18:27:07 +0000 Message-Id: <20191203182714.17297-58-ktraynor@redhat.com> In-Reply-To: <20191203182714.17297-1-ktraynor@redhat.com> References: <20191203182714.17297-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-MC-Unique: i_puj9LWPEyCppm3VGGHpg-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Subject: [dpdk-stable] patch 'net/enic: fix probe for secondary process' has been queued to LTS release 18.11.6 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 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 Sender: "stable" Hi, FYI, your patch has been queued to LTS release 18.11.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 12/10/19. 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 rebasi= ng (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-queue This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable-queue/commit/3ab013d34bafe780a9= b31af9278b1dd72e53e67a Thanks. Kevin. --- >From 3ab013d34bafe780a9b31af9278b1dd72e53e67a Mon Sep 17 00:00:00 2001 From: Hyong Youb Kim Date: Thu, 5 Sep 2019 23:50:19 -0700 Subject: [PATCH] net/enic: fix probe for secondary process [ upstream commit e92a4b4148d3caadb5d3a8351fdf0fa3a2a709c2 ] Only the primary process initializes the adapter private data and rte_eth_dev_data. For secondary processes, do not touch them. Secondary processes need to select the right Tx and Rx handlers. Pick the same handlers that the primary process uses. Fixes: fefed3d1e62c ("enic: new driver") Reported-by: Dirk-Holger Lenz Signed-off-by: Hyong Youb Kim Tested-by: Dirk-Holger Lenz Reviewed-by: John Daley --- drivers/net/enic/enic.h | 5 ++++- drivers/net/enic/enic_ethdev.c | 10 ++++++++-- drivers/net/enic/enic_main.c | 28 ++++++++++++++++++++------- drivers/net/enic/enic_rxtx_vec_avx2.c | 5 ++--- 4 files changed, 35 insertions(+), 13 deletions(-) diff --git a/drivers/net/enic/enic.h b/drivers/net/enic/enic.h index 49831b00a..00a208728 100644 --- a/drivers/net/enic/enic.h +++ b/drivers/net/enic/enic.h @@ -137,4 +137,5 @@ struct enic { =09uint8_t ig_vlan_rewrite_mode; /* devargs ig-vlan-rewrite */ =09uint16_t vxlan_port; /* current vxlan port pushed to NIC */ +=09int use_simple_tx_handler; =20 =09unsigned int flags; @@ -332,5 +333,7 @@ uint16_t enic_prep_pkts(void *tx_queue, struct rte_mbuf= **tx_pkts, int enic_set_mtu(struct enic *enic, uint16_t new_mtu); int enic_link_update(struct enic *enic); -bool enic_use_vector_rx_handler(struct enic *enic); +bool enic_use_vector_rx_handler(struct rte_eth_dev *eth_dev); +void enic_pick_rx_handler(struct rte_eth_dev *eth_dev); +void enic_pick_tx_handler(struct rte_eth_dev *eth_dev); void enic_fdir_info(struct enic *enic); void enic_fdir_info_get(struct enic *enic, struct rte_eth_fdir_info *stats= ); diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.= c index 996bb5542..67a96a483 100644 --- a/drivers/net/enic/enic_ethdev.c +++ b/drivers/net/enic/enic_ethdev.c @@ -1043,10 +1043,16 @@ static int eth_enicpmd_dev_init(struct rte_eth_dev = *eth_dev) =09ENICPMD_FUNC_TRACE(); =20 -=09enic->port_id =3D eth_dev->data->port_id; -=09enic->rte_dev =3D eth_dev; =09eth_dev->dev_ops =3D &enicpmd_eth_dev_ops; =09eth_dev->rx_pkt_burst =3D &enic_recv_pkts; =09eth_dev->tx_pkt_burst =3D &enic_xmit_pkts; =09eth_dev->tx_pkt_prepare =3D &enic_prep_pkts; +=09if (rte_eal_process_type() !=3D RTE_PROC_PRIMARY) { +=09=09enic_pick_tx_handler(eth_dev); +=09=09enic_pick_rx_handler(eth_dev); +=09=09return 0; +=09} +=09/* Only the primary sets up adapter and other data in shared memory */ +=09enic->port_id =3D eth_dev->data->port_id; +=09enic->rte_dev =3D eth_dev; =20 =09pdev =3D RTE_ETH_DEV_TO_PCI(eth_dev); diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c index 5fb5122da..a6c838bc2 100644 --- a/drivers/net/enic/enic_main.c +++ b/drivers/net/enic/enic_main.c @@ -519,12 +519,12 @@ static void enic_prep_wq_for_simple_tx(struct enic *e= nic, uint16_t queue_idx) */ __rte_weak bool -enic_use_vector_rx_handler(__rte_unused struct enic *enic) +enic_use_vector_rx_handler(__rte_unused struct rte_eth_dev *eth_dev) { =09return false; } =20 -static void pick_rx_handler(struct enic *enic) +void enic_pick_rx_handler(struct rte_eth_dev *eth_dev) { -=09struct rte_eth_dev *eth_dev; +=09struct enic *enic =3D pmd_priv(eth_dev); =20 =09/* @@ -534,6 +534,5 @@ static void pick_rx_handler(struct enic *enic) =09 * 3. The default handler as a fallback. =09 */ -=09eth_dev =3D enic->rte_dev; -=09if (enic_use_vector_rx_handler(enic)) +=09if (enic_use_vector_rx_handler(eth_dev)) =09=09return; =09if (enic->rq_count > 0 && enic->rq[0].data_queue_enable =3D=3D 0) { @@ -546,4 +545,18 @@ static void pick_rx_handler(struct enic *enic) } =20 +/* Secondary process uses this to set the Tx handler */ +void enic_pick_tx_handler(struct rte_eth_dev *eth_dev) +{ +=09struct enic *enic =3D pmd_priv(eth_dev); + +=09if (enic->use_simple_tx_handler) { +=09=09PMD_INIT_LOG(DEBUG, " use the simple tx handler"); +=09=09eth_dev->tx_pkt_burst =3D &enic_simple_xmit_pkts; +=09} else { +=09=09PMD_INIT_LOG(DEBUG, " use the default tx handler"); +=09=09eth_dev->tx_pkt_burst =3D &enic_xmit_pkts; +=09} +} + int enic_enable(struct enic *enic) { @@ -623,4 +636,5 @@ int enic_enable(struct enic *enic) =09=09for (index =3D 0; index < enic->wq_count; index++) =09=09=09enic_prep_wq_for_simple_tx(enic, index); +=09=09enic->use_simple_tx_handler =3D 1; =09} else { =09=09PMD_INIT_LOG(DEBUG, " use the default tx handler"); @@ -628,5 +642,5 @@ int enic_enable(struct enic *enic) =09} =20 -=09pick_rx_handler(enic); +=09enic_pick_rx_handler(eth_dev); =20 =09for (index =3D 0; index < enic->wq_count; index++) @@ -1601,5 +1615,5 @@ int enic_set_mtu(struct enic *enic, uint16_t new_mtu) =09/* put back the real receive function */ =09rte_mb(); -=09pick_rx_handler(enic); +=09enic_pick_rx_handler(eth_dev); =09rte_mb(); =20 diff --git a/drivers/net/enic/enic_rxtx_vec_avx2.c b/drivers/net/enic/enic_= rxtx_vec_avx2.c index d21854901..e4d4581cc 100644 --- a/drivers/net/enic/enic_rxtx_vec_avx2.c +++ b/drivers/net/enic/enic_rxtx_vec_avx2.c @@ -807,10 +807,9 @@ enic_noscatter_vec_recv_pkts(void *rx_queue, struct rt= e_mbuf **rx_pkts, =20 bool -enic_use_vector_rx_handler(struct enic *enic) +enic_use_vector_rx_handler(struct rte_eth_dev *eth_dev) { -=09struct rte_eth_dev *eth_dev; +=09struct enic *enic =3D pmd_priv(eth_dev); =09struct rte_fdir_conf *fconf; =20 -=09eth_dev =3D enic->rte_dev; =09/* User needs to request for the avx2 handler */ =09if (!enic->enable_avx2_rx) --=20 2.21.0 --- Diff of the applied patch vs upstream commit (please double-check if non-= empty: --- --- -=092019-12-03 17:29:55.109379272 +0000 +++ 0058-net-enic-fix-probe-for-secondary-process.patch=092019-12-03 17:29:= 51.788749162 +0000 @@ -1 +1 @@ -From e92a4b4148d3caadb5d3a8351fdf0fa3a2a709c2 Mon Sep 17 00:00:00 2001 +From 3ab013d34bafe780a9b31af9278b1dd72e53e67a Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit e92a4b4148d3caadb5d3a8351fdf0fa3a2a709c2 ] + @@ -13 +14,0 @@ -Cc: stable@dpdk.org @@ -27 +28 @@ -index 93d3cfcf6..681109ba9 100644 +index 49831b00a..00a208728 100644 @@ -36 +37 @@ -@@ -336,5 +337,7 @@ uint16_t enic_prep_pkts(void *tx_queue, struct rte_mbu= f **tx_pkts, +@@ -332,5 +333,7 @@ uint16_t enic_prep_pkts(void *tx_queue, struct rte_mbu= f **tx_pkts, @@ -46 +47 @@ -index 5fa711852..fe18cf3a9 100644 +index 996bb5542..67a96a483 100644 @@ -49 +50 @@ -@@ -1228,10 +1228,16 @@ static int eth_enicpmd_dev_init(struct rte_eth_dev= *eth_dev) +@@ -1043,10 +1043,16 @@ static int eth_enicpmd_dev_init(struct rte_eth_dev= *eth_dev) @@ -66,2 +67,2 @@ - =09/* Let rte_eth_dev_close() release the port resources */ - =09eth_dev->data->dev_flags |=3D RTE_ETH_DEV_CLOSE_REMOVE; +=20 + =09pdev =3D RTE_ETH_DEV_TO_PCI(eth_dev); @@ -69 +70 @@ -index e507df1f6..30c7b1c86 100644 +index 5fb5122da..a6c838bc2 100644 @@ -72 +73 @@ -@@ -526,12 +526,12 @@ static void enic_prep_wq_for_simple_tx(struct enic *= enic, uint16_t queue_idx) +@@ -519,12 +519,12 @@ static void enic_prep_wq_for_simple_tx(struct enic *= enic, uint16_t queue_idx) @@ -88 +89 @@ -@@ -541,6 +541,5 @@ static void pick_rx_handler(struct enic *enic) +@@ -534,6 +534,5 @@ static void pick_rx_handler(struct enic *enic) @@ -96 +97 @@ -@@ -553,4 +552,18 @@ static void pick_rx_handler(struct enic *enic) +@@ -546,4 +545,18 @@ static void pick_rx_handler(struct enic *enic) @@ -105 +106 @@ -+=09=09ENICPMD_LOG(DEBUG, " use the simple tx handler"); ++=09=09PMD_INIT_LOG(DEBUG, " use the simple tx handler"); @@ -108 +109 @@ -+=09=09ENICPMD_LOG(DEBUG, " use the default tx handler"); ++=09=09PMD_INIT_LOG(DEBUG, " use the default tx handler"); @@ -115 +116 @@ -@@ -630,4 +643,5 @@ int enic_enable(struct enic *enic) +@@ -623,4 +636,5 @@ int enic_enable(struct enic *enic) @@ -120,2 +121,2 @@ - =09=09ENICPMD_LOG(DEBUG, " use the default tx handler"); -@@ -635,5 +649,5 @@ int enic_enable(struct enic *enic) + =09=09PMD_INIT_LOG(DEBUG, " use the default tx handler"); +@@ -628,5 +642,5 @@ int enic_enable(struct enic *enic) @@ -128 +129 @@ -@@ -1606,5 +1620,5 @@ int enic_set_mtu(struct enic *enic, uint16_t new_mtu= ) +@@ -1601,5 +1615,5 @@ int enic_set_mtu(struct enic *enic, uint16_t new_mtu= ) @@ -136 +137 @@ -index 517d4092f..36d4d0dea 100644 +index d21854901..e4d4581cc 100644