From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl0-f49.google.com (mail-pl0-f49.google.com [209.85.160.49]) by dpdk.org (Postfix) with ESMTP id B4DBF235 for ; Mon, 23 Jul 2018 19:38:00 +0200 (CEST) Received: by mail-pl0-f49.google.com with SMTP id j8-v6so457844pll.12 for ; Mon, 23 Jul 2018 10:38:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=vm99mG80eSZGod6m8SZDxid2I7d18AN4xjR0vWlPLHM=; b=ROuum/GKXJUnwIVOXwDMhlS7HBJ9r8iEjJW6fG2iUs33n/j7gYQ0mX4FrdKACFLBJb eX/DnGlXfkOzhWLkJpKTxjwzu8LEzcmMESmSSYqYySW4exSpQRQaDqUvICS2E5Wz8O3F +Pnt/+MEkN5iY3YnAfjHTFwTgSxCdTSjRrwQBS254ihTFT2nWvCpsoP05kdxZa0dcDwB qvXJTGJJnDm/hC/bFElgFx5ql5Ls4zqkfBHX0nJ60OCNWfIwnMxkUNicK7B2K3XUaNap TVh//HNpQ0B8unuod4JPXhY/u2HtLN+UiamwHRceUZYp35GkWyicwAXnskasVCwFWM20 MLsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=vm99mG80eSZGod6m8SZDxid2I7d18AN4xjR0vWlPLHM=; b=QMWoOHX5vXvUfpGssEvuaWFpFTTLmQb2byoREkLVNgSIsJRknvC71oFvj9B8Fml/Ri ZGYkOaYd8dqGUcIR2NmJR+AIKFzJ4xezxhUgMCkGCG4N1tSfvJ2+zJMlDM4cjvMCGddJ SZnxPMXnb3lv0gw9KXCIBIWajmWBJlL3+yY5VrRvp43U+5rPO0ifY9t76f/vulat++eH xWjsgNCZyrhu0/8Lt8hwG5QTjx9OD49PP4PTYWYAH22gkuVGepTw5mNcgLw8qkmZHwhl iabeODuzi3pWdF0ao3DCUHeOVurjx+4ETPRIUa14VAZnvrVGFXyW9qPkNJAn4Aj/Tszt nJmQ== X-Gm-Message-State: AOUpUlFlN4ThVvfPa8Xpaf2wPKaAz2QWIeE9L4VvrgoRJVhkzZvEQ+P9 T4H/6Bk8XMVV/bT4mYc2PRbVL/i8OaY= X-Google-Smtp-Source: AAOMgpfN1GKctoBonfhFcly2Ru1j5eWKUQAa7P9Q86yabdND+8YvUT7dM9IR0oQn0mQVqhsDA0BspQ== X-Received: by 2002:a17:902:2927:: with SMTP id g36-v6mr13503212plb.303.1532367479936; Mon, 23 Jul 2018 10:37:59 -0700 (PDT) Received: from xeon-e3 (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id 16-v6sm20511087pfo.164.2018.07.23.10.37.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Jul 2018 10:37:59 -0700 (PDT) Date: Mon, 23 Jul 2018 10:37:57 -0700 From: Stephen Hemminger To: Morten =?UTF-8?B?QnLDuHJ1cA==?= Cc: "Olivier Matz" , Message-ID: <20180723103757.47e4c26b@xeon-e3> In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35B421EE@smartserver.smartshare.dk> References: <98CBD80474FA8B44BF855DF32C47DC35B421EE@smartserver.smartshare.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [dpdk-dev] rte_mbuf library likely()/unlikely() X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jul 2018 17:38:01 -0000 On Mon, 23 Jul 2018 15:53:42 +0200 Morten Br=C3=B8rup wrote: > Hi Olivier, >=20 > =20 >=20 > I noticed that __rte_pktmbuf_read() could do with an unlikely(), so I wen= t through the entire library. Here are my suggested modifications. >=20 > =20 >=20 > =20 >=20 > diff -bu rte_mbuf.c.orig rte_mbuf.c >=20 > --- rte_mbuf.c.orig 2018-07-23 15:13:22.000000000 +0200 >=20 > +++ rte_mbuf.c 2018-07-23 15:32:53.000000000 +0200 >=20 > @@ -173,19 +173,19 @@ >=20 > { >=20 > unsigned int nb_segs, pkt_len; >=20 > =20 >=20 > - if (m =3D=3D NULL) >=20 > + if (unlikely(m =3D=3D NULL)) >=20 > rte_panic("mbuf is NULL\n"); >=20 > =20 Adding is unlikely is not necessary since rte_panic is marked with cold att= ribute which has the same effect.