From patchwork Fri Jan 25 20:48:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Garrett K X-Patchwork-Id: 1031294 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=osuosl.org (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="pRvOHh3g"; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43mWMF2l3yz9sBn for ; Sat, 26 Jan 2019 07:48:24 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id BB4BF2291C; Fri, 25 Jan 2019 20:48:22 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qJY8vYlVLzFH; Fri, 25 Jan 2019 20:48:21 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id DEE5F2275A; Fri, 25 Jan 2019 20:48:21 +0000 (UTC) X-Original-To: intel-wired-lan@osuosl.org Delivered-To: intel-wired-lan@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 3E1BC1BF342 for ; Fri, 25 Jan 2019 20:48:21 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 39DF22275A for ; Fri, 25 Jan 2019 20:48:21 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ycRJg5IvnS3H for ; Fri, 25 Jan 2019 20:48:20 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-it1-f170.google.com (mail-it1-f170.google.com [209.85.166.170]) by silver.osuosl.org (Postfix) with ESMTPS id 80A762155D for ; Fri, 25 Jan 2019 20:48:20 +0000 (UTC) Received: by mail-it1-f170.google.com with SMTP id m8so5856353itk.0 for ; Fri, 25 Jan 2019 12:48:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=mkL6QX0q5WB5MbKmBibjush8zCeqOk+GzhcqJlJJnuk=; b=pRvOHh3gMDjwuPaddTF2lsIZ/xRm7zCCbiUKb9XlmCUBoKXFjbuzMDfPLHc7PmbUFU rF+VpxLyFaF/O3V/l3iMjG4+95cCSLM6xRx1qDEH5qWMycsOqVLLGn98bEA0HsJmL4zo hsPwkIRXCF+Seso++rMEKaLYR43DR+KUmMqn7G7GEYGrpe9EuZ5I83Huz5pjnsCYERHW R4DS1s5HrUZlssnB48KiMfLFhfUMyfXYSPnWWkZq8oclMkYg1X8Hcp+ylojAGtj3pfa0 mrJMk5tK8Ua8lQIEB3Miilw5Gzmha260BVyf7mqcscCr5CvTzrM3lU/fgpGwyeelQUbw s4aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=mkL6QX0q5WB5MbKmBibjush8zCeqOk+GzhcqJlJJnuk=; b=AzfsAtYZwVPHE09tSUxW20pqv9DWv8Mv09CvStcrhS+ELeEdPC2qQIZKbmJTZNid81 2ynbeZtUJP5fRXeoexIqRbYV8sVge4Q3YoPHh/LLaCn59Me8DEXKlKZmsfx+DZVTG+it g2d4DKLPznAfGPAX0UOPkZuJkTmRLRreO1GuVp4ZBtobkfAsGgm053Tmvb0T8f5qSk08 XJWV6aKv6FdXwzH3ry09Ckk9gbeMzlHsglTGPPJqUkSsr+3czALX0uI4NZzwIPcihtVd 0cliQiYj8XH77kXTYHTLWuidQHk0y74SaFY2QIZjJn63i1Ha8w2W2HkqBwNJ49iN/ER6 rrSA== X-Gm-Message-State: AJcUukfqUjdpNC4A48dIwbA6ljUpLQbL0X2ZBdbelqSfVRZbVHaHdUmF QN0PWH8dOchnuD+RWiLle6MbGQpBL/usJEo3thYWllA2 X-Google-Smtp-Source: ALg8bN785QRLPbmhNhrh/ybFqhHwiZuL8kbBiyNsbGrYkoYEqXO80RAeLdy0xnK2Fyd6VTQxOHtQLOTSZYiMM5U1sR8= X-Received: by 2002:a02:49c9:: with SMTP id p70mr8130436jad.40.1548449299679; Fri, 25 Jan 2019 12:48:19 -0800 (PST) MIME-Version: 1.0 From: Garrett K Date: Fri, 25 Jan 2019 14:48:09 -0600 Message-ID: To: intel-wired-lan@osuosl.org Subject: [Intel-wired-lan] i40e XDP - inform user if MTU exceeds rx_buf_len when loading program X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" Hi, A coworker reached out to me after updating distributions on a lab machine. A previously-working eBFP/XDP program suddenly stopped working, reporting "invalid argument" when attempting to load it with iproute2. write(2, "RTNETLINK answers: Invalid argum"..., 36RTNETLINK answers: Invalid argument It looks like their MTU was somehow set to 9000 after the update. Reducing the MTU allowed the program to load. I _think_ that error was coming from i40e_main.c:i40e_xdp_setup(). If that's the indeed true, and if it's possible, it might be helpful to bubble an error message back up to the user. Maybe something like this? for this report. Cheers, Garrett Kuchta diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index f52e2c46e6a7..134ecbbbb84f 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c @@ -11872,8 +11872,11 @@ static int i40e_xdp_setup(struct i40e_vsi *vsi, int i; /* Don't allow frames that span over multiple buffers */ - if (frame_size > vsi->rx_buf_len) + if (frame_size > vsi->rx_buf_len) { + netdev_warn(vsi->netdev, "Frame size %d exceeds rx_buf_len %d; reduce device MTU.\n", + frame_size, vsi->rx_buf_len); return -EINVAL; + } Thank you for the consideration, and apologies if this isn't the right list