Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2490016rwb; Mon, 7 Nov 2022 14:03:07 -0800 (PST) X-Google-Smtp-Source: AMsMyM5F3jMCV0SOwSvdZaBOIjFLbN04cvLhCaHDOw9J4j+1O5777ZNrZo7v0hDbaSkKSv6MLGkx X-Received: by 2002:a17:903:2308:b0:186:95bd:dc21 with SMTP id d8-20020a170903230800b0018695bddc21mr52650139plh.135.1667858587561; Mon, 07 Nov 2022 14:03:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667858587; cv=none; d=google.com; s=arc-20160816; b=cy8IxNlAHOsIrgOY6LQ7qpHN8A4C+4zGHW/0OthD7J70Zp6TUmr9Bz1umORPmv9fr3 me4C2f4Wo6FrEgzrlKDGU9OjMQF0ebRLlrb3icb/07ej38XLQRQdiVlQxJcbKh8exjz7 9nRce+0j2e79mWVW7J8DupasQnjRgBHH2vmmjHr42XWq86G6iB/jGuPi6Sl//ghHftY2 EpG3phIpELDnWQqJROldy1xrX/SkeYju77mnrhEt00xc1hyGldLXmcJzk0mwLUfW57ps BD2Z+gRRcb1PEutDixMHjw5J4GahWdd3IvSFQ9dntc5gXDgAKNHIwBXybbC4Mdg3dd/m x8NA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ECPNx4pL1/CxCRgn8HIrE24nQiHL0anA80CnQdiBN5g=; b=0ysIenVXtjTIxYEbGgnAbj3nh+RIAcbUD3Oj0ejBIuvroLGUAyzSCd2HCZC1Aj822V Jjo3sJzvw482QCrLFyTQpqAmpDKa7rNKak4Yfb5U/3mge6zqNz0quKC3XFk+UUAKhGn7 +Ycx7LhQZJJLie5k1NbBtcyxrTUS+lPoRGDqwEfO+Lbmsb/+0X6llq2r9rMgdwvMk5MP 16fhiyhemZLIsmZzDvEXJXzV57idv2g/PHo2ZM9dFFRu0Ci3qrHLCurx5nu06lzxgDYv ri5UPBJchuLzqWgl2VObgvFU+0R404Rp7pYswmNB+4WWRtzjO873H/msakRx9kwpyknt 3rMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=Gul6JWYh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b18-20020a170902e95200b0017db9b9d54asi11767541pll.300.2022.11.07.14.02.55; Mon, 07 Nov 2022 14:03:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=Gul6JWYh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232475AbiKGVWG (ORCPT + 91 others); Mon, 7 Nov 2022 16:22:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232964AbiKGVVo (ORCPT ); Mon, 7 Nov 2022 16:21:44 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4D8A2A71B; Mon, 7 Nov 2022 13:21:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1667856095; x=1699392095; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=YkoNsI9/1R+ki7fJQr6gAdHFToRmOJwu7Ie2j7MiVaU=; b=Gul6JWYhv58qIG/yFCwxqv3RB3p/lz2tcRjWMOGsVsMoRxZtXRH4bXmr XH4W47dBb6m106wp0XaiwALFemMKbVwXl+qaW5kpKitAFPNTWktMwRuvt s5hxSmf/YPnwjefu0R6N2DtnzZ32Nh4p7qldvuxQC3fwsrryYomLNeZJH vyA26M+lBqBus3K2SykLRUoNpG3+YFSCWpypc3M+lstWhFs3GsJZrpW8z mAkM48zyofqdlyi47Qp0s47Z96dFGpEPZsRu0z9dOUaz7JaAqDJPVW3vI L6BicLMBch0gcVTbp4S76SPdzvL8WzqbTu4QJkmnSQkMwhBjdukUCs4iL Q==; X-IronPort-AV: E=Sophos;i="5.96,145,1665471600"; d="scan'208";a="187996260" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 07 Nov 2022 14:21:33 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.12; Mon, 7 Nov 2022 14:21:33 -0700 Received: from localhost (10.10.115.15) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.2507.12 via Frontend Transport; Mon, 7 Nov 2022 14:21:33 -0700 Date: Mon, 7 Nov 2022 22:26:18 +0100 From: Horatiu Vultur To: Alexander Lobakin CC: Alexander Lobakin , , , , , , , , , , , , Subject: Re: [PATCH net-next v2 3/4] net: lan966x: Add basic XDP support Message-ID: <20221107212618.73aqn3cdqojs6zbo@soft-dev3-1> References: <20221106211154.3225784-1-horatiu.vultur@microchip.com> <20221106211154.3225784-4-horatiu.vultur@microchip.com> <20221107161357.556549-1-alexandr.lobakin@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline In-Reply-To: <20221107161357.556549-1-alexandr.lobakin@intel.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The 11/07/2022 17:13, Alexander Lobakin wrote: Hi Olek, > > From: Alexander Lobakin > > From: Horatiu Vultur > Date: Sun, 6 Nov 2022 22:11:53 +0100 > > > Introduce basic XDP support to lan966x driver. Currently the driver > > supports only the actions XDP_PASS, XDP_DROP and XDP_ABORTED. > > > > Signed-off-by: Horatiu Vultur > > --- > > .../net/ethernet/microchip/lan966x/Makefile | 3 +- > > .../ethernet/microchip/lan966x/lan966x_fdma.c | 11 ++- > > .../ethernet/microchip/lan966x/lan966x_main.c | 5 ++ > > .../ethernet/microchip/lan966x/lan966x_main.h | 13 +++ > > .../ethernet/microchip/lan966x/lan966x_xdp.c | 81 +++++++++++++++++++ > > 5 files changed, 111 insertions(+), 2 deletions(-) > > create mode 100644 drivers/net/ethernet/microchip/lan966x/lan966x_xdp.c > > [...] > > > +bool lan966x_xdp_port_present(struct lan966x_port *port) > > +{ > > + return !!port->xdp_prog; > > +} > > Why uninline such a simple check? I realize you want to keep all XDP > stuff inside in the separate file, but doesn't this one looks too > much? I was kind of hoping that the compiler will inline it for me. But I can add it in the header file to inline it. > > > + > > +int lan966x_xdp_port_init(struct lan966x_port *port) > > +{ > > + struct lan966x *lan966x = port->lan966x; > > + > > + return xdp_rxq_info_reg(&port->xdp_rxq, port->dev, 0, > > + lan966x->napi.napi_id); > > +} > > + > > +void lan966x_xdp_port_deinit(struct lan966x_port *port) > > +{ > > + if (xdp_rxq_info_is_reg(&port->xdp_rxq)) > > + xdp_rxq_info_unreg(&port->xdp_rxq); > > +} > > -- > > 2.38.0 > > Thanks, > Olek -- /Horatiu