netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gal Pressman <gal@nvidia.com>
To: "David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>
Cc: <netdev@vger.kernel.org>, Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>, Gal Pressman <gal@nvidia.com>,
	Tariq Toukan <tariqt@nvidia.com>
Subject: [PATCH net-next 2/2] skbuff: Add likely to skb pointer in build_skb()
Date: Wed, 15 Feb 2023 14:17:07 +0200	[thread overview]
Message-ID: <20230215121707.1936762-3-gal@nvidia.com> (raw)
In-Reply-To: <20230215121707.1936762-1-gal@nvidia.com>

Similarly to napi_build_skb(), it is likely the skb allocation in
build_skb() succeeded.

Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Gal Pressman <gal@nvidia.com>
---
 net/core/skbuff.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 069604b9ff9d..3aa9687d7546 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -420,7 +420,7 @@ struct sk_buff *build_skb(void *data, unsigned int frag_size)
 {
 	struct sk_buff *skb = __build_skb(data, frag_size);
 
-	if (skb && frag_size) {
+	if (likely(skb) && frag_size) {
 		skb->head_frag = 1;
 		skb_propagate_pfmemalloc(virt_to_head_page(data), skb);
 	}
-- 
2.39.0


  parent reply	other threads:[~2023-02-15 12:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-15 12:17 [PATCH net-next 0/2] Couple of minor improvements to build_skb variants Gal Pressman
2023-02-15 12:17 ` [PATCH net-next 1/2] skbuff: Replace open-coded skb_propagate_pfmemalloc()s Gal Pressman
2023-02-15 12:17 ` Gal Pressman [this message]
2023-02-15 23:01   ` [PATCH net-next 2/2] skbuff: Add likely to skb pointer in build_skb() Jakub Kicinski
2023-02-16 14:55     ` Gal Pressman
2023-02-16 15:00       ` Paolo Abeni
2023-02-16 12:15   ` Paolo Abeni
2023-02-15 15:03 ` [PATCH net-next 0/2] Couple of minor improvements to build_skb variants Larysa Zaremba

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=20230215121707.1936762-3-gal@nvidia.com \
    --to=gal@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=tariqt@nvidia.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).