* Re: [PATCH v4] smsc95xx: Add comments to the registers definition
From: David Miller @ 2017-04-17 17:05 UTC (permalink / raw)
To: martin-ufNpD2TjPakDzzZUHZsW5w
Cc: Woojung.Huh-UWL1GkI3JZL3oGB3hsPCZA, andrew-g2DYL2Zd6BY,
steve.glendinning-nksJyM/082jR7s880joybQ,
UNGLinuxDriver-UWL1GkI3JZL3oGB3hsPCZA,
netdev-u79uwXL29TY76Z2rM5mHXA, linux-usb-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20170413080844.zgud2zr7ht6kw2tx@SMX-2>
From: Martin Wetterwald <martin-ufNpD2TjPakDzzZUHZsW5w@public.gmane.org>
Date: Thu, 13 Apr 2017 10:08:44 +0200
> This chip is used by a lot of embedded devices and also by the Raspberry
> Pi 1, 2 & 3 which were created to promote the study of computer
> sciences. Students wanting to learn kernel / network device driver
> programming through those devices can only rely on the Linux kernel
> driver source to make their own.
>
> This commit adds a lot of comments to the registers definition to expand
> the register names.
>
> Cc: Steve Glendinning <steve.glendinning-nksJyM/082jR7s880joybQ@public.gmane.org>
> Cc: Microchip Linux Driver Support <UNGLinuxDriver-UWL1GkI3JZL3oGB3hsPCZA@public.gmane.org>
> CC: David Miller <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
> Signed-off-by: Martin Wetterwald <martin-ufNpD2TjPakDzzZUHZsW5w@public.gmane.org>
> Reviewed-by: Andrew Lunn <andrew-g2DYL2Zd6BY@public.gmane.org>
> Acked-by: Steve Glendinning <steve.glendinning-nksJyM/082jR7s880joybQ@public.gmane.org>
Applied to net-next, thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH net-next 1/1] net sched actions: dump more than TCA_ACT_MAX_PRIO actions per batch
From: Jiri Pirko @ 2017-04-17 17:04 UTC (permalink / raw)
To: Jamal Hadi Salim; +Cc: Eric Dumazet, davem, netdev, xiyou.wangcong
In-Reply-To: <0bd1e885-cdf3-60fc-783b-a075b777560b@mojatatu.com>
Mon, Apr 17, 2017 at 06:46:17PM CEST, jhs@mojatatu.com wrote:
>On 17-04-17 11:31 AM, Jiri Pirko wrote:
>> Mon, Apr 17, 2017 at 03:10:59PM CEST, eric.dumazet@gmail.com wrote:
>> > On Mon, 2017-04-17 at 07:01 -0400, Jamal Hadi Salim wrote:
>
>> Agreed.
>>
>> Plus the argument that attributes are "a big waste" sounds to me really
>> silly. What is couple of bytes?Please do this properly, as it should
>> be done.
>
>Jiri - you wanted to have these uapi discussions, right? ;->
>
>Of course it is trivial to add this as attributes and 32 bits
>for this case is not a big deal because it is done once. I want to talk
>about the pads instead ;-> What do you suggest we do with pads?
I believe we should leave them as they are.
>
>cheers,
>jaaml
>
^ permalink raw reply
* Re: [PATCH] net: thunderx: Fix set_max_bgx_per_node for 81xx rgx
From: David Miller @ 2017-04-17 17:04 UTC (permalink / raw)
To: george.cherian; +Cc: linux-arm-kernel, netdev, linux-kernel, rric, sgoutham
In-Reply-To: <1492068301-1141-1-git-send-email-george.cherian@cavium.com>
From: George Cherian <george.cherian@cavium.com>
Date: Thu, 13 Apr 2017 07:25:01 +0000
> Add the PCI_SUBSYS_DEVID_81XX_RGX and use the same to set
> the max bgx per node count.
>
> This fixes the issue intoduced by following commit
> 78aacb6f6 net: thunderx: Fix invalid mac addresses for node1 interfaces
> With this commit the max_bgx_per_node for 81xx is set as 2 instead of 3
> because of which num_vfs is always calculated as zero.
>
> Signed-off-by: George Cherian <george.cherian@cavium.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next] l2tp: device MTU setup, tunnel socket needs a lock
From: David Miller @ 2017-04-17 17:02 UTC (permalink / raw)
To: parameswaran.r7
Cc: netdev, kleptog, jchapman, nprachan, rshearma, stephen, sdietric,
ciwillia, lboccass, dfawcus, bhong, jblunck, g.nault,
linux-kernel
In-Reply-To: <alpine.DEB.2.11.1704121825410.1923@nelson51.eng.vyatta.net>
From: "R. Parameswaran" <parameswaran.r7@gmail.com>
Date: Wed, 12 Apr 2017 18:31:04 -0700 (PDT)
>
> The MTU overhead calculation in L2TP device set-up
> merged via commit b784e7ebfce8cfb16c6f95e14e8532d0768ab7ff
> needs to be adjusted to lock the tunnel socket while
> referencing the sub-data structures to derive the
> socket's IP overhead.
>
> Reported-by: Guillaume Nault <g.nault@alphalink.fr>
> Tested-by: Guillaume Nault <g.nault@alphalink.fr>
> Signed-off-by: R. Parameswaran <rparames@brocade.com>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH net] net-timestamp: avoid use-after-free in ip_recv_error
From: David Miller @ 2017-04-17 17:00 UTC (permalink / raw)
To: willemdebruijn.kernel
Cc: netdev, andreyknvl, eric.dumazet, xiyou.wangcong, willemb
In-Reply-To: <20170412232435.80455-1-willemdebruijn.kernel@gmail.com>
From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Date: Wed, 12 Apr 2017 19:24:35 -0400
> From: Willem de Bruijn <willemb@google.com>
>
> Syzkaller reported a use-after-free in ip_recv_error at line
>
> info->ipi_ifindex = skb->dev->ifindex;
>
> This function is called on dequeue from the error queue, at which
> point the device pointer may no longer be valid.
>
> Save ifindex on enqueue in __skb_complete_tx_timestamp, when the
> pointer is valid or NULL. Store it in temporary storage skb->cb.
>
> It is safe to reference skb->dev here, as called from device drivers
> or dev_queue_xmit. The exception is when called from tcp_ack_tstamp;
> in that case it is NULL and ifindex is set to 0 (invalid).
>
> Do not return a pktinfo cmsg if ifindex is 0. This maintains the
> current behavior of not returning a cmsg if skb->dev was NULL.
>
> On dequeue, the ipv4 path will cast from sock_exterr_skb to
> in_pktinfo. Both have ifindex as their first element, so no explicit
> conversion is needed. This is by design, introduced in commit
> 0b922b7a829c ("net: original ingress device index in PKTINFO"). For
> ipv6 ip6_datagram_support_cmsg converts to in6_pktinfo.
>
> Fixes: 829ae9d61165 ("net-timestamp: allow reading recv cmsg on errqueue with origin tstamp")
>
> Reported-by: Andrey Konovalov <andreyknvl@google.com>
> Signed-off-by: Willem de Bruijn <willemb@google.com>
Applied and queued up for -stable, thanks.
In the future please don't insert empty lines between the Fixes: and
other tags.
Thanks.
^ permalink raw reply
* Re: [PATCH resend 3/4] uapi glibc compat: Do not check for __USE_MISC
From: David Miller @ 2017-04-17 16:55 UTC (permalink / raw)
To: hauke
Cc: netdev, linux-kernel, jarod, jogo, david.heidelberger,
maillist-linux, mikko.rapeli, dwmw2
In-Reply-To: <20170412203103.6057-4-hauke@hauke-m.de>
From: Hauke Mehrtens <hauke@hauke-m.de>
Date: Wed, 12 Apr 2017 22:31:02 +0200
> __USE_MISC is glibc specific and not available in musl libc. Only do
> this check when glibc is used. This fixes a problem with musl libc.
>
> Acked-by: Mikko Rapeli <mikko.rapeli@iki.fi>
> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
You yourself introduce this problem in patch #1.
The code before patch #1 was perfectly fine, as this code block only
existing in an area protected by __GLIBC__.
So you have to redo these patches such that you deal with all of
the fallout from changing __GLIBC__ into !__KERNEL__ at the same
time that you make that change.
Thanks.
^ permalink raw reply
* Re: [patch net-next] MAINTAINERS: rename TC entry and add couple of header files
From: Jamal Hadi Salim @ 2017-04-17 16:49 UTC (permalink / raw)
To: Jiri Pirko, netdev; +Cc: davem, mlxsw
In-Reply-To: <1492100031-13462-1-git-send-email-jiri@resnulli.us>
On 17-04-13 12:13 PM, Jiri Pirko wrote:
> From: Jiri Pirko <jiri@mellanox.com>
>
> The section is not specific only to "TC classifiers", but applies to the
> whole TC subsystem. Also, add couple of forgotten headers.
>
> Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
cheers,
jamal
^ permalink raw reply
* Re: [Patch net] ipv4: fix a deadlock in ip_ra_control
From: David Miller @ 2017-04-17 16:47 UTC (permalink / raw)
To: xiyou.wangcong; +Cc: netdev, dvyukov, andreyknvl
In-Reply-To: <1492025533-23084-1-git-send-email-xiyou.wangcong@gmail.com>
From: Cong Wang <xiyou.wangcong@gmail.com>
Date: Wed, 12 Apr 2017 12:32:13 -0700
> Similar to commit 87e9f0315952
> ("ipv4: fix a potential deadlock in mcast getsockopt() path"),
> there is a deadlock scenario for IP_ROUTER_ALERT too:
>
> CPU0 CPU1
> ---- ----
> lock(rtnl_mutex);
> lock(sk_lock-AF_INET);
> lock(rtnl_mutex);
> lock(sk_lock-AF_INET);
>
> Fix this by always locking RTNL first on all setsockopt() paths.
>
> Note, after this patch ip_ra_lock is no longer needed either.
>
> Reported-by: Dmitry Vyukov <dvyukov@google.com>
> Tested-by: Andrey Konovalov <andreyknvl@google.com>
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next] net: ipv6: send unsolicited NA on admin up
From: David Miller @ 2017-04-17 16:45 UTC (permalink / raw)
To: dsa; +Cc: netdev, hannes
In-Reply-To: <1492022944-18842-1-git-send-email-dsa@cumulusnetworks.com>
From: David Ahern <dsa@cumulusnetworks.com>
Date: Wed, 12 Apr 2017 11:49:04 -0700
> ndisc_notify is the ipv6 equivalent to arp_notify. When arp_notify is
> set to 1, gratuitous arp requests are sent when the device is brought up.
> The same is expected when ndisc_notify is set to 1 (per ndisc_notify in
> Documentation/networking/ip-sysctl.txt). The NA is not sent on NETDEV_UP
> event; add it.
>
> Fixes: 5cb04436eef6 ("ipv6: add knob to send unsolicited ND on link-layer address change")
> Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH net-next 1/1] net sched actions: dump more than TCA_ACT_MAX_PRIO actions per batch
From: Jamal Hadi Salim @ 2017-04-17 16:46 UTC (permalink / raw)
To: Jiri Pirko, Eric Dumazet; +Cc: davem, netdev, xiyou.wangcong
In-Reply-To: <20170417153133.GA1895@nanopsycho.orion>
On 17-04-17 11:31 AM, Jiri Pirko wrote:
> Mon, Apr 17, 2017 at 03:10:59PM CEST, eric.dumazet@gmail.com wrote:
>> On Mon, 2017-04-17 at 07:01 -0400, Jamal Hadi Salim wrote:
> Agreed.
>
> Plus the argument that attributes are "a big waste" sounds to me really
> silly. What is couple of bytes?Please do this properly, as it should
> be done.
Jiri - you wanted to have these uapi discussions, right? ;->
Of course it is trivial to add this as attributes and 32 bits
for this case is not a big deal because it is done once. I want to talk
about the pads instead ;-> What do you suggest we do with pads?
cheers,
jaaml
^ permalink raw reply
* Re: [RFC PATCH linux 0/2] net sched actions: access to uninitialized data and error handling
From: Jamal Hadi Salim @ 2017-04-17 16:41 UTC (permalink / raw)
To: David Miller, w.bumiller; +Cc: netdev
In-Reply-To: <20170417.105947.202929252465875756.davem@davemloft.net>
On 17-04-17 10:59 AM, David Miller wrote:
>
> Jamal please review this.
>
Waiting for Wolfgang to submit a new patch.
cheers,
jamal
^ permalink raw reply
* Re: [PATCH net-next 1/1] net sched actions: dump more than TCA_ACT_MAX_PRIO actions per batch
From: Jamal Hadi Salim @ 2017-04-17 16:40 UTC (permalink / raw)
To: Eric Dumazet; +Cc: Jiri Pirko, davem, netdev, xiyou.wangcong
In-Reply-To: <1492441116.10587.96.camel@edumazet-glaptop3.roam.corp.google.com>
On 17-04-17 10:58 AM, Eric Dumazet wrote:
[..]
> Very often, pads are there because of ABI constraints.
>
> We 'name' them to make clear to developers that they are there,
> and avoid security issues, because of say few bytes from kernel stack
> are copied to user space.
>
> struct foo {
> __u32 a;
> __u16 b;
> };
>
>
> Note that the 16bit padding is there, even if you do not name it.
>
Agreed. But note netlink is defined as "a wire protocol" which
has explicit requirement to pad/align to 32 bit boundary. Therefore
we _always_ explicitly name the pads.
> Once this structure had been exported to some include file and in a
> kernel, there is little point trying to 'reuse' the padding, unless for
> very specific cases.
>
> If you name paddings, then developers might think about it.
>
We always name them for netlink. The challenge is a few months later
we are not allowed to use the fields we name. I see these netlink
struct pads in the same manner as say reserved packet header fields.
cheers,
jamal
^ permalink raw reply
* Re: Use of skb_unclone in drivers
From: Eric Dumazet @ 2017-04-17 16:07 UTC (permalink / raw)
To: James Hughes; +Cc: netdev
In-Reply-To: <CAE_XsMLcUbCdJvzkW8E0rh7NjJHG8vEa-PhKgR3RzzFHaGBS6w@mail.gmail.com>
On Mon, 2017-04-17 at 16:02 +0100, James Hughes wrote:
> Netdevs,
>
> We have recently got to the bottom of an issue which we have been
> encountering on a Raspberry Pi being used as an access point, and we
> need a bit of advice on the correct way of fixing the issue.
>
> The set up is a Raspberry Pi 3 running hostapd on its inbuilt wireless
> adaptor (Brcm43438 ), bridged to the built in ethernet adaptor
> (smsc9514). Using the standard drivers for these devices as of 4.9
> (looking at 4.11, no changes noted that would affect the issue. I will
> be trying the latest kernel once I get back in to the office).
>
> We were encountering an error in the Brcm Wireless driver that after
> investigation was a skb_buff being corrupted by an action in the smsc
> Ethernet driver. Further digging shows that the bridge was cloning an
> incoming skb from the Ethernet, then sending it out to both the
> Ethernet and wlan ports. This mean that both the Ethernet driver and
> the wireless driver were looking at the same physical data, and one or
> both were altering that data in different ways (varied headers) ,
> which mean that headers were corrupted. This was only happening on
> broadcast packets.
>
> We can fix the issue by, in the drivers, using skb_unclone in
> appropriate places in the driver.
>
> So now to the questions. Is adding the unclone to the drivers the
> correct way of dealing with this issue? Examining other drivers shows
> that unclone is not particularly common, presumably in many cases,
> where the driver does not alter the skb, it doesn't matter. However,
> in any case where a driver may add header information to the skb (as
> is the case with the Brcm wireless driver), when the incoming skb has
> been cloned, the results must surely be undetermined unless an unclone
> is performed.
>
> Or, is the bridging code making a mistake by cloning the skb and
> passing it to multiple recipients?
>
bridge code is fine.
Problem is that some drivers lack calls to skb_cow_head() before they
mess with headers.
^ permalink raw reply
* [PATCH 25/25] sky2: Use seq_puts() in sky2_debug_show()
From: SF Markus Elfring @ 2017-04-17 15:35 UTC (permalink / raw)
To: netdev, David S. Miller, Florian Fainelli, Jarod Wilson,
Jisheng Zhang, Mirko Lindner, Philippe Reynes, Russell King,
Sergei Shtylyov, Stephen Hemminger, Thomas Petazzoni
Cc: LKML, kernel-janitors
In-Reply-To: <d6f26bba-c678-5b66-4f5d-85f56d895190@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 17 Apr 2017 16:15:12 +0200
A string which did not contain a data format specification should be put
into a sequence. Thus use the corresponding function "seq_puts".
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/net/ethernet/marvell/sky2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/marvell/sky2.c b/drivers/net/ethernet/marvell/sky2.c
index 2b2cc3f3ca10..1145cde2274a 100644
--- a/drivers/net/ethernet/marvell/sky2.c
+++ b/drivers/net/ethernet/marvell/sky2.c
@@ -4544,7 +4544,7 @@ static int sky2_debug_show(struct seq_file *seq, void *v)
sky2_read32(hw, B0_Y2_SP_ICR));
if (!netif_running(dev)) {
- seq_printf(seq, "network not running\n");
+ seq_puts(seq, "network not running\n");
return 0;
}
--
2.12.2
^ permalink raw reply related
* [PATCH 24/25] skge: Adjust a null pointer check in skge_down()
From: SF Markus Elfring @ 2017-04-17 15:34 UTC (permalink / raw)
To: netdev, David S. Miller, Florian Fainelli, Jarod Wilson,
Jisheng Zhang, Mirko Lindner, Philippe Reynes, Russell King,
Sergei Shtylyov, Stephen Hemminger, Thomas Petazzoni
Cc: LKML, kernel-janitors
In-Reply-To: <d6f26bba-c678-5b66-4f5d-85f56d895190@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 17 Apr 2017 16:08:39 +0200
The script "checkpatch.pl" pointed information out like the following.
Comparison to NULL could be written "!skge->mem".
Thus fix the affected source code place.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/net/ethernet/marvell/skge.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/marvell/skge.c b/drivers/net/ethernet/marvell/skge.c
index 90bfdbcfd910..5d7d94de4e00 100644
--- a/drivers/net/ethernet/marvell/skge.c
+++ b/drivers/net/ethernet/marvell/skge.c
@@ -2657,7 +2657,7 @@ static int skge_down(struct net_device *dev)
struct skge_hw *hw = skge->hw;
int port = skge->port;
- if (skge->mem == NULL)
+ if (!skge->mem)
return 0;
netif_info(skge, ifdown, skge->netdev, "disabling interface\n");
--
2.12.2
^ permalink raw reply related
* [PATCH 23/25] skge: Use seq_puts() in skge_debug_show()
From: SF Markus Elfring @ 2017-04-17 15:33 UTC (permalink / raw)
To: netdev, David S. Miller, Florian Fainelli, Jarod Wilson,
Jisheng Zhang, Mirko Lindner, Philippe Reynes, Russell King,
Sergei Shtylyov, Stephen Hemminger, Thomas Petazzoni
Cc: LKML, kernel-janitors
In-Reply-To: <d6f26bba-c678-5b66-4f5d-85f56d895190@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 17 Apr 2017 15:43:08 +0200
A string which did not contain a data format specification should be put
into a sequence. Thus use the corresponding function "seq_puts".
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/net/ethernet/marvell/skge.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/marvell/skge.c b/drivers/net/ethernet/marvell/skge.c
index edb95271a4f2..90bfdbcfd910 100644
--- a/drivers/net/ethernet/marvell/skge.c
+++ b/drivers/net/ethernet/marvell/skge.c
@@ -3718,7 +3718,7 @@ static int skge_debug_show(struct seq_file *seq, void *v)
t->csum_offs, t->csum_write, t->csum_start);
}
- seq_printf(seq, "\nRx Ring:\n");
+ seq_puts(seq, "\nRx Ring:\n");
for (e = skge->rx_ring.to_clean; ; e = e->next) {
const struct skge_rx_desc *r = e->desc;
--
2.12.2
^ permalink raw reply related
* [PATCH 22/25] net: pxa168_eth: Adjust four checks for null pointers
From: SF Markus Elfring @ 2017-04-17 15:32 UTC (permalink / raw)
To: netdev, David S. Miller, Florian Fainelli, Jarod Wilson,
Jisheng Zhang, Mirko Lindner, Philippe Reynes, Russell King,
Sergei Shtylyov, Stephen Hemminger, Thomas Petazzoni
Cc: LKML, kernel-janitors
In-Reply-To: <d6f26bba-c678-5b66-4f5d-85f56d895190@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 17 Apr 2017 15:23:45 +0200
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The script “checkpatch.pl” pointed information out like the following.
Comparison to NULL could be written …
Thus fix the affected source code places.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/net/ethernet/marvell/pxa168_eth.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/marvell/pxa168_eth.c b/drivers/net/ethernet/marvell/pxa168_eth.c
index 2404eac51c63..993724959a7c 100644
--- a/drivers/net/ethernet/marvell/pxa168_eth.c
+++ b/drivers/net/ethernet/marvell/pxa168_eth.c
@@ -556,11 +556,11 @@ static int init_hash_table(struct pxa168_eth_private *pep)
* function.Driver can dynamically switch to them if the 1/2kB hash
* table is full.
*/
- if (pep->htpr == NULL) {
+ if (!pep->htpr) {
pep->htpr = dma_zalloc_coherent(pep->dev->dev.parent,
HASH_ADDR_TABLE_SIZE,
&pep->htpr_dma, GFP_KERNEL);
- if (pep->htpr == NULL)
+ if (!pep->htpr)
return -ENOMEM;
} else {
memset(pep->htpr, 0, HASH_ADDR_TABLE_SIZE);
@@ -1356,7 +1356,7 @@ static int pxa168_smi_write(struct mii_bus *bus, int phy_addr, int regnum,
static int pxa168_eth_do_ioctl(struct net_device *dev, struct ifreq *ifr,
int cmd)
{
- if (dev->phydev != NULL)
+ if (dev->phydev)
return phy_mii_ioctl(dev->phydev, ifr, cmd);
return -EOPNOTSUPP;
@@ -1501,7 +1501,7 @@ static int pxa168_eth_probe(struct platform_device *pdev)
pep->timeout.data = (unsigned long)pep;
pep->smi_bus = mdiobus_alloc();
- if (pep->smi_bus == NULL) {
+ if (!pep->smi_bus) {
err = -ENOMEM;
goto err_netdev;
}
--
2.12.2
^ permalink raw reply related
* Re: [PATCH net-next 1/1] net sched actions: dump more than TCA_ACT_MAX_PRIO actions per batch
From: Jiri Pirko @ 2017-04-17 15:31 UTC (permalink / raw)
To: Eric Dumazet; +Cc: Jamal Hadi Salim, davem, netdev, xiyou.wangcong
In-Reply-To: <1492434659.10587.90.camel@edumazet-glaptop3.roam.corp.google.com>
Mon, Apr 17, 2017 at 03:10:59PM CEST, eric.dumazet@gmail.com wrote:
>On Mon, 2017-04-17 at 07:01 -0400, Jamal Hadi Salim wrote:
>
>> The name "pad" is ugly - but _we need to put these reserved spaces
>> to good use_. We cant keep declaring pads and say they should never
>> be used in the future.
>> We dont need more than 2-3 bits for the flags for example and i dont
>> see anyone dumping 64K actions in one message.
>> An attribute is a big waste of space. I cant change the name pad -
>> perhaps a union with a new name? We had a similar discussion a while
>> back on some netlink header, i just dont remember the details.
>> Suggestions?
>
>We can not assume user programs properly cleared the paddings anyway.
>
>Using them for 'new features' is risky, since it might break programs.
>
>So the safe way is using new attributes really.
Agreed.
Plus the argument that attributes are "a big waste" sounds to me really
silly. What is couple of bytes? Please do this properly, as it should
be done.
>
>
>
>
^ permalink raw reply
* [PATCH 21/25] net: pxa168_eth: Use kcalloc() in two functions
From: SF Markus Elfring @ 2017-04-17 15:31 UTC (permalink / raw)
To: netdev, David S. Miller, Florian Fainelli, Jarod Wilson,
Jisheng Zhang, Mirko Lindner, Philippe Reynes, Russell King,
Sergei Shtylyov, Stephen Hemminger, Thomas Petazzoni
Cc: LKML, kernel-janitors
In-Reply-To: <d6f26bba-c678-5b66-4f5d-85f56d895190@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 17 Apr 2017 14:32:14 +0200
Multiplications for the size determination of memory allocations
indicated that array data structures should be processed.
Thus use the corresponding function "kcalloc".
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/net/ethernet/marvell/pxa168_eth.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/marvell/pxa168_eth.c b/drivers/net/ethernet/marvell/pxa168_eth.c
index 28cb36d9e50a..2404eac51c63 100644
--- a/drivers/net/ethernet/marvell/pxa168_eth.c
+++ b/drivers/net/ethernet/marvell/pxa168_eth.c
@@ -1036,8 +1036,7 @@ static int rxq_init(struct net_device *dev)
int rx_desc_num = pep->rx_ring_size;
/* Allocate RX skb rings */
- pep->rx_skb = kzalloc(sizeof(*pep->rx_skb) * pep->rx_ring_size,
- GFP_KERNEL);
+ pep->rx_skb = kcalloc(rx_desc_num, sizeof(*pep->rx_skb), GFP_KERNEL);
if (!pep->rx_skb)
return -ENOMEM;
@@ -1096,8 +1095,7 @@ static int txq_init(struct net_device *dev)
int size = 0, i = 0;
int tx_desc_num = pep->tx_ring_size;
- pep->tx_skb = kzalloc(sizeof(*pep->tx_skb) * pep->tx_ring_size,
- GFP_KERNEL);
+ pep->tx_skb = kcalloc(tx_desc_num, sizeof(*pep->tx_skb), GFP_KERNEL);
if (!pep->tx_skb)
return -ENOMEM;
--
2.12.2
^ permalink raw reply related
* [PATCH 20/25] net: mvpp2: Adjust a null pointer check in mvpp2_egress_enable()
From: SF Markus Elfring @ 2017-04-17 15:30 UTC (permalink / raw)
To: netdev, David S. Miller, Florian Fainelli, Jarod Wilson,
Jisheng Zhang, Mirko Lindner, Philippe Reynes, Russell King,
Sergei Shtylyov, Stephen Hemminger, Thomas Petazzoni
Cc: LKML, kernel-janitors
In-Reply-To: <d6f26bba-c678-5b66-4f5d-85f56d895190@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 17 Apr 2017 14:07:52 +0200
The script "checkpatch.pl" pointed information out like the following.
Comparison to NULL could be written "txq->descs".
Thus fix the affected source code place.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/net/ethernet/marvell/mvpp2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/marvell/mvpp2.c b/drivers/net/ethernet/marvell/mvpp2.c
index 3bdd3f1fe34e..9b875d776b29 100644
--- a/drivers/net/ethernet/marvell/mvpp2.c
+++ b/drivers/net/ethernet/marvell/mvpp2.c
@@ -4415,7 +4415,7 @@ static void mvpp2_egress_enable(struct mvpp2_port *port)
for (queue = 0; queue < txq_number; queue++) {
struct mvpp2_tx_queue *txq = port->txqs[queue];
- if (txq->descs != NULL)
+ if (txq->descs)
qmap |= (1 << queue);
}
--
2.12.2
^ permalink raw reply related
* [PATCH 19/25] net: mvpp2: Rename a jump label in mvpp2_prs_vlan_add()
From: SF Markus Elfring @ 2017-04-17 15:29 UTC (permalink / raw)
To: netdev, David S. Miller, Florian Fainelli, Jarod Wilson,
Jisheng Zhang, Mirko Lindner, Philippe Reynes, Russell King,
Sergei Shtylyov, Stephen Hemminger, Thomas Petazzoni
Cc: LKML, kernel-janitors
In-Reply-To: <d6f26bba-c678-5b66-4f5d-85f56d895190@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 17 Apr 2017 13:50:35 +0200
Adjust jump labels according to the Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/net/ethernet/marvell/mvpp2.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/marvell/mvpp2.c b/drivers/net/ethernet/marvell/mvpp2.c
index 0c190bd003b1..3bdd3f1fe34e 100644
--- a/drivers/net/ethernet/marvell/mvpp2.c
+++ b/drivers/net/ethernet/marvell/mvpp2.c
@@ -2021,7 +2021,7 @@ static int mvpp2_prs_vlan_add(struct mvpp2 *priv, unsigned short tpid, int ai,
if (tid <= tid_aux) {
ret = -EINVAL;
- goto error;
+ goto free_pe;
}
memset(pe, 0, sizeof(*pe));
@@ -2053,8 +2053,7 @@ static int mvpp2_prs_vlan_add(struct mvpp2 *priv, unsigned short tpid, int ai,
mvpp2_prs_tcam_port_map_set(pe, port_map);
mvpp2_prs_hw_write(priv, pe);
-
-error:
+free_pe:
kfree(pe);
return ret;
--
2.12.2
^ permalink raw reply related
* [PATCH 18/25] net: mvpp2: Rename a jump label in mvpp2_prs_double_vlan_add()
From: SF Markus Elfring @ 2017-04-17 15:28 UTC (permalink / raw)
To: netdev, David S. Miller, Florian Fainelli, Jarod Wilson,
Jisheng Zhang, Mirko Lindner, Philippe Reynes, Russell King,
Sergei Shtylyov, Stephen Hemminger, Thomas Petazzoni
Cc: LKML, kernel-janitors
In-Reply-To: <d6f26bba-c678-5b66-4f5d-85f56d895190@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 17 Apr 2017 13:03:49 +0200
Adjust jump labels according to the Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/net/ethernet/marvell/mvpp2.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/marvell/mvpp2.c b/drivers/net/ethernet/marvell/mvpp2.c
index a5cd1036012a..0c190bd003b1 100644
--- a/drivers/net/ethernet/marvell/mvpp2.c
+++ b/drivers/net/ethernet/marvell/mvpp2.c
@@ -2139,7 +2139,7 @@ static int mvpp2_prs_double_vlan_add(struct mvpp2 *priv, unsigned short tpid1,
ai = mvpp2_prs_double_vlan_ai_free_get(priv);
if (ai < 0) {
ret = ai;
- goto error;
+ goto free_pe;
}
/* Get first single/triple vlan tid */
@@ -2162,7 +2162,7 @@ static int mvpp2_prs_double_vlan_add(struct mvpp2 *priv, unsigned short tpid1,
if (tid >= tid_aux) {
ret = -ERANGE;
- goto error;
+ goto free_pe;
}
memset(pe, 0, sizeof(*pe));
@@ -2189,8 +2189,7 @@ static int mvpp2_prs_double_vlan_add(struct mvpp2 *priv, unsigned short tpid1,
/* Update ports' mask */
mvpp2_prs_tcam_port_map_set(pe, port_map);
mvpp2_prs_hw_write(priv, pe);
-
-error:
+free_pe:
kfree(pe);
return ret;
}
--
2.12.2
^ permalink raw reply related
* [PATCH 17/25] net: mvpp2: Rename a jump label in mvpp2_txq_init()
From: SF Markus Elfring @ 2017-04-17 15:27 UTC (permalink / raw)
To: netdev, David S. Miller, Florian Fainelli, Jarod Wilson,
Jisheng Zhang, Mirko Lindner, Philippe Reynes, Russell King,
Sergei Shtylyov, Stephen Hemminger, Thomas Petazzoni
Cc: LKML, kernel-janitors
In-Reply-To: <d6f26bba-c678-5b66-4f5d-85f56d895190@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 17 Apr 2017 12:58:33 +0200
Adjust jump labels according to the Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/net/ethernet/marvell/mvpp2.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/marvell/mvpp2.c b/drivers/net/ethernet/marvell/mvpp2.c
index 8f4348316d28..a5cd1036012a 100644
--- a/drivers/net/ethernet/marvell/mvpp2.c
+++ b/drivers/net/ethernet/marvell/mvpp2.c
@@ -5087,7 +5087,7 @@ static int mvpp2_txq_init(struct mvpp2_port *port,
sizeof(*txq_pcpu->buffs),
GFP_KERNEL);
if (!txq_pcpu->buffs)
- goto error;
+ goto cleanup;
txq_pcpu->count = 0;
txq_pcpu->reserved_num = 0;
@@ -5096,8 +5096,7 @@ static int mvpp2_txq_init(struct mvpp2_port *port,
}
return 0;
-
-error:
+cleanup:
for_each_present_cpu(cpu) {
txq_pcpu = per_cpu_ptr(txq->pcpu, cpu);
kfree(txq_pcpu->buffs);
--
2.12.2
^ permalink raw reply related
* [PATCH 16/25] net: mvpp2: Rename a jump label in mvpp2_tx_frag_process()
From: SF Markus Elfring @ 2017-04-17 15:26 UTC (permalink / raw)
To: netdev, David S. Miller, Florian Fainelli, Jarod Wilson,
Jisheng Zhang, Mirko Lindner, Philippe Reynes, Russell King,
Sergei Shtylyov, Stephen Hemminger, Thomas Petazzoni
Cc: LKML, kernel-janitors
In-Reply-To: <d6f26bba-c678-5b66-4f5d-85f56d895190@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 17 Apr 2017 11:36:34 +0200
Adjust jump labels according to the Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/net/ethernet/marvell/mvpp2.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/marvell/mvpp2.c b/drivers/net/ethernet/marvell/mvpp2.c
index 717d79dcb6aa..8f4348316d28 100644
--- a/drivers/net/ethernet/marvell/mvpp2.c
+++ b/drivers/net/ethernet/marvell/mvpp2.c
@@ -5606,7 +5606,7 @@ static int mvpp2_tx_frag_process(struct mvpp2_port *port, struct sk_buff *skb,
DMA_TO_DEVICE);
if (dma_mapping_error(port->dev->dev.parent, buf_dma_addr)) {
mvpp2_txq_desc_put(txq);
- goto error;
+ goto cleanup;
}
mvpp2_txdesc_offset_set(port, tx_desc,
@@ -5627,8 +5627,7 @@ static int mvpp2_tx_frag_process(struct mvpp2_port *port, struct sk_buff *skb,
}
return 0;
-
-error:
+cleanup:
/* Release all descriptors that were used to map fragments of
* this packet, as well as the corresponding DMA mappings
*/
--
2.12.2
^ permalink raw reply related
* [PATCH 15/25] net: mvpp2: Adjust three error messages
From: SF Markus Elfring @ 2017-04-17 15:25 UTC (permalink / raw)
To: netdev, David S. Miller, Florian Fainelli, Jarod Wilson,
Jisheng Zhang, Mirko Lindner, Philippe Reynes, Russell King,
Sergei Shtylyov, Stephen Hemminger, Thomas Petazzoni
Cc: LKML, kernel-janitors
In-Reply-To: <d6f26bba-c678-5b66-4f5d-85f56d895190@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 17 Apr 2017 11:20:41 +0200
Use the word "failed" in the string for three function calls.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/net/ethernet/marvell/mvpp2.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/marvell/mvpp2.c b/drivers/net/ethernet/marvell/mvpp2.c
index 89237abf386d..717d79dcb6aa 100644
--- a/drivers/net/ethernet/marvell/mvpp2.c
+++ b/drivers/net/ethernet/marvell/mvpp2.c
@@ -6094,7 +6094,7 @@ static int mvpp2_set_mac_address(struct net_device *dev, void *p)
mvpp2_ingress_enable(port);
return 0;
log_error:
- netdev_err(dev, "fail to change MAC address\n");
+ netdev_err(dev, "failed to change MAC address\n");
return err;
}
@@ -6142,7 +6142,7 @@ static int mvpp2_change_mtu(struct net_device *dev, int mtu)
return 0;
log_error:
- netdev_err(dev, "fail to change MTU\n");
+ netdev_err(dev, "failed to change MTU\n");
return err;
}
@@ -6311,7 +6311,7 @@ static int mvpp2_ethtool_set_ringparam(struct net_device *dev,
err_clean_rxqs:
mvpp2_cleanup_rxqs(port);
err_out:
- netdev_err(dev, "fail to change ring parameters");
+ netdev_err(dev, "failed to change ring parameters");
return err;
}
--
2.12.2
^ 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