From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6FC2942D22; Thu, 22 Jun 2023 11:48:23 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 455AD406B8; Thu, 22 Jun 2023 11:48:23 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id A7F0F406A2 for ; Thu, 22 Jun 2023 11:48:21 +0200 (CEST) Received: from [192.168.1.40] (unknown [188.170.81.161]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id 9F56D50; Thu, 22 Jun 2023 12:48:20 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 9F56D50 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1687427300; bh=how0NdjpPjrUYUpyoTowocHw+bVayHf9pIxpbLJ2RMU=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=tuhOJSZFyDb3MexOmDAluArsll2FIqFIjuRpz5F6tJ5UzQFZk3ZM+lX9+QuUqgTHK JY8c5n8aHF/uBGKaWsnCK2dhjjPPUcNDYd6wTtEDeb3YIID0zUjPN+W3qDxW30zM/N CIiWqZ3eEJ6DD6N/4QIhKk8ZCMYl7GyWXV/eS9zw= Message-ID: Date: Thu, 22 Jun 2023 12:48:20 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH v2 1/4] common/sfc_efx/base: discover NIC partitioning mode Content-Language: en-US To: Denis Pryazhennikov , dev@dpdk.org Cc: Ferruh Yigit , Sandilya Bhagi , Andy Moreton References: <20230601114220.17796-1-denis.pryazhennikov@arknetworks.am> <20230622034738.51288-1-denis.pryazhennikov@arknetworks.am> <20230622034738.51288-2-denis.pryazhennikov@arknetworks.am> From: Andrew Rybchenko In-Reply-To: <20230622034738.51288-2-denis.pryazhennikov@arknetworks.am> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On 6/22/23 06:47, Denis Pryazhennikov wrote: > From: Sandilya Bhagi > > NIC Partitioning mode in SFC devices means multiple PFs > per network port. When NIC Partitioning is configured, > apart from the privileged adapter(s) the other > unprivileged adapter(s) will share the same physical port. > Determining NIC Partitioning mode is required to take > necessary action(s) for unprivileged adapter to work seamlessly. > BNIC Partitioning is determined using heuristic approach. > If the physical ports are shared between PFs then either > NIC Partitioning or SR-IOV is in use. > > Signed-off-by: Sandilya Bhagi > Signed-off-by: Denis Pryazhennikov > Reviewed-by: Andy Moreton Overall LGMT with few style notes: Acked-by: Andrew Rybchenko [snip] > +#define CAP_PFS_TO_PORTS(_n) \ > + (MC_CMD_GET_CAPABILITIES_V2_OUT_PFS_TO_PORTS_ASSIGNMENT_ ## _n) > + > + encp->enc_port_usage = EFX_PORT_USAGE_UNKNOWN; > + > + if (req.emr_out_length_used >= MC_CMD_GET_CAPABILITIES_V2_OUT_LEN) { > + /* PFs to ports assignment */ > + uint8_t pfs_to_ports[CAP_PFS_TO_PORTS(NUM)]; > + > + EFX_STATIC_ASSERT((CAP_PFS_TO_PORTS(NUM) * CAP_PFS_TO_PORTS(LEN)) == > + EFX_ARRAY_SIZE(pfs_to_ports)); As far as I remember libefx style, it should be 4 spaces indent above relative to mail line. > + > + memcpy(pfs_to_ports, MCDI_OUT(req, efx_byte_t, CAP_PFS_TO_PORTS(OFST)), > + EFX_ARRAY_SIZE(pfs_to_ports)); same here, 4 spaces indent > + > + rc = ef10_nic_get_physical_port_usage(enp, pfs_to_ports, > + EFX_ARRAY_SIZE(pfs_to_ports), > + &encp->enc_port_usage); same here, 4 spaces indent > + if (rc != 0) { > + /* PF to port mapping lookup failed */ > + encp->enc_port_usage = EFX_PORT_USAGE_UNKNOWN; > + } > + } > +#undef CAP_PFS_TO_PORTS > + > /* > * Check if firmware reports the VI window mode. > * Medford2 has a variable VI window size (8K, 16K or 64K). [snip]