From patchwork Mon Sep 28 18:10:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Duyck X-Patchwork-Id: 523528 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.180.67]) by ozlabs.org (Postfix) with ESMTP id 8C7EA1401AD for ; Tue, 29 Sep 2015 04:10:38 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=mirantis.com header.i=@mirantis.com header.b=XkLko7nS; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756609AbbI1SKe (ORCPT ); Mon, 28 Sep 2015 14:10:34 -0400 Received: from mail-pa0-f44.google.com ([209.85.220.44]:34359 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756421AbbI1SKd (ORCPT ); Mon, 28 Sep 2015 14:10:33 -0400 Received: by padhy16 with SMTP id hy16so180774275pad.1 for ; Mon, 28 Sep 2015 11:10:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mirantis.com; s=google; h=subject:from:to:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; bh=C37nrEkVa5KUKuKaL+qlwsGbu6L8cDy32SfyA9Kfkhw=; b=XkLko7nSfGmo3tkJY7lGucn2kRaCTKmVlRsB+Z+5A/nJFzlNaRHQUQEy5CNe9kY73D 6j97nWJH6DxabU0D1aNdSMAIuXOkBXuukP+QitP+ylabX19PKTJ2RiiC0cfMuxbyEtf/ rbnsQlzYfZzZoZPmJ178O3rEax/CZiFahZmYA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:from:to:cc:date:message-id:in-reply-to :references:user-agent:mime-version:content-type :content-transfer-encoding; bh=C37nrEkVa5KUKuKaL+qlwsGbu6L8cDy32SfyA9Kfkhw=; b=AuEv3ibfnWxI4R5ACqTIEsOaR1vs35PKRWfsHM0ygxJCmMXSvVKSFyAm0PjXJhpJQg 6L0nbwvATrVVPwNygTkWEtP2DKtYoJbXuI3AXHEK4nnLEWlxj+w10C8D/WU+nb1c5f0Y IzJ7FARgBfqy+0HIXCdfwzy+vngO10mQqUZANblNscxwk5ua3x2j+B7Y9LGbakZDcpYU 2dIpQY1jScNrb+bmoUX4Ge9jxVl9sL16XhHmJ1x4DH1I3wYXP/JxfI0aPylO0U/HpiQC 0r6RJdDRHN7oL9lGHvqbGy0lDbPHpm9SrANV/7kCPt7gV4x0z5+RZklVIPPOnDrKaqYm gSCg== X-Gm-Message-State: ALoCoQmki4u+/BtX69U43V0WSu/p7k/uDQciDBiYyQ2LbwedyPVSPlXqGE0FH2G53Cj7LiRChacG X-Received: by 10.68.234.200 with SMTP id ug8mr28344556pbc.13.1443463832919; Mon, 28 Sep 2015 11:10:32 -0700 (PDT) Received: from [192.168.122.149] (static-50-53-21-5.bvtn.or.frontiernet.net. [50.53.21.5]) by smtp.gmail.com with ESMTPSA id rk2sm20641496pbc.75.2015.09.28.11.10.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Sep 2015 11:10:32 -0700 (PDT) Subject: [net-next PATCH 1/3] net/ipv4: Pass proto as u8 instead of u16 in ip_check_mc_rcu From: Alexander Duyck To: netdev@vger.kernel.org Cc: davem@davemloft.net Date: Mon, 28 Sep 2015 11:10:31 -0700 Message-ID: <20150928181031.20320.2151.stgit@ahduyck-vm-fedora22> In-Reply-To: <20150928175512.20320.97537.stgit@ahduyck-vm-fedora22> References: <20150928175512.20320.97537.stgit@ahduyck-vm-fedora22> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This patch updates ip_check_mc_rcu so that protocol is passed as a u8 instead of a u16. The motivation is just to avoid any unneeded type transitions since some systems will require an instruction to zero extend a u8 field to a u16. Also it makes it a bit more readable as to the fact that protocol is a u8 so there are no byte ordering changes needed to pass it. Signed-off-by: Alexander Duyck --- include/linux/igmp.h | 2 +- net/ipv4/igmp.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -- 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 --git a/include/linux/igmp.h b/include/linux/igmp.h index 908429216d9f..9c9de11549a7 100644 --- a/include/linux/igmp.h +++ b/include/linux/igmp.h @@ -110,7 +110,7 @@ struct ip_mc_list { #define IGMPV3_QQIC(value) IGMPV3_EXP(0x80, 4, 3, value) #define IGMPV3_MRC(value) IGMPV3_EXP(0x80, 4, 3, value) -extern int ip_check_mc_rcu(struct in_device *dev, __be32 mc_addr, __be32 src_addr, u16 proto); +extern int ip_check_mc_rcu(struct in_device *dev, __be32 mc_addr, __be32 src_addr, u8 proto); extern int igmp_rcv(struct sk_buff *); extern int ip_mc_join_group(struct sock *sk, struct ip_mreqn *imr); extern int ip_mc_leave_group(struct sock *sk, struct ip_mreqn *imr); diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c index d38b8b61eaee..de6d4c8ba600 100644 --- a/net/ipv4/igmp.c +++ b/net/ipv4/igmp.c @@ -2569,7 +2569,7 @@ void ip_mc_drop_socket(struct sock *sk) } /* called with rcu_read_lock() */ -int ip_check_mc_rcu(struct in_device *in_dev, __be32 mc_addr, __be32 src_addr, u16 proto) +int ip_check_mc_rcu(struct in_device *in_dev, __be32 mc_addr, __be32 src_addr, u8 proto) { struct ip_mc_list *im; struct ip_mc_list __rcu **mc_hash;