* Re: [PATCH] ipv6: fix incorrect ipsec transport mode fragment
From: David Miller @ 2012-05-14 22:41 UTC (permalink / raw)
To: steffen.klassert; +Cc: gaofeng, netdev, lw
In-Reply-To: <20120514130528.GA24733@secunet.com>
From: Steffen Klassert <steffen.klassert@secunet.com>
Date: Mon, 14 May 2012 15:05:28 +0200
> There might be other opinions, but I don't like to see this IPsec mode
> dependent stuff hacked into the generic ipv6 output path.
Completely agreed.
^ permalink raw reply
* Re: [PATCH v3 6/6] net: sh_eth: use NAPI
From: David Miller @ 2012-05-14 22:50 UTC (permalink / raw)
To: yoshihiro.shimoda.uh; +Cc: netdev, linux-sh
In-Reply-To: <4FB0AA7C.1000603@renesas.com>
From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
Date: Mon, 14 May 2012 15:47:24 +0900
> This patch modifies the driver to use NAPI.
>
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
I think your TX path is still extremely racey.
No locks are held here, so you tell me what happens if we execute:
> + /* check txdesc */
> + txfree_num = sh_eth_txfree(ndev);
> + if (txfree_num)
and at this exact moment the queue was in fact already awake and
another thread of control transmits packets, and this action fills up
the TX queue and stops the queue.
> netif_wake_queue(ndev);
This will erroneously wake the queue and trigger the debugging
message in your TX function.
You need strict synchronization between your TX queueing and TX
liberation flows. So that queue stop and wake are only performed
at the correct moment.
In fact, looking at how the mdp->lock is used in your TX routine, it
seems to protect absolutely against nothing.
Please read the TX flow of drivers/net/ethernet/broadcom/tg3.c to see
how to do this correctly, and lock free, in a NAPI driver.
^ permalink raw reply
* Re: [net-next 1/3 (v2)] stmmac: extend mac addr reg and fix perfect filering
From: David Miller @ 2012-05-14 22:53 UTC (permalink / raw)
To: peppe.cavallaro; +Cc: netdev, gianni.antoniazzi-ext
In-Reply-To: <1336983523-4075-1-git-send-email-peppe.cavallaro@st.com>
From: Giuseppe CAVALLARO <peppe.cavallaro@st.com>
Date: Mon, 14 May 2012 10:18:41 +0200
> From: Giuseppe CAVALLARO <peppe.cavallaro@st.com>
>
> This patch is to extend the number of MAC address registers
> for 16 to 32. In fact, other new 16 registers are available in new
> chips and this can help on perfect filter mode for unicast.
>
> This patch also fixes the perfect filtering mode by setting the
> bit 31 in the MAC address registers.
>
> v2: fixed Coding Style.
>
> Signed-off-by: Gianni Antoniazzi <gianni.antoniazzi-ext@st.com>
> Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Applied.
^ permalink raw reply
* Re: [net-next 2/3 (v2)] stmmac: add mixed burst for DMA
From: David Miller @ 2012-05-14 22:54 UTC (permalink / raw)
To: peppe.cavallaro; +Cc: netdev
In-Reply-To: <1336983523-4075-2-git-send-email-peppe.cavallaro@st.com>
From: Giuseppe CAVALLARO <peppe.cavallaro@st.com>
Date: Mon, 14 May 2012 10:18:42 +0200
> From: Giuseppe CAVALLARO <peppe.cavallaro@st.com>
>
> In mixed burst (MB) mode, the AHB master always initiates
> the bursts with fixed-size when the DMA requests transfers
> of size less than or equal to 16 beats.
> This patch adds the MB support and the flag that can be
> passed from the platform to select it.
> MB mode can also give some benefits in terms of performances
> on some platforms.
>
> v2: fixed Coding Style
>
> Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Applied.
^ permalink raw reply
* Re: [net-next 3/3] stmmac: fix suspend/resume locking
From: David Miller @ 2012-05-14 22:54 UTC (permalink / raw)
To: peppe.cavallaro; +Cc: netdev
In-Reply-To: <1336983523-4075-3-git-send-email-peppe.cavallaro@st.com>
From: Giuseppe CAVALLARO <peppe.cavallaro@st.com>
Date: Mon, 14 May 2012 10:18:43 +0200
> Upon resume from standby, there is a possible interrupt
> unsafe locking scenario raised when configure the Kernel
> with CONFIG_PROVE_LOCKING. So this patch fixes that in
> PM driver stuff by calling lock/unlock_irqsave/restore.
>
> Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Applied.
^ permalink raw reply
* Re: [PATCH 0/4] netfilter fixes for 3.4-rc7
From: David Miller @ 2012-05-14 22:56 UTC (permalink / raw)
To: pablo; +Cc: netfilter-devel, netdev
In-Reply-To: <1336996023-20249-1-git-send-email-pablo@netfilter.org>
From: pablo@netfilter.org
Date: Mon, 14 May 2012 13:46:59 +0200
> * One fix for possible timeout overflow for ipset, from Jozsef
> Kadlecsik.
>
> * One fix to ensure that hash size is correct, again for ipset
> from Jozsef Kadlecsik.
>
> * Removal of redundant include in xt_CT from Eldad Zack.
>
> * Fix for wrong usage of MODULE_ALIAS_NFCT_HELPER in nf_ct_h323
> helper from myself.
I don't consider any of these appropriate this late in the -RC
series.
They don't fix major regressions seen by many users.
And the duplicate header include is extremely out-of-scope and
inappropriate.
Sorry.
^ permalink raw reply
* Re: [PATCH 0/4] netfilter fixes for 3.4-rc7
From: Pablo Neira Ayuso @ 2012-05-14 23:25 UTC (permalink / raw)
To: David Miller; +Cc: netfilter-devel, netdev
In-Reply-To: <20120514.185607.1967456974676336550.davem@davemloft.net>
On Mon, May 14, 2012 at 06:56:07PM -0400, David Miller wrote:
> From: pablo@netfilter.org
> Date: Mon, 14 May 2012 13:46:59 +0200
>
> > * One fix for possible timeout overflow for ipset, from Jozsef
> > Kadlecsik.
> >
> > * One fix to ensure that hash size is correct, again for ipset
> > from Jozsef Kadlecsik.
> >
> > * Removal of redundant include in xt_CT from Eldad Zack.
> >
> > * Fix for wrong usage of MODULE_ALIAS_NFCT_HELPER in nf_ct_h323
> > helper from myself.
>
> I don't consider any of these appropriate this late in the -RC
> series.
>
> They don't fix major regressions seen by many users.
>
> And the duplicate header include is extremely out-of-scope and
> inappropriate.
>
> Sorry.
No problem, I'll schedule those for net-next.
^ permalink raw reply
* [PATCH 6/7] pch_gbe: Do not abort probe on bad MAC
From: Tomoya MORINAGA @ 2012-05-15 2:11 UTC (permalink / raw)
To: stable
Cc: Tomoya MORINAGA, Darren Hart, Arjan van de Ven, Alan Cox,
Jeff Kirsher, David S. Miller, Paul Gortmaker, Jon Mason, netdev,
Mark Brown, David Laight, Joe Perches
In-Reply-To: <1337047891-2973-1-git-send-email-tomoya.rohm@gmail.com>
If the MAC is invalid or not implemented, do not abort the probe. Issue
a warning and prevent bringing the interface up until a MAC is set manually
(via ifconfig $IFACE hw ether $MAC).
Tested on two platforms, one with a valid MAC, the other without a MAC. The real
MAC is used if present, the interface fails to come up until the MAC is set on
the other. They successfully get an IP over DHCP and pass a simple ping and
login over ssh test.
This is meant to allow the Inforce SYS940X development board:
http://www.inforcecomputing.com/SYS940X_ECX.html
(and others suffering from a missing MAC) to work with the mainline kernel.
Without this patch, the probe will fail and the interface will not be created,
preventing the user from configuring the MAC manually.
This does not make any attempt to address a missing or invalid MAC for the
pch_phub driver.
commit 2b53d07891630dead46d65c8f896955fd3ae0302
Kernel 3.0
Cc: stable@vger.kernel.org
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
CC: Arjan van de Ven <arjan@linux.intel.com>
CC: Alan Cox <alan@linux.intel.com>
CC: Tomoya MORINAGA <tomoya.rohm@gmail.com>
CC: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
CC: "David S. Miller" <davem@davemloft.net>
CC: Paul Gortmaker <paul.gortmaker@windriver.com>
CC: Jon Mason <jdmason@kudzu.us>
CC: netdev@vger.kernel.org
CC: Mark Brown <broonie@opensource.wolfsonmicro.com>
CC: David Laight <David.Laight@ACULAB.COM>
CC: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Tomoya MORINAGA <tomoya.rohm@gmail.com>
---
drivers/net/pch_gbe/pch_gbe_main.c | 17 ++++++++++++++---
1 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/drivers/net/pch_gbe/pch_gbe_main.c b/drivers/net/pch_gbe/pch_gbe_main.c
index b8b4ba2..d506e28 100644
--- a/drivers/net/pch_gbe/pch_gbe_main.c
+++ b/drivers/net/pch_gbe/pch_gbe_main.c
@@ -1745,6 +1745,12 @@ int pch_gbe_up(struct pch_gbe_adapter *adapter)
struct pch_gbe_rx_ring *rx_ring = adapter->rx_ring;
int err;
+ /* Ensure we have a valid MAC */
+ if (!is_valid_ether_addr(adapter->hw.mac.addr)) {
+ pr_err("Error: Invalid MAC address\n");
+ return -EINVAL;
+ }
+
/* hardware has been reset, we need to reload some things */
pch_gbe_set_multi(netdev);
@@ -2467,9 +2473,14 @@ static int pch_gbe_probe(struct pci_dev *pdev,
memcpy(netdev->dev_addr, adapter->hw.mac.addr, netdev->addr_len);
if (!is_valid_ether_addr(netdev->dev_addr)) {
- dev_err(&pdev->dev, "Invalid MAC Address\n");
- ret = -EIO;
- goto err_free_adapter;
+ /*
+ * If the MAC is invalid (or just missing), display a warning
+ * but do not abort setting up the device. pch_gbe_up will
+ * prevent the interface from being brought up until a valid MAC
+ * is set.
+ */
+ dev_err(&pdev->dev, "Invalid MAC address, "
+ "interface disabled.\n");
}
setup_timer(&adapter->watchdog_timer, pch_gbe_watchdog,
(unsigned long)adapter);
--
1.7.7.6
^ permalink raw reply related
* Re: [PATCH] ipv6: fix incorrect ipsec transport mode fragment
From: Gao feng @ 2012-05-15 3:44 UTC (permalink / raw)
To: Steffen Klassert; +Cc: netdev, davem, lw
In-Reply-To: <20120514130528.GA24733@secunet.com>
Hi steffen:
于 2012年05月14日 21:05, Steffen Klassert 写道:
> On Mon, May 14, 2012 at 11:21:00AM +0800, Gao feng wrote:
>> Since commit 299b0767(ipv6: Fix IPsec slowpath fragmentation problem)
>> the fragment of ipsec transport mode packets is incorrect.
>> because tunnel mode needs IPsec headers and trailer for all fragments,
>> while on transport mode it is sufficient to add the headers to the
>> first fragment and the trailer to the last.
>
> I mentioned this in an other thread some time ago,
> this is due to commit ad0081e43a
> "ipv6: Fragment locally generated tunnel-mode IPSec6 packets as needed"
> changed tunnel mode to do fragmentation before the transformation
> while transport mode still does fragmentation after transformation.
> Now, tunnel mode needs IPsec headers and trailer for all fragments,
> while on transport mode it is sufficient to add the headers to the
> first fragment and the trailer to the last.
>
>>
>> so modify mtu and maxfraglen base on ipsec mode and if fragment is first
>> or last.
>
> There might be other opinions, but I don't like to see this IPsec mode
> dependent stuff hacked into the generic ipv6 output path.
>
> Basically we have two cases. One where we have to add rt->dst.header_len
> to the first fragment and rt->dst.trailer_len to the last fragment,
> and the other where we have to add both to all fragments. So perhaps we
> could isolate this code and create two functions, one for each case.
>
how about add a function pointer append_data to the struct rt6_info?
so we can just call rt->append_data in ip6_append_data without conside
witch mode it is.
of course, we will set rt->append_data appropriatly in xfrm_lookup.
But the only problem is this will bloats up rt6_info,I don't konw if
it's worth doing it in this way.
>
>>
>> with my test,it work well and does not trigger slow fragment path.
>>
>> Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
>> ---
>> net/ipv6/ip6_output.c | 80 +++++++++++++++++++++++++++++++++++++-----------
>> 1 files changed, 61 insertions(+), 19 deletions(-)
>>
>> diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
>> index b7ca461..9416887 100644
>> --- a/net/ipv6/ip6_output.c
>> +++ b/net/ipv6/ip6_output.c
>> @@ -1191,19 +1191,23 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to,
>> struct ipv6_pinfo *np = inet6_sk(sk);
>> struct inet_cork *cork;
>> struct sk_buff *skb;
>> - unsigned int maxfraglen, fragheaderlen;
>> + unsigned int maxfraglen, maxfraglen_prev, fragheaderlen;
>> int exthdrlen;
>> int dst_exthdrlen;
>> int hh_len;
>> - int mtu;
>> + int mtu, mtu_prev;
>> int copy;
>> int err;
>> int offset = 0;
>> int csummode = CHECKSUM_NONE;
>> __u8 tx_flags = 0;
>> -
>> + bool transport_mode = false;
>> + struct xfrm_state *x = rt->dst.xfrm;
>> if (flags&MSG_PROBE)
>> return 0;
>> + if (x && x->props.mode == XFRM_MODE_TRANSPORT)
>> + transport_mode = true;
>> +
>
> Btw. beet mode should behave like transport mode here, just tunnel
> mode was changed to do fragmentation before the transformation.
>
thanks steffen,I miss it and CONFIG_XFRM...
^ permalink raw reply
* Re: [PATCH net-next 1/8] net/mlx4: Address build warnings on set but not used variables
From: David Miller @ 2012-05-15 4:07 UTC (permalink / raw)
To: ogerlitz; +Cc: roland, netdev
In-Reply-To: <1337025853-26685-2-git-send-email-ogerlitz@mellanox.com>
From: Or Gerlitz <ogerlitz@mellanox.com>
Date: Mon, 14 May 2012 23:04:06 +0300
> - err = mlx4_qp_detach_common(dev, &qp, rgid->gid, rgid->prot,
> + (void) mlx4_qp_detach_common(dev, &qp, rgid->gid, rgid->prot,
> rgid->steer);
You must update the indentation of all the lines comprising of the function
call when you change the indentation of it's initial line.
Please go through all of your patches in this series and fix that up.
^ permalink raw reply
* RE: Question about be2net error field, rx_drops_no_pbuf
From: Sathya.Perla @ 2012-05-15 4:28 UTC (permalink / raw)
To: mleitner; +Cc: netdev
In-Reply-To: <4FB17863.5020908@redhat.com>
>-----Original Message-----
>From: netdev-owner@vger.kernel.org [mailto:netdev-owner@vger.kernel.org] On
>Behalf Of Marcelo Leitner
>What does 'rx_drops_no_pbuf' mean at be2net driver? I can see it is a
>hardware counter for some type of error, which I would like to know
>about. What causes it?
>
>All documentation I could find about it is a comment referring firmware
>specification
Brief descriptions of the counters are in be_ethtool.c:
/* Received packets dropped due to lack of available HW packet buffers
* used to temporarily hold the received packets.
*/
{DRVSTAT_INFO(rx_drops_no_pbuf)}
pbufs are HW buffers for parking incoming pkts before they are transferred to the host.
You can see this counter go up when the transfer speed of the slot is not fast enough.
lspci -vv?
^ permalink raw reply
* Re: [PATCH v3 6/6] net: sh_eth: use NAPI
From: Shimoda, Yoshihiro @ 2012-05-15 4:47 UTC (permalink / raw)
To: David Miller; +Cc: netdev, linux-sh
In-Reply-To: <20120514.185034.399229364191924851.davem@davemloft.net>
2012/05/15 7:50, David Miller wrote:
> From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
> Date: Mon, 14 May 2012 15:47:24 +0900
>
>> This patch modifies the driver to use NAPI.
>>
>> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
>
> I think your TX path is still extremely racey.
>
> No locks are held here, so you tell me what happens if we execute:
>
>> + /* check txdesc */
>> + txfree_num = sh_eth_txfree(ndev);
>> + if (txfree_num)
>
Thank you for your review.
In the sh_eth_txfree(), it check the tx descriptors. If the tx descriptor
is completed, it calls dev_kfree_skb_irq(), and it returns value 1 or more.
So, the sh_eth_poll() calls netif_wake_queue() if the dev_kfree_skb_irq() is
called.
> and at this exact moment the queue was in fact already awake and
> another thread of control transmits packets, and this action fills up
> the TX queue and stops the queue.
>
>> netif_wake_queue(ndev);
>
> This will erroneously wake the queue and trigger the debugging
> message in your TX function.
>
> You need strict synchronization between your TX queueing and TX
> liberation flows. So that queue stop and wake are only performed
> at the correct moment.
I will add netif_queue_stopped() in the sh_eth_poll().
> In fact, looking at how the mdp->lock is used in your TX routine, it
> seems to protect absolutely against nothing.
I wlll remove the mdp->lock in the sh_eth_start_xmit().
> Please read the TX flow of drivers/net/ethernet/broadcom/tg3.c to see
> how to do this correctly, and lock free, in a NAPI driver.
>
Thank you for your suggestion.
I will add netif_tx_lock/unlock before and after netif_wake_queue().
Best regards,
Yoshihiro Shimoda
^ permalink raw reply
* Re: [PATCH v3 6/6] net: sh_eth: use NAPI
From: David Miller @ 2012-05-15 5:07 UTC (permalink / raw)
To: yoshihiro.shimoda.uh; +Cc: netdev, linux-sh
In-Reply-To: <4FB1DFF0.4040709@renesas.com>
From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
Date: Tue, 15 May 2012 13:47:44 +0900
> 2012/05/15 7:50, David Miller wrote:
>> You need strict synchronization between your TX queueing and TX
>> liberation flows. So that queue stop and wake are only performed
>> at the correct moment.
>
> I will add netif_queue_stopped() in the sh_eth_poll().
That doesn't fix the bug. What if someone transmits a packet and
fills the TX queue between the netif_queue_stopped() test and the
call to netif_wake_queue()?
Adding another test doesn't create the necessary synchronization.
^ permalink raw reply
* Re: [net-next 06/12] ixgbe: Hardware Timestamping + PTP Hardware Clock (PHC)
From: Richard Cochran @ 2012-05-15 5:32 UTC (permalink / raw)
To: Jacob Keller
Cc: Kirsher, Jeffrey T, davem@davemloft.net, netdev@vger.kernel.org,
gospo@redhat.com, sassmann@redhat.com
In-Reply-To: <4FB18A3B.8030308@intel.com>
On Mon, May 14, 2012 at 03:42:03PM -0700, Jacob Keller wrote:
>
> sk_run_filter is always returning PTP_CLASS_NONE (0), instead of the
> correct type. Do you know what I am doing wrong? I can send you the
> patch I am working with...
The filter need to run with a pointer to the DST MAC. Perhaps you are
passing it the address of padding or Layer 3?
I will take a look at the patch...
Thanks,
Richard
^ permalink raw reply
* Re: [PATCH net-next 1/8] net/mlx4: Address build warnings on set but not used variables
From: Or Gerlitz @ 2012-05-15 5:52 UTC (permalink / raw)
To: David Miller; +Cc: roland, netdev
In-Reply-To: <20120515.000754.1011080018257342361.davem@davemloft.net>
On 5/15/2012 7:07 AM, David Miller wrote:
>
>> - err = mlx4_qp_detach_common(dev,&qp, rgid->gid, rgid->prot,
>> + (void) mlx4_qp_detach_common(dev,&qp, rgid->gid, rgid->prot,
>> rgid->steer);
>
> You must update the indentation of all the lines comprising of the function call when you change the indentation of it's initial line.
Just want to make sure I understood right what has to be done here, e.g
in this case its needs to be
like this?
> @@ -2604,13 +2604,12 @@ static void detach_qp(struct mlx4_dev *dev,
> int slave, struct res_qp *rqp)
> {
> struct res_gid *rgid;
> struct res_gid *tmp;
> - int err;
> struct mlx4_qp qp; /* dummy for calling attach/detach */
>
> list_for_each_entry_safe(rgid, tmp, &rqp->mcg_list, list) {
> qp.qpn = rqp->local_qpn;
> - err = mlx4_qp_detach_common(dev, &qp, rgid->gid,
> rgid->prot,
> - rgid->steer);
> + (void) mlx4_qp_detach_common(dev, &qp, rgid->gid,
> rgid->prot,
> + rgid->steer);
> list_del(&rgid->list);
> kfree(rgid);
> }
Or.
^ permalink raw reply
* Will You Be Trusted?
From: Mr.Saeed Ahmed. @ 2012-05-09 6:29 UTC (permalink / raw)
Dear Friend,
As you read this, I don't want you to feel sorry for me,because, I
believe everyone will die someday,and am contacting you because
I really do need your help and I want you to help me with all your
effort and time for just seven to fourteen workings days of your time.I
want you to be honest and truthful with me that you will help me
with my last wish as a dying man.
Please i need a reliable person who will usethe Money($18 milliondollars)to
build orphanage home or charity organization.
Please kindly reply to my most confidential email if you are really
interested in helping me please: mr.saeed01@linuxmail.org
God be with you.
Mr.Saeed Ahmed.
----------------------------------------------------------------
FME Webmail
www.educacao.niteroi.rj.gov.br
^ permalink raw reply
* RE: [PATCH] netfilter: xt_HMARK: endian bugs
From: Hans Schillström @ 2012-05-15 5:57 UTC (permalink / raw)
To: Eric Dumazet, Pablo Neira Ayuso
Cc: Jozsef Kadlecsik, Jan Engelhardt, kaber@trash.net,
jengelh@medozas.de, netfilter-devel@vger.kernel.org,
netdev@vger.kernel.org, dan.carpenter@oracle.com,
hans@schillstrom.com
In-Reply-To: <1337022835.8512.610.camel@edumazet-glaptop>
>On Mon, 2012-05-14 at 21:02 +0200, Pablo Neira Ayuso wrote:
>
>> IIRC, Hans wants that, in case you have a cluster composed of system
>> with different endianess, the hash mark calculated will be the same
>> in both systems. To ensure that the distribution is consistent with
>> independency of the endianess.
>
>Then jhash() must be audited to make sure its output is OK with this
>requirement.
Have done that, and made tests on a mips 32 running debian
It was as expected jhash3_words is endian safe, while jhash() is not
^ permalink raw reply
* Re: [PATCH net-next 1/8] net/mlx4: Address build warnings on set but not used variables
From: David Miller @ 2012-05-15 5:59 UTC (permalink / raw)
To: ogerlitz; +Cc: roland, netdev
In-Reply-To: <4FB1EF06.6070909@mellanox.com>
From: Or Gerlitz <ogerlitz@mellanox.com>
Date: Tue, 15 May 2012 08:52:06 +0300
> On 5/15/2012 7:07 AM, David Miller wrote:
>>
>>> - err = mlx4_qp_detach_common(dev,&qp, rgid->gid, rgid->prot,
>>> + (void) mlx4_qp_detach_common(dev,&qp, rgid->gid, rgid->prot,
>>> rgid->steer);
>>
>> You must update the indentation of all the lines comprising of the
>> function call when you change the indentation of it's initial line.
>
> Just want to make sure I understood right what has to be done here,
> e.g in this case its needs to be
> like this?
...
>> - rgid->steer);
>> + (void) mlx4_qp_detach_common(dev, &qp, rgid->gid, rgid->prot,
>> + rgid->steer);
I can't tell if it's right, becuase it got all reformatted by your
mail client.
You simply need to make sure the arguments on the second and
further lines line up with the column after the openning
parenthesis on the first line.
^ permalink raw reply
* Re: [PATCH net-next 1/8] net/mlx4: Address build warnings on set but not used variables
From: Or Gerlitz @ 2012-05-15 6:16 UTC (permalink / raw)
To: David Miller; +Cc: roland, netdev
In-Reply-To: <20120515.015916.1228365475475285173.davem@davemloft.net>
On 5/15/2012 8:59 AM, David Miller wrote:
> I can't tell if it's right, becuase it got all reformatted by your
> mail client. You simply need to make sure the arguments on the second
> and further lines line up with the column after the openning
> parenthesis on the first line.
Oh I see you point now, indeed, there were two cases in this patch where
I replaced "err = " which spans six chars with "(void) " which spans
seven, so what I needs to be done here is to add a tab in the 2nd, etc
lines or a space? BTW there are such changes only in this patch (1/8).
Or.
^ permalink raw reply
* Re: [patch] Re: qlge driver corrupting kernel memory
From: Mike Galbraith @ 2012-05-15 6:19 UTC (permalink / raw)
To: Thadeu Lima de Souza Cascardo; +Cc: netdev, Jitendra Kalsaria
In-Reply-To: <1337009597.17437.1.camel@marge.simpson.net>
On Mon, 2012-05-14 at 17:33 +0200, Mike Galbraith wrote:
> (add CC)
>
> On Sun, 2012-05-13 at 12:16 +0200, Mike Galbraith wrote:
> > Erm, with a quilt refresh you get the compiling version :)
> >
> > glge: Fix double pci_free_consistent() upon tx_ring->q allocation failure
> >
> > Let ql_free_tx_resources() do it's job. You are not helping.
> >
> > Signed-off-by: Mike Galbraith <mgalbraith@suse.de>
> > ---
> > drivers/net/qlge/qlge_main.c | 10 +++-------
> > 1 file changed, 3 insertions(+), 7 deletions(-)
> >
> > --- a/drivers/net/qlge/qlge_main.c
> > +++ b/drivers/net/qlge/qlge_main.c
Sigh, never mind, this is patch from the wrong tree. Maintainer will
fix buglet his way.
-Mike
^ permalink raw reply
* [PATCH net-next V1 1/8] net/mlx4: Address build warnings on set but not used variables
From: Or Gerlitz @ 2012-05-15 7:24 UTC (permalink / raw)
To: davem; +Cc: roland, netdev, yevgenyp, Or Gerlitz
In-Reply-To: <1337066690-2248-1-git-send-email-ogerlitz@mellanox.com>
Handle the compiler warnings on variables which are set but not used
by removing the relevant variable or casting a return value which is
ignored on purpose to void.
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
---
drivers/net/ethernet/mellanox/mlx4/cmd.c | 5 +----
drivers/net/ethernet/mellanox/mlx4/mcg.c | 2 --
drivers/net/ethernet/mellanox/mlx4/mr.c | 3 ---
drivers/net/ethernet/mellanox/mlx4/port.c | 7 +++----
.../net/ethernet/mellanox/mlx4/resource_tracker.c | 9 ++++-----
5 files changed, 8 insertions(+), 18 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx4/cmd.c b/drivers/net/ethernet/mellanox/mlx4/cmd.c
index 773c70e..53b738b 100644
--- a/drivers/net/ethernet/mellanox/mlx4/cmd.c
+++ b/drivers/net/ethernet/mellanox/mlx4/cmd.c
@@ -1254,7 +1254,6 @@ static void mlx4_master_do_cmd(struct mlx4_dev *dev, int slave, u8 cmd,
struct mlx4_priv *priv = mlx4_priv(dev);
struct mlx4_slave_state *slave_state = priv->mfunc.master.slave_state;
u32 reply;
- u32 slave_status = 0;
u8 is_going_down = 0;
int i;
@@ -1274,10 +1273,8 @@ static void mlx4_master_do_cmd(struct mlx4_dev *dev, int slave, u8 cmd,
}
/*check if we are in the middle of FLR process,
if so return "retry" status to the slave*/
- if (MLX4_COMM_CMD_FLR == slave_state[slave].last_cmd) {
- slave_status = MLX4_DELAY_RESET_SLAVE;
+ if (MLX4_COMM_CMD_FLR == slave_state[slave].last_cmd)
goto inform_slave_state;
- }
/* write the version in the event field */
reply |= mlx4_comm_get_version();
diff --git a/drivers/net/ethernet/mellanox/mlx4/mcg.c b/drivers/net/ethernet/mellanox/mlx4/mcg.c
index 4799e82..f4a8f98 100644
--- a/drivers/net/ethernet/mellanox/mlx4/mcg.c
+++ b/drivers/net/ethernet/mellanox/mlx4/mcg.c
@@ -357,7 +357,6 @@ static int add_promisc_qp(struct mlx4_dev *dev, u8 port,
u32 prot;
int i;
bool found;
- int last_index;
int err;
struct mlx4_priv *priv = mlx4_priv(dev);
@@ -419,7 +418,6 @@ static int add_promisc_qp(struct mlx4_dev *dev, u8 port,
if (err)
goto out_mailbox;
}
- last_index = entry->index;
}
/* add the new qpn to list of promisc qps */
diff --git a/drivers/net/ethernet/mellanox/mlx4/mr.c b/drivers/net/ethernet/mellanox/mlx4/mr.c
index fe2ac84..cefa76f 100644
--- a/drivers/net/ethernet/mellanox/mlx4/mr.c
+++ b/drivers/net/ethernet/mellanox/mlx4/mr.c
@@ -788,7 +788,6 @@ int mlx4_fmr_alloc(struct mlx4_dev *dev, u32 pd, u32 access, int max_pages,
int max_maps, u8 page_shift, struct mlx4_fmr *fmr)
{
struct mlx4_priv *priv = mlx4_priv(dev);
- u64 mtt_offset;
int err = -ENOMEM;
if (max_maps > dev->caps.max_fmr_maps)
@@ -811,8 +810,6 @@ int mlx4_fmr_alloc(struct mlx4_dev *dev, u32 pd, u32 access, int max_pages,
if (err)
return err;
- mtt_offset = fmr->mr.mtt.offset * dev->caps.mtt_entry_sz;
-
fmr->mtts = mlx4_table_find(&priv->mr_table.mtt_table,
fmr->mr.mtt.offset,
&fmr->dma_handle);
diff --git a/drivers/net/ethernet/mellanox/mlx4/port.c b/drivers/net/ethernet/mellanox/mlx4/port.c
index 55b12e6..1c59792 100644
--- a/drivers/net/ethernet/mellanox/mlx4/port.c
+++ b/drivers/net/ethernet/mellanox/mlx4/port.c
@@ -338,13 +338,12 @@ EXPORT_SYMBOL_GPL(__mlx4_unregister_mac);
void mlx4_unregister_mac(struct mlx4_dev *dev, u8 port, u64 mac)
{
u64 out_param;
- int err;
if (mlx4_is_mfunc(dev)) {
set_param_l(&out_param, port);
- err = mlx4_cmd_imm(dev, mac, &out_param, RES_MAC,
- RES_OP_RESERVE_AND_MAP, MLX4_CMD_FREE_RES,
- MLX4_CMD_TIME_CLASS_A, MLX4_CMD_WRAPPED);
+ (void) mlx4_cmd_imm(dev, mac, &out_param, RES_MAC,
+ RES_OP_RESERVE_AND_MAP, MLX4_CMD_FREE_RES,
+ MLX4_CMD_TIME_CLASS_A, MLX4_CMD_WRAPPED);
return;
}
__mlx4_unregister_mac(dev, port, mac);
diff --git a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
index 8752e6e..215c165 100644
--- a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
+++ b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
@@ -2536,7 +2536,7 @@ int mlx4_QP_ATTACH_wrapper(struct mlx4_dev *dev, int slave,
struct mlx4_qp qp; /* dummy for calling attach/detach */
u8 *gid = inbox->buf;
enum mlx4_protocol prot = (vhcr->in_modifier >> 28) & 0x7;
- int err, err1;
+ int err;
int qpn;
struct res_qp *rqp;
int attach = vhcr->op_modifier;
@@ -2571,7 +2571,7 @@ int mlx4_QP_ATTACH_wrapper(struct mlx4_dev *dev, int slave,
ex_rem:
/* ignore error return below, already in error */
- err1 = rem_mcg_res(dev, slave, rqp, gid, prot, type);
+ (void) rem_mcg_res(dev, slave, rqp, gid, prot, type);
ex_put:
put_res(dev, slave, qpn, RES_QP);
@@ -2604,13 +2604,12 @@ static void detach_qp(struct mlx4_dev *dev, int slave, struct res_qp *rqp)
{
struct res_gid *rgid;
struct res_gid *tmp;
- int err;
struct mlx4_qp qp; /* dummy for calling attach/detach */
list_for_each_entry_safe(rgid, tmp, &rqp->mcg_list, list) {
qp.qpn = rqp->local_qpn;
- err = mlx4_qp_detach_common(dev, &qp, rgid->gid, rgid->prot,
- rgid->steer);
+ (void) mlx4_qp_detach_common(dev, &qp, rgid->gid, rgid->prot,
+ rgid->steer);
list_del(&rgid->list);
kfree(rgid);
}
--
1.7.1
^ permalink raw reply related
* [PATCH net-next V1 4/8] net/mlx4_core: Remove unused *_str functions from the resource tracker
From: Or Gerlitz @ 2012-05-15 7:24 UTC (permalink / raw)
To: davem; +Cc: roland, netdev, yevgenyp, Jack Morgenstein, Or Gerlitz
In-Reply-To: <1337066690-2248-1-git-send-email-ogerlitz@mellanox.com>
From: Jack Morgenstein <jackm@dev.mellanox.co.il>
Removed unsued *_str helper functions from resource_tracker.c
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
---
.../net/ethernet/mellanox/mlx4/resource_tracker.c | 30 --------------------
1 files changed, 0 insertions(+), 30 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
index 215c165..2cb3a10 100644
--- a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
+++ b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
@@ -89,17 +89,6 @@ enum res_qp_states {
RES_QP_HW
};
-static inline const char *qp_states_str(enum res_qp_states state)
-{
- switch (state) {
- case RES_QP_BUSY: return "RES_QP_BUSY";
- case RES_QP_RESERVED: return "RES_QP_RESERVED";
- case RES_QP_MAPPED: return "RES_QP_MAPPED";
- case RES_QP_HW: return "RES_QP_HW";
- default: return "Unknown";
- }
-}
-
struct res_qp {
struct res_common com;
struct res_mtt *mtt;
@@ -173,16 +162,6 @@ enum res_srq_states {
RES_SRQ_HW,
};
-static inline const char *srq_states_str(enum res_srq_states state)
-{
- switch (state) {
- case RES_SRQ_BUSY: return "RES_SRQ_BUSY";
- case RES_SRQ_ALLOCATED: return "RES_SRQ_ALLOCATED";
- case RES_SRQ_HW: return "RES_SRQ_HW";
- default: return "Unknown";
- }
-}
-
struct res_srq {
struct res_common com;
struct res_mtt *mtt;
@@ -195,15 +174,6 @@ enum res_counter_states {
RES_COUNTER_ALLOCATED,
};
-static inline const char *counter_states_str(enum res_counter_states state)
-{
- switch (state) {
- case RES_COUNTER_BUSY: return "RES_COUNTER_BUSY";
- case RES_COUNTER_ALLOCATED: return "RES_COUNTER_ALLOCATED";
- default: return "Unknown";
- }
-}
-
struct res_counter {
struct res_common com;
int port;
--
1.7.1
^ permalink raw reply related
* [PATCH net-next V1 2/8] net/mlx4_core: Fix init_port mask state for slaves
From: Or Gerlitz @ 2012-05-15 7:24 UTC (permalink / raw)
To: davem; +Cc: roland, netdev, yevgenyp, Jack Morgenstein, Or Gerlitz
In-Reply-To: <1337066690-2248-1-git-send-email-ogerlitz@mellanox.com>
From: Jack Morgenstein <jackm@dev.mellanox.co.il>
In function mlx4_INIT_PORT_wrapper, the port state mask for the
slave is only set if we are invoking the INIT_PORT fw command.
However, the reference count for the (initialized) port is
incremented anyway.
This creates a problem in that when we have multiple slaves,
then the CLOSE_PORT command will never be invoked. The
reason is that in the CLOSE_PORT wrapper, if the port-state
mask is zero for the slave (which it is), the wrapper returns
without doing anything. The only slave which will not return
immediately in the CLOSE_PORT wrapper is that slave for which
INIT_PORT was invoked.
The fix is to not have the port-state mask setting depend
on the logic for calling the INIT_PORT fw command.
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
---
drivers/net/ethernet/mellanox/mlx4/fw.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx4/fw.c b/drivers/net/ethernet/mellanox/mlx4/fw.c
index 2a02ba5..24429a9 100644
--- a/drivers/net/ethernet/mellanox/mlx4/fw.c
+++ b/drivers/net/ethernet/mellanox/mlx4/fw.c
@@ -1164,9 +1164,8 @@ int mlx4_INIT_PORT_wrapper(struct mlx4_dev *dev, int slave,
MLX4_CMD_TIME_CLASS_A, MLX4_CMD_NATIVE);
if (err)
return err;
- priv->mfunc.master.slave_state[slave].init_port_mask |=
- (1 << port);
}
+ priv->mfunc.master.slave_state[slave].init_port_mask |= (1 << port);
++priv->mfunc.master.init_port_ref[port];
return 0;
}
--
1.7.1
^ permalink raw reply related
* [PATCH net-next V1 6/8] net/mlx4_core: Fix potential kernel Oops in res tracker during Dom0 driver unload
From: Or Gerlitz @ 2012-05-15 7:24 UTC (permalink / raw)
To: davem; +Cc: roland, netdev, yevgenyp, Jack Morgenstein, Or Gerlitz
In-Reply-To: <1337066690-2248-1-git-send-email-ogerlitz@mellanox.com>
From: Jack Morgenstein <jackm@dev.mellanox.co.il>
Currently the slave and master resources are deleted after master freed
all bitmaps. If any resources were not properly cleaned up during the
shutdown process, an Oops would result.
Fix so that delete slave (only) resources during cleanup. Master resources
are cleaned up during unload process, and need not separately be cleaned.
Note that during cleanup, we need to split the resource-tracker freeing
functionality.
Before removing all the bitmaps, we free any leftover slave resources.
However, we can only remove the resource tracker linked list after
all bitmap frees, since some of the freeing functions (e.g.,
mlx4_cleanup_eq_table) use paravirtualized FW commands which expect
the resource tracker linked list to be present.
Found-by: Aviad Yehezkel <aviadye@mellanox.com>
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
---
drivers/net/ethernet/mellanox/mlx4/cmd.c | 2 +-
drivers/net/ethernet/mellanox/mlx4/main.c | 7 ++++++-
drivers/net/ethernet/mellanox/mlx4/mlx4.h | 8 +++++++-
.../net/ethernet/mellanox/mlx4/resource_tracker.c | 17 ++++++++++++-----
4 files changed, 26 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx4/cmd.c b/drivers/net/ethernet/mellanox/mlx4/cmd.c
index 53b738b..1bcead1 100644
--- a/drivers/net/ethernet/mellanox/mlx4/cmd.c
+++ b/drivers/net/ethernet/mellanox/mlx4/cmd.c
@@ -1554,7 +1554,7 @@ int mlx4_multi_func_init(struct mlx4_dev *dev)
return 0;
err_resource:
- mlx4_free_resource_tracker(dev);
+ mlx4_free_resource_tracker(dev, RES_TR_FREE_ALL);
err_thread:
flush_workqueue(priv->mfunc.master.comm_wq);
destroy_workqueue(priv->mfunc.master.comm_wq);
diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c
index 8eed1f2..2e94f76 100644
--- a/drivers/net/ethernet/mellanox/mlx4/main.c
+++ b/drivers/net/ethernet/mellanox/mlx4/main.c
@@ -2069,6 +2069,10 @@ static void mlx4_remove_one(struct pci_dev *pdev)
mlx4_CLOSE_PORT(dev, p);
}
+ if (mlx4_is_master(dev))
+ mlx4_free_resource_tracker(dev,
+ RES_TR_FREE_SLAVES_ONLY);
+
mlx4_cleanup_counters_table(dev);
mlx4_cleanup_mcg_table(dev);
mlx4_cleanup_qp_table(dev);
@@ -2081,7 +2085,8 @@ static void mlx4_remove_one(struct pci_dev *pdev)
mlx4_cleanup_pd_table(dev);
if (mlx4_is_master(dev))
- mlx4_free_resource_tracker(dev);
+ mlx4_free_resource_tracker(dev,
+ RES_TR_FREE_STRUCTS_ONLY);
iounmap(priv->kar);
mlx4_uar_free(dev, &priv->driver_uar);
diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4.h b/drivers/net/ethernet/mellanox/mlx4/mlx4.h
index cd56f1a..8767fbf 100644
--- a/drivers/net/ethernet/mellanox/mlx4/mlx4.h
+++ b/drivers/net/ethernet/mellanox/mlx4/mlx4.h
@@ -146,6 +146,11 @@ enum mlx4_alloc_mode {
RES_OP_MAP_ICM,
};
+enum mlx4_res_tracker_free_type {
+ RES_TR_FREE_ALL,
+ RES_TR_FREE_SLAVES_ONLY,
+ RES_TR_FREE_STRUCTS_ONLY,
+};
/*
*Virtual HCR structures.
@@ -1027,7 +1032,8 @@ int mlx4_get_slave_from_resource_id(struct mlx4_dev *dev,
void mlx4_delete_all_resources_for_slave(struct mlx4_dev *dev, int slave_id);
int mlx4_init_resource_tracker(struct mlx4_dev *dev);
-void mlx4_free_resource_tracker(struct mlx4_dev *dev);
+void mlx4_free_resource_tracker(struct mlx4_dev *dev,
+ enum mlx4_res_tracker_free_type type);
int mlx4_SET_PORT_wrapper(struct mlx4_dev *dev, int slave,
struct mlx4_vhcr *vhcr,
diff --git a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
index 2cb3a10..868cadd 100644
--- a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
+++ b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
@@ -224,16 +224,23 @@ int mlx4_init_resource_tracker(struct mlx4_dev *dev)
return 0 ;
}
-void mlx4_free_resource_tracker(struct mlx4_dev *dev)
+void mlx4_free_resource_tracker(struct mlx4_dev *dev,
+ enum mlx4_res_tracker_free_type type)
{
struct mlx4_priv *priv = mlx4_priv(dev);
int i;
if (priv->mfunc.master.res_tracker.slave_list) {
- for (i = 0 ; i < dev->num_slaves; i++)
- mlx4_delete_all_resources_for_slave(dev, i);
-
- kfree(priv->mfunc.master.res_tracker.slave_list);
+ if (type != RES_TR_FREE_STRUCTS_ONLY)
+ for (i = 0 ; i < dev->num_slaves; i++)
+ if (type == RES_TR_FREE_ALL ||
+ dev->caps.function != i)
+ mlx4_delete_all_resources_for_slave(dev, i);
+
+ if (type != RES_TR_FREE_SLAVES_ONLY) {
+ kfree(priv->mfunc.master.res_tracker.slave_list);
+ priv->mfunc.master.res_tracker.slave_list = NULL;
+ }
}
}
--
1.7.1
^ permalink raw reply related
* [PATCH net-next V1 8/8] net/mlx4_core: Fixed error flow in rem_slave_eqs
From: Or Gerlitz @ 2012-05-15 7:24 UTC (permalink / raw)
To: davem; +Cc: roland, netdev, yevgenyp, Jack Morgenstein, Or Gerlitz
In-Reply-To: <1337066690-2248-1-git-send-email-ogerlitz@mellanox.com>
From: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
---
.../net/ethernet/mellanox/mlx4/resource_tracker.c | 13 ++++++-------
1 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
index 6fc810e..c0291c0 100644
--- a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
+++ b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
@@ -3152,14 +3152,13 @@ static void rem_slave_eqs(struct mlx4_dev *dev, int slave)
MLX4_CMD_HW2SW_EQ,
MLX4_CMD_TIME_CLASS_A,
MLX4_CMD_NATIVE);
- mlx4_dbg(dev, "rem_slave_eqs: failed"
- " to move slave %d eqs %d to"
- " SW ownership\n", slave, eqn);
+ if (err)
+ mlx4_dbg(dev, "rem_slave_eqs: failed"
+ " to move slave %d eqs %d to"
+ " SW ownership\n", slave, eqn);
mlx4_free_cmd_mailbox(dev, mailbox);
- if (!err) {
- atomic_dec(&eq->mtt->ref_count);
- state = RES_EQ_RESERVED;
- }
+ atomic_dec(&eq->mtt->ref_count);
+ state = RES_EQ_RESERVED;
break;
default:
--
1.7.1
^ permalink raw reply related
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