DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] app/testpmd: fix crash when attaching a device
@ 2018-06-13 16:27 Adrien Mazarguil
  2018-06-14 14:56 ` Iremonger, Bernard
  0 siblings, 1 reply; 3+ messages in thread
From: Adrien Mazarguil @ 2018-06-13 16:27 UTC (permalink / raw)
  To: Wenzhuo Lu, Jingjing Wu, Bernard Iremonger
  Cc: dev, stable, Jasvinder Singh, Xueming(steven) Li

Below commit checks global device information to determine if a port uses
the softnic driver once initialized. Problem is that this information is
not available at this point when a port is initialized interactively
through a "port attach XXX" command, crashing testpmd.

This patch systematically initializes global device information to address
this issue.

Fixes: 5b590fbe09b6 ("app/testpmd: add traffic management forwarding mode")
Cc: stable@dpdk.org
Cc: Jasvinder Singh <jasvinder.singh@intel.com>

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
---
 app/test-pmd/testpmd.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 35cf26674..24c199844 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -2355,16 +2355,15 @@ init_port_config(void)
 {
 	portid_t pid;
 	struct rte_port *port;
-	struct rte_eth_dev_info dev_info;
 
 	RTE_ETH_FOREACH_DEV(pid) {
 		port = &ports[pid];
 		port->dev_conf.fdir_conf = fdir_conf;
+		rte_eth_dev_info_get(pid, &port->dev_info);
 		if (nb_rxq > 1) {
-			rte_eth_dev_info_get(pid, &dev_info);
 			port->dev_conf.rx_adv_conf.rss_conf.rss_key = NULL;
 			port->dev_conf.rx_adv_conf.rss_conf.rss_hf =
-				rss_hf & dev_info.flow_type_rss_offloads;
+				rss_hf & port->dev_info.flow_type_rss_offloads;
 		} else {
 			port->dev_conf.rx_adv_conf.rss_conf.rss_key = NULL;
 			port->dev_conf.rx_adv_conf.rss_conf.rss_hf = 0;
-- 
2.11.0

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] app/testpmd: fix crash when attaching a device
  2018-06-13 16:27 [dpdk-dev] [PATCH] app/testpmd: fix crash when attaching a device Adrien Mazarguil
@ 2018-06-14 14:56 ` Iremonger, Bernard
  2018-06-14 15:19   ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
  0 siblings, 1 reply; 3+ messages in thread
From: Iremonger, Bernard @ 2018-06-14 14:56 UTC (permalink / raw)
  To: Adrien Mazarguil, Lu, Wenzhuo, Wu, Jingjing
  Cc: dev, stable, Singh, Jasvinder, Xueming(steven) Li



> -----Original Message-----
> From: Adrien Mazarguil [mailto:adrien.mazarguil@6wind.com]
> Sent: Wednesday, June 13, 2018 5:28 PM
> To: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu, Jingjing
> <jingjing.wu@intel.com>; Iremonger, Bernard
> <bernard.iremonger@intel.com>
> Cc: dev@dpdk.org; stable@dpdk.org; Singh, Jasvinder
> <jasvinder.singh@intel.com>; Xueming(steven) Li
> <xuemingl@mellanox.com>
> Subject: [PATCH] app/testpmd: fix crash when attaching a device
> 
> Below commit checks global device information to determine if a port uses
> the softnic driver once initialized. Problem is that this information is not
> available at this point when a port is initialized interactively through a "port
> attach XXX" command, crashing testpmd.
> 
> This patch systematically initializes global device information to address this
> issue.
> 
> Fixes: 5b590fbe09b6 ("app/testpmd: add traffic management forwarding
> mode")
> Cc: stable@dpdk.org
> Cc: Jasvinder Singh <jasvinder.singh@intel.com>
> 
> Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
> ---

Acked-by: Bernard Iremonger <Bernard.iremonger@intel.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [dpdk-stable] [PATCH] app/testpmd: fix crash when attaching a device
  2018-06-14 14:56 ` Iremonger, Bernard
@ 2018-06-14 15:19   ` Ferruh Yigit
  0 siblings, 0 replies; 3+ messages in thread
From: Ferruh Yigit @ 2018-06-14 15:19 UTC (permalink / raw)
  To: Iremonger, Bernard, Adrien Mazarguil, Lu, Wenzhuo, Wu, Jingjing
  Cc: dev, stable, Singh, Jasvinder, Xueming(steven) Li

On 6/14/2018 3:56 PM, Iremonger, Bernard wrote:
> 
> 
>> -----Original Message-----
>> From: Adrien Mazarguil [mailto:adrien.mazarguil@6wind.com]
>> Sent: Wednesday, June 13, 2018 5:28 PM
>> To: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu, Jingjing
>> <jingjing.wu@intel.com>; Iremonger, Bernard
>> <bernard.iremonger@intel.com>
>> Cc: dev@dpdk.org; stable@dpdk.org; Singh, Jasvinder
>> <jasvinder.singh@intel.com>; Xueming(steven) Li
>> <xuemingl@mellanox.com>
>> Subject: [PATCH] app/testpmd: fix crash when attaching a device
>>
>> Below commit checks global device information to determine if a port uses
>> the softnic driver once initialized. Problem is that this information is not
>> available at this point when a port is initialized interactively through a "port
>> attach XXX" command, crashing testpmd.
>>
>> This patch systematically initializes global device information to address this
>> issue.
>>
>> Fixes: 5b590fbe09b6 ("app/testpmd: add traffic management forwarding
>> mode")
>> Cc: stable@dpdk.org
>> Cc: Jasvinder Singh <jasvinder.singh@intel.com>
>>
>> Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
>> ---
> 
> Acked-by: Bernard Iremonger <Bernard.iremonger@intel.com>

Applied to dpdk-next-net/master, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-06-14 15:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-13 16:27 [dpdk-dev] [PATCH] app/testpmd: fix crash when attaching a device Adrien Mazarguil
2018-06-14 14:56 ` Iremonger, Bernard
2018-06-14 15:19   ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).