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 52E76C43381 for ; Fri, 1 Mar 2019 22:03:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0F80A20840 for ; Fri, 1 Mar 2019 22:03:57 +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="lcNVa9Ar" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726986AbfCAWD4 (ORCPT ); Fri, 1 Mar 2019 17:03:56 -0500 Received: from mail-qt1-f196.google.com ([209.85.160.196]:35717 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725905AbfCAWDz (ORCPT ); Fri, 1 Mar 2019 17:03:55 -0500 Received: by mail-qt1-f196.google.com with SMTP id p48so29663619qtk.2 for ; Fri, 01 Mar 2019 14:03:55 -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=IOoMjZC2qpixpgizlzF20KGAJlTTdsemqNWMM/B1jxY=; b=lcNVa9ArRdZfNSzzc/kE7DMBBFMFDFJyNarArKeYU6ZtTllqytyCYE8TfCQwQf+EfO rLuKIEOrNerUuI8onefW4UOp0ZoorQqXuAHHe6Jxr35bCVH+CshUbeMBkKEESjk0mtJ4 Xy3E5f6KCzpIDLHPBuxSbwEQq1+O1Koyb9+uiZTpupYoleeJ/roNZox+M9PLHn5LUsYV 5VHxvh1/sadLCeE8jw/2XvDicvUvFd5hTQ6pbl2eFPooFb92AYbR5INomgylH78TKTNZ E6pPImmgIFMUVGBI28o1ISQdBH1HmnumAf3RrqFf1YCvwlLwla58MfODZKnifZdXstIB tQfw== 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=IOoMjZC2qpixpgizlzF20KGAJlTTdsemqNWMM/B1jxY=; b=e3LcbC5++x76biwIqlU2MiQq2ox5zkxI9yaXKHkEuX4mQ8irHSF8DGmSoAThuzW7u9 1vvgAVyxsXEvhQa3oLxKCwcljxxeZWEOImTDQkqcwa8DG2UekRi6sdqwij8hTVyMVVtM guHt11hLludGyrjHSSbbJ2rDfu714UTk0TtEC6a1pe5y4fHZPathUG1cxmvkPVlDhUWA a6BzMcR7hbwNJhceqqsQP8cgqky8bgvsD/fZmvg6/HzW0QbpZDny4qbUX2RGM6pAbsGu RJPuSTmPJJG/pxXKRGEP9x/4s1pNbW0eNCPRUyDRY7lyyaPRZWahDYJybsTwCLcJ1BE0 lXww== X-Gm-Message-State: APjAAAX/gSuIlHYzb9C0Mp8mcjENojK7L4ycftRAeoohExRvjnqJhh2e zqyjO4BjMUeszaDop/B8DoI7ng== X-Google-Smtp-Source: APXvYqyzDbCyeTD4Qx0o0QbAJA21Vg2YG4ruGTxWHobBokG+CtvZKWzbPYHdzsTe3dE27hNy/P0+QA== X-Received: by 2002:a0c:963d:: with SMTP id 58mr5658751qvx.25.1551477834537; Fri, 01 Mar 2019 14:03:54 -0800 (PST) Received: from cakuba.netronome.com ([66.60.152.14]) by smtp.gmail.com with ESMTPSA id n78sm5038954qkn.10.2019.03.01.14.03.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Mar 2019 14:03:54 -0800 (PST) Date: Fri, 1 Mar 2019 14:03:46 -0800 From: Jakub Kicinski To: Stephen Hemminger Cc: Maciej Fijalkowski , netdev@vger.kernel.org Subject: Re: [RFC v2 3/6] i40e: use extack for bpf errors Message-ID: <20190301140346.5c777c12@cakuba.netronome.com> In-Reply-To: <20190301135553.7bbc6aa3@shemminger-XPS-13-9360> References: <20190228215441.28275-1-stephen@networkplumber.org> <20190228215441.28275-4-stephen@networkplumber.org> <20190228190645.34c21d8b@cakuba.netronome.com> <20190301122958.000034ba@gmail.com> <20190301082849.13efdb99@cakuba.netronome.com> <20190301135553.7bbc6aa3@shemminger-XPS-13-9360> 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 13:55:53 -0800, Stephen Hemminger wrote: > On Fri, 1 Mar 2019 08:28:49 -0800 > Jakub Kicinski wrote: > > > 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 was just making a best guess based on similar checks elsewhere in the > code as to the correct error message Digging into this I think there are more netdevs, so perhaps "XDP is only allowed on the main netdev instance"? Hopefully Intel folks can advise even better.