Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9EB3B200D2 for ; Wed, 13 Sep 2023 18:04:26 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16F0919BB for ; Wed, 13 Sep 2023 11:04:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1694628266; x=1726164266; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=QyYLIif5LNoMNg4j2gxbRukKDXmGrWFYxEqdO7nWWb4=; b=N+Zso0OGvqR+1RPPCd9epoFGKMehg+/6hAbLwa6wrhdqDaC9gzI69VP0 VB3H7KAYKaHaKYgdnO9VEeZL2JkW6SWNSEbgrw+uNMiO2T/53HHnlAVNn bMxq9j2Eeca8W/c+yxqdPnrvlV8Wm+1kgVAFAwwmXjGMOJj9xvb9w6Ayd ew258450lw+CrqxK9bYrVaMYVS8PpLRdVgOM7L7t9lYjQ4Cfe3HfwvO0O UgfTOOWWOostsS/qYo/mTXbRoQjbObc3WxqapkKN9WhVLpN4ndV9up/b4 E0eZSKd2/9gDwUQu73vmx4iCanbKWrt3VprCcw5w89A7AiaADmkoZpP17 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10832"; a="378658454" X-IronPort-AV: E=Sophos;i="6.02,143,1688454000"; d="scan'208";a="378658454" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Sep 2023 11:03:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10832"; a="747417165" X-IronPort-AV: E=Sophos;i="6.02,143,1688454000"; d="scan'208";a="747417165" Received: from anguy11-upstream.jf.intel.com ([10.166.9.133]) by fmsmga007.fm.intel.com with ESMTP; 13 Sep 2023 11:03:54 -0700 From: Tony Nguyen To: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, edumazet@google.com, netdev@vger.kernel.org Cc: Haiyue Wang , anthony.l.nguyen@intel.com, Jesse Brandeburg , Ahmed Zaki , Rafal Romanowski Subject: [PATCH net-next 2/4] ice: Support FCS/CRC strip disable for VF Date: Wed, 13 Sep 2023 11:03:32 -0700 Message-Id: <20230913180334.2116162-3-anthony.l.nguyen@intel.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230913180334.2116162-1-anthony.l.nguyen@intel.com> References: <20230913180334.2116162-1-anthony.l.nguyen@intel.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Haiyue Wang To support CRC strip enable/disable functionality, VF needs the explicit request VIRTCHNL_VF_OFFLOAD_CRC offload. Then according to crc_disable flag of Rx queue configuration information to set up the queue context. Signed-off-by: Haiyue Wang Reviewed-by: Jesse Brandeburg Signed-off-by: Ahmed Zaki Tested-by: Rafal Romanowski Signed-off-by: Tony Nguyen --- drivers/net/ethernet/intel/ice/ice_virtchnl.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl.c b/drivers/net/ethernet/intel/ice/ice_virtchnl.c index b03426ac932b..c0c3e524c523 100644 --- a/drivers/net/ethernet/intel/ice/ice_virtchnl.c +++ b/drivers/net/ethernet/intel/ice/ice_virtchnl.c @@ -486,6 +486,9 @@ static int ice_vc_get_vf_res_msg(struct ice_vf *vf, u8 *msg) if (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_REQ_QUEUES) vfres->vf_cap_flags |= VIRTCHNL_VF_OFFLOAD_REQ_QUEUES; + if (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_CRC) + vfres->vf_cap_flags |= VIRTCHNL_VF_OFFLOAD_CRC; + if (vf->driver_caps & VIRTCHNL_VF_CAP_ADV_LINK_SPEED) vfres->vf_cap_flags |= VIRTCHNL_VF_CAP_ADV_LINK_SPEED; @@ -1666,6 +1669,18 @@ static int ice_vc_cfg_qs_msg(struct ice_vf *vf, u8 *msg) vsi->rx_rings[i]->dma = qpi->rxq.dma_ring_addr; vsi->rx_rings[i]->count = qpi->rxq.ring_len; + if (qpi->rxq.crc_disable && + !(vf->driver_caps & VIRTCHNL_VF_OFFLOAD_CRC)) { + goto error_param; + } + + if (qpi->rxq.crc_disable) + vsi->rx_rings[q_idx]->flags |= + ICE_RX_FLAGS_CRC_STRIP_DIS; + else + vsi->rx_rings[q_idx]->flags &= + ~ICE_RX_FLAGS_CRC_STRIP_DIS; + if (qpi->rxq.databuffer_size != 0 && (qpi->rxq.databuffer_size > ((16 * 1024) - 128) || qpi->rxq.databuffer_size < 1024)) -- 2.38.1