From patchwork Mon Oct 5 09:11:40 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sreenivasa Honnur X-Patchwork-Id: 34949 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id B3DA1B7BC1 for ; Mon, 5 Oct 2009 20:12:48 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932317AbZJEJMU (ORCPT ); Mon, 5 Oct 2009 05:12:20 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932304AbZJEJMT (ORCPT ); Mon, 5 Oct 2009 05:12:19 -0400 Received: from barracuda.s2io.com ([72.1.205.138]:39135 "EHLO barracuda.s2io.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932292AbZJEJMT (ORCPT ); Mon, 5 Oct 2009 05:12:19 -0400 X-Greylist: delayed 328 seconds by postgrey-1.27 at vger.kernel.org; Mon, 05 Oct 2009 05:12:18 EDT X-ASG-Debug-ID: 1254733901-4084001f0000-gSecQ8 X-Barracuda-URL: http://72.1.205.138:8000/cgi-bin/mark.cgi Received: from guinness.s2io.com (localhost [127.0.0.1]) by barracuda.s2io.com (Spam & Virus Firewall) with ESMTP id 2051C20B562A; Mon, 5 Oct 2009 05:11:41 -0400 (EDT) Received: from guinness.s2io.com (142-46-210.147.tel-ott.com [142.46.210.147]) by barracuda.s2io.com with ESMTP id WqAGyMYEZ6aDIGft; Mon, 05 Oct 2009 05:11:41 -0400 (EDT) X-Barracuda-Envelope-From: Sreenivasa.Honnur@neterion.com X-ASG-Whitelist: Client Received: from guinness.s2io.com (localhost [127.0.0.1]) by guinness.s2io.com (8.12.6/8.12.6) with ESMTP id n959Bemd002766; Mon, 5 Oct 2009 05:11:40 -0400 (EDT) Received: from localhost (shonnur@localhost) by guinness.s2io.com (8.12.6/8.12.6/Submit) with ESMTP id n959BeFO002763; Mon, 5 Oct 2009 05:11:40 -0400 (EDT) Date: Mon, 5 Oct 2009 05:11:40 -0400 (EDT) From: Sreenivasa Honnur To: davem@davemloft.net cc: netdev@vger.kernel.org, support@neterion.com X-ASG-Orig-Subj: [net-next-2.6 PATCH 6/9] vxge: Check if FCS stripping is disabled by the firmware. Subject: [net-next-2.6 PATCH 6/9] vxge: Check if FCS stripping is disabled by the firmware. Message-ID: MIME-Version: 1.0 X-Barracuda-Connect: 142-46-210.147.tel-ott.com[142.46.210.147] X-Barracuda-Start-Time: 1254733901 X-Barracuda-Virus-Scanned: by Barracuda Spam & Virus Firewall at s2io.com Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org - Added a function to check if FCS stripping is disabled by the firmware, if it is not disabled fail driver load. - By default FCS stripping is disabled by the firmware. With this assumption driver decrements the indicated packet length by 4 bytes(FCS length). - This patch ensures that FCS stripping is disabled during driver load time. Signed-off-by: Sreenivasa Honnur --- -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff -urpN patch5/drivers/net/vxge/vxge-config.c patch6/drivers/net/vxge/vxge-config.c --- patch5/drivers/net/vxge/vxge-config.c 2009-09-04 01:24:25.000000000 -0700 +++ patch6/drivers/net/vxge/vxge-config.c 2009-09-04 01:33:43.000000000 -0700 @@ -2157,6 +2157,28 @@ exit: } /* + * vxge_hw_vpath_strip_fcs_check - Check for FCS strip. + */ +enum vxge_hw_status +vxge_hw_vpath_strip_fcs_check(struct __vxge_hw_device *hldev, u64 vpath_mask) +{ + struct vxge_hw_vpmgmt_reg __iomem *vpmgmt_reg; + enum vxge_hw_status status = VXGE_HW_OK; + int i = 0, j = 0; + + for (i = 0; i < VXGE_HW_MAX_VIRTUAL_PATHS; i++) { + if (!((vpath_mask) & vxge_mBIT(i))) + continue; + vpmgmt_reg = hldev->vpmgmt_reg[i]; + for (j = 0; j < VXGE_HW_MAC_MAX_MAC_PORT_ID; j++) { + if (readq(&vpmgmt_reg->rxmac_cfg0_port_vpmgmt_clone[j]) + & VXGE_HW_RXMAC_CFG0_PORT_VPMGMT_CLONE_STRIP_FCS) + return VXGE_HW_FAIL; + } + } + return status; +} +/* * vxge_hw_mgmt_reg_Write - Write Titan register. */ enum vxge_hw_status diff -urpN patch5/drivers/net/vxge/vxge-config.h patch6/drivers/net/vxge/vxge-config.h --- patch5/drivers/net/vxge/vxge-config.h 2009-09-04 01:23:26.000000000 -0700 +++ patch6/drivers/net/vxge/vxge-config.h 2009-09-04 01:29:17.000000000 -0700 @@ -2201,6 +2201,8 @@ __vxge_hw_vpath_func_id_get( enum vxge_hw_status __vxge_hw_vpath_reset_check(struct __vxge_hw_virtualpath *vpath); +enum vxge_hw_status +vxge_hw_vpath_strip_fcs_check(struct __vxge_hw_device *hldev, u64 vpath_mask); /** * vxge_debug * @level: level of debug verbosity. diff -urpN patch5/drivers/net/vxge/vxge-main.c patch6/drivers/net/vxge/vxge-main.c --- patch5/drivers/net/vxge/vxge-main.c 2009-09-04 01:23:26.000000000 -0700 +++ patch6/drivers/net/vxge/vxge-main.c 2009-09-04 01:31:12.000000000 -0700 @@ -4244,6 +4244,15 @@ vxge_probe(struct pci_dev *pdev, const s goto _exit3; } + /* if FCS stripping is not disabled in MAC fail driver load */ + if (vxge_hw_vpath_strip_fcs_check(hldev, vpath_mask) != VXGE_HW_OK) { + vxge_debug_init(VXGE_ERR, + "%s: FCS stripping is not disabled in MAC" + " failing driver load", VXGE_DRIVER_NAME); + ret = -EINVAL; + goto _exit4; + } + vxge_hw_device_debug_set(hldev, VXGE_ERR, VXGE_COMPONENT_LL); /* set private device info */