netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, gospo@redhat.com,
	Alexander Duyck <alexander.h.duyck@intel.com>,
	Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next-2.6 PATCH 17/20] igb: make tx ring map and free functionality non-static
Date: Tue, 27 Oct 2009 18:54:43 -0700	[thread overview]
Message-ID: <20091028015442.12470.96576.stgit@localhost.localdomain> (raw)
In-Reply-To: <20091028014858.12470.99520.stgit@localhost.localdomain>

From: Alexander Duyck <alexander.h.duyck@intel.com>

This change makes a minor change to the xmit_frame_ring_adv funcition in that
it moves 2 checks from it into the xmit_frame_adv since the checks were not
ring specific.  In addition it exports the xmit_frame_ring_adv and the
unmap_and_free_tx_resource calls so that they can be used by other code such
as the ethtool loopback testing calls.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---

 drivers/net/igb/igb.h      |    3 +++
 drivers/net/igb/igb_main.c |   35 ++++++++++++++++-------------------
 2 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h
index 8b189a0..6c35c90 100644
--- a/drivers/net/igb/igb.h
+++ b/drivers/net/igb/igb.h
@@ -349,6 +349,9 @@ extern void igb_configure_tx_ring(struct igb_adapter *, struct igb_ring *);
 extern void igb_configure_rx_ring(struct igb_adapter *, struct igb_ring *);
 extern void igb_setup_tctl(struct igb_adapter *);
 extern void igb_setup_rctl(struct igb_adapter *);
+extern netdev_tx_t igb_xmit_frame_ring_adv(struct sk_buff *, struct igb_ring *);
+extern void igb_unmap_and_free_tx_resource(struct igb_ring *,
+					   struct igb_buffer *);
 extern void igb_alloc_rx_buffers_adv(struct igb_ring *, int);
 extern void igb_update_stats(struct igb_adapter *);
 extern void igb_set_ethtool_ops(struct net_device *);
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index 576a4fa..c9fda11 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -99,10 +99,7 @@ static void igb_set_rx_mode(struct net_device *);
 static void igb_update_phy_info(unsigned long);
 static void igb_watchdog(unsigned long);
 static void igb_watchdog_task(struct work_struct *);
-static netdev_tx_t igb_xmit_frame_ring_adv(struct sk_buff *,
-					   struct igb_ring *);
-static netdev_tx_t igb_xmit_frame_adv(struct sk_buff *skb,
-				      struct net_device *);
+static netdev_tx_t igb_xmit_frame_adv(struct sk_buff *skb, struct net_device *);
 static struct net_device_stats *igb_get_stats(struct net_device *);
 static int igb_change_mtu(struct net_device *, int);
 static int igb_set_mac(struct net_device *, void *);
@@ -2521,8 +2518,8 @@ static void igb_free_all_tx_resources(struct igb_adapter *adapter)
 		igb_free_tx_resources(&adapter->tx_ring[i]);
 }
 
-static void igb_unmap_and_free_tx_resource(struct igb_ring *tx_ring,
-					   struct igb_buffer *buffer_info)
+void igb_unmap_and_free_tx_resource(struct igb_ring *tx_ring,
+				    struct igb_buffer *buffer_info)
 {
 	buffer_info->dma = 0;
 	if (buffer_info->skb) {
@@ -3585,8 +3582,8 @@ static int igb_maybe_stop_tx(struct igb_ring *tx_ring, int size)
 	return __igb_maybe_stop_tx(tx_ring, size);
 }
 
-static netdev_tx_t igb_xmit_frame_ring_adv(struct sk_buff *skb,
-					   struct igb_ring *tx_ring)
+netdev_tx_t igb_xmit_frame_ring_adv(struct sk_buff *skb,
+				    struct igb_ring *tx_ring)
 {
 	struct igb_adapter *adapter = netdev_priv(tx_ring->netdev);
 	unsigned int first;
@@ -3596,16 +3593,6 @@ static netdev_tx_t igb_xmit_frame_ring_adv(struct sk_buff *skb,
 	int tso = 0;
 	union skb_shared_tx *shtx;
 
-	if (test_bit(__IGB_DOWN, &adapter->state)) {
-		dev_kfree_skb_any(skb);
-		return NETDEV_TX_OK;
-	}
-
-	if (skb->len <= 0) {
-		dev_kfree_skb_any(skb);
-		return NETDEV_TX_OK;
-	}
-
 	/* need: 1 descriptor per page,
 	 *       + 2 desc gap to keep tail from touching head,
 	 *       + 1 desc for skb->data,
@@ -3680,8 +3667,18 @@ static netdev_tx_t igb_xmit_frame_adv(struct sk_buff *skb,
 {
 	struct igb_adapter *adapter = netdev_priv(netdev);
 	struct igb_ring *tx_ring;
-
 	int r_idx = 0;
+
+	if (test_bit(__IGB_DOWN, &adapter->state)) {
+		dev_kfree_skb_any(skb);
+		return NETDEV_TX_OK;
+	}
+
+	if (skb->len <= 0) {
+		dev_kfree_skb_any(skb);
+		return NETDEV_TX_OK;
+	}
+
 	r_idx = skb->queue_mapping & (IGB_ABS_MAX_TX_QUEUES - 1);
 	tx_ring = adapter->multi_tx_table[r_idx];
 


  parent reply	other threads:[~2009-10-28  1:58 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-28  1:49 [net-next-2.6 PATCH 01/20] igb: add new data structure for handling interrupts and NAPI Jeff Kirsher
2009-10-28  1:49 ` [net-next-2.6 PATCH 02/20] igb: remove rx checksum good counter Jeff Kirsher
2009-10-28  1:50 ` [net-next-2.6 PATCH 03/20] igb: increase minimum rx buffer size to 1K Jeff Kirsher
2009-10-28  1:50 ` [net-next-2.6 PATCH 04/20] igb: move the tx and rx ring specific config into seperate functions Jeff Kirsher
2009-10-28  1:50 ` [net-next-2.6 PATCH 05/20] igb: remove rx_ps_hdr_len Jeff Kirsher
2009-10-28  1:51 ` [net-next-2.6 PATCH 06/20] igb: move SRRCTL register configuration into ring specific config Jeff Kirsher
2009-10-28  1:51 ` [net-next-2.6 PATCH 07/20] igb: change the head and tail offsets into pointers Jeff Kirsher
2009-10-28  1:51 ` [net-next-2.6 PATCH 08/20] igb: add pci device pointer to ring structure Jeff Kirsher
2009-10-28  1:52 ` [net-next-2.6 PATCH 09/20] igb: move rx_buffer_len into the " Jeff Kirsher
2009-10-28  1:52 ` [net-next-2.6 PATCH 10/20] igb: move alloc_failed and csum_err stats into per rx-ring stat Jeff Kirsher
2009-10-28  1:52 ` [net-next-2.6 PATCH 11/20] igb: add a flags value to the ring Jeff Kirsher
2009-10-28  1:53 ` [net-next-2.6 PATCH 12/20] igb: place a pointer to the netdev struct in the ring itself Jeff Kirsher
2009-10-28  1:53 ` [net-next-2.6 PATCH 13/20] igb: move the multiple receive queue configuration into seperate function Jeff Kirsher
2009-10-28  1:53 ` [net-next-2.6 PATCH 14/20] igb: delay VF reset notification until after interrupts are enabed Jeff Kirsher
2009-10-28  1:54 ` [net-next-2.6 PATCH 15/20] igb: setup vlan tag replication stripping in igb_vmm_control Jeff Kirsher
2009-10-28  1:54 ` [net-next-2.6 PATCH 16/20] igb: re-use ring configuration code in ethtool testing Jeff Kirsher
2009-10-28  1:54 ` Jeff Kirsher [this message]
2009-10-28  1:55 ` [net-next-2.6 PATCH 18/20] igb: make ethtool use core xmit map and free functionality Jeff Kirsher
2009-10-28  1:55 ` [net-next-2.6 PATCH 19/20] igb: add single vector msi-x testing to interrupt test Jeff Kirsher
2009-10-28  1:55 ` [net-next-2.6 PATCH 20/20] igb: cleanup "todo" code found in igb_ethtool.c Jeff Kirsher
2009-10-28  8:28 ` [net-next-2.6 PATCH 01/20] igb: add new data structure for handling interrupts and NAPI 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=20091028015442.12470.96576.stgit@localhost.localdomain \
    --to=jeffrey.t.kirsher@intel.com \
    --cc=alexander.h.duyck@intel.com \
    --cc=davem@davemloft.net \
    --cc=gospo@redhat.com \
    --cc=netdev@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).