From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4FA6FC433ED for ; Thu, 8 Apr 2021 10:10:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0663A61158 for ; Thu, 8 Apr 2021 10:10:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230506AbhDHKKj (ORCPT ); Thu, 8 Apr 2021 06:10:39 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:54038 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229686AbhDHKKj (ORCPT ); Thu, 8 Apr 2021 06:10:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617876626; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=UTr/e7iTYGD0N+XocUt6MT1hNOKxHbIF/br9tzGgYJQ=; b=jNchhmleGm93zjGkFjBV7fygAPmyXM3cz2JMjwoDxdpQPijQcehvLOXQlEKN1GX8bEr1N6 O67P3zITKyt7q/Sw1Xjf7eCIk9A2pKUij0W6wtGAhJvePRcnfhceNrjYsJZspKapyD923J v9e5nJiqgIH3a3Sd3tsiySS2otKPlSM= Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-355-7MnwnBqNO3CooVvJmrtpuw-1; Thu, 08 Apr 2021 06:10:25 -0400 X-MC-Unique: 7MnwnBqNO3CooVvJmrtpuw-1 Received: by mail-ed1-f71.google.com with SMTP id m21so784348edp.12 for ; Thu, 08 Apr 2021 03:10:24 -0700 (PDT) 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:references :mime-version:content-disposition:in-reply-to; bh=UTr/e7iTYGD0N+XocUt6MT1hNOKxHbIF/br9tzGgYJQ=; b=aW01q+PUiCHV3rSiraULvlAgqXAvrlnGgOAB3maGzzhK8ztYIyH2FdxE+M+Hr5o8RI h33jTighaxl4lsOX5Dq8bsQDkGeimUs+Mhhz9zBhdRFc3MFUjkHcFfemtmDd070DOxc1 539YFi7IeEMAGc9WLO6YX/BAcnHOBaQWY44MZ53hDAallTPy+KMLSVyyfvew84ef3bwW XxZKVTv0fsSV40FFLI/Cnfg7RH1++D5Jj6Ixhv536B3553HcH+ViQLgRYTDAhTSWmcpE /QB+AYASP0UFNhqfSFWigSvAdbFDnjBk4oAxUL3WKtLWeQd0qShJhuGBe5VJ0Ql05DjA HY0g== X-Gm-Message-State: AOAM533u8/rfi74oengcEclXi60cEC8tp/MVolFRNUegIo1Luz4jrQRX hNwuCI3A6llaBvRk3mxxMi6T/heXx+f+/VTxehbmknpWvyi8codEv5+di65EDbYYo+LUkrF+2eT FU+qjiu3w9G0v X-Received: by 2002:a17:906:54e:: with SMTP id k14mr7648299eja.149.1617876623785; Thu, 08 Apr 2021 03:10:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwpnJjQy2rZdlAboIQBscmKQmo84RgWlmjXkcCNGPz1zcfUSVUF8HWkzTgefk3L069TwaB2mw== X-Received: by 2002:a17:906:54e:: with SMTP id k14mr7648271eja.149.1617876623571; Thu, 08 Apr 2021 03:10:23 -0700 (PDT) Received: from localhost ([151.66.38.94]) by smtp.gmail.com with ESMTPSA id gq9sm14287766ejb.62.2021.04.08.03.10.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Apr 2021 03:10:23 -0700 (PDT) Date: Thu, 8 Apr 2021 12:10:19 +0200 From: Lorenzo Bianconi To: Song Liu Cc: Lorenzo Bianconi , bpf , Networking , "David S . Miller" , Jakub Kicinski , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer Subject: Re: [PATCH bpf-next] cpumap: bulk skb using netif_receive_skb_list Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Yqa6TSx8vTqTsFV8" Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org --Yqa6TSx8vTqTsFV8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable > On Thu, Apr 1, 2021 at 9:49 AM Lorenzo Bianconi wrot= e: > > > > > On Thu, Apr 1, 2021 at 1:57 AM Lorenzo Bianconi = wrote: > > > > > > > > [...] > > > > > > - /* Inject into network stack */ > > > > - ret =3D netif_receive_skb_core(skb); > > > > - if (ret =3D=3D NET_RX_DROP) > > > > - drops++; > > > > > > I guess we stop tracking "drops" with this patch? > > > > > > Thanks, > > > Song > > > > Hi Song, > > > > we do not report the packets dropped by the stack but we still count th= e drops > > in the cpumap. If you think they are really important I guess we can ch= ange > > return value of netif_receive_skb_list returning the dropped packets or > > similar. What do you think? >=20 > I think we shouldn't silently change the behavior of the tracepoint below: >=20 > trace_xdp_cpumap_kthread(rcpu->map_id, n, drops, sched, &stats); >=20 > Returning dropped packets from netif_receive_skb_list() sounds good to me. Hi Song, I reviewed the netif_receive_skb_list() and I guess the code needed to count number of dropped frames is a bit intrusive and we need to add some checks in the hot path. Moreover the dropped frames are already accounted in the networking stack (e.g. mib counters for the ip traffic). Since drop counter is just exported in a tracepoint in cpu_map_kthread_run, I guess we can just not count dropped packets in the networking stack here and rely on the mib counters. What do you think? @Jesper: since you added the original code, what do you think about it? Regards, Lorenzo >=20 > Thanks, > Song >=20 --Yqa6TSx8vTqTsFV8 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQTquNwa3Txd3rGGn7Y6cBh0uS2trAUCYG7WiAAKCRA6cBh0uS2t rBYDAP0RCcYqwIC/AtBhEVkKZUoTdEjAGWpOeyNHj2d0LpEoFgEAny0pzyMyPYxZ tutnWMeXubA5rheq8FbzRU/YzxKHLgU= =PC/0 -----END PGP SIGNATURE----- --Yqa6TSx8vTqTsFV8--