All of lore.kernel.org
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/2] net/bnxt: log failure for switch domain free
@ 2020-10-30  7:03 Somnath Kotur
  2020-10-30  7:03 ` [dpdk-dev] [PATCH 2/2] net/bnxt: pass dev args by reference Somnath Kotur
  2020-11-01  3:18 ` [dpdk-dev] [PATCH 1/2] net/bnxt: log failure for switch domain free Ajit Khaparde
  0 siblings, 2 replies; 4+ messages in thread
From: Somnath Kotur @ 2020-10-30  7:03 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Somnath Kotur, stable, Kalesh Anakkur Purayil

Check and log an error message if switch domain free API fails

Coverity issue: 362757

Fixes: 322bd6e70272 ("net/bnxt: add port representor infrastructure")
Cc: stable@dpdk.org

Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Kalesh Anakkur Purayil <kalesh-anakkur.purayil@broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index b2f72ea..31e94f2 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -1343,8 +1343,14 @@ static int bnxt_dev_set_link_down_op(struct rte_eth_dev *eth_dev)
 
 static void bnxt_free_switch_domain(struct bnxt *bp)
 {
-	if (bp->switch_domain_id)
-		rte_eth_switch_domain_free(bp->switch_domain_id);
+	int rc = 0;
+
+	if (bp->switch_domain_id) {
+		rc = rte_eth_switch_domain_free(bp->switch_domain_id);
+		if (rc)
+			PMD_DRV_LOG(ERR, "free switch domain:%d fail: %d\n",
+				    bp->switch_domain_id, rc);
+	}
 }
 
 /* Unload the driver, release resources */
-- 
2.7.4


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

* [dpdk-dev] [PATCH 2/2] net/bnxt: pass dev args by reference
  2020-10-30  7:03 [dpdk-dev] [PATCH 1/2] net/bnxt: log failure for switch domain free Somnath Kotur
@ 2020-10-30  7:03 ` Somnath Kotur
  2020-11-01  3:19   ` Ajit Khaparde
  2020-11-01  3:18 ` [dpdk-dev] [PATCH 1/2] net/bnxt: log failure for switch domain free Ajit Khaparde
  1 sibling, 1 reply; 4+ messages in thread
From: Somnath Kotur @ 2020-10-30  7:03 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Somnath Kotur, stable, Kalesh Anakkur Purayil

Pass 'eth_da' pointer instead of pass by value to
bnxt_rep_port_probe()

Coverity issue: 360841

Fixes: 322bd6e70272 ("net/bnxt: add port representor infrastructure")
Cc: stable@dpdk.org

Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Kalesh Anakkur Purayil <kalesh-anakkur.purayil@broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 31e94f2..6a77e57 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -6288,7 +6288,7 @@ static int bnxt_init_rep_info(struct bnxt *bp)
 }
 
 static int bnxt_rep_port_probe(struct rte_pci_device *pci_dev,
-			       struct rte_eth_devargs eth_da,
+			       struct rte_eth_devargs *eth_da,
 			       struct rte_eth_dev *backing_eth_dev,
 			       const char *dev_args)
 {
@@ -6299,7 +6299,7 @@ static int bnxt_rep_port_probe(struct rte_pci_device *pci_dev,
 	int i, ret = 0;
 	struct rte_kvargs *kvlist = NULL;
 
-	num_rep = eth_da.nb_representor_ports;
+	num_rep = eth_da->nb_representor_ports;
 	if (num_rep > BNXT_MAX_VF_REPS) {
 		PMD_DRV_LOG(ERR, "nb_representor_ports = %d > %d MAX VF REPS\n",
 			    num_rep, BNXT_MAX_VF_REPS);
@@ -6329,7 +6329,7 @@ static int bnxt_rep_port_probe(struct rte_pci_device *pci_dev,
 
 	for (i = 0; i < num_rep; i++) {
 		struct bnxt_representor representor = {
-			.vf_id = eth_da.representor_ports[i],
+			.vf_id = eth_da->representor_ports[i],
 			.switch_domain_id = backing_bp->switch_domain_id,
 			.parent_dev = backing_eth_dev
 		};
@@ -6342,7 +6342,7 @@ static int bnxt_rep_port_probe(struct rte_pci_device *pci_dev,
 
 		/* representor port net_bdf_port */
 		snprintf(name, sizeof(name), "net_%s_representor_%d",
-			 pci_dev->device.name, eth_da.representor_ports[i]);
+			 pci_dev->device.name, eth_da->representor_ports[i]);
 
 		kvlist = rte_kvargs_parse(dev_args, bnxt_dev_args);
 		if (kvlist) {
@@ -6505,7 +6505,7 @@ static int bnxt_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
 		return ret;
 
 	/* probe representor ports now */
-	ret = bnxt_rep_port_probe(pci_dev, eth_da, backing_eth_dev,
+	ret = bnxt_rep_port_probe(pci_dev, &eth_da, backing_eth_dev,
 				  pci_dev->device.devargs->args);
 
 	return ret;
-- 
2.7.4


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

* Re: [dpdk-dev] [PATCH 1/2] net/bnxt: log failure for switch domain free
  2020-10-30  7:03 [dpdk-dev] [PATCH 1/2] net/bnxt: log failure for switch domain free Somnath Kotur
  2020-10-30  7:03 ` [dpdk-dev] [PATCH 2/2] net/bnxt: pass dev args by reference Somnath Kotur
@ 2020-11-01  3:18 ` Ajit Khaparde
  1 sibling, 0 replies; 4+ messages in thread
From: Ajit Khaparde @ 2020-11-01  3:18 UTC (permalink / raw)
  To: Somnath Kotur; +Cc: dpdk-dev, Ferruh Yigit, dpdk stable, Kalesh Anakkur Purayil

On Fri, Oct 30, 2020 at 12:11 AM Somnath Kotur
<somnath.kotur@broadcom.com> wrote:
>
> Check and log an error message if switch domain free API fails
>
> Coverity issue: 362757
>
> Fixes: 322bd6e70272 ("net/bnxt: add port representor infrastructure")
> Cc: stable@dpdk.org
>
> Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
> Reviewed-by: Kalesh Anakkur Purayil <kalesh-anakkur.purayil@broadcom.com>
Patch applied to dpdk-next-net-brcm.

> ---
>  drivers/net/bnxt/bnxt_ethdev.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
> index b2f72ea..31e94f2 100644
> --- a/drivers/net/bnxt/bnxt_ethdev.c
> +++ b/drivers/net/bnxt/bnxt_ethdev.c
> @@ -1343,8 +1343,14 @@ static int bnxt_dev_set_link_down_op(struct rte_eth_dev *eth_dev)
>
>  static void bnxt_free_switch_domain(struct bnxt *bp)
>  {
> -       if (bp->switch_domain_id)
> -               rte_eth_switch_domain_free(bp->switch_domain_id);
> +       int rc = 0;
> +
> +       if (bp->switch_domain_id) {
> +               rc = rte_eth_switch_domain_free(bp->switch_domain_id);
> +               if (rc)
> +                       PMD_DRV_LOG(ERR, "free switch domain:%d fail: %d\n",
> +                                   bp->switch_domain_id, rc);
> +       }
>  }
>
>  /* Unload the driver, release resources */
> --
> 2.7.4
>

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

* Re: [dpdk-dev] [PATCH 2/2] net/bnxt: pass dev args by reference
  2020-10-30  7:03 ` [dpdk-dev] [PATCH 2/2] net/bnxt: pass dev args by reference Somnath Kotur
@ 2020-11-01  3:19   ` Ajit Khaparde
  0 siblings, 0 replies; 4+ messages in thread
From: Ajit Khaparde @ 2020-11-01  3:19 UTC (permalink / raw)
  To: Somnath Kotur; +Cc: dpdk-dev, Ferruh Yigit, dpdk stable, Kalesh Anakkur Purayil

On Fri, Oct 30, 2020 at 12:11 AM Somnath Kotur
<somnath.kotur@broadcom.com> wrote:
>
> Pass 'eth_da' pointer instead of pass by value to
> bnxt_rep_port_probe()
>
> Coverity issue: 360841
>
> Fixes: 322bd6e70272 ("net/bnxt: add port representor infrastructure")
> Cc: stable@dpdk.org
>
> Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
> Reviewed-by: Kalesh Anakkur Purayil <kalesh-anakkur.purayil@broadcom.com>
Patch applied to dpdk-next-net-brcm.

> ---
>  drivers/net/bnxt/bnxt_ethdev.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
> index 31e94f2..6a77e57 100644
> --- a/drivers/net/bnxt/bnxt_ethdev.c
> +++ b/drivers/net/bnxt/bnxt_ethdev.c
> @@ -6288,7 +6288,7 @@ static int bnxt_init_rep_info(struct bnxt *bp)
>  }
>
>  static int bnxt_rep_port_probe(struct rte_pci_device *pci_dev,
> -                              struct rte_eth_devargs eth_da,
> +                              struct rte_eth_devargs *eth_da,
>                                struct rte_eth_dev *backing_eth_dev,
>                                const char *dev_args)
>  {
> @@ -6299,7 +6299,7 @@ static int bnxt_rep_port_probe(struct rte_pci_device *pci_dev,
>         int i, ret = 0;
>         struct rte_kvargs *kvlist = NULL;
>
> -       num_rep = eth_da.nb_representor_ports;
> +       num_rep = eth_da->nb_representor_ports;
>         if (num_rep > BNXT_MAX_VF_REPS) {
>                 PMD_DRV_LOG(ERR, "nb_representor_ports = %d > %d MAX VF REPS\n",
>                             num_rep, BNXT_MAX_VF_REPS);
> @@ -6329,7 +6329,7 @@ static int bnxt_rep_port_probe(struct rte_pci_device *pci_dev,
>
>         for (i = 0; i < num_rep; i++) {
>                 struct bnxt_representor representor = {
> -                       .vf_id = eth_da.representor_ports[i],
> +                       .vf_id = eth_da->representor_ports[i],
>                         .switch_domain_id = backing_bp->switch_domain_id,
>                         .parent_dev = backing_eth_dev
>                 };
> @@ -6342,7 +6342,7 @@ static int bnxt_rep_port_probe(struct rte_pci_device *pci_dev,
>
>                 /* representor port net_bdf_port */
>                 snprintf(name, sizeof(name), "net_%s_representor_%d",
> -                        pci_dev->device.name, eth_da.representor_ports[i]);
> +                        pci_dev->device.name, eth_da->representor_ports[i]);
>
>                 kvlist = rte_kvargs_parse(dev_args, bnxt_dev_args);
>                 if (kvlist) {
> @@ -6505,7 +6505,7 @@ static int bnxt_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
>                 return ret;
>
>         /* probe representor ports now */
> -       ret = bnxt_rep_port_probe(pci_dev, eth_da, backing_eth_dev,
> +       ret = bnxt_rep_port_probe(pci_dev, &eth_da, backing_eth_dev,
>                                   pci_dev->device.devargs->args);
>
>         return ret;
> --
> 2.7.4
>

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

end of thread, other threads:[~2020-11-01  3:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-30  7:03 [dpdk-dev] [PATCH 1/2] net/bnxt: log failure for switch domain free Somnath Kotur
2020-10-30  7:03 ` [dpdk-dev] [PATCH 2/2] net/bnxt: pass dev args by reference Somnath Kotur
2020-11-01  3:19   ` Ajit Khaparde
2020-11-01  3:18 ` [dpdk-dev] [PATCH 1/2] net/bnxt: log failure for switch domain free Ajit Khaparde

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.