All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heiner Kallweit <hkallweit1@gmail.com>
To: David Miller <davem@davemloft.net>,
	Realtek linux nic maintainers <nic_swsd@realtek.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: [PATCH net-next 10/10] r8169: replace get_protocol with vlan_get_protocol
Date: Wed, 2 May 2018 21:40:02 +0200	[thread overview]
Message-ID: <b9e8d2a7-1e73-7899-c759-ee08b2192c7f@gmail.com> (raw)
In-Reply-To: <2c7cae9e-d989-8529-7209-5a271242ce39@gmail.com>

This patch is basically the same as 6e74d1749a33 ("r8152: replace
get_protocol with vlan_get_protocol"). Use vlan_get_protocol
instead of duplicating the functionality.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/net/ethernet/realtek/r8169.c | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)

diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 6fce3cc8..6d99b141 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -6510,18 +6510,6 @@ static int msdn_giant_send_check(struct sk_buff *skb)
 	return ret;
 }
 
-static inline __be16 get_protocol(struct sk_buff *skb)
-{
-	__be16 protocol;
-
-	if (skb->protocol == htons(ETH_P_8021Q))
-		protocol = vlan_eth_hdr(skb)->h_vlan_encapsulated_proto;
-	else
-		protocol = skb->protocol;
-
-	return protocol;
-}
-
 static bool rtl8169_tso_csum_v1(struct rtl8169_private *tp,
 				struct sk_buff *skb, u32 *opts)
 {
@@ -6558,7 +6546,7 @@ static bool rtl8169_tso_csum_v2(struct rtl8169_private *tp,
 			return false;
 		}
 
-		switch (get_protocol(skb)) {
+		switch (vlan_get_protocol(skb)) {
 		case htons(ETH_P_IP):
 			opts[0] |= TD1_GTSENV4;
 			break;
@@ -6590,7 +6578,7 @@ static bool rtl8169_tso_csum_v2(struct rtl8169_private *tp,
 			return false;
 		}
 
-		switch (get_protocol(skb)) {
+		switch (vlan_get_protocol(skb)) {
 		case htons(ETH_P_IP):
 			opts[1] |= TD1_IPv4_CS;
 			ip_protocol = ip_hdr(skb)->protocol;
-- 
2.17.0

  parent reply	other threads:[~2018-05-02 19:40 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-02 19:28 [PATCH net-next 00/10] r8169: series with further improvements Heiner Kallweit
2018-05-02 19:39 ` [PATCH net-next 01/10] r8169: remove unneeded check in r8168_pll_power_down Heiner Kallweit
2018-05-02 19:39 ` [PATCH net-next 02/10] r8169: remove 810x_phy_power_up/down Heiner Kallweit
2018-05-02 19:39 ` [PATCH net-next 03/10] r8169: merge r810x_pll_power_down/up into r8168_pll_power_down/up Heiner Kallweit
2018-05-02 19:39 ` [PATCH net-next 04/10] r8169: drop member pll_power_ops from struct rtl8169_private Heiner Kallweit
2018-05-02 19:39 ` [PATCH net-next 05/10] r8169: simplify code by using ranges in switch clauses Heiner Kallweit
2018-05-02 19:39 ` [PATCH net-next 06/10] r8169: replace longer if statements with switch statements Heiner Kallweit
2018-05-02 19:39 ` [PATCH net-next 07/10] r8169: drop rtl_generic_op Heiner Kallweit
2018-05-02 19:39 ` [PATCH net-next 08/10] r8169: improve PCI config space access Heiner Kallweit
2018-05-02 19:39 ` [PATCH net-next 09/10] r8169: avoid potentially misaligned access when getting mac address Heiner Kallweit
2018-05-02 19:40 ` Heiner Kallweit [this message]
2018-05-02 20:24 ` [PATCH net-next 00/10] r8169: series with further improvements David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b9e8d2a7-1e73-7899-c759-ee08b2192c7f@gmail.com \
    --to=hkallweit1@gmail.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=nic_swsd@realtek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.