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=-3.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, 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 BD05EC17441 for ; Tue, 12 Nov 2019 14:52:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9077A20818 for ; Tue, 12 Nov 2019 14:52:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=cloudflare.com header.i=@cloudflare.com header.b="HCajAbdi" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727036AbfKLOwl (ORCPT ); Tue, 12 Nov 2019 09:52:41 -0500 Received: from mail-lj1-f193.google.com ([209.85.208.193]:41493 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727016AbfKLOwk (ORCPT ); Tue, 12 Nov 2019 09:52:40 -0500 Received: by mail-lj1-f193.google.com with SMTP id d22so6601294lji.8 for ; Tue, 12 Nov 2019 06:52:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloudflare.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zMxQ9/HiBoVmHgdjL1Dea6TBMrXdo7hHLCySnCEmogQ=; b=HCajAbdidtsw4278qDsX+KBdupb0mCwkRKzWDvxwtPr0uVx7AP3AsTK7VI7QH43ME+ 3qbMdoX6DF/sfBv8Lmh2/nFm8oFdVOL7VEZ/vGWufN7FuTmVyKLm+wQCC3d+ik21GG5g PDuMUSVA4McUzRjX5mWdlcDrcZW4n/1KYyQNk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zMxQ9/HiBoVmHgdjL1Dea6TBMrXdo7hHLCySnCEmogQ=; b=MwBnl1Iaor3JLBHEgoVWofO76LjjLk47Ukg4sn3YSIDCGnAQ3UqCbG4j35wn8JGges xjAvTm43wQv/jpYeWAhPrJhKt8rpDZ0OzLPAZBkJ1nrVKiYtu6R7ghbBykEh+xGSoKS0 h22GuvA7x+M+JER7GNjo2Uy/tW5ACaREi1kcJZuW9OeAPh8a4drqFFXe5+xqBYyYZ+GU WGWsoNc4+Sw3CHHveoSdA50Qotl3ssWkxLt4Sic99XHbZm0BPC9oSkw3Y8RBh+QQ0mZT +N98i6C4Os0gfJEDX1l227lZ0cMOVwm93KNoRRvfskwvSjAD6D8dOQi7y5m5UvXRZ0e1 HSqw== X-Gm-Message-State: APjAAAWM2pO6SApnBKkukaordUAfu16XPD02CTNrCr8nZoIu+OxtpNki BlkQZPKNjsz2OD+Dedde2ik7wVixRUKUaAPA40uY4w== X-Google-Smtp-Source: APXvYqwqMsztcy5Mg+165AlF5ASR4319ObjY+ke77gSvEtLMeESmNyD8jVL3nabXwv2uf85mJpGcjovZi5EK5iD75EI= X-Received: by 2002:a2e:9712:: with SMTP id r18mr10190601lji.12.1573570358059; Tue, 12 Nov 2019 06:52:38 -0800 (PST) MIME-Version: 1.0 References: <20191111105100.2992-1-afabre@cloudflare.com> <6a3705cc-809d-0c7a-d39f-97d61c4ce58c@solarflare.com> In-Reply-To: <6a3705cc-809d-0c7a-d39f-97d61c4ce58c@solarflare.com> From: Arthur Fabre Date: Tue, 12 Nov 2019 14:52:26 +0000 Message-ID: Subject: Re: [PATCH net-next] sfc: trace_xdp_exception on XDP failure To: Edward Cree Cc: Solarflare linux maintainers , Charles McLachlan , Martin Habets , David Miller , Alexei Starovoitov , Daniel Borkmann , Jakub Kicinski , Jesper Dangaard Brouer , John Fastabend , netdev , bpf , kernel-team Content-Type: text/plain; charset="UTF-8" Sender: bpf-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org On Mon, Nov 11, 2019 at 6:01 PM Edward Cree wrote: > > On 11/11/2019 17:38, Arthur Fabre wrote: > > On Mon, Nov 11, 2019 at 5:27 PM Edward Cree wrote: > >> > >> On 11/11/2019 10:51, Arthur Fabre wrote: > >>> diff --git a/drivers/net/ethernet/sfc/rx.c b/drivers/net/ethernet/sfc/rx.c > >>> index a7d9841105d8..5bfe1f6112a1 100644 > >>> --- a/drivers/net/ethernet/sfc/rx.c > >>> +++ b/drivers/net/ethernet/sfc/rx.c > >>> @@ -678,6 +678,7 @@ static bool efx_do_xdp(struct efx_nic *efx, struct efx_channel *channel, > >>> "XDP is not possible with multiple receive fragments (%d)\n", > >>> channel->rx_pkt_n_frags); > >>> channel->n_rx_xdp_bad_drops++; > >>> + trace_xdp_exception(efx->net_dev, xdp_prog, xdp_act); > >>> return false; > >>> } > >> AIUI trace_xdp_exception() is improper here as we have not run > >> the XDP program (and xdp_act is thus uninitialised). > >> > >> The other three, below, appear to be correct. > >> -Ed > >> > > > > Good point. Do you know under what conditions we'd end up with > > "fragmented" packets? As far as I can tell this isn't IP > > fragmentation? > > Fragments in this case means that the packet data are spread across > multiple RX buffers (~= memory pages). This should only happen if > the RX packet is too big to fit in a single buffer, and when > enabling XDP we ensure that the MTU is small enough to prevent > that. So in theory this can't happen if the NIC is functioning > correctly. > > -Ed Makes sense, thank you for the explanation.