* Re: [PATCH] com20020-pci: add support for eae single card
From: David Miller @ 2015-02-15 16:22 UTC (permalink / raw)
To: m.grzeschik; +Cc: netdev, linux-kernel, kernel
In-Reply-To: <1423829030-20682-1-git-send-email-m.grzeschik@pengutronix.de>
From: Michael Grzeschik <m.grzeschik@pengutronix.de>
Date: Fri, 13 Feb 2015 13:03:50 +0100
> Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH net] vhost_net: fix wrong iter offset when setting number of buffers
From: David Miller @ 2015-02-15 16:17 UTC (permalink / raw)
To: jasowang; +Cc: kvm, mst, netdev, linux-kernel, virtualization, viro
In-Reply-To: <1423989317-16038-1-git-send-email-jasowang@redhat.com>
From: Jason Wang <jasowang@redhat.com>
Date: Sun, 15 Feb 2015 16:35:17 +0800
> In commit ba7438aed924 ("vhost: don't bother copying iovecs in
> handle_rx(), kill memcpy_toiovecend()"), we advance iov iter fixup
> sizeof(struct virtio_net_hdr) bytes and fill the number of buffers
> after doing the socket recvmsg(). This work well but was broken after
> commit 6e03f896b52c ("Merge
> git://git.kernel.org/pub/scm/linux/kernel/git/davem/net") which tries
> to advance sizeof(struct virtio_net_hdr_mrg_rxbuf). It will fill the
> number of buffers at the wrong place. This patch fixes this.
>
> Fixes 6e03f896b52c
> ("Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net")
> Cc: David S. Miller <davem@davemloft.net>
> Cc: Al Viro <viro@zeniv.linux.org.uk>
> Cc: Michael S. Tsirkin <mst@redhat.com>
> Signed-off-by: Jason Wang <jasowang@redhat.com>
I was wondering if I got that merge conflict right. :-/
Applied, thanks Jason.
^ permalink raw reply
* Re: [RFC net-next 3/4] openvswitch: Add conntrack action.
From: Nicolas Dichtel @ 2015-02-15 15:08 UTC (permalink / raw)
To: Joe Stringer, Thomas Graf
Cc: Linux Netdev List, Justin Pettit, Pablo Neira Ayuso,
dev@openvswitch.org
In-Reply-To: <CANr6G5x19zc8qK0gtPBFzMD02xMxieFqGpv9-nkKyiZ1MzSUwA@mail.gmail.com>
Le 15/02/2015 05:47, Joe Stringer a écrit :
> On 14 February 2015 at 11:56, Thomas Graf <tgraf@suug.ch> wrote:
>> On 02/14/15 at 12:13am, Joe Stringer wrote:
>>
>> [..]
>>
>>> +static bool skb_has_valid_nfct(const struct net *net, u16 zone,
>>> + const struct sk_buff *skb)
>>> +{
>>> + enum ip_conntrack_info ctinfo;
>>> + struct nf_conn *ct = nf_ct_get(skb, &ctinfo);
>>> +
>>> + if (!ct)
>>> + return false;
>>> + if (!net_eq(net, ct->ct_net))
>>> + return false;
>>
>> I'm surprised that this is needed. Shouldn't we call skb_scrub_packet()
>> between namespaces and invalidate the ct associated with the skb.
>
> Right, it was more of a general sanity check which is likely unneeded.
> I'm not aware of any particular case that this handles.
I agree with Thomas. If we fall into this case, it's probably a real bug ;-)
^ permalink raw reply
* Re: [PATCH v3] brcmfmac: avoid duplicated suspend/resume operation
From: Kalle Valo @ 2015-02-15 14:54 UTC (permalink / raw)
To: Arend van Spriel
Cc: Pat Erley, Fu, Zhonghui, brudley, Franky Lin, meuleman, linville,
pieterpg, hdegoede, wens, linux-wireless, brcm80211-dev-list,
netdev, linux-kernel@vger.kernel.org
In-Reply-To: <54E05961.7000201@broadcom.com>
Arend van Spriel <arend@broadcom.com> writes:
> On 02/15/15 04:27, Pat Erley wrote:
>> On 02/14/2015 08:40 PM, Fu, Zhonghui wrote:
>>>
>>> Any comments to this patch? Can it be accepted?
>
> I assume that patches are queued up until after the merge window that
> we are currently in.
That's right. In the future I will most likely apply patches also during
the merge window, but as I'm still a greenhorn I'll be on the safe and
wait for the merge window to end.
--
Kalle Valo
^ permalink raw reply
* Re: [PATCH next v3 2/6] bonding: implement bond_poll_controller()
From: Jay Vosburgh @ 2015-02-15 14:51 UTC (permalink / raw)
To: Mahesh Bandewar
Cc: Andy Gospodarek, Veaceslav Falico, Nikolay Aleksandrov,
David Miller, Maciej Zenczykowski, netdev, Eric Dumazet
In-Reply-To: <CAF2d9jgXqRM7CtLVyCuKSt3gi-2_uixDUQbDkAoEVTbUKJpGTw@mail.gmail.com>
Mahesh Bandewar <maheshb@google.com> wrote:
>On Thu, Feb 12, 2015 at 1:45 PM, Jay Vosburgh <jay.vosburgh@canonical.com>
>wrote:
[...]
> >+ if (BOND_MODE(bond) == BOND_MODE_8023AD)
> >+ if (bond_3ad_get_active_agg_info(bond, &ad_info))
> >+ return;
> >+
> >+ bond_for_each_slave(bond, slave, iter) {
> >+ ops = slave->dev->netdev_ops;
> >+ if (!bond_slave_is_up(slave) || !ops->ndo_poll_controller)
> >+ continue;
> >+
> >+ if (BOND_MODE(bond) == BOND_MODE_8023AD) {
> >+ struct aggregator *agg =
> >+ SLAVE_AD_INFO(slave)->port.aggregator;
> >+
> >+ if (agg && agg->aggregator_identifier !=
> >+ ad_info.aggregator_id)
> >+ continue;
> >+ if (!bond_3ad_port_is_active(slave) || ad_info.ports != 1)
> >+ continue;
>
>
> The above will exclude slaves that are in an aggregator with
> more than one member, which is likely to be the usual case. Is that
> intentional?
>
>
>
>The idea is to use all the ports in the aggregator. In a situation where
>there is only one port but is not active, then *only* use it. So from that
>perspective this logic needs '&&' instead of '||'.
If you want to use any port from the active aggregator, then I
think logic to first find the active agg, then cycle through its ports
would be better. This would also eliminate the concern from your other
reply regarding the following:
> >+static int bond_3ad_port_operational(struct slave *slave)
> >+{
> >+ port_t *port = &SLAVE_AD_INFO(slave)->port;
> >+
> >+ return bond_slave_can_tx(slave) &&
> >+ (port->actor_oper_port_state & port->partner_oper.port_state &
> >+ BOND_3AD_PORT_OPERATIONAL) == BOND_3AD_PORT_OPERATIONAL;
> >+}
needing to test the port_state; if the logic cycles through the
ports of the active aggregator, then it shouldn't need to check the
state. Any port in the active aggregator should be able to transmit,
even if it is in the "no LACP peer" fallback situation (with one
exception, noted below).
I think something like:
first_slave = bond_first_slave_rcu(bond);
agg = __get_active_agg(&(SLAVE_AD_INFO(first_slave)->aggregator));
for (port = agg->lag_ports; port;
port = port->next_port_in_aggregator) {
if (bond_slave_can_tx(port->slave))
/* use this one */
}
would do roughly what you're describing, although it will always
choose the first available port of the active aggregator, even if there
are more than one.
Generally, slaves that are not up will not remain in the active
aggregator, but the slave_can_tx test will cover the window between when
a slave goes carrier down and the 3ad logic removes it from the active
agg.
-J
---
-Jay Vosburgh, jay.vosburgh@canonical.com
^ permalink raw reply
* Re: [PATCH net-next] tcp: do not pace pure ack packets
From: Eric Dumazet @ 2015-02-15 14:25 UTC (permalink / raw)
To: Or Gerlitz; +Cc: David Miller, netdev, Kenneth Klette Jonassen, john fastabend
In-Reply-To: <CAJ3xEMiB-qGF0C9tPEQHA5gqAF9JyMeOeSuUprb9N7HtVgRh1g@mail.gmail.com>
On Sat, 2015-02-14 at 22:45 +0200, Or Gerlitz wrote:
> Wow, so what is the black box impact on systems running without the
> fix, pacing works but also un-needed slow downs
> are introduced, right?
>
> Sounds to me as something we really want to push into -stable, isn't that?
>
> Do you think we need to let the patch rot for a while in 3.20-rc or we
> can do it right away?
No impact at all. black box are forwarding packets, they are not pacing
them at all.
fq/pacing paces locally generated traffic only.
This works the following way :
TCP sets sk->sk_pacing_rate = 2 * cwnd * mss / srtt
fq then paces packets that are attached to a (local) socket, and where
sk->sk_pacing_rate is different than default value ( ~0U )
The only case a middle box could pace is when/if the optional
'maxrate xxx' parameter is given to fq packet scheduler, and in this
case the intent is to have a max rate, including ACK packets.
I really do not think this patch is a stable candidate.
Thanks
^ permalink raw reply
* Buisness Proposal For you Contact: mao_chan15@outlook.com
From: William Parker @ 2015-02-15 10:31 UTC (permalink / raw)
*********CSIR-NGRI ****** Disclaimer ****** CSIR-NGRI ************
This email, together with any files or attachments transmitted
with it, is intended solely for the addressee. If you are not the
intended recipient, please delete the email and notify the sender
/originator immediately. Please note that any unauthorized copying,
disclosure or other processing of this information may be unlawful.
Unless otherwise stated, any opinions expressed in this email are
those of the originator and not necessarily of CSIR-NGRI.
****** CSIR-NGRI ***** End of Disclaimer ***** CSIR-NGRI **********
^ permalink raw reply
* Re: [PATCH net-next 4/4] be2net: Add a few inline functions to test TXQ conditions
From: Sergei Shtylyov @ 2015-02-15 12:37 UTC (permalink / raw)
To: Sriharsha Basavapatna, netdev
In-Reply-To: <1423986327-10069-5-git-send-email-sriharsha.basavapatna@emulex.com>
Hello.
On 2/15/2015 10:45 AM, Sriharsha Basavapatna wrote:
> - Check qfull condition
> - Check qwake condition
> - Check pkts pending completion
> Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna@emulex.com>
> ---
> drivers/net/ethernet/emulex/benet/be_main.c | 23 +++++++++++++++++++----
> 1 file changed, 19 insertions(+), 4 deletions(-)
> diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
> index b37b099..028b093 100644
> --- a/drivers/net/ethernet/emulex/benet/be_main.c
> +++ b/drivers/net/ethernet/emulex/benet/be_main.c
> @@ -728,6 +728,22 @@ static u16 skb_ip_proto(struct sk_buff *skb)
> ip_hdr(skb)->protocol : ipv6_hdr(skb)->nexthdr;
> }
>
> +static inline bool be_is_txq_full(struct be_tx_obj *txo)
> +{
> + return ((atomic_read(&txo->q.used) + BE_MAX_TX_FRAG_COUNT) >=
> + txo->q.len);
> +}
> +
> +static inline bool be_can_txq_wake(struct be_tx_obj *txo)
> +{
> + return (atomic_read(&txo->q.used) < txo->q.len / 2);
> +}
> +
> +static inline bool be_is_tx_compl_pending(struct be_tx_obj *txo)
> +{
> + return (atomic_read(&txo->q.used) > txo->pend_wrb_cnt);
> +}
> +
Parens not needed around the *return* expressions.
[...]
WBR, Sergei
^ permalink raw reply
* Re: vnet problem (bug? feature?)
From: Toerless Eckert @ 2015-02-15 10:12 UTC (permalink / raw)
To: Bill Fink; +Cc: Cong Wang, netdev
In-Reply-To: <20150214131744.051b90fc8dfdbf4e1bfe6bfb@mindspring.com>
Thanks, Bill.
Unfortunately, that kernel var didn't do the trick. I had tried to reverse
the direction in before too, so if the namespace was doing RPF check and accepting
from only one interfce, than one direction should have worked.
Cheers
Toerless
On Sat, Feb 14, 2015 at 01:17:44PM -0500, Bill Fink wrote:
> On Sat, 14 Feb 2015, Toerless Eckert wrote:
>
> > Thanks for replying, Cong.
> >
> > On Fri, Feb 13, 2015 at 03:48:14PM -0800, Cong Wang wrote:
> > > > - Created vnet pair
> > > > - NOT putting them into different namespaces.
> > > > - Unicast across them works fine.
> > > > - When sending IP multicsast into one end, i can not receive it on the other side
> > > > (with normal socket API applications).
> > >
> > > Hmm, what does your routing table look like?
> > >
> > > They are in the same namespace, so in the same stack, so their IP addresses
> > > belong to the same stack.
> >
> > Sure, but it must be possible to send/receive multicast packets to/from a specific
> > interface. For example link-local-scope multicast. Which works.
> >
> > Just repeated with a mint 17, 3.13 kernel, same result:
> >
> > ip link add name veth1 type veth peer name veth2
> > ip addr add 10.0.0.1/24 dev veth1
> > ip addr add 10.0.0.2/24 dev veth2
> > ip link set dev veth1 up
> > ip link set dev veth2 up
>
> Did you try disabling reverse path filtering:
>
> echo 0 > /proc/sys/net/ipv4/conf/veth1/rp_filter
> echo 0 > /proc/sys/net/ipv4/conf/veth2/rp_filter
>
> Both veth1 and veth2 are in the same subnet, but only one
> (presumably veth1) is the expected source for packets coming
> from net 10, so when the muticast packets from a net 10
> source arrive on veth2, they are rejected for arriving
> on the wrong interface.
>
> You could check this with "nstat -z | grep -i filter".
>
> The above is an educated guess on my part, and could
> be something completely different.
>
> -Bill
>
>
>
> > Receiver socket, eg: on veth2:
> > socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)
> > setsockopt(SO_REUSEADDR, 1)
> > bind(0.0.0.0/<port>)
> > setsockopt(IP_ADD_MEMBERSHIP, 224.0.0.33/10.0.0.2)
> >
> > check wih "netstat -gn" that there is IGMP membership on veth2:
> > veth2 1 224.0.0.33
> >
> > Sender socket, eg: on veth1:
> > socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)
> > setsockopt(SO_REUSEADDR, 1)
> > bind(10.0.0.1/7000)
> > connect(224.0.0.33/<port>)
> >
> > Sending packet, check how they're transmitted:
> > - TX countes on veth1 go up (ifconfig output)
> > - RX counters on veth2 go up (ifconfig output)
> > - tcpdump -i veth2 -P in shows packets being received
> > - tcpdump -i veth1 -P out shows packets being sent
> >
> > Played around with lots of parameters:
> > - same behavior for non-link-local-scope multicast, TTL > 1 doesn't elp.
> > - same behavior if setting "multicast, "allmulticast", "promiscuous" on the veth
> > - same behavior when setting IP_MULTICAST_LOOP on sender.
> >
> > Routing table:
> > netstat -r -n
> > Kernel IP routing table
> > Destination Gateway Genmask Flags MSS Window irtt Iface
> > 0.0.0.0 192.168.1.254 0.0.0.0 UG 0 0 0 eth1
> > 10.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0 veth1
> > 10.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0 veth2
> > 192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
> >
> > And of course it works if one side is put into a separate namespace,
> > but that doesn't help me.
> >
> > But: it really seems to be a problem with the kernel/sockets, not with veth.
> > Just replaced the veth pair with a pair of ethernets with a loopback cable and
> > pretty much exactly the same result (except that receiver side does not see
> > packets in RX unless it's promiscuous or has a real receiver socket, but that's
> > perfect). But not being a veth problem but other kernel network stack "feature"
> > doesn't make it right IMHO. I can't see by which "logic" the receiver socket
> > seemingly does not care about these packets even though it's explicitly bound
> > to the interface and the multicast group. "Gimme the darn packets, socket,
> > they are received on the interface"! ;-))
> >
> > I can play around with the receiver side socket API call details, but i really
> > don't see why those should be different if the packets happen to be looped
> > than if they're not.
> >
> > Cheers
> > Toerless
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
---
Toerless.Eckert@informatik.uni-erlangen.de
/C=de/A=d400/P=uni-erlangen/OU=informatik/S=Eckert/G=Toerless/
^ permalink raw reply
* [PATCH net] vhost_net: fix wrong iter offset when setting number of buffers
From: Jason Wang @ 2015-02-15 8:35 UTC (permalink / raw)
To: mst, kvm, virtualization, netdev, linux-kernel
Cc: Jason Wang, David S. Miller, Al Viro
In commit ba7438aed924 ("vhost: don't bother copying iovecs in
handle_rx(), kill memcpy_toiovecend()"), we advance iov iter fixup
sizeof(struct virtio_net_hdr) bytes and fill the number of buffers
after doing the socket recvmsg(). This work well but was broken after
commit 6e03f896b52c ("Merge
git://git.kernel.org/pub/scm/linux/kernel/git/davem/net") which tries
to advance sizeof(struct virtio_net_hdr_mrg_rxbuf). It will fill the
number of buffers at the wrong place. This patch fixes this.
Fixes 6e03f896b52c
("Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net")
Cc: David S. Miller <davem@davemloft.net>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
drivers/vhost/net.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
index 8dccca9..afa06d2 100644
--- a/drivers/vhost/net.c
+++ b/drivers/vhost/net.c
@@ -528,9 +528,9 @@ static void handle_rx(struct vhost_net *net)
.msg_controllen = 0,
.msg_flags = MSG_DONTWAIT,
};
- struct virtio_net_hdr_mrg_rxbuf hdr = {
- .hdr.flags = 0,
- .hdr.gso_type = VIRTIO_NET_HDR_GSO_NONE
+ struct virtio_net_hdr hdr = {
+ .flags = 0,
+ .gso_type = VIRTIO_NET_HDR_GSO_NONE
};
size_t total_len = 0;
int err, mergeable;
@@ -539,6 +539,7 @@ static void handle_rx(struct vhost_net *net)
size_t vhost_len, sock_len;
struct socket *sock;
struct iov_iter fixup;
+ __virtio16 num_buffers;
mutex_lock(&vq->mutex);
sock = vq->private_data;
@@ -616,9 +617,9 @@ static void handle_rx(struct vhost_net *net)
}
/* TODO: Should check and handle checksum. */
- hdr.num_buffers = cpu_to_vhost16(vq, headcount);
+ num_buffers = cpu_to_vhost16(vq, headcount);
if (likely(mergeable) &&
- copy_to_iter(&hdr.num_buffers, 2, &fixup) != 2) {
+ copy_to_iter(&num_buffers, 2, &fixup) != 2) {
vq_err(vq, "Failed num_buffers write");
vhost_discard_vq_desc(vq, headcount);
break;
--
1.9.1
^ permalink raw reply related
* Re: [PATCH v3] brcmfmac: avoid duplicated suspend/resume operation
From: Arend van Spriel @ 2015-02-15 8:31 UTC (permalink / raw)
To: Pat Erley
Cc: Fu, Zhonghui, Kalle Valo, brudley-dY08KVG/lbpWk0Htik3J/w,
Franky Lin, meuleman-dY08KVG/lbpWk0Htik3J/w,
linville-2XuSBdqkA4R54TAoqtyWWQ, pieterpg-dY08KVG/lbpWk0Htik3J/w,
hdegoede-H+wXaHxf7aLQT0dZR+AlfA, wens-jdAy2FN1RRM,
linux-wireless-u79uwXL29TY76Z2rM5mHXA,
brcm80211-dev-list-dY08KVG/lbpWk0Htik3J/w,
netdev-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
In-Reply-To: <54E01209.7010300-Jx9fsTfDDR3YtjvyW6yDsg@public.gmane.org>
On 02/15/15 04:27, Pat Erley wrote:
> On 02/14/2015 08:40 PM, Fu, Zhonghui wrote:
>>
>> Any comments to this patch? Can it be accepted?
I assume that patches are queued up until after the merge window that we
are currently in.
>> Thanks,
>> Zhonghui
>>
>> On 2015/2/12 11:26, Fu, Zhonghui wrote:
>>> From a05d35ab334c20970c236fb971dae88810078c88 Mon Sep 17 00:00:00 2001
>>> From: Fu Zhonghui <zhonghui.fu-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
>>> Date: Thu, 12 Feb 2015 10:49:35 +0800
>>> Subject: [PATCH v3] brcmfmac: avoid duplicated suspend/resume operation
>>>
>>> WiFi chip has 2 SDIO functions, and PM core will trigger
>>> twice suspend/resume operations for one WiFi chip to do
>>> the same things. This patch avoid this case.
>>>
>>> Acked-by: Arend van Spriel <arend-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
>>> Signed-off-by: Fu Zhonghui <zhonghui.fu-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
>>> ---
>>> Changes in v3:
>>> - Rebase to wireless-drivers-next/master branch
>>>
>>> drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c | 13 ++++++++++++-
>>> 1 file changed, 12 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
>>> b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
>>> index 7944224..b8832a7 100644
>>> --- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
>>> +++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
>>> @@ -1117,9 +1117,13 @@ static int brcmf_ops_sdio_suspend(struct
>>> device *dev)
>>> struct brcmf_bus *bus_if;
>>> struct brcmf_sdio_dev *sdiodev;
>>> mmc_pm_flag_t sdio_flags;
>>> + struct sdio_func *func = dev_to_sdio_func(dev);
>>>
>>> brcmf_dbg(SDIO, "Enter\n");
>>>
>>> + if (func->num == 2)
>>> + return 0;
>>> +
>
> Should it be >= 2 instead of == 2 so that if, in the future, a 3+
> SDIO function chip comes out, it's already handled? Not that that
> should hold up the patch or anything, just a curiosity.
The driver only claims functions 1 and 2 during the probe so that assure
it works for SDIO devices that have more than two functions.
Regards,
Arend
>>> bus_if = dev_get_drvdata(dev);
>>> sdiodev = bus_if->bus_priv.sdio;
>>>
>>> @@ -1148,9 +1152,16 @@ static int brcmf_ops_sdio_suspend(struct
>>> device *dev)
>>> static int brcmf_ops_sdio_resume(struct device *dev)
>>> {
>>> struct brcmf_bus *bus_if = dev_get_drvdata(dev);
>>> - struct brcmf_sdio_dev *sdiodev = bus_if->bus_priv.sdio;
>>> + struct brcmf_sdio_dev *sdiodev;
>>> + struct sdio_func *func = dev_to_sdio_func(dev);
>>>
>>> brcmf_dbg(SDIO, "Enter\n");
>>> +
>>> + if (func->num == 2)
>>> + return 0;
>>> +
>>> + sdiodev = bus_if->bus_priv.sdio;
>>> +
>>> if (sdiodev->pdata && sdiodev->pdata->oob_irq_supported)
>>> disable_irq_wake(sdiodev->pdata->oob_irq_nr);
>>> brcmf_sdio_wd_timer(sdiodev->bus, BRCMF_WD_POLL_MS);
>>> -- 1.9.1
>>>
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe
>> linux-wireless" in
>> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" 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
* [PATCH net-next 3/4] be2net: Minor code cleanup in tx completion process
From: Sriharsha Basavapatna @ 2015-02-15 7:45 UTC (permalink / raw)
To: netdev
In-Reply-To: <1423986327-10069-1-git-send-email-sriharsha.basavapatna@emulex.com>
- To avoid multiple accesses to CQE, extract compl_status and end_idx from
be_tx_compl_get().
Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna@emulex.com>
---
drivers/net/ethernet/emulex/benet/be.h | 7 +++++
drivers/net/ethernet/emulex/benet/be_main.c | 47 +++++++++++++++--------------
2 files changed, 31 insertions(+), 23 deletions(-)
diff --git a/drivers/net/ethernet/emulex/benet/be.h b/drivers/net/ethernet/emulex/benet/be.h
index bc7f3d6..ad33bf1 100644
--- a/drivers/net/ethernet/emulex/benet/be.h
+++ b/drivers/net/ethernet/emulex/benet/be.h
@@ -238,10 +238,17 @@ struct be_tx_stats {
struct u64_stats_sync sync_compl;
};
+/* Structure to hold some data of interest obtained from a TX CQE */
+struct be_tx_compl_info {
+ u8 status; /* Completion status */
+ u16 end_index; /* Completed TXQ Index */
+};
+
struct be_tx_obj {
u32 db_offset;
struct be_queue_info q;
struct be_queue_info cq;
+ struct be_tx_compl_info txcp;
/* Remember the skbs that were transmitted */
struct sk_buff *sent_skb_list[TX_Q_LEN];
struct be_tx_stats stats;
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index 2f17937..b37b099 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -2065,18 +2065,23 @@ static void be_post_rx_frags(struct be_rx_obj *rxo, gfp_t gfp, u32 frags_needed)
}
}
-static struct be_eth_tx_compl *be_tx_compl_get(struct be_queue_info *tx_cq)
+static struct be_tx_compl_info *be_tx_compl_get(struct be_tx_obj *txo)
{
- struct be_eth_tx_compl *txcp = queue_tail_node(tx_cq);
+ struct be_queue_info *tx_cq = &txo->cq;
+ struct be_tx_compl_info *txcp = &txo->txcp;
+ struct be_eth_tx_compl *compl = queue_tail_node(tx_cq);
- if (txcp->dw[offsetof(struct amap_eth_tx_compl, valid) / 32] == 0)
+ if (compl->dw[offsetof(struct amap_eth_tx_compl, valid) / 32] == 0)
return NULL;
+ /* Ensure load ordering of valid bit dword and other dwords below */
rmb();
- be_dws_le_to_cpu(txcp, sizeof(*txcp));
+ be_dws_le_to_cpu(compl, sizeof(*compl));
- txcp->dw[offsetof(struct amap_eth_tx_compl, valid) / 32] = 0;
+ txcp->status = GET_TX_COMPL_BITS(status, compl);
+ txcp->end_index = GET_TX_COMPL_BITS(wrb_index, compl);
+ compl->dw[offsetof(struct amap_eth_tx_compl, valid) / 32] = 0;
queue_tail_inc(tx_cq);
return txcp;
}
@@ -2197,9 +2202,9 @@ static void be_tx_compl_clean(struct be_adapter *adapter)
{
u16 end_idx, notified_idx, cmpl = 0, timeo = 0, num_wrbs = 0;
struct device *dev = &adapter->pdev->dev;
- struct be_tx_obj *txo;
+ struct be_tx_compl_info *txcp;
struct be_queue_info *txq;
- struct be_eth_tx_compl *txcp;
+ struct be_tx_obj *txo;
int i, pending_txqs;
/* Stop polling for compls when HW has been silent for 10ms */
@@ -2210,10 +2215,10 @@ static void be_tx_compl_clean(struct be_adapter *adapter)
cmpl = 0;
num_wrbs = 0;
txq = &txo->q;
- while ((txcp = be_tx_compl_get(&txo->cq))) {
- end_idx = GET_TX_COMPL_BITS(wrb_index, txcp);
- num_wrbs += be_tx_compl_process(adapter, txo,
- end_idx);
+ while ((txcp = be_tx_compl_get(txo))) {
+ num_wrbs +=
+ be_tx_compl_process(adapter, txo,
+ txcp->end_index);
cmpl++;
}
if (cmpl) {
@@ -2572,7 +2577,7 @@ loop_continue:
return work_done;
}
-static inline void be_update_tx_err(struct be_tx_obj *txo, u32 status)
+static inline void be_update_tx_err(struct be_tx_obj *txo, u8 status)
{
switch (status) {
case BE_TX_COMP_HDR_PARSE_ERR:
@@ -2587,7 +2592,7 @@ static inline void be_update_tx_err(struct be_tx_obj *txo, u32 status)
}
}
-static inline void lancer_update_tx_err(struct be_tx_obj *txo, u32 status)
+static inline void lancer_update_tx_err(struct be_tx_obj *txo, u8 status)
{
switch (status) {
case LANCER_TX_COMP_LSO_ERR:
@@ -2612,22 +2617,18 @@ static inline void lancer_update_tx_err(struct be_tx_obj *txo, u32 status)
static void be_process_tx(struct be_adapter *adapter, struct be_tx_obj *txo,
int idx)
{
- struct be_eth_tx_compl *txcp;
int num_wrbs = 0, work_done = 0;
- u32 compl_status;
- u16 last_idx;
+ struct be_tx_compl_info *txcp;
- while ((txcp = be_tx_compl_get(&txo->cq))) {
- last_idx = GET_TX_COMPL_BITS(wrb_index, txcp);
- num_wrbs += be_tx_compl_process(adapter, txo, last_idx);
+ while ((txcp = be_tx_compl_get(txo))) {
+ num_wrbs += be_tx_compl_process(adapter, txo, txcp->end_index);
work_done++;
- compl_status = GET_TX_COMPL_BITS(status, txcp);
- if (compl_status) {
+ if (txcp->status) {
if (lancer_chip(adapter))
- lancer_update_tx_err(txo, compl_status);
+ lancer_update_tx_err(txo, txcp->status);
else
- be_update_tx_err(txo, compl_status);
+ be_update_tx_err(txo, txcp->status);
}
}
--
2.2.0.65.g9abc44b
^ permalink raw reply related
* [PATCH net-next 1/4] be2net: Refactor wrb_fill_hdr() routine
From: Sriharsha Basavapatna @ 2015-02-15 7:45 UTC (permalink / raw)
To: netdev
In-Reply-To: <1423986327-10069-1-git-send-email-sriharsha.basavapatna@emulex.com>
The WRB header is setup by wrb_fill_hdr() routine. This routine currently
gets some of the WRB params as args and figures out rest of the WRB params
by looking at various fields in skb (like gso, checksum, vlan-tag etc).
All these params could instead be retrieved from the skb into a structure
and passed to this routine. This separates wrb_fill_hdr() to only provide
chip-specific code to fill the WRB. This also makes it simple to support
chips with different WRB formats.
Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna@emulex.com>
---
drivers/net/ethernet/emulex/benet/be.h | 33 +++++++++
drivers/net/ethernet/emulex/benet/be_main.c | 105 +++++++++++++++++-----------
2 files changed, 99 insertions(+), 39 deletions(-)
diff --git a/drivers/net/ethernet/emulex/benet/be.h b/drivers/net/ethernet/emulex/benet/be.h
index 27de37a..bc7f3d6 100644
--- a/drivers/net/ethernet/emulex/benet/be.h
+++ b/drivers/net/ethernet/emulex/benet/be.h
@@ -417,6 +417,39 @@ struct rss_info {
u8 rss_hkey[RSS_HASH_KEY_LEN];
};
+/* Macros to read/write the 'features' word of be_wrb_params structure.
+ */
+#define BE_WRB_F_BIT(name) BE_WRB_F_##name##_BIT
+#define BE_WRB_F_MASK(name) BIT_MASK(BE_WRB_F_##name##_BIT)
+
+#define BE_WRB_F_GET(word, name) \
+ (((word) & (BE_WRB_F_MASK(name))) >> BE_WRB_F_BIT(name))
+
+#define BE_WRB_F_SET(word, name, val) \
+ ((word) |= (((val) << BE_WRB_F_BIT(name)) & BE_WRB_F_MASK(name)))
+
+/* Feature/offload bits */
+enum {
+ BE_WRB_F_CRC_BIT, /* Ethernet CRC */
+ BE_WRB_F_IPCS_BIT, /* IP csum */
+ BE_WRB_F_TCPCS_BIT, /* TCP csum */
+ BE_WRB_F_UDPCS_BIT, /* UDP csum */
+ BE_WRB_F_LSO_BIT, /* LSO */
+ BE_WRB_F_LSO6_BIT, /* LSO6 */
+ BE_WRB_F_VLAN_BIT, /* VLAN */
+ BE_WRB_F_VLAN_SKIP_HW_BIT /* Skip VLAN tag (workaround) */
+};
+
+/* The structure below provides a HW-agnostic abstraction of WRB params
+ * retrieved from a TX skb. This is in turn passed to chip specific routines
+ * during transmit, to set the corresponding params in the WRB.
+ */
+struct be_wrb_params {
+ u32 features; /* Feature bits */
+ u16 vlan_tag; /* VLAN tag */
+ u16 lso_mss; /* MSS for LSO */
+};
+
struct be_adapter {
struct pci_dev *pdev;
struct net_device *netdev;
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index 932b93a..40f54c0 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -728,48 +728,71 @@ static u16 skb_ip_proto(struct sk_buff *skb)
ip_hdr(skb)->protocol : ipv6_hdr(skb)->nexthdr;
}
-static void wrb_fill_hdr(struct be_adapter *adapter, struct be_eth_hdr_wrb *hdr,
- struct sk_buff *skb, u32 wrb_cnt, u32 len,
- bool skip_hw_vlan)
+static void be_get_wrb_params_from_skb(struct be_adapter *adapter,
+ struct sk_buff *skb,
+ struct be_wrb_params *wrb_params)
{
- u16 vlan_tag, proto;
-
- memset(hdr, 0, sizeof(*hdr));
-
- SET_TX_WRB_HDR_BITS(crc, hdr, 1);
+ u16 proto;
if (skb_is_gso(skb)) {
- SET_TX_WRB_HDR_BITS(lso, hdr, 1);
- SET_TX_WRB_HDR_BITS(lso_mss, hdr, skb_shinfo(skb)->gso_size);
+ BE_WRB_F_SET(wrb_params->features, LSO, 1);
+ wrb_params->lso_mss = skb_shinfo(skb)->gso_size;
if (skb_is_gso_v6(skb) && !lancer_chip(adapter))
- SET_TX_WRB_HDR_BITS(lso6, hdr, 1);
+ BE_WRB_F_SET(wrb_params->features, LSO6, 1);
} else if (skb->ip_summed == CHECKSUM_PARTIAL) {
if (skb->encapsulation) {
- SET_TX_WRB_HDR_BITS(ipcs, hdr, 1);
+ BE_WRB_F_SET(wrb_params->features, IPCS, 1);
proto = skb_inner_ip_proto(skb);
} else {
proto = skb_ip_proto(skb);
}
if (proto == IPPROTO_TCP)
- SET_TX_WRB_HDR_BITS(tcpcs, hdr, 1);
+ BE_WRB_F_SET(wrb_params->features, TCPCS, 1);
else if (proto == IPPROTO_UDP)
- SET_TX_WRB_HDR_BITS(udpcs, hdr, 1);
+ BE_WRB_F_SET(wrb_params->features, UDPCS, 1);
}
if (skb_vlan_tag_present(skb)) {
- SET_TX_WRB_HDR_BITS(vlan, hdr, 1);
- vlan_tag = be_get_tx_vlan_tag(adapter, skb);
- SET_TX_WRB_HDR_BITS(vlan_tag, hdr, vlan_tag);
+ BE_WRB_F_SET(wrb_params->features, VLAN, 1);
+ wrb_params->vlan_tag = be_get_tx_vlan_tag(adapter, skb);
}
- SET_TX_WRB_HDR_BITS(num_wrb, hdr, wrb_cnt);
- SET_TX_WRB_HDR_BITS(len, hdr, len);
+ BE_WRB_F_SET(wrb_params->features, CRC, 1);
+}
+
+static void wrb_fill_hdr(struct be_adapter *adapter,
+ struct be_eth_hdr_wrb *hdr,
+ struct be_wrb_params *wrb_params,
+ struct sk_buff *skb)
+{
+ memset(hdr, 0, sizeof(*hdr));
- /* Hack to skip HW VLAN tagging needs evt = 1, compl = 0
- * When this hack is not needed, the evt bit is set while ringing DB
+ SET_TX_WRB_HDR_BITS(crc, hdr,
+ BE_WRB_F_GET(wrb_params->features, CRC));
+ SET_TX_WRB_HDR_BITS(ipcs, hdr,
+ BE_WRB_F_GET(wrb_params->features, IPCS));
+ SET_TX_WRB_HDR_BITS(tcpcs, hdr,
+ BE_WRB_F_GET(wrb_params->features, TCPCS));
+ SET_TX_WRB_HDR_BITS(udpcs, hdr,
+ BE_WRB_F_GET(wrb_params->features, UDPCS));
+
+ SET_TX_WRB_HDR_BITS(lso, hdr,
+ BE_WRB_F_GET(wrb_params->features, LSO));
+ SET_TX_WRB_HDR_BITS(lso6, hdr,
+ BE_WRB_F_GET(wrb_params->features, LSO6));
+ SET_TX_WRB_HDR_BITS(lso_mss, hdr, wrb_params->lso_mss);
+
+ /* Hack to skip HW VLAN tagging needs evt = 1, compl = 0. When this
+ * hack is not needed, the evt bit is set while ringing DB.
*/
- if (skip_hw_vlan)
- SET_TX_WRB_HDR_BITS(event, hdr, 1);
+ SET_TX_WRB_HDR_BITS(event, hdr,
+ BE_WRB_F_GET(wrb_params->features, VLAN_SKIP_HW));
+ SET_TX_WRB_HDR_BITS(vlan, hdr,
+ BE_WRB_F_GET(wrb_params->features, VLAN));
+ SET_TX_WRB_HDR_BITS(vlan_tag, hdr, wrb_params->vlan_tag);
+
+ SET_TX_WRB_HDR_BITS(num_wrb, hdr, skb_wrb_cnt(skb));
+ SET_TX_WRB_HDR_BITS(len, hdr, skb->len);
}
static void unmap_tx_frag(struct device *dev, struct be_eth_wrb *wrb,
@@ -791,7 +814,8 @@ static void unmap_tx_frag(struct device *dev, struct be_eth_wrb *wrb,
/* Returns the number of WRBs used up by the skb */
static u32 be_xmit_enqueue(struct be_adapter *adapter, struct be_tx_obj *txo,
- struct sk_buff *skb, bool skip_hw_vlan)
+ struct sk_buff *skb,
+ struct be_wrb_params *wrb_params)
{
u32 i, copied = 0, wrb_cnt = skb_wrb_cnt(skb);
struct device *dev = &adapter->pdev->dev;
@@ -803,7 +827,7 @@ static u32 be_xmit_enqueue(struct be_adapter *adapter, struct be_tx_obj *txo,
u16 head = txq->head;
hdr = queue_head_node(txq);
- wrb_fill_hdr(adapter, hdr, skb, wrb_cnt, skb->len, skip_hw_vlan);
+ wrb_fill_hdr(adapter, hdr, wrb_params, skb);
be_dws_cpu_to_le(hdr, sizeof(*hdr));
queue_head_inc(txq);
@@ -870,7 +894,8 @@ static inline int qnq_async_evt_rcvd(struct be_adapter *adapter)
static struct sk_buff *be_insert_vlan_in_pkt(struct be_adapter *adapter,
struct sk_buff *skb,
- bool *skip_hw_vlan)
+ struct be_wrb_params
+ *wrb_params)
{
u16 vlan_tag = 0;
@@ -887,8 +912,7 @@ static struct sk_buff *be_insert_vlan_in_pkt(struct be_adapter *adapter,
/* f/w workaround to set skip_hw_vlan = 1, informs the F/W to
* skip VLAN insertion
*/
- if (skip_hw_vlan)
- *skip_hw_vlan = true;
+ BE_WRB_F_SET(wrb_params->features, VLAN_SKIP_HW, 1);
}
if (vlan_tag) {
@@ -906,8 +930,7 @@ static struct sk_buff *be_insert_vlan_in_pkt(struct be_adapter *adapter,
vlan_tag);
if (unlikely(!skb))
return skb;
- if (skip_hw_vlan)
- *skip_hw_vlan = true;
+ BE_WRB_F_SET(wrb_params->features, VLAN_SKIP_HW, 1);
}
return skb;
@@ -947,7 +970,8 @@ static int be_ipv6_tx_stall_chk(struct be_adapter *adapter, struct sk_buff *skb)
static struct sk_buff *be_lancer_xmit_workarounds(struct be_adapter *adapter,
struct sk_buff *skb,
- bool *skip_hw_vlan)
+ struct be_wrb_params
+ *wrb_params)
{
struct vlan_ethhdr *veh = (struct vlan_ethhdr *)skb->data;
unsigned int eth_hdr_len;
@@ -971,7 +995,7 @@ static struct sk_buff *be_lancer_xmit_workarounds(struct be_adapter *adapter,
*/
if (be_pvid_tagging_enabled(adapter) &&
veh->h_vlan_proto == htons(ETH_P_8021Q))
- *skip_hw_vlan = true;
+ BE_WRB_F_SET(wrb_params->features, VLAN_SKIP_HW, 1);
/* HW has a bug wherein it will calculate CSUM for VLAN
* pkts even though it is disabled.
@@ -979,7 +1003,7 @@ static struct sk_buff *be_lancer_xmit_workarounds(struct be_adapter *adapter,
*/
if (skb->ip_summed != CHECKSUM_PARTIAL &&
skb_vlan_tag_present(skb)) {
- skb = be_insert_vlan_in_pkt(adapter, skb, skip_hw_vlan);
+ skb = be_insert_vlan_in_pkt(adapter, skb, wrb_params);
if (unlikely(!skb))
goto err;
}
@@ -1001,7 +1025,7 @@ static struct sk_buff *be_lancer_xmit_workarounds(struct be_adapter *adapter,
*/
if (be_ipv6_tx_stall_chk(adapter, skb) &&
be_vlan_tag_tx_chk(adapter, skb)) {
- skb = be_insert_vlan_in_pkt(adapter, skb, skip_hw_vlan);
+ skb = be_insert_vlan_in_pkt(adapter, skb, wrb_params);
if (unlikely(!skb))
goto err;
}
@@ -1015,7 +1039,7 @@ err:
static struct sk_buff *be_xmit_workarounds(struct be_adapter *adapter,
struct sk_buff *skb,
- bool *skip_hw_vlan)
+ struct be_wrb_params *wrb_params)
{
/* Lancer, SH-R ASICs have a bug wherein Packets that are 32 bytes or
* less may cause a transmit stall on that port. So the work-around is
@@ -1027,7 +1051,7 @@ static struct sk_buff *be_xmit_workarounds(struct be_adapter *adapter,
}
if (BEx_chip(adapter) || lancer_chip(adapter)) {
- skb = be_lancer_xmit_workarounds(adapter, skb, skip_hw_vlan);
+ skb = be_lancer_xmit_workarounds(adapter, skb, wrb_params);
if (!skb)
return NULL;
}
@@ -1061,18 +1085,21 @@ static void be_xmit_flush(struct be_adapter *adapter, struct be_tx_obj *txo)
static netdev_tx_t be_xmit(struct sk_buff *skb, struct net_device *netdev)
{
- bool skip_hw_vlan = false, flush = !skb->xmit_more;
struct be_adapter *adapter = netdev_priv(netdev);
u16 q_idx = skb_get_queue_mapping(skb);
struct be_tx_obj *txo = &adapter->tx_obj[q_idx];
+ struct be_wrb_params wrb_params = { 0 };
struct be_queue_info *txq = &txo->q;
+ bool flush = !skb->xmit_more;
u16 wrb_cnt;
- skb = be_xmit_workarounds(adapter, skb, &skip_hw_vlan);
+ skb = be_xmit_workarounds(adapter, skb, &wrb_params);
if (unlikely(!skb))
goto drop;
- wrb_cnt = be_xmit_enqueue(adapter, txo, skb, skip_hw_vlan);
+ be_get_wrb_params_from_skb(adapter, skb, &wrb_params);
+
+ wrb_cnt = be_xmit_enqueue(adapter, txo, skb, &wrb_params);
if (unlikely(!wrb_cnt)) {
dev_kfree_skb_any(skb);
goto drop;
--
2.2.0.65.g9abc44b
^ permalink raw reply related
* [PATCH net-next 4/4] be2net: Add a few inline functions to test TXQ conditions
From: Sriharsha Basavapatna @ 2015-02-15 7:45 UTC (permalink / raw)
To: netdev
In-Reply-To: <1423986327-10069-1-git-send-email-sriharsha.basavapatna@emulex.com>
- Check qfull condition
- Check qwake condition
- Check pkts pending completion
Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna@emulex.com>
---
drivers/net/ethernet/emulex/benet/be_main.c | 23 +++++++++++++++++++----
1 file changed, 19 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index b37b099..028b093 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -728,6 +728,22 @@ static u16 skb_ip_proto(struct sk_buff *skb)
ip_hdr(skb)->protocol : ipv6_hdr(skb)->nexthdr;
}
+static inline bool be_is_txq_full(struct be_tx_obj *txo)
+{
+ return ((atomic_read(&txo->q.used) + BE_MAX_TX_FRAG_COUNT) >=
+ txo->q.len);
+}
+
+static inline bool be_can_txq_wake(struct be_tx_obj *txo)
+{
+ return (atomic_read(&txo->q.used) < txo->q.len / 2);
+}
+
+static inline bool be_is_tx_compl_pending(struct be_tx_obj *txo)
+{
+ return (atomic_read(&txo->q.used) > txo->pend_wrb_cnt);
+}
+
static void be_get_wrb_params_from_skb(struct be_adapter *adapter,
struct sk_buff *skb,
struct be_wrb_params *wrb_params)
@@ -1135,7 +1151,6 @@ static netdev_tx_t be_xmit(struct sk_buff *skb, struct net_device *netdev)
u16 q_idx = skb_get_queue_mapping(skb);
struct be_tx_obj *txo = &adapter->tx_obj[q_idx];
struct be_wrb_params wrb_params = { 0 };
- struct be_queue_info *txq = &txo->q;
bool flush = !skb->xmit_more;
u16 wrb_cnt;
@@ -1151,7 +1166,7 @@ static netdev_tx_t be_xmit(struct sk_buff *skb, struct net_device *netdev)
goto drop;
}
- if ((atomic_read(&txq->used) + BE_MAX_TX_FRAG_COUNT) >= txq->len) {
+ if (be_is_txq_full(txo)) {
netif_stop_subqueue(netdev, q_idx);
tx_stats(txo)->tx_stops++;
}
@@ -2226,7 +2241,7 @@ static void be_tx_compl_clean(struct be_adapter *adapter)
atomic_sub(num_wrbs, &txq->used);
timeo = 0;
}
- if (atomic_read(&txq->used) == txo->pend_wrb_cnt)
+ if (!be_is_tx_compl_pending(txo))
pending_txqs--;
}
@@ -2639,7 +2654,7 @@ static void be_process_tx(struct be_adapter *adapter, struct be_tx_obj *txo,
/* As Tx wrbs have been freed up, wake up netdev queue
* if it was stopped due to lack of tx wrbs. */
if (__netif_subqueue_stopped(adapter->netdev, idx) &&
- atomic_read(&txo->q.used) < txo->q.len / 2) {
+ be_can_txq_wake(txo)) {
netif_wake_subqueue(adapter->netdev, idx);
}
--
2.2.0.65.g9abc44b
^ permalink raw reply related
* [PATCH net-next 2/4] be2net: Refactor be_xmit_enqueue() routine
From: Sriharsha Basavapatna @ 2015-02-15 7:45 UTC (permalink / raw)
To: netdev
In-Reply-To: <1423986327-10069-1-git-send-email-sriharsha.basavapatna@emulex.com>
- Reduce code duplication by moving WRB-frags setup into a function.
- Do not setup WRB-header before frags are setup, which is unncessary if
there's errors while setting up frags. We should only grab an entry for
the header, setup the frags and if everything is fine setup the header.
- The error cleanup can be moved into a small function.
Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna@emulex.com>
---
drivers/net/ethernet/emulex/benet/be_main.c | 126 +++++++++++++++++++---------
1 file changed, 86 insertions(+), 40 deletions(-)
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index 40f54c0..2f17937 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -812,7 +812,80 @@ static void unmap_tx_frag(struct device *dev, struct be_eth_wrb *wrb,
}
}
-/* Returns the number of WRBs used up by the skb */
+/* Grab a WRB header for xmit */
+static u16 be_tx_get_wrb_hdr(struct be_tx_obj *txo)
+{
+ u16 head = txo->q.head;
+
+ queue_head_inc(&txo->q);
+ return head;
+}
+
+/* Set up the WRB header for xmit */
+static void be_tx_setup_wrb_hdr(struct be_adapter *adapter,
+ struct be_tx_obj *txo,
+ struct be_wrb_params *wrb_params,
+ struct sk_buff *skb, u16 head)
+{
+ u32 num_frags = skb_wrb_cnt(skb);
+ struct be_queue_info *txq = &txo->q;
+ struct be_eth_hdr_wrb *hdr = queue_index_node(txq, head);
+
+ wrb_fill_hdr(adapter, hdr, wrb_params, skb);
+ be_dws_cpu_to_le(hdr, sizeof(*hdr));
+
+ BUG_ON(txo->sent_skb_list[head]);
+ txo->sent_skb_list[head] = skb;
+ txo->last_req_hdr = head;
+ atomic_add(num_frags, &txq->used);
+ txo->last_req_wrb_cnt = num_frags;
+ txo->pend_wrb_cnt += num_frags;
+}
+
+/* Setup a WRB fragment (buffer descriptor) for xmit */
+static void be_tx_setup_wrb_frag(struct be_tx_obj *txo, dma_addr_t busaddr,
+ int len)
+{
+ struct be_eth_wrb *wrb;
+ struct be_queue_info *txq = &txo->q;
+
+ wrb = queue_head_node(txq);
+ wrb_fill(wrb, busaddr, len);
+ queue_head_inc(txq);
+}
+
+/* Bring the queue back to the state it was in before be_xmit_enqueue() routine
+ * was invoked. The producer index is restored to the previous packet and the
+ * WRBs of the current packet are unmapped. Invoked to handle tx setup errors.
+ */
+static void be_xmit_restore(struct be_adapter *adapter,
+ struct be_tx_obj *txo, u16 head, bool map_single,
+ u32 copied)
+{
+ struct device *dev;
+ struct be_eth_wrb *wrb;
+ struct be_queue_info *txq = &txo->q;
+
+ dev = &adapter->pdev->dev;
+ txq->head = head;
+
+ /* skip the first wrb (hdr); it's not mapped */
+ queue_head_inc(txq);
+ while (copied) {
+ wrb = queue_head_node(txq);
+ unmap_tx_frag(dev, wrb, map_single);
+ map_single = false;
+ copied -= le32_to_cpu(wrb->frag_len);
+ queue_head_inc(txq);
+ }
+
+ txq->head = head;
+}
+
+/* Enqueue the given packet for transmit. This routine allocates WRBs for the
+ * packet, dma maps the packet buffers and sets up the WRBs. Returns the number
+ * of WRBs used up by the packet.
+ */
static u32 be_xmit_enqueue(struct be_adapter *adapter, struct be_tx_obj *txo,
struct sk_buff *skb,
struct be_wrb_params *wrb_params)
@@ -820,70 +893,43 @@ static u32 be_xmit_enqueue(struct be_adapter *adapter, struct be_tx_obj *txo,
u32 i, copied = 0, wrb_cnt = skb_wrb_cnt(skb);
struct device *dev = &adapter->pdev->dev;
struct be_queue_info *txq = &txo->q;
- struct be_eth_hdr_wrb *hdr;
bool map_single = false;
- struct be_eth_wrb *wrb;
- dma_addr_t busaddr;
u16 head = txq->head;
+ dma_addr_t busaddr;
+ int len;
- hdr = queue_head_node(txq);
- wrb_fill_hdr(adapter, hdr, wrb_params, skb);
- be_dws_cpu_to_le(hdr, sizeof(*hdr));
-
- queue_head_inc(txq);
+ head = be_tx_get_wrb_hdr(txo);
if (skb->len > skb->data_len) {
- int len = skb_headlen(skb);
+ len = skb_headlen(skb);
busaddr = dma_map_single(dev, skb->data, len, DMA_TO_DEVICE);
if (dma_mapping_error(dev, busaddr))
goto dma_err;
map_single = true;
- wrb = queue_head_node(txq);
- wrb_fill(wrb, busaddr, len);
- queue_head_inc(txq);
+ be_tx_setup_wrb_frag(txo, busaddr, len);
copied += len;
}
for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
const struct skb_frag_struct *frag = &skb_shinfo(skb)->frags[i];
+ len = skb_frag_size(frag);
- busaddr = skb_frag_dma_map(dev, frag, 0,
- skb_frag_size(frag), DMA_TO_DEVICE);
+ busaddr = skb_frag_dma_map(dev, frag, 0, len, DMA_TO_DEVICE);
if (dma_mapping_error(dev, busaddr))
goto dma_err;
- wrb = queue_head_node(txq);
- wrb_fill(wrb, busaddr, skb_frag_size(frag));
- queue_head_inc(txq);
- copied += skb_frag_size(frag);
+ be_tx_setup_wrb_frag(txo, busaddr, len);
+ copied += len;
}
- BUG_ON(txo->sent_skb_list[head]);
- txo->sent_skb_list[head] = skb;
- txo->last_req_hdr = head;
- atomic_add(wrb_cnt, &txq->used);
- txo->last_req_wrb_cnt = wrb_cnt;
- txo->pend_wrb_cnt += wrb_cnt;
+ be_tx_setup_wrb_hdr(adapter, txo, wrb_params, skb, head);
be_tx_stats_update(txo, skb);
return wrb_cnt;
dma_err:
- /* Bring the queue back to the state it was in before this
- * routine was invoked.
- */
- txq->head = head;
- /* skip the first wrb (hdr); it's not mapped */
- queue_head_inc(txq);
- while (copied) {
- wrb = queue_head_node(txq);
- unmap_tx_frag(dev, wrb, map_single);
- map_single = false;
- copied -= le32_to_cpu(wrb->frag_len);
- adapter->drv_stats.dma_map_errors++;
- queue_head_inc(txq);
- }
- txq->head = head;
+ adapter->drv_stats.dma_map_errors++;
+ be_xmit_restore(adapter, txo, head, map_single, copied);
return 0;
}
--
2.2.0.65.g9abc44b
^ permalink raw reply related
* [PATCH net-next 0/4] be2net patch-set
From: Sriharsha Basavapatna @ 2015-02-15 7:45 UTC (permalink / raw)
To: netdev
Hi David,
This patch set contains a few code refactoring changes to make it easy to
support new TX WRB formats in future ASICs. Please consider applying it to
net-next tree.
Patch 1: Refactors chip specific code to setup tx wrb into a separate routine.
Patch 2: Refactors tx enqueue function to remove a bit of duplicate code and
improves wrb setup steps.
Patch 3: Minor refactoring in tx compl to limit CQE accesses to 1 routine.
Patch 4: Adds a few inline functions.
Sriharsha Basavapatna (4):
be2net: Refactor wrb_fill_hdr() routine
be2net: Refactor be_xmit_enqueue() routine
be2net: Minor code cleanup in tx completion process
be2net: Add a few inline functions to test TXQ conditions
drivers/net/ethernet/emulex/benet/be.h | 40 ++++
drivers/net/ethernet/emulex/benet/be_main.c | 295 ++++++++++++++++++----------
2 files changed, 232 insertions(+), 103 deletions(-)
--
2.2.0.65.g9abc44b
^ permalink raw reply
* RE: If bridge have no sub-interfaces, it's status may be still with 'RUNNING'
From: Wu, Kuaikuai @ 2015-02-15 7:49 UTC (permalink / raw)
To: Stephen Hemminger, Zhu, Yanjun; +Cc: netdev, Tao, Yue
In-Reply-To: <20150213133056.3944c13e@uryu.home.lan>
Hi Stephen,
When we up a bridge without sub-interfaces, it has "RUNNING" flag as below. Is it correct or not?
1. brctl addbr br0
2. ifconfig br0 up
3. ifconfig br0
br0 Link encap:Ethernet HWaddr e6:6c:84:a6:fc:64
inet6 addr: fe80::e46c:84ff:fea6:fc64/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:168 (168.0 B)
Best Regards
Kuaikuai Wu
-----Original Message-----
From: Stephen Hemminger [mailto:stephen@networkplumber.org]
Sent: Saturday, February 14, 2015 2:31 AM
To: Zhu, Yanjun
Cc: netdev; Wu, Kuaikuai; Tao, Yue
Subject: Re: If bridge have no sub-interfaces, it's status may be still with 'RUNNING'
On Fri, 13 Feb 2015 17:57:45 +0800
yzhu1 <Yanjun.Zhu@windriver.com> wrote:
> Hi, all
>
> I made this test on ubuntu 14.04 with kernel 3,19-rc7:
>
> 1. brctl addbr br0
>
> 2. ifconfig br0 up
>
> 3. ifconfig br0 (br0's status is with 'RUNNING')
>
> 4. brctl addif br0 eth0
>
> 5. brctl delif br0 eth0
>
> 6. ifconfig br0 (br0's status is without 'RUNNING')
>
> When there is no sub-interface, the flag "RUNNING" is missing after
> the last sub-interface is removed.
>
> As such, should we keep "RUNNING" flag after the last sub-interface is
> removed?
This is intentional. If there are no active ports in bridge, then we want to tell applications that packets will go nowhere.
^ permalink raw reply
* Re: [RFC net-next 3/4] openvswitch: Add conntrack action.
From: Joe Stringer @ 2015-02-15 4:47 UTC (permalink / raw)
To: Thomas Graf
Cc: dev-yBygre7rU0TnMu66kgdUjQ@public.gmane.org, Linux Netdev List,
Pablo Neira Ayuso
In-Reply-To: <20150214195607.GA30752-FZi0V3Vbi30CUdFEqe4BF2D2FQJk+8+b@public.gmane.org>
On 14 February 2015 at 11:56, Thomas Graf <tgraf@suug.ch> wrote:
> On 02/14/15 at 12:13am, Joe Stringer wrote:
>
> [..]
>
>> +static bool skb_has_valid_nfct(const struct net *net, u16 zone,
>> + const struct sk_buff *skb)
>> +{
>> + enum ip_conntrack_info ctinfo;
>> + struct nf_conn *ct = nf_ct_get(skb, &ctinfo);
>> +
>> + if (!ct)
>> + return false;
>> + if (!net_eq(net, ct->ct_net))
>> + return false;
>
> I'm surprised that this is needed. Shouldn't we call skb_scrub_packet()
> between namespaces and invalidate the ct associated with the skb.
Right, it was more of a general sanity check which is likely unneeded.
I'm not aware of any particular case that this handles.
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev
^ permalink raw reply
* Re: [PATCH] net/core: Fix warning while make xmldocs caused by dev.c
From: David Miller @ 2015-02-15 4:35 UTC (permalink / raw)
To: standby24x7; +Cc: monis, linux-kernel, netdev
In-Reply-To: <1423920394-26652-1-git-send-email-standby24x7@gmail.com>
From: Masanari Iida <standby24x7@gmail.com>
Date: Sat, 14 Feb 2015 22:26:34 +0900
> This patch fix following warning wile make xmldocs.
>
> Warning(.//net/core/dev.c:5345): No description found
> for parameter 'bonding_info'
> Warning(.//net/core/dev.c:5345): Excess function parameter
> 'netdev_bonding_info' description in 'netdev_bonding_info_change'
>
> This warning starts to appear after following patch was added
> into Linus's tree during merger period.
>
> commit 61bd3857ff2c7daf756d49b41e6277bbdaa8f789
> net/core: Add event for a change in slave state
>
> Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Applied.
^ permalink raw reply
* Re: [PATCH] net: phy: micrel: disable NAND-tree for KSZ8021,KSZ8031,KSZ8051,KSZ8081
From: David Miller @ 2015-02-15 4:31 UTC (permalink / raw)
To: sylvain.rochet
Cc: f.fainelli, netdev, linux-kernel, nicolas.ferre,
alexandre.belloni, voice.shen, josh.wu, ludovic.desroches,
boris.brezillon
In-Reply-To: <1423859733-21456-1-git-send-email-sylvain.rochet@finsecur.com>
From: Sylvain Rochet <sylvain.rochet@finsecur.com>
Date: Fri, 13 Feb 2015 21:35:33 +0100
> NAND-tree is used to check wiring between MAC and PHY using NAND gates
> on the PHY side, hence the name.
>
> NAND-tree initial status is latched at reset by probing the IRQ pin.
> However some devices are sharing the PHY IRQ pin with other peripherals
> such as Atmel SAMA5D[34]x-EK boards when using the optional TM7000
> display module, therefore they are switching the PHY in NAND-tree test
> mode depending on the current IRQ line status at reset.
>
> This patch ensure PHY is not in NAND-tree test mode for all Micrel PHYs
> using IRQ line as a NAND-tree toggle mode at reset.
>
> Signed-off-by: Sylvain Rochet <sylvain.rochet@finsecur.com>
> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next] net: spelling fixes
From: David Miller @ 2015-02-15 4:36 UTC (permalink / raw)
To: stephen; +Cc: netdev
In-Reply-To: <20150214134754.07a6aed8@uryu.home.lan>
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Sat, 14 Feb 2015 13:47:54 -0500
> Spelling errors caught by codespell.
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Applied.
^ permalink raw reply
* Re: [PATCH] rhashtable: use rht_obj() consistently
From: David Miller @ 2015-02-15 4:31 UTC (permalink / raw)
To: tgraf; +Cc: johannes, netdev, johannes.berg
In-Reply-To: <20150213214208.GB18659@casper.infradead.org>
From: Thomas Graf <tgraf@suug.ch>
Date: Fri, 13 Feb 2015 21:42:08 +0000
> On 02/13/15 at 08:58pm, Thomas Graf wrote:
>> On 02/13/15 at 09:42pm, Johannes Berg wrote:
>> > From: Johannes Berg <johannes.berg@intel.com>
>> >
>> > Looking at the RHT code I found two places where this was
>> > done manually rather than using the rht_obj() helper, use
>> > that instead.
>> >
>> > Signed-off-by: Johannes Berg <johannes.berg@intel.com>
>>
>> Acked-by: Thomas Graf <tgraf@suug.ch>
>
> Actually, this is already "fixed" in net-next.
So I'm going to toss this.
^ permalink raw reply
* Re: [PATCH net-next v2] ipv6: fix ipv6_cow_metrics for non DST_HOST case
From: David Miller @ 2015-02-15 4:28 UTC (permalink / raw)
To: kafai; +Cc: netdev, hannes, kernel-team
In-Reply-To: <1423786448-1158200-1-git-send-email-kafai@fb.com>
From: Martin KaFai Lau <kafai@fb.com>
Date: Thu, 12 Feb 2015 16:14:08 -0800
> ipv6_cow_metrics() currently assumes only DST_HOST routes require
> dynamic metrics allocation from inetpeer. The assumption breaks
> when ndisc discovered router with RTAX_MTU and RTAX_HOPLIMIT metric.
> Refer to ndisc_router_discovery() in ndisc.c and note that dst_metric_set()
> is called after the route is created.
>
> This patch creates the metrics array (by calling dst_cow_metrics_generic) in
> ipv6_cow_metrics().
...
> Fixes: 8e2ec639173f325 (ipv6: don't use inetpeer to store metrics for routes.)
> Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Applied, thank you.
^ permalink raw reply
* Re: [PATCH net] r8152: restore hw settings
From: David Miller @ 2015-02-15 4:16 UTC (permalink / raw)
To: hayeswang; +Cc: netdev, nic_swsd, linux-kernel, linux-usb
In-Reply-To: <1394712342-15778-145-Taiwan-albertk@realtek.com>
From: Hayes Wang <hayeswang@realtek.com>
Date: Thu, 12 Feb 2015 16:20:46 +0800
> There is a capability which let the hw could change the settings
> automatically when the power change to ON. However, the USB reset
> would reset the settings to the hw default, so the driver has to
> restore the relative settings. Otherwise, it would influence the
> functions of the hw, and the compatibility for the USB hub and
> USB host controller.
>
> The relative settings are as following.
> - set the power down scale to 96.
> - enable the power saving function of USB 2.0.
> - disable the ALDPS of ECM mode.
> - set burst mode depending on the burst size.
> - enable the flow control of endpoint full.
> - set fifo empty boundary to 32448 bytes.
> - enable the function of exiting LPM when Rx OK occurs.
> - set the connect timer to 1.
>
> Signed-off-by: Hayes Wang <hayeswang@realtek.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next] openvswitch: Fix key serialization.
From: David Miller @ 2015-02-15 4:21 UTC (permalink / raw)
To: pshelar; +Cc: netdev, joestringer
In-Reply-To: <1423763928-1554-1-git-send-email-pshelar@nicira.com>
From: Pravin B Shelar <pshelar@nicira.com>
Date: Thu, 12 Feb 2015 09:58:48 -0800
> Fix typo where mask is used rather than key.
>
> Fixes: 74ed7ab9264("openvswitch: Add support for unique flow IDs.")
> Reported-by: Joe Stringer <joestringer@nicira.com>
> Signed-off-by: Pravin B Shelar <pshelar@nicira.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