From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 5F5BE5F36 for ; Wed, 21 Mar 2018 15:03:36 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Mar 2018 07:03:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,340,1517904000"; d="scan'208";a="213353718" Received: from kmsmsx156.gar.corp.intel.com ([172.21.138.133]) by fmsmga006.fm.intel.com with ESMTP; 21 Mar 2018 07:03:30 -0700 Received: from pgsmsx112.gar.corp.intel.com ([169.254.3.227]) by KMSMSX156.gar.corp.intel.com ([169.254.1.97]) with mapi id 14.03.0319.002; Wed, 21 Mar 2018 22:03:29 +0800 From: "Dai, Wei" To: "Ananyev, Konstantin" , "Lu, Wenzhuo" CC: "dev@dpdk.org" Thread-Topic: [PATCH v2 3/4] net/ixgbe: convert to new Rx offloads API Thread-Index: AQHTtheeZqGIsRCsKkqiZIbDZvB4pqPPyeQAgAclmOCAAaJHgIACN+bA Date: Wed, 21 Mar 2018 14:03:28 +0000 Message-ID: <49759EB36A64CF4892C1AFEC9231E8D66CF6170C@PGSMSX112.gar.corp.intel.com> References: <1519747291-6969-1-git-send-email-wei.dai@intel.com> <1520427990-73471-1-git-send-email-wei.dai@intel.com> <1520427990-73471-4-git-send-email-wei.dai@intel.com> <2601191342CEEE43887BDE71AB9772589E28FDBA@irsmsx105.ger.corp.intel.com> <49759EB36A64CF4892C1AFEC9231E8D66CF60396@PGSMSX112.gar.corp.intel.com> <2601191342CEEE43887BDE71AB977258A0AB20F4@irsmsx105.ger.corp.intel.com> In-Reply-To: <2601191342CEEE43887BDE71AB977258A0AB20F4@irsmsx105.ger.corp.intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOTcyNTk4NGItODhhZi00MTA1LTkzYTAtNzdjYTdiMTJiNzkwIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6ImkxbE9wVXR3V1NXazVsamNUZWtuQ3VNV0taQkU2aVNCUTV4aG1hcDh4Ymc9In0= x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [172.30.20.205] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2 3/4] net/ixgbe: convert to new Rx offloads API X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2018 14:03:37 -0000 Hi, Konstantin Thanks for your patient guidance! > IXGBE_WRITE_REG(hw, IXGBE_SRRCTL(rxq->reg_idx), srrctl); in > ixgbe_dev_rx_init( ). > > Same case is also in the code line: IXGBE_WRITE_REG(hw, > IXGBE_VFSRRCTL(i), srrctl); in ixgbevf_dev_rx_init( ). >=20 > Yes, HW can enable/disable it on a per queue basis. > Though it affects rx function selection, and as right now we have one rx > function per device - That's why it looks to me more like a per port offl= oad. > Though I believe these days ixgbe PMD doesn't support it properly anyway > (we always set rxd.hdr_addr to zero) - so probably better to remove it at= all. >=20 Yes, rx function is related with offloading. I'll remove this header split capability in my next patch set. > > > > > > +static int > > > > +ixgbe_check_rx_queue_offloads(struct rte_eth_dev *dev, uint64_t > > > > +requested) { > > > > + uint64_t port_offloads =3D dev->data->dev_conf.rxmode.offloads; > > > > + uint64_t queue_supported =3D ixgbe_get_rx_queue_offloads(dev); > > > > + uint64_t port_supported =3D ixgbe_get_rx_port_offloads(dev); > > > > + > > > > + if ((requested & (queue_supported | port_supported)) !=3D request= ed) > > > > + return 0; > > > > + > > > > + if ((port_offloads ^ requested) & port_supported) > > > > > > Could you explain a bit more what are you cheking here? > > > As I can see: > > > (port_offloads ^ requested) - that's a diff between already set and > > > newly requested offloads. > > > Then you check if that diff consists of supported by port offloads, > > > and if yes you return an error? > > > Konstantin > > > > > This function is similar to mlx4_check_rx_queue_offloads() in mlx4 driv= er. > > As the git log message in the commit > > ce17eddefc20285bbfe575bdc07f42f0b20f34cb say that a per port > > capability should has same setting (enabling or disabling) on both port > configuration via rte_eth_dev_configure( ) and queue configuration via > rte_eth_rx_queue_setup( ). > > This function check if this requirement is matched or not. > > It also check offloading request is supported as a per port or a per qu= eue > capability or not. > > If above checking is pass, it return 1 else return 0. >=20 > Ok, let be more specific here. > Let say: > requested =3D=3D DEV_RX_OFFLOAD_VLAN_STRIP; > port_offloads =3D=3D DEV_RX_OFFLOAD_IPV4_CKSUM; port_supported =3D > (DEV_RX_OFFLOAD_IPV4_CKSUM | > DEV_RX_OFFLOAD_UDP_CKSUM | > DEV_RX_OFFLOAD_TCP_CKSUM | > DEV_RX_OFFLOAD_CRC_STRIP | > DEV_RX_OFFLOAD_JUMBO_FRAME | > DEV_RX_OFFLOAD_SCATTER); >=20 > (port_offloads ^ requested) =3D=3D DEV_RX_OFFLOAD_VLAN_STRIP | > DEV_RX_OFFLOAD_IPV4_CKSUM; (port_offloads ^ requested) & > port_supported =3D=3D DEV_RX_OFFLOAD_IPV4_CKSUM; And that function will > return failure, while as I understand it shouldn't - requested queue offl= oad is > valid. >=20 > Konstantin I'd like to list the git message of commit ce17eddefc20285bbfe575bdc07f42f0= b20f34cb which=20 has been submitted by Shahaf Shuler and already been accepted. SHA-1: ce17eddefc20285bbfe575bdc07f42f0b20f34cb * ethdev: introduce Rx queue offloads API Introduce a new API to configure Rx offloads. In the new API, offloads are divided into per-port and per-queue offloads. The PMD reports capability for each of them. Offloads are enabled using the existing DEV_RX_OFFLOAD_* flags. To enable per-port offload, the offload should be set on both device configuration and queue configuration. To enable per-queue offload, the offloads can be set only on queue configuration. Applications should set the ignore_offload_bitfield bit on rxmode structure in order to move to the new API. The old Rx offloads API is kept for the meanwhile, in order to enable a smooth transition for PMDs and application to the new API. Signed-off-by: Shahaf Shuler Reviewed-by: Andrew Rybchenko Acked-by: Konstantin Ananyev In your example, IPV4_CKSUM is a per port offloading, it is Enabled in port_offloads to rte_eth_dev_configure(), and it Should also be enabled in requested to rte_eth_rx_queue_setup( ). So your example fails in this checking. This function is very similar with priv_is_rx_queue_offloads_allowed( ) in = /net/mlx5/mlx5_rxq.c In the patch http://dpdk.org/dev/patchwork/patch/33386/ which has already b= een accepted. =20