patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH 1/6] net/null: fix secondary burst function selection
@ 2020-03-02 17:36 Ferruh Yigit
  2020-03-02 17:36 ` [dpdk-stable] [PATCH 3/6] net/null: remove redundant check Ferruh Yigit
  2020-04-07  8:38 ` [dpdk-stable] [PATCH 1/6] net/null: fix secondary burst function selection Ferruh Yigit
  0 siblings, 2 replies; 4+ messages in thread
From: Ferruh Yigit @ 2020-03-02 17:36 UTC (permalink / raw)
  To: dev, Tetsuya Mukawa, Yasufumi Ogawa; +Cc: Ferruh Yigit, stable

Secondary process uses the primary process device and while setting the
Rx/Tx functions it uses the device arguments from the secondary process
instead of the primary ones.

This may cause primary and secondary process use different Rx/Tx
functions unintentionally.

Fixes: bccc77a6a74a ("net/null: fix multi-process Rx and Tx")
Cc: stable@dpdk.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
Cc: yasufum.o@gmail.com
---
 drivers/net/null/rte_eth_null.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c
index 025b73acb..87a29b853 100644
--- a/drivers/net/null/rte_eth_null.c
+++ b/drivers/net/null/rte_eth_null.c
@@ -584,6 +584,7 @@ rte_pmd_null_probe(struct rte_vdev_device *dev)
 	PMD_LOG(INFO, "Initializing pmd_null for %s", name);
 
 	if (rte_eal_process_type() == RTE_PROC_SECONDARY) {
+		struct pmd_internals *internals;
 		eth_dev = rte_eth_dev_attach_secondary(name);
 		if (!eth_dev) {
 			PMD_LOG(ERR, "Failed to probe %s", name);
@@ -592,7 +593,8 @@ rte_pmd_null_probe(struct rte_vdev_device *dev)
 		/* TODO: request info from primary to set up Rx and Tx */
 		eth_dev->dev_ops = &ops;
 		eth_dev->device = &dev->device;
-		if (packet_copy) {
+		internals = eth_dev->data->dev_private;
+		if (internals->packet_copy) {
 			eth_dev->rx_pkt_burst = eth_null_copy_rx;
 			eth_dev->tx_pkt_burst = eth_null_copy_tx;
 		} else {
-- 
2.24.1


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

* [dpdk-stable] [PATCH 3/6] net/null: remove redundant check
  2020-03-02 17:36 [dpdk-stable] [PATCH 1/6] net/null: fix secondary burst function selection Ferruh Yigit
@ 2020-03-02 17:36 ` Ferruh Yigit
  2020-04-07  8:38 ` [dpdk-stable] [PATCH 1/6] net/null: fix secondary burst function selection Ferruh Yigit
  1 sibling, 0 replies; 4+ messages in thread
From: Ferruh Yigit @ 2020-03-02 17:36 UTC (permalink / raw)
  To: dev, Tetsuya Mukawa, Bernard Iremonger; +Cc: Ferruh Yigit, stable, mukawa

There is no need to check if the argument exist or not,
`rte_kvargs_process` returns success if the argument is not provided at
all.

Fixes: c743e50c475f ("null: new poll mode driver")
Cc: stable@dpdk.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
Cc: mukawa@igel.co.jp
---
 drivers/net/null/rte_eth_null.c | 29 ++++++++++++-----------------
 1 file changed, 12 insertions(+), 17 deletions(-)

diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c
index 87a29b853..beedd5f4b 100644
--- a/drivers/net/null/rte_eth_null.c
+++ b/drivers/net/null/rte_eth_null.c
@@ -610,23 +610,18 @@ rte_pmd_null_probe(struct rte_vdev_device *dev)
 		if (kvlist == NULL)
 			return -1;
 
-		if (rte_kvargs_count(kvlist, ETH_NULL_PACKET_SIZE_ARG) == 1) {
-
-			ret = rte_kvargs_process(kvlist,
-					ETH_NULL_PACKET_SIZE_ARG,
-					&get_packet_size_arg, &packet_size);
-			if (ret < 0)
-				goto free_kvlist;
-		}
-
-		if (rte_kvargs_count(kvlist, ETH_NULL_PACKET_COPY_ARG) == 1) {
-
-			ret = rte_kvargs_process(kvlist,
-					ETH_NULL_PACKET_COPY_ARG,
-					&get_packet_copy_arg, &packet_copy);
-			if (ret < 0)
-				goto free_kvlist;
-		}
+		ret = rte_kvargs_process(kvlist,
+				ETH_NULL_PACKET_SIZE_ARG,
+				&get_packet_size_arg, &packet_size);
+		if (ret < 0)
+			goto free_kvlist;
+
+
+		ret = rte_kvargs_process(kvlist,
+				ETH_NULL_PACKET_COPY_ARG,
+				&get_packet_copy_arg, &packet_copy);
+		if (ret < 0)
+			goto free_kvlist;
 	}
 
 	PMD_LOG(INFO, "Configure pmd_null: packet size is %d, "
-- 
2.24.1


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

* Re: [dpdk-stable] [PATCH 1/6] net/null: fix secondary burst function selection
  2020-03-02 17:36 [dpdk-stable] [PATCH 1/6] net/null: fix secondary burst function selection Ferruh Yigit
  2020-03-02 17:36 ` [dpdk-stable] [PATCH 3/6] net/null: remove redundant check Ferruh Yigit
@ 2020-04-07  8:38 ` Ferruh Yigit
  2020-04-10  8:33   ` Ferruh Yigit
  1 sibling, 1 reply; 4+ messages in thread
From: Ferruh Yigit @ 2020-04-07  8:38 UTC (permalink / raw)
  To: dev, Tetsuya Mukawa, Yasufumi Ogawa; +Cc: stable

On 3/2/2020 5:36 PM, Ferruh Yigit wrote:
> Secondary process uses the primary process device and while setting the
> Rx/Tx functions it uses the device arguments from the secondary process
> instead of the primary ones.
> 
> This may cause primary and secondary process use different Rx/Tx
> functions unintentionally.
> 
> Fixes: bccc77a6a74a ("net/null: fix multi-process Rx and Tx")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>

Is there any review on this set? If there is no objection I will merge it soon.


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

* Re: [dpdk-stable] [PATCH 1/6] net/null: fix secondary burst function selection
  2020-04-07  8:38 ` [dpdk-stable] [PATCH 1/6] net/null: fix secondary burst function selection Ferruh Yigit
@ 2020-04-10  8:33   ` Ferruh Yigit
  0 siblings, 0 replies; 4+ messages in thread
From: Ferruh Yigit @ 2020-04-10  8:33 UTC (permalink / raw)
  To: dev, Tetsuya Mukawa, Yasufumi Ogawa; +Cc: stable

On 4/7/2020 9:38 AM, Ferruh Yigit wrote:
> On 3/2/2020 5:36 PM, Ferruh Yigit wrote:
>> Secondary process uses the primary process device and while setting the
>> Rx/Tx functions it uses the device arguments from the secondary process
>> instead of the primary ones.
>>
>> This may cause primary and secondary process use different Rx/Tx
>> functions unintentionally.
>>
>> Fixes: bccc77a6a74a ("net/null: fix multi-process Rx and Tx")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> 
> Is there any review on this set? If there is no objection I will merge it soon.
> 

Series applied to dpdk-next-net/master, thanks.

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

end of thread, other threads:[~2020-04-10  8:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-02 17:36 [dpdk-stable] [PATCH 1/6] net/null: fix secondary burst function selection Ferruh Yigit
2020-03-02 17:36 ` [dpdk-stable] [PATCH 3/6] net/null: remove redundant check Ferruh Yigit
2020-04-07  8:38 ` [dpdk-stable] [PATCH 1/6] net/null: fix secondary burst function selection Ferruh Yigit
2020-04-10  8:33   ` 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).