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=-1.0 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS autolearn=ham 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 BBCD1C43381 for ; Fri, 1 Mar 2019 16:29:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 85FC020850 for ; Fri, 1 Mar 2019 16:29:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=netronome-com.20150623.gappssmtp.com header.i=@netronome-com.20150623.gappssmtp.com header.b="RV/v8miA" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388913AbfCAQ27 (ORCPT ); Fri, 1 Mar 2019 11:28:59 -0500 Received: from mail-qt1-f194.google.com ([209.85.160.194]:35743 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728449AbfCAQ27 (ORCPT ); Fri, 1 Mar 2019 11:28:59 -0500 Received: by mail-qt1-f194.google.com with SMTP id p48so28424457qtk.2 for ; Fri, 01 Mar 2019 08:28:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :organization:mime-version:content-transfer-encoding; bh=ib4nTTxB3yslI3fl38ipQV5/rulMcK+w9k5eDNpA/I8=; b=RV/v8miAHlPEO5DODoeIWd1Ge+51cv7gRcuqZiwyuibBbyUm35nTKxdLOh6UKJldqA Zn4byoxDApr1nIO3K8uDxRqtn5Tsb3NlAJprYuA5HfuN63/1D5FPiOJOVwo8vurw8K63 HkS6yEe7bsamq+0qr2GqGflojKo7sA+59yyPnXK+pXUpLGHF+sEBsRgtFKW9ltl7oKKF MlhXz7jwesAXPcCl+4kJqP+B2fk8Sxl4oayZ5I9Cdza1uGKrf1NrZQCAb2Hj8dQZHxlW /w5Ky3c5xWY81exMS8kNWmzQ+ruMPnxE5FtgGigsEw1Uk5DHKoIeQPFFha+eHw7trm03 Zd+w== 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:organization:mime-version:content-transfer-encoding; bh=ib4nTTxB3yslI3fl38ipQV5/rulMcK+w9k5eDNpA/I8=; b=DZxYJ6V8lMgQI0Si2bgc9FkCwURXZDXvPjSrFIEmBXTYD5ydS/etZ2YrhguRv75kuD USFxrsE5zMGrEaaJj1T9jjVsfrizOkGzLvPNUzHxf1LijadLglqIzEyrfHJhEH/i1Tur XQNCSM6u/ts54Q6I6Wb8pychKgLg0sQqF34wmFNCCGZo1NSitBLnZXrQ/2/vo49mwhGz 8OLvOeaposiVo1Y502MfqX6V51VYmRamVPKwhA3o6XQxOpE+/QXa9prqmSGPnIyUFmak UVUf9hxTBSQ6KpzfjwO1C92Pf9FJnY6Y51EZTBipAPXNtY4/zygVEaBNvDZSkfcAyh/h sa+A== X-Gm-Message-State: APjAAAWfKx7+h87P2b1dzElEUcMkKxi7Z8Jv/km7w0aHBqfPFlP1CTdz 0fK0bQpbXLvvzwbvBZv4Mqc1jTjWnws= X-Google-Smtp-Source: APXvYqyFwT30goqk/1XXQttalzZKkD0EMxndaSbgZ7NgVZpCJCEskgSii1e8654ltvvnJxxaAQw3Ig== X-Received: by 2002:a0c:b512:: with SMTP id d18mr4388845qve.125.1551457737785; Fri, 01 Mar 2019 08:28:57 -0800 (PST) Received: from cakuba.netronome.com ([66.60.152.14]) by smtp.gmail.com with ESMTPSA id j11sm15686988qtk.26.2019.03.01.08.28.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Mar 2019 08:28:57 -0800 (PST) Date: Fri, 1 Mar 2019 08:28:49 -0800 From: Jakub Kicinski To: Maciej Fijalkowski Cc: Stephen Hemminger , netdev@vger.kernel.org Subject: Re: [RFC v2 3/6] i40e: use extack for bpf errors Message-ID: <20190301082849.13efdb99@cakuba.netronome.com> In-Reply-To: <20190301122958.000034ba@gmail.com> References: <20190228215441.28275-1-stephen@networkplumber.org> <20190228215441.28275-4-stephen@networkplumber.org> <20190228190645.34c21d8b@cakuba.netronome.com> <20190301122958.000034ba@gmail.com> Organization: Netronome Systems, Ltd. MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Fri, 1 Mar 2019 12:31:08 +0100, Maciej Fijalkowski wrote: > On Thu, 28 Feb 2019 19:06:45 -0800 > Jakub Kicinski wrote: > > > On Thu, 28 Feb 2019 13:54:38 -0800, Stephen Hemminger wrote: > > > @@ -12140,12 +12144,14 @@ static int i40e_xdp(struct net_device *dev, > > > struct i40e_netdev_priv *np = netdev_priv(dev); > > > struct i40e_vsi *vsi = np->vsi; > > > > > > - if (vsi->type != I40E_VSI_MAIN) > > > + if (vsi->type != I40E_VSI_MAIN) { > > > + NL_SET_ERR_MSG_MOD(xdp->extack, "XDP not allowed on VF"); > > > > Is that right? Intel tends to have separate drivers for VFs, I think > > the i40evf got renamed to iavf. > > > Good catch, this sanity check is to make sure that XDP is being enabled on main > VSI of PF, not for example the VSI dedicated for Flow Director management > (I40E_VSI_FDIR). Besides that, vsi->type != I40E_VSI_MAIN doesn't yield the > I40E_VSI_SRIOV type. > > So it would be better to have an error message like "XDP is not allowed on VSIs > other than main VSI". > > Thoughts? Do the other VSI types have netdevs? If they do this may be hard to understand (unless Intel's manuals refer to VSI and users know what that is). If there is no netdev on other VSIs perhaps this "should never happen" and we can convert it to a WARN_ON()? > > I think it would be a good idea to CC maintainers on the driver patches. > > > > > return -EINVAL; > > > + } > > > > > >