From patchwork Tue Feb 17 16:43:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Larry Finger X-Patchwork-Id: 5840671 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2C5D0BF440 for ; Tue, 17 Feb 2015 16:43:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7B15D2017E for ; Tue, 17 Feb 2015 16:43:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 71ECC20166 for ; Tue, 17 Feb 2015 16:43:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752030AbbBQQne (ORCPT ); Tue, 17 Feb 2015 11:43:34 -0500 Received: from mail-ob0-f171.google.com ([209.85.214.171]:64804 "EHLO mail-ob0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751636AbbBQQnd (ORCPT ); Tue, 17 Feb 2015 11:43:33 -0500 Received: by mail-ob0-f171.google.com with SMTP id gq1so55169100obb.2 for ; Tue, 17 Feb 2015 08:43:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type; bh=QEQ4KNUq92QGYtM0EQlUqIUCgFxu5GVEMfImRWwiB78=; b=0RY1TcwenQue0UxdvaM7L0QD7HRksPryh7mK1u/GciOWVQ7KQYBt023hYf0Ta1t6W7 FSuDHlAF9TDFisgyVrLVEvudOJYjrvlRWEVbswhi2oh5fDmtGZgY2FHpVsiJmbdBBbgA 3t2luPsFA8OZkOAeehtQVrb1V/DXdo0Dj1osS4ux6HEgXhE+XOUkkqrZjQZGlR6Y+9kD jnRE4rif7U/yR25Ha45MT1Pgk7c+QRjcsFJM6eh63NOgvlXA/bZ5bjrlYKrS5p+ahFgc vQFhFd5nh0i25E8SIid1JbkYl7iainj0deyzERfLPKEOYl3rHX675UM9+OxqkrRU1HhP H09g== X-Received: by 10.202.220.9 with SMTP id t9mr18271458oig.102.1424191412306; Tue, 17 Feb 2015 08:43:32 -0800 (PST) Received: from linux.site ([69.76.245.152]) by mx.google.com with ESMTPSA id k9sm11439983obh.0.2015.02.17.08.43.30 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Feb 2015 08:43:31 -0800 (PST) Message-ID: <54E36FB2.1050000@lwfinger.net> Date: Tue, 17 Feb 2015 10:43:30 -0600 From: Larry Finger User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Alan Fisher , linux-wireless@vger.kernel.org, linville@tuxdriver.com Subject: Re: PROBLEM: rtlwifi drops most IPv6 packets References: <54E19DD6.9050704@unixcube.org> <54E23664.70509@lwfinger.net> <54E2FBCD.7070707@unixcube.org> In-Reply-To: <54E2FBCD.7070707@unixcube.org> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,T_TVD_MIME_EPI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 02/17/2015 02:29 AM, Alan Fisher wrote: > Larry, > >> I am guessing that you have an RTL8188CE, which uses rtl8192ce. > > Yep, my wireless card is an RTL8188CE > >> The purpose of rtl_is_special_data() is to ensure that management packets have >> the highest probability of being successfully transmitted by sending them at a >> low rate. > ... >> It also occurs to me that mac80211 probably handles this function, and that it >> may be possible to remove this routine, which is essentially what your >> workaround does. > I couldn't find any information on mac80211 treating certain packets (ARP, DHCP, > etc...) as special. It does seem to handle automatic rate selection, though. I > would think that would be enough to handle packet loss reasonably well. I > believe the protocols tested for here all have mechanisms for handling lost > packets. I also can't find any other 802.11 drivers which try to handle DHCP > packets in a special way. I think it would be safe to remove this routine. I > have a patch to do that, if you're okay with that change. The story is a bit more complicated. These drivers use firmware rate selection, not the ones in mac80211. At this point, I would not be comfortable with removing the entire routine. > > Regarding the patch, this change: > > - } else if (0x86DD == ether_type) { > - return true; > } > > successfully prevents IPv6 packets from being treated as special (and thus > dropped). > > However, this: > + if (ETH_P_IP == ether_type || ETH_P_IPV6 == ether_type) { > ip = (struct iphdr *)((u8 *)skb->data + offset + > > seems to be reading an IPv4 header (struct iphdr) from an IPv6 packet. I believe > a struct ipv6hdr should be used here. You are correct. My patch was prepared too hastily. > If we are to continue handling certain types of packets differently, IPv6 > neighbor solicitation messages (like ARP in IPv4) and IPv6 router discovery > messages (stateless IPv6 autoconfig, similar to DHCP in IPv4 networks) should > probably be added to the list to maintain consistency with what is being handled > for IPv4. These are both variants of ICMPv6 packets, although generally > transmitting all ICMPv6 packets at the lowest rate is probably a bad idea, as > ICMP echo is commonly used to measure network performance and should be treated > the same as normal traffic. For the moment, I think we need to return false, not true, for all IPv6 packets until a more complete solution is found. Does the attached patch fix the problem you are seeing? I do not have an IPv6 compliant ISP, thus I cannot do much testing. Larry Index: wireless-drivers-next/drivers/net/wireless/rtlwifi/base.c =================================================================== --- wireless-drivers-next.orig/drivers/net/wireless/rtlwifi/base.c +++ wireless-drivers-next/drivers/net/wireless/rtlwifi/base.c @@ -1386,8 +1386,11 @@ u8 rtl_is_special_data(struct ieee80211_ } return true; - } else if (0x86DD == ether_type) { - return true; + } else if (ETH_P_IPV6 == ether_type) { + /* TODO: Handle any IPv6 cases that need special handling. + * For now, always return false + */ + goto end; } end: