netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Chan <michael.chan@broadcom.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, Somnath Kotur <somnath.kotur@broadcom.com>
Subject: [PATCH net-next 2/7] bnxt: Avoid logging an unnecessary message when a flow can't be offloaded
Date: Wed, 30 Oct 2019 03:59:30 -0400	[thread overview]
Message-ID: <1572422375-7269-3-git-send-email-michael.chan@broadcom.com> (raw)
In-Reply-To: <1572422375-7269-1-git-send-email-michael.chan@broadcom.com>

From: Somnath Kotur <somnath.kotur@broadcom.com>

For every single case where bnxt_tc_can_offload() can fail, we are
logging a user friendly descriptive message anyway, but because of the
path it would take in case of failure, another redundant error message
would get logged. Just freeing the node and returning from the point of
failure should suffice.

Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c
index 6734825..2d86796 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c
@@ -1405,7 +1405,8 @@ static int bnxt_tc_add_flow(struct bnxt *bp, u16 src_fid,
 
 	if (!bnxt_tc_can_offload(bp, flow)) {
 		rc = -EOPNOTSUPP;
-		goto free_node;
+		kfree_rcu(new_node, rcu);
+		return rc;
 	}
 
 	/* If a flow exists with the same cookie, delete it */
-- 
2.5.1


  parent reply	other threads:[~2019-10-30  8:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-30  7:59 [PATCH net-next 0/7] bnxt_en: Updates for net-next Michael Chan
2019-10-30  7:59 ` [PATCH net-next 1/7] bnxt_en: Add support for L2 rewrite Michael Chan
2019-10-30 18:46   ` David Miller
2019-10-30  7:59 ` Michael Chan [this message]
2019-10-30  7:59 ` [PATCH net-next 3/7] bnxt_en: Add support for NAT(L3/L4 rewrite) Michael Chan
2019-10-30  7:59 ` [PATCH net-next 4/7] bnxt_en: flow_offload: offload tunnel decap rules via indirect callbacks Michael Chan
2019-10-30  7:59 ` [PATCH net-next 5/7] bnxt_en: Improve bnxt_ulp_stop()/bnxt_ulp_start() call sequence Michael Chan
2019-10-30  7:59 ` [PATCH net-next 6/7] bnxt_en: Call bnxt_ulp_stop()/bnxt_ulp_start() during error recovery Michael Chan
2019-10-30  7:59 ` [PATCH net-next 7/7] bnxt_en: Call bnxt_ulp_stop()/bnxt_ulp_start() during suspend/resume Michael Chan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1572422375-7269-3-git-send-email-michael.chan@broadcom.com \
    --to=michael.chan@broadcom.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=somnath.kotur@broadcom.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).