* [dpdk-dev] [PATCH] net/softnic: fix undefined dev info fields
@ 2018-11-20 13:00 Jasvinder Singh
2018-11-20 22:35 ` Ferruh Yigit
0 siblings, 1 reply; 3+ messages in thread
From: Jasvinder Singh @ 2018-11-20 13:00 UTC (permalink / raw)
To: dev; +Cc: cristian.dumitrescu
The memcpy operation overwrites the device info fields set
by ethdev API and leaves the device field undefined.
Thus, replaces memcpy by only updating the required fields
at the driver layer.
error log: testpmd> show port info 1
**** Infos for port 1 ****
MAC address: 00:00:00:00:00:00
Device name: net_softnic0
Segmentation fault.
port_infos_display (port_id=1) at /dpdk/app/test-pmd/config.c:418
if (dev_info.device->devargs && dev_info.device->devargs->args)
Fixes: cc6d421574fe ("net/softnic: add softnic PMD")
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
---
drivers/net/softnic/rte_eth_softnic.c | 21 +++------------------
1 file changed, 3 insertions(+), 18 deletions(-)
diff --git a/drivers/net/softnic/rte_eth_softnic.c b/drivers/net/softnic/rte_eth_softnic.c
index 743a7c585..14d4a1030 100644
--- a/drivers/net/softnic/rte_eth_softnic.c
+++ b/drivers/net/softnic/rte_eth_softnic.c
@@ -59,23 +59,6 @@ static const struct softnic_conn_params conn_params_default = {
.msg_handle_arg = NULL,
};
-static const struct rte_eth_dev_info pmd_dev_info = {
- .min_rx_bufsize = 0,
- .max_rx_pktlen = UINT32_MAX,
- .max_rx_queues = UINT16_MAX,
- .max_tx_queues = UINT16_MAX,
- .rx_desc_lim = {
- .nb_max = UINT16_MAX,
- .nb_min = 0,
- .nb_align = 1,
- },
- .tx_desc_lim = {
- .nb_max = UINT16_MAX,
- .nb_min = 0,
- .nb_align = 1,
- },
-};
-
static int pmd_softnic_logtype;
#define PMD_LOG(level, fmt, args...) \
@@ -86,7 +69,9 @@ static void
pmd_dev_infos_get(struct rte_eth_dev *dev __rte_unused,
struct rte_eth_dev_info *dev_info)
{
- memcpy(dev_info, &pmd_dev_info, sizeof(*dev_info));
+ dev_info->max_rx_pktlen = UINT32_MAX;
+ dev_info->max_rx_queues = UINT16_MAX;
+ dev_info->max_tx_queues = UINT16_MAX;
}
static int
--
2.17.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [PATCH] net/softnic: fix undefined dev info fields
2018-11-20 13:00 [dpdk-dev] [PATCH] net/softnic: fix undefined dev info fields Jasvinder Singh
@ 2018-11-20 22:35 ` Ferruh Yigit
2018-11-21 15:28 ` Ferruh Yigit
0 siblings, 1 reply; 3+ messages in thread
From: Ferruh Yigit @ 2018-11-20 22:35 UTC (permalink / raw)
To: Jasvinder Singh, dev; +Cc: cristian.dumitrescu
On 11/20/2018 1:00 PM, Jasvinder Singh wrote:
> The memcpy operation overwrites the device info fields set
> by ethdev API and leaves the device field undefined.
> Thus, replaces memcpy by only updating the required fields
> at the driver layer.
>
> error log: testpmd> show port info 1
>
> **** Infos for port 1 ****
> MAC address: 00:00:00:00:00:00
> Device name: net_softnic0
>
> Segmentation fault.
> port_infos_display (port_id=1) at /dpdk/app/test-pmd/config.c:418
> if (dev_info.device->devargs && dev_info.device->devargs->args)
>
> Fixes: cc6d421574fe ("net/softnic: add softnic PMD")
>
> Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [PATCH] net/softnic: fix undefined dev info fields
2018-11-20 22:35 ` Ferruh Yigit
@ 2018-11-21 15:28 ` Ferruh Yigit
0 siblings, 0 replies; 3+ messages in thread
From: Ferruh Yigit @ 2018-11-21 15:28 UTC (permalink / raw)
To: Jasvinder Singh, dev; +Cc: cristian.dumitrescu
On 11/20/2018 10:35 PM, Ferruh Yigit wrote:
> On 11/20/2018 1:00 PM, Jasvinder Singh wrote:
>> The memcpy operation overwrites the device info fields set
>> by ethdev API and leaves the device field undefined.
>> Thus, replaces memcpy by only updating the required fields
>> at the driver layer.
>>
>> error log: testpmd> show port info 1
>>
>> **** Infos for port 1 ****
>> MAC address: 00:00:00:00:00:00
>> Device name: net_softnic0
>>
>> Segmentation fault.
>> port_infos_display (port_id=1) at /dpdk/app/test-pmd/config.c:418
>> if (dev_info.device->devargs && dev_info.device->devargs->args)
>>
>> Fixes: cc6d421574fe ("net/softnic: add softnic PMD")
>>
>> Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
>
> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
>
Applied to dpdk-next-net/master, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-11-21 15:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-20 13:00 [dpdk-dev] [PATCH] net/softnic: fix undefined dev info fields Jasvinder Singh
2018-11-20 22:35 ` Ferruh Yigit
2018-11-21 15:28 ` 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).