* Re: [PATCH] net: fix neigh_resolve_output can cause skb_under_panic
From: gregkh @ 2012-09-29 0:57 UTC (permalink / raw)
To: Ramesh Nagappa
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
davem@davemloft.net, michel@digirati.com.br,
eric.dumazet@gmail.com
In-Reply-To: <CA3E5132752D1F49871ED0FC40D56BBA43ECE2E743@EUSAACMS0701.eamcs.ericsson.se>
On Fri, Sep 28, 2012 at 08:26:51PM -0400, Ramesh Nagappa wrote:
> >
> > Why is all of this in the middle of the changelog section?
> >
> > I'm guessing you didn't use 'git send-email' for this?
> >
> > And why are you copying me on the patch?
>
> I got the CC list from scripts/get_maintainers.pl
>
> asglx-2-300 $ scripts/get_maintainer.pl 0001-net-fix-neigh_resolve_output-can-cause-skb_under_pan.patch
> "David S. Miller" <davem@davemloft.net> (maintainer:NETWORKING [GENERAL],commit_signer:3/4=75%)
> Greg Kroah-Hartman <gregkh@linuxfoundation.org> (commit_signer:3/4=75%)
> Eric Dumazet <eric.dumazet@gmail.com> (commit_signer:2/4=50%)
> Shawn Lu <shawn.lu@ericsson.com> (commit_signer:1/4=25%)
> Michel Machado <michel@digirati.com.br> (commit_signer:1/4=25%)
> netdev@vger.kernel.org (open list:NETWORKING [GENERAL])
> linux-kernel@vger.kernel.org (open list)
I can't reproduce this:
$ ./scripts/get_maintainer.pl --file net/core/neighbour.c
"David S. Miller" <davem@davemloft.net> (maintainer:NETWORKING [GENERAL],commit_signer:22/22=100%)
Eric Dumazet <edumazet@google.com> (commit_signer:4/22=18%)
"Eric W. Biederman" <ebiederm@xmission.com> (commit_signer:2/22=9%)
Pavel Emelyanov <xemul@parallels.com> (commit_signer:2/22=9%)
netdev@vger.kernel.org (open list:NETWORKING [GENERAL])
linux-kernel@vger.kernel.org (open list)
What tree are you doing that against?
> > You need a blank line before the first Signed-off-by: line.
> > Surely one of the reviewers should have caught this basic thing?
>
> Outlook mangled the patch. I am unable to use git send-email because of
> a corporate firewall on the build machine.
Then your patch would also be corrupted, Outlook, and Exchange, can not
handle patches at all. Please read Documentation/email_clients.txt for
more details.
Also, ask your coworkers who properly submit patches what they do to
work around your broken email infrastructure.
good luck,
greg k-h
^ permalink raw reply
* [wireless-next:for-davem 123/299] net/ipv4/ip_gre.c:222:29: sparse: restricted __be16 degrades to integer
From: Fengguang Wu @ 2012-09-29 1:12 UTC (permalink / raw)
To: stephen hemminger; +Cc: kernel-janitors, netdev
Hi stephen,
FYI, there are new sparse warnings show up in
tree: git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next.git for-davem
head: c487606f835a93a725bac1aefd536be98f22474d
commit: d208328765a0ab425e36b5b828285f3337a85451 [123/299] gre: fix handling of key 0
+ net/ipv4/ip_gre.c:222:29: sparse: restricted __be16 degrades to integer
net/ipv4/ip_gre.c:227:34: sparse: restricted __be16 degrades to integer
+ net/ipv4/ip_gre.c:562:33: sparse: incorrect type in argument 4 (different base types)
net/ipv4/ip_gre.c:562:33: expected unsigned int [unsigned] [usertype] flags
net/ipv4/ip_gre.c:562:33: got restricted __be16 [assigned] [usertype] flags
net/ipv4/ip_gre.c:669:62: sparse: incorrect type in argument 4 (different base types)
net/ipv4/ip_gre.c:669:62: expected unsigned int [unsigned] [usertype] flags
net/ipv4/ip_gre.c:669:62: got restricted __be16 [assigned] [usertype] flags
vim +222 net/ipv4/ip_gre.c
d2083287 (stephen hemminger 2012-09-24 217) /* Does key in tunnel parameters match packet */
d2083287 (stephen hemminger 2012-09-24 218) static bool ipgre_key_match(const struct ip_tunnel_parm *p,
d2083287 (stephen hemminger 2012-09-24 219) __u32 flags, __be32 key)
d2083287 (stephen hemminger 2012-09-24 220) {
d2083287 (stephen hemminger 2012-09-24 221) if (p->i_flags & GRE_KEY) {
d2083287 (stephen hemminger 2012-09-24 @222) if (flags & GRE_KEY)
d2083287 (stephen hemminger 2012-09-24 223) return key == p->i_key;
d2083287 (stephen hemminger 2012-09-24 224) else
d2083287 (stephen hemminger 2012-09-24 225) return false; /* key expected, none present */
d2083287 (stephen hemminger 2012-09-24 226) } else
d2083287 (stephen hemminger 2012-09-24 227) return !(flags & GRE_KEY);
d2083287 (stephen hemminger 2012-09-24 228) }
d2083287 (stephen hemminger 2012-09-24 229)
^1da177e (Linus Torvalds 2005-04-16 230) /* Given src, dst and key, find appropriate for input tunnel. */
---
0-DAY kernel build testing backend Open Source Technology Centre
Fengguang Wu, Yuanhan Liu Intel Corporation
^ permalink raw reply
* [PATCH 5/7 net-next v2] tg3: Refactor tg3_close()
From: Michael Chan @ 2012-09-28 17:12 UTC (permalink / raw)
To: davem; +Cc: netdev, Michael Chan
In-Reply-To: <1348852363-8582-4-git-send-email-mchan@broadcom.com>
by introducing tg3_stop() that does the opposite of tg3_start(). This
function will be useful when adding the support for changing the numbe
of rx and tx rings.
Reviewed-by: Nithin Nayak Sujir <nsujir@broadcom.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/ethernet/broadcom/tg3.c | 70 +++++++++++++++++++----------------
1 files changed, 38 insertions(+), 32 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 9bd99ce..3f2197e 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -10448,6 +10448,43 @@ err_out1:
return err;
}
+static void tg3_stop(struct tg3 *tp)
+{
+ int i;
+
+ tg3_napi_disable(tp);
+ tg3_reset_task_cancel(tp);
+
+ netif_tx_disable(tp->dev);
+
+ tg3_timer_stop(tp);
+
+ tg3_hwmon_close(tp);
+
+ tg3_phy_stop(tp);
+
+ tg3_full_lock(tp, 1);
+
+ tg3_disable_ints(tp);
+
+ tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
+ tg3_free_rings(tp);
+ tg3_flag_clear(tp, INIT_COMPLETE);
+
+ tg3_full_unlock(tp);
+
+ for (i = tp->irq_cnt - 1; i >= 0; i--) {
+ struct tg3_napi *tnapi = &tp->napi[i];
+ free_irq(tnapi->irq_vec, tnapi);
+ }
+
+ tg3_ints_fini(tp);
+
+ tg3_napi_fini(tp);
+
+ tg3_free_consistent(tp);
+}
+
static int tg3_open(struct net_device *dev)
{
struct tg3 *tp = netdev_priv(dev);
@@ -10490,45 +10527,14 @@ static int tg3_open(struct net_device *dev)
static int tg3_close(struct net_device *dev)
{
- int i;
struct tg3 *tp = netdev_priv(dev);
- tg3_napi_disable(tp);
- tg3_reset_task_cancel(tp);
-
- netif_tx_stop_all_queues(dev);
-
- tg3_timer_stop(tp);
-
- tg3_hwmon_close(tp);
-
- tg3_phy_stop(tp);
-
- tg3_full_lock(tp, 1);
-
- tg3_disable_ints(tp);
-
- tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
- tg3_free_rings(tp);
- tg3_flag_clear(tp, INIT_COMPLETE);
-
- tg3_full_unlock(tp);
-
- for (i = tp->irq_cnt - 1; i >= 0; i--) {
- struct tg3_napi *tnapi = &tp->napi[i];
- free_irq(tnapi->irq_vec, tnapi);
- }
-
- tg3_ints_fini(tp);
+ tg3_stop(tp);
/* Clear stats across close / open calls */
memset(&tp->net_stats_prev, 0, sizeof(tp->net_stats_prev));
memset(&tp->estats_prev, 0, sizeof(tp->estats_prev));
- tg3_napi_fini(tp);
-
- tg3_free_consistent(tp);
-
tg3_power_down(tp);
netif_carrier_off(tp->dev);
--
1.7.1
^ permalink raw reply related
* [PATCH 6/7 net-next v2] tg3: Add support for ethtool -L|-l to get/set the number of rings.
From: Michael Chan @ 2012-09-28 17:12 UTC (permalink / raw)
To: davem; +Cc: netdev, Michael Chan
In-Reply-To: <1348852363-8582-5-git-send-email-mchan@broadcom.com>
Default remains the same.
Reviewed-by: Nithin Nayak Sujir <nsujir@broadcom.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/ethernet/broadcom/tg3.c | 64 +++++++++++++++++++++++++++++++++--
drivers/net/ethernet/broadcom/tg3.h | 2 +
2 files changed, 63 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 3f2197e..74eea2f 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -10239,11 +10239,15 @@ static bool tg3_enable_msix(struct tg3 *tp)
int i, rc;
struct msix_entry msix_ent[tp->irq_max];
- tp->rxq_cnt = netif_get_num_default_rss_queues();
+ tp->txq_cnt = tp->txq_req;
+ tp->rxq_cnt = tp->rxq_req;
+ if (!tp->rxq_cnt)
+ tp->rxq_cnt = netif_get_num_default_rss_queues();
if (tp->rxq_cnt > tp->rxq_max)
tp->rxq_cnt = tp->rxq_max;
- if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5720)
+ if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5720) &&
+ !tp->txq_req)
tp->txq_cnt = min(tp->rxq_cnt, tp->txq_max);
tp->irq_cnt = tg3_irq_count(tp);
@@ -11384,6 +11388,58 @@ static int tg3_set_rxfh_indir(struct net_device *dev, const u32 *indir)
return 0;
}
+static void tg3_get_channels(struct net_device *dev,
+ struct ethtool_channels *channel)
+{
+ struct tg3 *tp = netdev_priv(dev);
+ u32 deflt_qs = netif_get_num_default_rss_queues();
+
+ channel->max_rx = tp->rxq_max;
+ channel->max_tx = tp->txq_max;
+
+ if (netif_running(dev)) {
+ channel->rx_count = tp->rxq_cnt;
+ channel->tx_count = tp->txq_cnt;
+ } else {
+ if (tp->rxq_req)
+ channel->rx_count = tp->rxq_req;
+ else
+ channel->rx_count = min(deflt_qs, tp->rxq_max);
+
+ if (tp->txq_req)
+ channel->tx_count = tp->txq_req;
+ else
+ channel->tx_count = min(deflt_qs, tp->txq_max);
+ }
+}
+
+static int tg3_set_channels(struct net_device *dev,
+ struct ethtool_channels *channel)
+{
+ struct tg3 *tp = netdev_priv(dev);
+
+ if (!tg3_flag(tp, SUPPORT_MSIX))
+ return -EOPNOTSUPP;
+
+ if (channel->rx_count > tp->rxq_max ||
+ channel->tx_count > tp->txq_max)
+ return -EINVAL;
+
+ tp->rxq_req = channel->rx_count;
+ tp->txq_req = channel->tx_count;
+
+ if (!netif_running(dev))
+ return 0;
+
+ tg3_stop(tp);
+
+ netif_carrier_off(dev);
+
+ tg3_start(tp, true, false);
+
+ return 0;
+}
+
static void tg3_get_strings(struct net_device *dev, u32 stringset, u8 *buf)
{
switch (stringset) {
@@ -12632,6 +12688,8 @@ static const struct ethtool_ops tg3_ethtool_ops = {
.get_rxfh_indir_size = tg3_get_rxfh_indir_size,
.get_rxfh_indir = tg3_get_rxfh_indir,
.set_rxfh_indir = tg3_set_rxfh_indir,
+ .get_channels = tg3_get_channels,
+ .set_channels = tg3_set_channels,
.get_ts_info = ethtool_op_get_ts_info,
};
diff --git a/drivers/net/ethernet/broadcom/tg3.h b/drivers/net/ethernet/broadcom/tg3.h
index 2abe94c..d9308c3 100644
--- a/drivers/net/ethernet/broadcom/tg3.h
+++ b/drivers/net/ethernet/broadcom/tg3.h
@@ -3038,6 +3038,7 @@ struct tg3 {
void (*write32_tx_mbox) (struct tg3 *, u32,
u32);
u32 dma_limit;
+ u32 txq_req;
u32 txq_cnt;
u32 txq_max;
@@ -3054,6 +3055,7 @@ struct tg3 {
u32 rx_std_max_post;
u32 rx_offset;
u32 rx_pkt_map_sz;
+ u32 rxq_req;
u32 rxq_cnt;
u32 rxq_max;
bool rx_refill;
--
1.7.1
^ permalink raw reply related
* [PATCH 4/7 net-next v2] tg3: Refactor tg3_open()
From: Michael Chan @ 2012-09-28 17:12 UTC (permalink / raw)
To: davem; +Cc: netdev, Michael Chan
In-Reply-To: <1348852363-8582-3-git-send-email-mchan@broadcom.com>
by introducing tg3_start() that handles all initialization steps from
IRQ allocation. This function will be needed when adding support for
changing the number of rx and tx rings.
Reviewed-by: Nithin Nayak Sujir <nsujir@broadcom.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/ethernet/broadcom/tg3.c | 78 ++++++++++++++++++++---------------
1 files changed, 45 insertions(+), 33 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index ddf260c..9bd99ce 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -10339,38 +10339,11 @@ static void tg3_ints_fini(struct tg3 *tp)
tg3_flag_clear(tp, ENABLE_TSS);
}
-static int tg3_open(struct net_device *dev)
+static int tg3_start(struct tg3 *tp, bool reset_phy, bool test_irq)
{
- struct tg3 *tp = netdev_priv(dev);
+ struct net_device *dev = tp->dev;
int i, err;
- if (tp->fw_needed) {
- err = tg3_request_firmware(tp);
- if (tp->pci_chip_rev_id == CHIPREV_ID_5701_A0) {
- if (err)
- return err;
- } else if (err) {
- netdev_warn(tp->dev, "TSO capability disabled\n");
- tg3_flag_clear(tp, TSO_CAPABLE);
- } else if (!tg3_flag(tp, TSO_CAPABLE)) {
- netdev_notice(tp->dev, "TSO capability restored\n");
- tg3_flag_set(tp, TSO_CAPABLE);
- }
- }
-
- netif_carrier_off(tp->dev);
-
- err = tg3_power_up(tp);
- if (err)
- return err;
-
- tg3_full_lock(tp, 0);
-
- tg3_disable_ints(tp);
- tg3_flag_clear(tp, INIT_COMPLETE);
-
- tg3_full_unlock(tp);
-
/*
* Setup interrupts first so we know how
* many NAPI resources to allocate
@@ -10404,7 +10377,7 @@ static int tg3_open(struct net_device *dev)
tg3_full_lock(tp, 0);
- err = tg3_init_hw(tp, 1);
+ err = tg3_init_hw(tp, reset_phy);
if (err) {
tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
tg3_free_rings(tp);
@@ -10415,7 +10388,7 @@ static int tg3_open(struct net_device *dev)
if (err)
goto err_out3;
- if (tg3_flag(tp, USING_MSI)) {
+ if (test_irq && tg3_flag(tp, USING_MSI)) {
err = tg3_test_msi(tp);
if (err) {
@@ -10471,8 +10444,47 @@ err_out2:
err_out1:
tg3_ints_fini(tp);
- tg3_frob_aux_power(tp, false);
- pci_set_power_state(tp->pdev, PCI_D3hot);
+
+ return err;
+}
+
+static int tg3_open(struct net_device *dev)
+{
+ struct tg3 *tp = netdev_priv(dev);
+ int err;
+
+ if (tp->fw_needed) {
+ err = tg3_request_firmware(tp);
+ if (tp->pci_chip_rev_id == CHIPREV_ID_5701_A0) {
+ if (err)
+ return err;
+ } else if (err) {
+ netdev_warn(tp->dev, "TSO capability disabled\n");
+ tg3_flag_clear(tp, TSO_CAPABLE);
+ } else if (!tg3_flag(tp, TSO_CAPABLE)) {
+ netdev_notice(tp->dev, "TSO capability restored\n");
+ tg3_flag_set(tp, TSO_CAPABLE);
+ }
+ }
+
+ netif_carrier_off(tp->dev);
+
+ err = tg3_power_up(tp);
+ if (err)
+ return err;
+
+ tg3_full_lock(tp, 0);
+
+ tg3_disable_ints(tp);
+ tg3_flag_clear(tp, INIT_COMPLETE);
+
+ tg3_full_unlock(tp);
+
+ err = tg3_start(tp, true, true);
+ if (err) {
+ tg3_frob_aux_power(tp, false);
+ pci_set_power_state(tp->pdev, PCI_D3hot);
+ }
return err;
}
--
1.7.1
^ permalink raw reply related
* [PATCH 7/7 net-next v2] tg3: Disable multiple TX rings by default due to hardware flaw
From: Michael Chan @ 2012-09-28 17:12 UTC (permalink / raw)
To: davem; +Cc: netdev, Michael Chan
In-Reply-To: <1348852363-8582-6-git-send-email-mchan@broadcom.com>
Simple round-robin hardware TX scheduling can cause starvation of TX rings
with small packets when other TX rings have large TSO or jumbo packets.
In the simplest case, consider 2 TCP streams running in opposite
directions. The TSO TX traffic will hash to one ring and the ACKs for the
incoming data on a different TCP connection will hash to a different TX
ring. The hardware fetches one complete TSO packet (up to 64K data)
before servicing the other TX ring. When it gets to the other TX ring, it
will only fetch one packet (64-byte ACK packet in this case). After that,
it will switch back to the 1st ring filled with more TSO packets. Because
only one ACK can go out roughly every 500 usec in this case, the incoming
data rate becomes very low.
Update version to 3.125.
Signed-off-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/ethernet/broadcom/tg3.c | 15 +++++++++------
1 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 74eea2f..24f6623 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -92,10 +92,10 @@ static inline void _tg3_flag_clear(enum TG3_FLAGS flag, unsigned long *bits)
#define DRV_MODULE_NAME "tg3"
#define TG3_MAJ_NUM 3
-#define TG3_MIN_NUM 124
+#define TG3_MIN_NUM 125
#define DRV_MODULE_VERSION \
__stringify(TG3_MAJ_NUM) "." __stringify(TG3_MIN_NUM)
-#define DRV_MODULE_RELDATE "March 21, 2012"
+#define DRV_MODULE_RELDATE "September 26, 2012"
#define RESET_KIND_SHUTDOWN 0
#define RESET_KIND_INIT 1
@@ -10245,10 +10245,13 @@ static bool tg3_enable_msix(struct tg3 *tp)
tp->rxq_cnt = netif_get_num_default_rss_queues();
if (tp->rxq_cnt > tp->rxq_max)
tp->rxq_cnt = tp->rxq_max;
- if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5720) &&
- !tp->txq_req)
- tp->txq_cnt = min(tp->rxq_cnt, tp->txq_max);
+
+ /* Disable multiple TX rings by default. Simple round-robin hardware
+ * scheduling of the TX rings can cause starvation of rings with
+ * small packets when other rings have TSO or jumbo packets.
+ */
+ if (!tp->txq_req)
+ tp->txq_cnt = 1;
tp->irq_cnt = tg3_irq_count(tp);
--
1.7.1
^ permalink raw reply related
* [PATCH 1/7 net-next v2] tg3: Introduce separate functions to allocate/free RX/TX rings.
From: Michael Chan @ 2012-09-28 17:12 UTC (permalink / raw)
To: davem; +Cc: netdev, Michael Chan
This is preparation work to allow the number of RX and TX rings to be
configured separately.
Reviewed-by: Nithin Nayak Sujir <nsujir@broadcom.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/ethernet/broadcom/tg3.c | 220 +++++++++++++++++++++++------------
drivers/net/ethernet/broadcom/tg3.h | 2 +
2 files changed, 146 insertions(+), 76 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index bf906c5..93b8120 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -7607,15 +7607,11 @@ static int tg3_init_rings(struct tg3 *tp)
return 0;
}
-/*
- * Must not be invoked with interrupt sources disabled and
- * the hardware shutdown down.
- */
-static void tg3_free_consistent(struct tg3 *tp)
+static void tg3_mem_tx_release(struct tg3 *tp)
{
int i;
- for (i = 0; i < tp->irq_cnt; i++) {
+ for (i = 0; i < tp->irq_max; i++) {
struct tg3_napi *tnapi = &tp->napi[i];
if (tnapi->tx_ring) {
@@ -7626,17 +7622,114 @@ static void tg3_free_consistent(struct tg3 *tp)
kfree(tnapi->tx_buffers);
tnapi->tx_buffers = NULL;
+ }
+}
- if (tnapi->rx_rcb) {
- dma_free_coherent(&tp->pdev->dev,
- TG3_RX_RCB_RING_BYTES(tp),
- tnapi->rx_rcb,
- tnapi->rx_rcb_mapping);
- tnapi->rx_rcb = NULL;
- }
+static int tg3_mem_tx_acquire(struct tg3 *tp)
+{
+ int i;
+ struct tg3_napi *tnapi = &tp->napi[0];
+
+ /* If multivector TSS is enabled, vector 0 does not handle
+ * tx interrupts. Don't allocate any resources for it.
+ */
+ if (tg3_flag(tp, ENABLE_TSS))
+ tnapi++;
+
+ for (i = 0; i < tp->txq_cnt; i++, tnapi++) {
+ tnapi->tx_buffers = kzalloc(sizeof(struct tg3_tx_ring_info) *
+ TG3_TX_RING_SIZE, GFP_KERNEL);
+ if (!tnapi->tx_buffers)
+ goto err_out;
+
+ tnapi->tx_ring = dma_alloc_coherent(&tp->pdev->dev,
+ TG3_TX_RING_BYTES,
+ &tnapi->tx_desc_mapping,
+ GFP_KERNEL);
+ if (!tnapi->tx_ring)
+ goto err_out;
+ }
+
+ return 0;
+
+err_out:
+ tg3_mem_tx_release(tp);
+ return -ENOMEM;
+}
+
+static void tg3_mem_rx_release(struct tg3 *tp)
+{
+ int i;
+
+ for (i = 0; i < tp->irq_max; i++) {
+ struct tg3_napi *tnapi = &tp->napi[i];
tg3_rx_prodring_fini(tp, &tnapi->prodring);
+ if (!tnapi->rx_rcb)
+ continue;
+
+ dma_free_coherent(&tp->pdev->dev,
+ TG3_RX_RCB_RING_BYTES(tp),
+ tnapi->rx_rcb,
+ tnapi->rx_rcb_mapping);
+ tnapi->rx_rcb = NULL;
+ }
+}
+
+static int tg3_mem_rx_acquire(struct tg3 *tp)
+{
+ unsigned int i, limit;
+
+ limit = tp->rxq_cnt;
+
+ /* If RSS is enabled, we need a (dummy) producer ring
+ * set on vector zero. This is the true hw prodring.
+ */
+ if (tg3_flag(tp, ENABLE_RSS))
+ limit++;
+
+ for (i = 0; i < limit; i++) {
+ struct tg3_napi *tnapi = &tp->napi[i];
+
+ if (tg3_rx_prodring_init(tp, &tnapi->prodring))
+ goto err_out;
+
+ /* If multivector RSS is enabled, vector 0
+ * does not handle rx or tx interrupts.
+ * Don't allocate any resources for it.
+ */
+ if (!i && tg3_flag(tp, ENABLE_RSS))
+ continue;
+
+ tnapi->rx_rcb = dma_alloc_coherent(&tp->pdev->dev,
+ TG3_RX_RCB_RING_BYTES(tp),
+ &tnapi->rx_rcb_mapping,
+ GFP_KERNEL);
+ if (!tnapi->rx_rcb)
+ goto err_out;
+
+ memset(tnapi->rx_rcb, 0, TG3_RX_RCB_RING_BYTES(tp));
+ }
+
+ return 0;
+
+err_out:
+ tg3_mem_rx_release(tp);
+ return -ENOMEM;
+}
+
+/*
+ * Must not be invoked with interrupt sources disabled and
+ * the hardware shutdown down.
+ */
+static void tg3_free_consistent(struct tg3 *tp)
+{
+ int i;
+
+ for (i = 0; i < tp->irq_cnt; i++) {
+ struct tg3_napi *tnapi = &tp->napi[i];
+
if (tnapi->hw_status) {
dma_free_coherent(&tp->pdev->dev, TG3_HW_STATUS_SIZE,
tnapi->hw_status,
@@ -7645,6 +7738,9 @@ static void tg3_free_consistent(struct tg3 *tp)
}
}
+ tg3_mem_rx_release(tp);
+ tg3_mem_tx_release(tp);
+
if (tp->hw_stats) {
dma_free_coherent(&tp->pdev->dev, sizeof(struct tg3_hw_stats),
tp->hw_stats, tp->stats_mapping);
@@ -7683,72 +7779,38 @@ static int tg3_alloc_consistent(struct tg3 *tp)
memset(tnapi->hw_status, 0, TG3_HW_STATUS_SIZE);
sblk = tnapi->hw_status;
- if (tg3_rx_prodring_init(tp, &tnapi->prodring))
- goto err_out;
+ if (tg3_flag(tp, ENABLE_RSS)) {
+ u16 *prodptr = 0;
- /* If multivector TSS is enabled, vector 0 does not handle
- * tx interrupts. Don't allocate any resources for it.
- */
- if ((!i && !tg3_flag(tp, ENABLE_TSS)) ||
- (i && tg3_flag(tp, ENABLE_TSS))) {
- tnapi->tx_buffers = kzalloc(
- sizeof(struct tg3_tx_ring_info) *
- TG3_TX_RING_SIZE, GFP_KERNEL);
- if (!tnapi->tx_buffers)
- goto err_out;
-
- tnapi->tx_ring = dma_alloc_coherent(&tp->pdev->dev,
- TG3_TX_RING_BYTES,
- &tnapi->tx_desc_mapping,
- GFP_KERNEL);
- if (!tnapi->tx_ring)
- goto err_out;
- }
-
- /*
- * When RSS is enabled, the status block format changes
- * slightly. The "rx_jumbo_consumer", "reserved",
- * and "rx_mini_consumer" members get mapped to the
- * other three rx return ring producer indexes.
- */
- switch (i) {
- default:
- if (tg3_flag(tp, ENABLE_RSS)) {
- tnapi->rx_rcb_prod_idx = NULL;
+ /*
+ * When RSS is enabled, the status block format changes
+ * slightly. The "rx_jumbo_consumer", "reserved",
+ * and "rx_mini_consumer" members get mapped to the
+ * other three rx return ring producer indexes.
+ */
+ switch (i) {
+ case 1:
+ prodptr = &sblk->idx[0].rx_producer;
+ break;
+ case 2:
+ prodptr = &sblk->rx_jumbo_consumer;
+ break;
+ case 3:
+ prodptr = &sblk->reserved;
+ break;
+ case 4:
+ prodptr = &sblk->rx_mini_consumer;
break;
}
- /* Fall through */
- case 1:
+ tnapi->rx_rcb_prod_idx = prodptr;
+ } else {
tnapi->rx_rcb_prod_idx = &sblk->idx[0].rx_producer;
- break;
- case 2:
- tnapi->rx_rcb_prod_idx = &sblk->rx_jumbo_consumer;
- break;
- case 3:
- tnapi->rx_rcb_prod_idx = &sblk->reserved;
- break;
- case 4:
- tnapi->rx_rcb_prod_idx = &sblk->rx_mini_consumer;
- break;
}
-
- /*
- * If multivector RSS is enabled, vector 0 does not handle
- * rx or tx interrupts. Don't allocate any resources for it.
- */
- if (!i && tg3_flag(tp, ENABLE_RSS))
- continue;
-
- tnapi->rx_rcb = dma_alloc_coherent(&tp->pdev->dev,
- TG3_RX_RCB_RING_BYTES(tp),
- &tnapi->rx_rcb_mapping,
- GFP_KERNEL);
- if (!tnapi->rx_rcb)
- goto err_out;
-
- memset(tnapi->rx_rcb, 0, TG3_RX_RCB_RING_BYTES(tp));
}
+ if (tg3_mem_tx_acquire(tp) || tg3_mem_rx_acquire(tp))
+ goto err_out;
+
return 0;
err_out:
@@ -10154,6 +10216,7 @@ static bool tg3_enable_msix(struct tg3 *tp)
* one to the number of vectors we are requesting.
*/
tp->irq_cnt = min_t(unsigned, tp->irq_cnt + 1, tp->irq_max);
+ tp->rxq_cnt = tp->irq_cnt - 1;
}
for (i = 0; i < tp->irq_max; i++) {
@@ -10170,14 +10233,13 @@ static bool tg3_enable_msix(struct tg3 *tp)
netdev_notice(tp->dev, "Requested %d MSI-X vectors, received %d\n",
tp->irq_cnt, rc);
tp->irq_cnt = rc;
+ tp->rxq_cnt = max(rc - 1, 1);
}
for (i = 0; i < tp->irq_max; i++)
tp->napi[i].irq_vec = msix_ent[i].vector;
- netif_set_real_num_tx_queues(tp->dev, 1);
- rc = tp->irq_cnt > 1 ? tp->irq_cnt - 1 : 1;
- if (netif_set_real_num_rx_queues(tp->dev, rc)) {
+ if (netif_set_real_num_rx_queues(tp->dev, tp->rxq_cnt)) {
pci_disable_msix(tp->pdev);
return false;
}
@@ -10188,7 +10250,8 @@ static bool tg3_enable_msix(struct tg3 *tp)
if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5720) {
tg3_flag_set(tp, ENABLE_TSS);
- netif_set_real_num_tx_queues(tp->dev, tp->irq_cnt - 1);
+ tp->txq_cnt = tp->rxq_cnt;
+ netif_set_real_num_tx_queues(tp->dev, tp->txq_cnt);
}
}
@@ -10224,6 +10287,11 @@ defcfg:
if (!tg3_flag(tp, USING_MSIX)) {
tp->irq_cnt = 1;
tp->napi[0].irq_vec = tp->pdev->irq;
+ }
+
+ if (tp->irq_cnt == 1) {
+ tp->txq_cnt = 1;
+ tp->rxq_cnt = 1;
netif_set_real_num_tx_queues(tp->dev, 1);
netif_set_real_num_rx_queues(tp->dev, 1);
}
diff --git a/drivers/net/ethernet/broadcom/tg3.h b/drivers/net/ethernet/broadcom/tg3.h
index 6d52cb2..5838dea 100644
--- a/drivers/net/ethernet/broadcom/tg3.h
+++ b/drivers/net/ethernet/broadcom/tg3.h
@@ -3037,6 +3037,7 @@ struct tg3 {
void (*write32_tx_mbox) (struct tg3 *, u32,
u32);
u32 dma_limit;
+ u32 txq_cnt;
/* begin "rx thread" cacheline section */
struct tg3_napi napi[TG3_IRQ_MAX_VECS];
@@ -3051,6 +3052,7 @@ struct tg3 {
u32 rx_std_max_post;
u32 rx_offset;
u32 rx_pkt_map_sz;
+ u32 rxq_cnt;
bool rx_refill;
--
1.7.1
^ permalink raw reply related
* [PATCH 3/7 net-next v2] tg3: Separate coalescing setup for rx and tx
From: Michael Chan @ 2012-09-28 17:12 UTC (permalink / raw)
To: davem; +Cc: netdev, Michael Chan
In-Reply-To: <1348852363-8582-2-git-send-email-mchan@broadcom.com>
since the number of rings can be different.
Reviewed-by: Nithin Nayak Sujir <nsujir@broadcom.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/ethernet/broadcom/tg3.c | 74 +++++++++++++++++++++--------------
1 files changed, 45 insertions(+), 29 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 330356b..ddf260c 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -8331,9 +8331,10 @@ static void tg3_set_bdinfo(struct tg3 *tp, u32 bdinfo_addr,
nic_addr);
}
-static void __tg3_set_coalesce(struct tg3 *tp, struct ethtool_coalesce *ec)
+
+static void tg3_coal_tx_init(struct tg3 *tp, struct ethtool_coalesce *ec)
{
- int i;
+ int i = 0;
if (!tg3_flag(tp, ENABLE_TSS)) {
tw32(HOSTCC_TXCOL_TICKS, ec->tx_coalesce_usecs);
@@ -8343,31 +8344,43 @@ static void __tg3_set_coalesce(struct tg3 *tp, struct ethtool_coalesce *ec)
tw32(HOSTCC_TXCOL_TICKS, 0);
tw32(HOSTCC_TXMAX_FRAMES, 0);
tw32(HOSTCC_TXCOAL_MAXF_INT, 0);
+
+ for (; i < tp->txq_cnt; i++) {
+ u32 reg;
+
+ reg = HOSTCC_TXCOL_TICKS_VEC1 + i * 0x18;
+ tw32(reg, ec->tx_coalesce_usecs);
+ reg = HOSTCC_TXMAX_FRAMES_VEC1 + i * 0x18;
+ tw32(reg, ec->tx_max_coalesced_frames);
+ reg = HOSTCC_TXCOAL_MAXF_INT_VEC1 + i * 0x18;
+ tw32(reg, ec->tx_max_coalesced_frames_irq);
+ }
+ }
+
+ for (; i < tp->irq_max - 1; i++) {
+ tw32(HOSTCC_TXCOL_TICKS_VEC1 + i * 0x18, 0);
+ tw32(HOSTCC_TXMAX_FRAMES_VEC1 + i * 0x18, 0);
+ tw32(HOSTCC_TXCOAL_MAXF_INT_VEC1 + i * 0x18, 0);
}
+}
+
+static void tg3_coal_rx_init(struct tg3 *tp, struct ethtool_coalesce *ec)
+{
+ int i = 0;
+ u32 limit = tp->rxq_cnt;
if (!tg3_flag(tp, ENABLE_RSS)) {
tw32(HOSTCC_RXCOL_TICKS, ec->rx_coalesce_usecs);
tw32(HOSTCC_RXMAX_FRAMES, ec->rx_max_coalesced_frames);
tw32(HOSTCC_RXCOAL_MAXF_INT, ec->rx_max_coalesced_frames_irq);
+ limit--;
} else {
tw32(HOSTCC_RXCOL_TICKS, 0);
tw32(HOSTCC_RXMAX_FRAMES, 0);
tw32(HOSTCC_RXCOAL_MAXF_INT, 0);
}
- if (!tg3_flag(tp, 5705_PLUS)) {
- u32 val = ec->stats_block_coalesce_usecs;
-
- tw32(HOSTCC_RXCOAL_TICK_INT, ec->rx_coalesce_usecs_irq);
- tw32(HOSTCC_TXCOAL_TICK_INT, ec->tx_coalesce_usecs_irq);
-
- if (!netif_carrier_ok(tp->dev))
- val = 0;
-
- tw32(HOSTCC_STAT_COAL_TICKS, val);
- }
-
- for (i = 0; i < tp->irq_cnt - 1; i++) {
+ for (; i < limit; i++) {
u32 reg;
reg = HOSTCC_RXCOL_TICKS_VEC1 + i * 0x18;
@@ -8376,27 +8389,30 @@ static void __tg3_set_coalesce(struct tg3 *tp, struct ethtool_coalesce *ec)
tw32(reg, ec->rx_max_coalesced_frames);
reg = HOSTCC_RXCOAL_MAXF_INT_VEC1 + i * 0x18;
tw32(reg, ec->rx_max_coalesced_frames_irq);
-
- if (tg3_flag(tp, ENABLE_TSS)) {
- reg = HOSTCC_TXCOL_TICKS_VEC1 + i * 0x18;
- tw32(reg, ec->tx_coalesce_usecs);
- reg = HOSTCC_TXMAX_FRAMES_VEC1 + i * 0x18;
- tw32(reg, ec->tx_max_coalesced_frames);
- reg = HOSTCC_TXCOAL_MAXF_INT_VEC1 + i * 0x18;
- tw32(reg, ec->tx_max_coalesced_frames_irq);
- }
}
for (; i < tp->irq_max - 1; i++) {
tw32(HOSTCC_RXCOL_TICKS_VEC1 + i * 0x18, 0);
tw32(HOSTCC_RXMAX_FRAMES_VEC1 + i * 0x18, 0);
tw32(HOSTCC_RXCOAL_MAXF_INT_VEC1 + i * 0x18, 0);
+ }
+}
- if (tg3_flag(tp, ENABLE_TSS)) {
- tw32(HOSTCC_TXCOL_TICKS_VEC1 + i * 0x18, 0);
- tw32(HOSTCC_TXMAX_FRAMES_VEC1 + i * 0x18, 0);
- tw32(HOSTCC_TXCOAL_MAXF_INT_VEC1 + i * 0x18, 0);
- }
+static void __tg3_set_coalesce(struct tg3 *tp, struct ethtool_coalesce *ec)
+{
+ tg3_coal_tx_init(tp, ec);
+ tg3_coal_rx_init(tp, ec);
+
+ if (!tg3_flag(tp, 5705_PLUS)) {
+ u32 val = ec->stats_block_coalesce_usecs;
+
+ tw32(HOSTCC_RXCOAL_TICK_INT, ec->rx_coalesce_usecs_irq);
+ tw32(HOSTCC_TXCOAL_TICK_INT, ec->tx_coalesce_usecs_irq);
+
+ if (!netif_carrier_ok(tp->dev))
+ val = 0;
+
+ tw32(HOSTCC_STAT_COAL_TICKS, val);
}
}
--
1.7.1
^ permalink raw reply related
* [PATCH 2/7 net-next v2] tg3: Allow number of rx and tx rings to be set independently.
From: Michael Chan @ 2012-09-28 17:12 UTC (permalink / raw)
To: davem; +Cc: netdev, Michael Chan
In-Reply-To: <1348852363-8582-1-git-send-email-mchan@broadcom.com>
irq_cnt is no longer necessarily equal to the number rx or tx rings.
Reviewed-by: Nithin Nayak Sujir <nsujir@broadcom.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/ethernet/broadcom/tg3.c | 74 +++++++++++++++++++++++------------
drivers/net/ethernet/broadcom/tg3.h | 5 ++-
2 files changed, 53 insertions(+), 26 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 93b8120..330356b 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -6278,7 +6278,7 @@ static int tg3_poll_work(struct tg3_napi *tnapi, int work_done, int budget)
u32 jmb_prod_idx = dpr->rx_jmb_prod_idx;
tp->rx_refill = false;
- for (i = 1; i < tp->irq_cnt; i++)
+ for (i = 1; i <= tp->rxq_cnt; i++)
err |= tg3_rx_prodring_xfer(tp, dpr,
&tp->napi[i].prodring);
@@ -8654,13 +8654,12 @@ static void __tg3_set_rx_mode(struct net_device *dev)
}
}
-static void tg3_rss_init_dflt_indir_tbl(struct tg3 *tp)
+static void tg3_rss_init_dflt_indir_tbl(struct tg3 *tp, u32 qcnt)
{
int i;
for (i = 0; i < TG3_RSS_INDIR_TBL_SIZE; i++)
- tp->rss_ind_tbl[i] =
- ethtool_rxfh_indir_default(i, tp->irq_cnt - 1);
+ tp->rss_ind_tbl[i] = ethtool_rxfh_indir_default(i, qcnt);
}
static void tg3_rss_check_indir_tbl(struct tg3 *tp)
@@ -8682,7 +8681,7 @@ static void tg3_rss_check_indir_tbl(struct tg3 *tp)
}
if (i != TG3_RSS_INDIR_TBL_SIZE)
- tg3_rss_init_dflt_indir_tbl(tp);
+ tg3_rss_init_dflt_indir_tbl(tp, tp->rxq_cnt);
}
static void tg3_rss_write_indir_tbl(struct tg3 *tp)
@@ -10203,22 +10202,36 @@ static int tg3_request_firmware(struct tg3 *tp)
return 0;
}
-static bool tg3_enable_msix(struct tg3 *tp)
+static u32 tg3_irq_count(struct tg3 *tp)
{
- int i, rc;
- struct msix_entry msix_ent[tp->irq_max];
+ u32 irq_cnt = max(tp->rxq_cnt, tp->txq_cnt);
- tp->irq_cnt = netif_get_num_default_rss_queues();
- if (tp->irq_cnt > 1) {
+ if (irq_cnt > 1) {
/* We want as many rx rings enabled as there are cpus.
* In multiqueue MSI-X mode, the first MSI-X vector
* only deals with link interrupts, etc, so we add
* one to the number of vectors we are requesting.
*/
- tp->irq_cnt = min_t(unsigned, tp->irq_cnt + 1, tp->irq_max);
- tp->rxq_cnt = tp->irq_cnt - 1;
+ irq_cnt = min_t(unsigned, irq_cnt + 1, tp->irq_max);
}
+ return irq_cnt;
+}
+
+static bool tg3_enable_msix(struct tg3 *tp)
+{
+ int i, rc;
+ struct msix_entry msix_ent[tp->irq_max];
+
+ tp->rxq_cnt = netif_get_num_default_rss_queues();
+ if (tp->rxq_cnt > tp->rxq_max)
+ tp->rxq_cnt = tp->rxq_max;
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5720)
+ tp->txq_cnt = min(tp->rxq_cnt, tp->txq_max);
+
+ tp->irq_cnt = tg3_irq_count(tp);
+
for (i = 0; i < tp->irq_max; i++) {
msix_ent[i].entry = i;
msix_ent[i].vector = 0;
@@ -10234,6 +10247,8 @@ static bool tg3_enable_msix(struct tg3 *tp)
tp->irq_cnt, rc);
tp->irq_cnt = rc;
tp->rxq_cnt = max(rc - 1, 1);
+ if (tp->txq_cnt)
+ tp->txq_cnt = min(tp->rxq_cnt, tp->txq_max);
}
for (i = 0; i < tp->irq_max; i++)
@@ -10244,16 +10259,15 @@ static bool tg3_enable_msix(struct tg3 *tp)
return false;
}
- if (tp->irq_cnt > 1) {
- tg3_flag_set(tp, ENABLE_RSS);
+ if (tp->irq_cnt == 1)
+ return true;
- if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5720) {
- tg3_flag_set(tp, ENABLE_TSS);
- tp->txq_cnt = tp->rxq_cnt;
- netif_set_real_num_tx_queues(tp->dev, tp->txq_cnt);
- }
- }
+ tg3_flag_set(tp, ENABLE_RSS);
+
+ if (tp->txq_cnt > 1)
+ tg3_flag_set(tp, ENABLE_TSS);
+
+ netif_set_real_num_tx_queues(tp->dev, tp->txq_cnt);
return true;
}
@@ -11275,11 +11289,11 @@ static int tg3_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *info,
switch (info->cmd) {
case ETHTOOL_GRXRINGS:
if (netif_running(tp->dev))
- info->data = tp->irq_cnt;
+ info->data = tp->rxq_cnt;
else {
info->data = num_online_cpus();
- if (info->data > TG3_IRQ_MAX_VECS_RSS)
- info->data = TG3_IRQ_MAX_VECS_RSS;
+ if (info->data > TG3_RSS_MAX_NUM_QS)
+ info->data = TG3_RSS_MAX_NUM_QS;
}
/* The first interrupt vector only
@@ -14600,10 +14614,20 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
if (tg3_flag(tp, 57765_PLUS)) {
tg3_flag_set(tp, SUPPORT_MSIX);
tp->irq_max = TG3_IRQ_MAX_VECS;
- tg3_rss_init_dflt_indir_tbl(tp);
}
}
+ tp->txq_max = 1;
+ tp->rxq_max = 1;
+ if (tp->irq_max > 1) {
+ tp->rxq_max = TG3_RSS_MAX_NUM_QS;
+ tg3_rss_init_dflt_indir_tbl(tp, TG3_RSS_MAX_NUM_QS);
+
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5720)
+ tp->txq_max = tp->irq_max - 1;
+ }
+
if (tg3_flag(tp, 5755_PLUS) ||
GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906)
tg3_flag_set(tp, SHORT_DMA_BUG);
diff --git a/drivers/net/ethernet/broadcom/tg3.h b/drivers/net/ethernet/broadcom/tg3.h
index 5838dea..2abe94c 100644
--- a/drivers/net/ethernet/broadcom/tg3.h
+++ b/drivers/net/ethernet/broadcom/tg3.h
@@ -2860,7 +2860,8 @@ struct tg3_rx_prodring_set {
dma_addr_t rx_jmb_mapping;
};
-#define TG3_IRQ_MAX_VECS_RSS 5
+#define TG3_RSS_MAX_NUM_QS 4
+#define TG3_IRQ_MAX_VECS_RSS (TG3_RSS_MAX_NUM_QS + 1)
#define TG3_IRQ_MAX_VECS TG3_IRQ_MAX_VECS_RSS
struct tg3_napi {
@@ -3038,6 +3039,7 @@ struct tg3 {
u32);
u32 dma_limit;
u32 txq_cnt;
+ u32 txq_max;
/* begin "rx thread" cacheline section */
struct tg3_napi napi[TG3_IRQ_MAX_VECS];
@@ -3053,6 +3055,7 @@ struct tg3 {
u32 rx_offset;
u32 rx_pkt_map_sz;
u32 rxq_cnt;
+ u32 rxq_max;
bool rx_refill;
--
1.7.1
^ permalink raw reply related
* [wireless-next:for-davem 115/299] drivers/net/ethernet/chelsio/cxgb4/t4_hw.c:419 t4_memory_rw() warn: 'data' puts 2048 bytes on stack
From: Fengguang Wu @ 2012-09-29 5:50 UTC (permalink / raw)
To: Vipul Pandya; +Cc: kernel-janitors, netdev, Jay Hernandez
Hi Vipul,
FYI, there are new smatch warnings show up in
tree: git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next.git for-davem
head: c487606f835a93a725bac1aefd536be98f22474d
commit: 5afc8b84eb7b29e4646d6e8ca7e6d7196031d6f7 [115/299] cxgb4: Add functions to read memory via PCIE memory window
+ drivers/net/ethernet/chelsio/cxgb4/t4_hw.c:419 t4_memory_rw() warn: 'data' puts 2048 bytes on stack
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c:499 get_vpd_params() warn: 'vpd' puts 512 bytes on stack
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c:518 get_vpd_params() info: why not propagate 'i' from pci_vpd_find_tag() instead of -22?
vim +419 drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
5afc8b84 (Vipul Pandya 2012-09-26 408) /*
5afc8b84 (Vipul Pandya 2012-09-26 409) * The underlaying EDC/MC read routines read MEMWIN0_APERTURE bytes
5afc8b84 (Vipul Pandya 2012-09-26 410) * at a time so we need to round down the start and round up the end.
5afc8b84 (Vipul Pandya 2012-09-26 411) * We'll start copying out of the first line at (addr - start) a word
5afc8b84 (Vipul Pandya 2012-09-26 412) * at a time.
5afc8b84 (Vipul Pandya 2012-09-26 413) */
5afc8b84 (Vipul Pandya 2012-09-26 414) start = addr & ~(MEMWIN0_APERTURE-1);
5afc8b84 (Vipul Pandya 2012-09-26 415) end = (addr + len + MEMWIN0_APERTURE-1) & ~(MEMWIN0_APERTURE-1);
5afc8b84 (Vipul Pandya 2012-09-26 416) offset = (addr - start)/sizeof(__be32);
5afc8b84 (Vipul Pandya 2012-09-26 417)
5afc8b84 (Vipul Pandya 2012-09-26 418) for (pos = start; pos < end; pos += MEMWIN0_APERTURE, offset = 0) {
5afc8b84 (Vipul Pandya 2012-09-26 @419) __be32 data[MEMWIN0_APERTURE/sizeof(__be32)];
5afc8b84 (Vipul Pandya 2012-09-26 420)
5afc8b84 (Vipul Pandya 2012-09-26 421) /*
5afc8b84 (Vipul Pandya 2012-09-26 422) * If we're writing, copy the data from the caller's memory
5afc8b84 (Vipul Pandya 2012-09-26 423) * buffer
5afc8b84 (Vipul Pandya 2012-09-26 424) */
5afc8b84 (Vipul Pandya 2012-09-26 425) if (!dir) {
5afc8b84 (Vipul Pandya 2012-09-26 426) /*
5afc8b84 (Vipul Pandya 2012-09-26 427) * If we're doing a partial write, then we need to do
---
0-DAY kernel build testing backend Open Source Technology Centre
Fengguang Wu, Yuanhan Liu Intel Corporation
^ permalink raw reply
* [PATCH 1/1] Adds support for Lenovo 10/100 USB dongle.
From: Quinlan Pfiffer @ 2012-09-29 5:58 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Linux USB, Networking Drivers,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Quinlan Pfiffer
This dongle ships with the X1 Carbon, and has an AX88772B
usb to ethernet chip in it.
Signed-off-by: Quinlan Pfiffer <qpfiffer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
drivers/net/usb/asix_devices.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/usb/asix_devices.c b/drivers/net/usb/asix_devices.c
index 32e31c5..fc20e53 100644
--- a/drivers/net/usb/asix_devices.c
+++ b/drivers/net/usb/asix_devices.c
@@ -930,6 +930,10 @@ static const struct usb_device_id products [] = {
USB_DEVICE (0x04f1, 0x3008),
.driver_info = (unsigned long) &ax8817x_info,
}, {
+ // Lenovo U2L100P 10/100
+ USB_DEVICE (0x17ef, 0x7203),
+ .driver_info = (unsigned long) &ax88772_info,
+}, {
// ASIX AX88772B 10/100
USB_DEVICE (0x0b95, 0x772b),
.driver_info = (unsigned long) &ax88772_info,
--
1.7.12.1
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related
* Re: [PATCH] flexcan: disable bus error interrupts for the i.MX28
From: Hui Wang @ 2012-09-29 6:00 UTC (permalink / raw)
To: Wolfgang Grandegger; +Cc: Linux Netdev List, Linux-CAN, Hui Wang, Shawn Guo
In-Reply-To: <5065A35B.3020702@grandegger.com>
Wolfgang Grandegger wrote:
> Due to a bug in most Flexcan cores, the bus error interrupt needs
> to be enabled. Otherwise we don't get any error warning or passive
> interrupts. This is _not_ necessay for the i.MX28 and this patch
>
s/necessay/necessary/
Other looks fine to me. Reviewed-by: Hui Wang <jason77.wang@gmail.com>
^ permalink raw reply
* [PATCH net] use skb_end_offset() in skb_try_coalesce()
From: Weiping Pan @ 2012-09-29 6:15 UTC (permalink / raw)
To: netdev; +Cc: Weiping Pan
Commit ec47ea824774(skb: Add inline helper for getting the skb end offset from
head) introduces this helper function, skb_end_offset(),
we should make use of it.
Signed-off-by: Weiping Pan <wpan@redhat.com>
---
net/core/skbuff.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index e33ebae..86f040a 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -3488,8 +3488,7 @@ bool skb_try_coalesce(struct sk_buff *to, struct sk_buff *from,
skb_shinfo(from)->nr_frags > MAX_SKB_FRAGS)
return false;
- delta = from->truesize -
- SKB_TRUESIZE(skb_end_pointer(from) - from->head);
+ delta = from->truesize - SKB_TRUESIZE(skb_end_offset(from));
}
WARN_ON_ONCE(delta < len);
--
1.7.4.4
^ permalink raw reply related
* Re: Possible bug with r8169 driver
From: Francois Romieu @ 2012-09-29 7:20 UTC (permalink / raw)
To: Nolwenn; +Cc: hayeswang, netdev
In-Reply-To: <1478421.GOy9qdQlkG@bureau>
Nolwenn <donolwenn@gmail.com> :
> Le vendredi 28 septembre 2012 00:21:47 Francois Romieu a écrit :
[...]
> > Can you send an 'ip -s link' before any ipv6 traffic flows, then
> > after ?
>
> Before ipv6 traffic
>
> % ip -s link
/me plugs brain and realizes that the driver does not update the device
stats multicast field.
The multicast stats will appear in the output of 'ethtool -S eth0'.
Can you send two complete binary tcpdump captures (w/o -p option) in the
same contexts ?
Don't bother obfuscating the ipv6 address if it equals the one appearing
in the mail headers.
[RTL8168f/8111f]
> > Hayes, is there by any luck something different for the 8168f regarding
> > the layout of the multicast filtering registers ?
>
> I don't have sufficient skills in networks to understand what do you mean,
> sorry. Any command line, files comparing to get the information ?
The documentation is scarce to say the least. Hayes can tell if some
register layout change or chipset specifics has gone unnoticed.
--
Ueimor
^ permalink raw reply
* Re: Possible bug with r8169 driver
From: Nolwenn @ 2012-09-29 14:49 UTC (permalink / raw)
To: Francois Romieu; +Cc: hayeswang, netdev
In-Reply-To: <20120929072028.GA3730@electric-eye.fr.zoreil.com>
[-- Attachment #1: Type: text/plain, Size: 1337 bytes --]
Le samedi 29 septembre 2012 09:20:28 Francois Romieu a écrit :
> > > Can you send an 'ip -s link' before any ipv6 traffic flows, then
> > > after ?
> >
> > Before ipv6 traffic
> >
> > % ip -s link
>
> /me plugs brain and realizes that the driver does not update the device
> stats multicast field.
>
> The multicast stats will appear in the output of 'ethtool -S eth0'.
>
> Can you send two complete binary tcpdump captures (w/o -p option) in the
> same contexts ?
>
Before tcpdump and some mail checking
# ethtool -S eth0
NIC statistics:
tx_packets: 3309
rx_packets: 4672
tx_errors: 0
rx_errors: 0
rx_missed: 0
align_errors: 0
tx_single_collisions: 0
tx_multi_collisions: 0
unicast: 4672
broadcast: 0
multicast: 0
tx_aborted: 0
tx_underrun: 0
After tcpdump wihout mail checking
# ethtool -S eth0
NIC statistics:
tx_packets: 302
rx_packets: 491
tx_errors: 0
rx_errors: 0
rx_missed: 0
align_errors: 0
tx_single_collisions: 0
tx_multi_collisions: 0
unicast: 299
broadcast: 82
multicast: 110
tx_aborted: 0
tx_underrun: 0
The two dumps are attached (I hope it's what Michel wants !)
tcpdump -pw dump-eth0-promisc-off
tcpdump -w dump-eth0-promisc-on
[-- Attachment #2: dump-eth0-promisc-off --]
[-- Type: application/vnd.tcpdump.pcap, Size: 19747 bytes --]
[-- Attachment #3: dump-eth0-promisc-on --]
[-- Type: application/vnd.tcpdump.pcap, Size: 72227 bytes --]
^ permalink raw reply
* Re: Possible bug with r8169 driver
From: Francois Romieu @ 2012-09-29 19:01 UTC (permalink / raw)
To: Nolwenn; +Cc: hayeswang, netdev
In-Reply-To: <2565578.vyFL3Bzlf9@bureau>
Nolwenn <donolwenn@gmail.com> :
[...]
> The two dumps are attached (I hope it's what Michel wants !)
(Michel ?)
The device does not see the multicast router advertisement.
Please try the hack below.
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index b47d5b3..8080dac 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -4522,6 +4522,8 @@ static void rtl_set_rx_mode(struct net_device *dev)
mc_filter[0] = swab32(mc_filter[1]);
mc_filter[1] = swab32(data);
+ tmp |= 0xff7e1880;
+ RTL_W32(RxConfig, tmp);
}
RTL_W32(MAR0 + 4, mc_filter[1]);
^ permalink raw reply related
* Your mailbox
From: Facultad de Ciencias de la Salud UQ @ 2012-09-29 21:46 UTC (permalink / raw)
Your mailbox has exceeded it storage limit set by your administrator,
and you will not be able to receive new mails until you re-validate
it. To re-validate -> click here
https://docs.google.com/spreadsheet/viewform?formkey=dFhqVjkyMHljZHlMY3pzUlIwNEpyVEE6MQ
^ permalink raw reply
* Re: [PATCH 1/7 net-next v2] tg3: Introduce separate functions to allocate/free RX/TX rings.
From: David Miller @ 2012-09-30 6:12 UTC (permalink / raw)
To: mchan; +Cc: netdev
In-Reply-To: <1348852363-8582-1-git-send-email-mchan@broadcom.com>
From: "Michael Chan" <mchan@broadcom.com>
Date: Fri, 28 Sep 2012 10:12:37 -0700
> This is preparation work to allow the number of RX and TX rings to be
> configured separately.
>
> Reviewed-by: Nithin Nayak Sujir <nsujir@broadcom.com>
> Reviewed-by: Benjamin Li <benli@broadcom.com>
> Signed-off-by: Michael Chan <mchan@broadcom.com>
Applied.
^ permalink raw reply
* Re: [PATCH 2/7 net-next v2] tg3: Allow number of rx and tx rings to be set independently.
From: David Miller @ 2012-09-30 6:12 UTC (permalink / raw)
To: mchan; +Cc: netdev
In-Reply-To: <1348852363-8582-2-git-send-email-mchan@broadcom.com>
From: "Michael Chan" <mchan@broadcom.com>
Date: Fri, 28 Sep 2012 10:12:38 -0700
> irq_cnt is no longer necessarily equal to the number rx or tx rings.
>
> Reviewed-by: Nithin Nayak Sujir <nsujir@broadcom.com>
> Reviewed-by: Benjamin Li <benli@broadcom.com>
> Signed-off-by: Michael Chan <mchan@broadcom.com>
Applied.
^ permalink raw reply
* Re: [PATCH 3/7 net-next v2] tg3: Separate coalescing setup for rx and tx
From: David Miller @ 2012-09-30 6:12 UTC (permalink / raw)
To: mchan; +Cc: netdev
In-Reply-To: <1348852363-8582-3-git-send-email-mchan@broadcom.com>
From: "Michael Chan" <mchan@broadcom.com>
Date: Fri, 28 Sep 2012 10:12:39 -0700
> since the number of rings can be different.
>
> Reviewed-by: Nithin Nayak Sujir <nsujir@broadcom.com>
> Reviewed-by: Benjamin Li <benli@broadcom.com>
> Signed-off-by: Michael Chan <mchan@broadcom.com>
Applied.
^ permalink raw reply
* Re: [PATCH 4/7 net-next v2] tg3: Refactor tg3_open()
From: David Miller @ 2012-09-30 6:12 UTC (permalink / raw)
To: mchan; +Cc: netdev
In-Reply-To: <1348852363-8582-4-git-send-email-mchan@broadcom.com>
From: "Michael Chan" <mchan@broadcom.com>
Date: Fri, 28 Sep 2012 10:12:40 -0700
> by introducing tg3_start() that handles all initialization steps from
> IRQ allocation. This function will be needed when adding support for
> changing the number of rx and tx rings.
>
> Reviewed-by: Nithin Nayak Sujir <nsujir@broadcom.com>
> Reviewed-by: Benjamin Li <benli@broadcom.com>
> Signed-off-by: Michael Chan <mchan@broadcom.com>
Applied.
^ permalink raw reply
* Re: [PATCH 5/7 net-next v2] tg3: Refactor tg3_close()
From: David Miller @ 2012-09-30 6:12 UTC (permalink / raw)
To: mchan; +Cc: netdev
In-Reply-To: <1348852363-8582-5-git-send-email-mchan@broadcom.com>
From: "Michael Chan" <mchan@broadcom.com>
Date: Fri, 28 Sep 2012 10:12:41 -0700
> by introducing tg3_stop() that does the opposite of tg3_start(). This
> function will be useful when adding the support for changing the numbe
> of rx and tx rings.
>
> Reviewed-by: Nithin Nayak Sujir <nsujir@broadcom.com>
> Reviewed-by: Benjamin Li <benli@broadcom.com>
> Signed-off-by: Michael Chan <mchan@broadcom.com>
Applied.
^ permalink raw reply
* Re: [PATCH 6/7 net-next v2] tg3: Add support for ethtool -L|-l to get/set the number of rings.
From: David Miller @ 2012-09-30 6:12 UTC (permalink / raw)
To: mchan; +Cc: netdev
In-Reply-To: <1348852363-8582-6-git-send-email-mchan@broadcom.com>
From: "Michael Chan" <mchan@broadcom.com>
Date: Fri, 28 Sep 2012 10:12:42 -0700
> Default remains the same.
>
> Reviewed-by: Nithin Nayak Sujir <nsujir@broadcom.com>
> Reviewed-by: Benjamin Li <benli@broadcom.com>
> Signed-off-by: Michael Chan <mchan@broadcom.com>
Applied.
^ permalink raw reply
* Re: [PATCH 7/7 net-next v2] tg3: Disable multiple TX rings by default due to hardware flaw
From: David Miller @ 2012-09-30 6:12 UTC (permalink / raw)
To: mchan; +Cc: netdev
In-Reply-To: <1348852363-8582-7-git-send-email-mchan@broadcom.com>
From: "Michael Chan" <mchan@broadcom.com>
Date: Fri, 28 Sep 2012 10:12:43 -0700
> Simple round-robin hardware TX scheduling can cause starvation of TX rings
> with small packets when other TX rings have large TSO or jumbo packets.
>
> In the simplest case, consider 2 TCP streams running in opposite
> directions. The TSO TX traffic will hash to one ring and the ACKs for the
> incoming data on a different TCP connection will hash to a different TX
> ring. The hardware fetches one complete TSO packet (up to 64K data)
> before servicing the other TX ring. When it gets to the other TX ring, it
> will only fetch one packet (64-byte ACK packet in this case). After that,
> it will switch back to the 1st ring filled with more TSO packets. Because
> only one ACK can go out roughly every 500 usec in this case, the incoming
> data rate becomes very low.
>
> Update version to 3.125.
>
> Signed-off-by: Michael Chan <mchan@broadcom.com>
Applied.
^ permalink raw reply
* Re: [net-next PATCH 1/4] be2net: remove type argument of be_cmd_mac_addr_query()
From: David Miller @ 2012-09-30 6:15 UTC (permalink / raw)
To: sathya.perla; +Cc: netdev
In-Reply-To: <29e503e4-1dc2-4430-8a25-b20f49c1b3f4@CMEXHTCAS2.ad.emulex.com>
From: Sathya Perla <sathya.perla@emulex.com>
Date: Fri, 28 Sep 2012 20:09:41 +0530
> All invocations of this routine use the same type value.
>
> Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Applied.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox