* Re: [RFC PATCH linux 0/2] net sched actions: access to uninitialized data and error handling
From: David Miller @ 2017-04-17 14:59 UTC (permalink / raw)
To: w.bumiller; +Cc: netdev, linux-kernel, jhs
In-Reply-To: <20170412142140.26649-1-w.bumiller@proxmox.com>
From: Wolfgang Bumiller <w.bumiller@proxmox.com>
Date: Wed, 12 Apr 2017 16:21:38 +0200
> Commit 1045ba77a ("net sched actions: Add support for user cookies")
> added code to net/sched/act_api.c's tcf_action_init_1 using the `tb`
> nlattr array unconditionally, while it was otherwise used as well as
> initialized only when `name == NULL`:
...
> I'm not sure why the TC_ACT_COOKIE code was added to tcf_action_init_1
> where it is now. It makes me think that it's supposed to be available
> universally, but the `name == NULL` check for how nla is used or passed
> to ->init() shows that the there are various different TC_ACT_* enums in
> use at this point, hence the 'RFC' part of the patches, I'm not that
> familiar with the code yet.
Jamal please review this.
^ permalink raw reply
* Re: [PATCH net] sfc: limit the number of receive queues
From: David Miller @ 2017-04-17 15:01 UTC (permalink / raw)
To: bkenward; +Cc: davem, netdev, linux-net-drivers
In-Reply-To: <08aae3d8-7ff9-a0f0-8432-2b7b1e026611@solarflare.com>
From: Bert Kenward <bkenward@solarflare.com>
Date: Wed, 12 Apr 2017 17:06:52 +0100
> The number of rx queues is determined by the rss_cpus parameter
> or the cpu topology. If that is higher than EFX_MAX_RX_QUEUES the
> driver can corrupt state.
>
> Fixes: 8ceee660aacb ("New driver "sfc" for Solarstorm SFC4000 controller.")
> Signed-off-by: Bert Kenward <bkenward@solarflare.com>
Applied, thank you.
^ permalink raw reply
* Use of skb_unclone in drivers
From: James Hughes @ 2017-04-17 15:02 UTC (permalink / raw)
To: netdev
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?
Thanks
James Hughes
Raspberry Pi
^ permalink raw reply
* Re: [PATCH net-next v2] net: dsa: isolate legacy code
From: David Miller @ 2017-04-17 15:03 UTC (permalink / raw)
To: vivien.didelot; +Cc: netdev, linux-kernel, kernel, f.fainelli, andrew
In-Reply-To: <20170412164503.28264-1-vivien.didelot@savoirfairelinux.com>
From: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Date: Wed, 12 Apr 2017 12:45:03 -0400
> This patch moves as is the legacy DSA code from dsa.c to legacy.c,
> except the few shared symbols which remain in dsa.c.
>
> Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
> ---
> Changes in v2:
> - drop CONFIG_NET_DSA_LEGACY so that legacy code gets compiled anyway
Applied, thanks.
^ permalink raw reply
* [PATCH 00/25] Ethernet-Marvell: Fine-tuning for several function implementations
From: SF Markus Elfring @ 2017-04-17 15:03 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
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 17 Apr 2017 16:44:32 +0200
Several update suggestions were taken into account
from static source code analysis.
Markus Elfring (25):
Use devm_kmalloc_array() in mvneta_init()
Improve two size determinations in mvneta_init()
Use kmalloc_array() in mvneta_txq_init()
Adjust six checks for null pointers
Use kmalloc_array() in mvpp2_txq_init()
Improve two size determinations in mvpp2_probe()
Improve another size determination in mvpp2_init()
Improve another size determination in mvpp2_port_probe()
Improve another size determination in mvpp2_bm_init()
Improve another size determination in mvpp2_prs_default_init()
Improve 27 size determinations
Improve a size determination in two functions
Fix a jump label position in mvpp2_rx()
Rename a jump label in two functions
Adjust three error messages
Rename a jump label in mvpp2_tx_frag_process()
Rename a jump label in mvpp2_txq_init()
Rename a jump label in mvpp2_prs_double_vlan_add()
Rename a jump label in mvpp2_prs_vlan_add()
Adjust a null pointer check in mvpp2_egress_enable()
Use kcalloc() in two functions
Adjust four checks for null pointers
Use seq_puts() in skge_debug_show()
Adjust a null pointer check in skge_down()
Use seq_puts() in sky2_debug_show()
drivers/net/ethernet/marvell/mvneta.c | 29 +++----
drivers/net/ethernet/marvell/mvpp2.c | 127 ++++++++++++++----------------
drivers/net/ethernet/marvell/pxa168_eth.c | 14 ++--
drivers/net/ethernet/marvell/skge.c | 4 +-
drivers/net/ethernet/marvell/sky2.c | 2 +-
5 files changed, 84 insertions(+), 92 deletions(-)
--
2.12.2
^ permalink raw reply
* Re: [PATCH net-next,1/2] hv_netvsc: Fix the queue index computation in forwarding case
From: David Miller @ 2017-04-17 15:05 UTC (permalink / raw)
To: haiyangz, haiyangz; +Cc: netdev, kys, olaf, vkuznets, linux-kernel
In-Reply-To: <1492022106-4070-1-git-send-email-haiyangz@exchange.microsoft.com>
From: Haiyang Zhang <haiyangz@exchange.microsoft.com>
Date: Wed, 12 Apr 2017 11:35:05 -0700
> From: Haiyang Zhang <haiyangz@microsoft.com>
>
> If the outgoing skb has a RX queue mapping available, we use the queue
> number directly, other than put it through Send Indirection Table.
>
> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
> Reviewed-by: Stephen Hemminger <sthemmin@microsoft.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next,2/2] hv_netvsc: Exclude non-TCP port numbers from vRSS hashing
From: David Miller @ 2017-04-17 15:05 UTC (permalink / raw)
To: haiyangz, haiyangz; +Cc: netdev, kys, olaf, vkuznets, linux-kernel
In-Reply-To: <1492022106-4070-2-git-send-email-haiyangz@exchange.microsoft.com>
From: Haiyang Zhang <haiyangz@exchange.microsoft.com>
Date: Wed, 12 Apr 2017 11:35:06 -0700
> From: Haiyang Zhang <haiyangz@microsoft.com>
>
> Azure hosts are not supporting non-TCP port numbers in vRSS hashing for
> now. For example, UDP packet loss rate will be high if port numbers are
> also included in vRSS hash.
>
> So, we created this patch to use only IP numbers for hashing in non-TCP
> traffic.
>
> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
> Reviewed-by: Stephen Hemminger <sthemmin@microsoft.com>
Applied.
^ permalink raw reply
* [PATCH 01/25] net: mvneta: Use devm_kmalloc_array() in mvneta_init()
From: SF Markus Elfring @ 2017-04-17 15:08 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: Sun, 16 Apr 2017 21:23:19 +0200
* A multiplication for the size determination of a memory allocation
indicated that an array data structure should be processed.
Thus use the corresponding function "devm_kmalloc_array".
This issue was detected by using the Coccinelle software.
* Replace the specification of a data type by a pointer dereference
to make the corresponding size determination a bit safer according to
the Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/net/ethernet/marvell/mvneta.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index 34a3686d2ce6..46fa74e93814 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -4017,9 +4017,11 @@ static int mvneta_init(struct device *dev, struct mvneta_port *pp)
rxq->size = pp->rx_ring_size;
rxq->pkts_coal = MVNETA_RX_COAL_PKTS;
rxq->time_coal = MVNETA_RX_COAL_USEC;
- rxq->buf_virt_addr = devm_kmalloc(pp->dev->dev.parent,
- rxq->size * sizeof(void *),
- GFP_KERNEL);
+ rxq->buf_virt_addr
+ = devm_kmalloc_array(pp->dev->dev.parent,
+ rxq->size,
+ sizeof(*rxq->buf_virt_addr),
+ GFP_KERNEL);
if (!rxq->buf_virt_addr)
return -ENOMEM;
}
--
2.12.2
^ permalink raw reply related
* Re: [PATCH net-next 00/16] Mellanox, mlx5 RDMA net device support
From: David Miller @ 2017-04-17 15:08 UTC (permalink / raw)
To: saeedm
Cc: netdev, linux-rdma, dledford, leonro, erezsh, jgunthorpe,
niranjana.vishwanathapura
In-Reply-To: <20170413033706.19016-1-saeedm@mellanox.com>
From: Saeed Mahameed <saeedm@mellanox.com>
Date: Thu, 13 Apr 2017 06:36:50 +0300
> This series provides the lower level mlx5 support of RDMA netdevice
> creation API [1] suggested and introduced by Intel's HFI OPA VNIC
> netdevice driver [2], to enable IPoIB mlx5 RDMA netdevice creation.
Series applied to net-next.
^ permalink raw reply
* [PATCH 02/25] net: mvneta: Improve two size determinations in mvneta_init()
From: SF Markus Elfring @ 2017-04-17 15:10 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: Sun, 16 Apr 2017 21:45:38 +0200
Replace the specification of two data structures by pointer dereferences
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/net/ethernet/marvell/mvneta.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index 46fa74e93814..9c9eed5a8e28 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -3992,8 +3992,7 @@ static int mvneta_init(struct device *dev, struct mvneta_port *pp)
/* Set port default values */
mvneta_defaults_set(pp);
- pp->txqs = devm_kcalloc(dev, txq_number, sizeof(struct mvneta_tx_queue),
- GFP_KERNEL);
+ pp->txqs = devm_kcalloc(dev, txq_number, sizeof(*pp->txqs), GFP_KERNEL);
if (!pp->txqs)
return -ENOMEM;
@@ -4005,8 +4004,7 @@ static int mvneta_init(struct device *dev, struct mvneta_port *pp)
txq->done_pkts_coal = MVNETA_TXDONE_COAL_PKTS;
}
- pp->rxqs = devm_kcalloc(dev, rxq_number, sizeof(struct mvneta_rx_queue),
- GFP_KERNEL);
+ pp->rxqs = devm_kcalloc(dev, rxq_number, sizeof(*pp->rxqs), GFP_KERNEL);
if (!pp->rxqs)
return -ENOMEM;
--
2.12.2
^ permalink raw reply related
* Re: [PATCH v2 0/9] ftgmac100: Rework batch 5 - Features
From: David Miller @ 2017-04-17 15:11 UTC (permalink / raw)
To: benh; +Cc: netdev
In-Reply-To: <20170413043916.7793-1-benh@kernel.crashing.org>
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: Thu, 13 Apr 2017 14:39:07 +1000
> This is the second spin of the fifth and last batch of
> updates to the ftgmac100 driver.
This series doesn't apply cleanly to net-next, please respin.
Thanks.
^ permalink raw reply
* Re: [PATCH net-next] Replace constant with sysctl netdev_budget_jiffies to enable tuning
From: Eric Dumazet @ 2017-04-17 15:11 UTC (permalink / raw)
To: Matthew Whitehead; +Cc: netdev
In-Reply-To: <1492439349-21081-1-git-send-email-tedheadster@gmail.com>
On Mon, 2017-04-17 at 10:29 -0400, Matthew Whitehead wrote:
> Constants used for tuning are generally a bad idea, especially as hardware
> changes over time. Replace the constant '2' with netdev_budget_jiffies to
> enable sysadmins to tune the behavior. Also document the variable.
>
> For example, a very fast machine might tune this to 1, while my regression
> testing 486DX-25 needs it to be 4 on a nearly idle network to prevent
> time_squeeze from being incremented.
Hi Matthew
What is the problem with this 'time_squeeze' being incremented ?
This is an indicator, but not something bad per se.
Maybe your 486DX-25 should use HZ=100 ;)
Really I do not believe we should let admins/users play with this limit,
they will most likely shoot themselves.
Anyway, exporting in /proc/sys some time limit in 'jiffies' is not
recommended. We prefer portable msecs , usec or nanosec units.
Thanks.
^ permalink raw reply
* [PATCH 03/25] net: mvneta: Use kmalloc_array() in mvneta_txq_init()
From: SF Markus Elfring @ 2017-04-17 15:13 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: Sun, 16 Apr 2017 22:11:22 +0200
A multiplication for the size determination of a memory allocation
indicated that an array data structure should be processed.
Thus use the corresponding function "kmalloc_array".
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/net/ethernet/marvell/mvneta.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index 9c9eed5a8e28..9c2ddd22a86f 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -2933,7 +2933,8 @@ static int mvneta_txq_init(struct mvneta_port *pp,
mvreg_write(pp, MVNETA_TXQ_BASE_ADDR_REG(txq->id), txq->descs_phys);
mvreg_write(pp, MVNETA_TXQ_SIZE_REG(txq->id), txq->size);
- txq->tx_skb = kmalloc(txq->size * sizeof(*txq->tx_skb), GFP_KERNEL);
+ txq->tx_skb = kmalloc_array(txq->size, sizeof(*txq->tx_skb),
+ GFP_KERNEL);
if (txq->tx_skb == NULL) {
dma_free_coherent(pp->dev->dev.parent,
txq->size * MVNETA_DESC_ALIGNED_SIZE,
--
2.12.2
^ permalink raw reply related
* [PATCH 04/25] net: mvneta: Adjust six checks for null pointers
From: SF Markus Elfring @ 2017-04-17 15:14 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: Sun, 16 Apr 2017 22:45:33 +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/mvneta.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index 9c2ddd22a86f..6f436db8b01e 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -1107,7 +1107,7 @@ static void mvneta_port_up(struct mvneta_port *pp)
q_map = 0;
for (queue = 0; queue < txq_number; queue++) {
struct mvneta_tx_queue *txq = &pp->txqs[queue];
- if (txq->descs != NULL)
+ if (txq->descs)
q_map |= (1 << queue);
}
mvreg_write(pp, MVNETA_TXQ_CMD, q_map);
@@ -1116,7 +1116,7 @@ static void mvneta_port_up(struct mvneta_port *pp)
for (queue = 0; queue < rxq_number; queue++) {
struct mvneta_rx_queue *rxq = &pp->rxqs[queue];
- if (rxq->descs != NULL)
+ if (rxq->descs)
q_map |= (1 << queue);
}
mvreg_write(pp, MVNETA_RXQ_CMD, q_map);
@@ -2850,7 +2850,7 @@ static int mvneta_rxq_init(struct mvneta_port *pp,
rxq->descs = dma_alloc_coherent(pp->dev->dev.parent,
rxq->size * MVNETA_DESC_ALIGNED_SIZE,
&rxq->descs_phys, GFP_KERNEL);
- if (rxq->descs == NULL)
+ if (!rxq->descs)
return -ENOMEM;
rxq->last_desc = rxq->size - 1;
@@ -2920,7 +2920,7 @@ static int mvneta_txq_init(struct mvneta_port *pp,
txq->descs = dma_alloc_coherent(pp->dev->dev.parent,
txq->size * MVNETA_DESC_ALIGNED_SIZE,
&txq->descs_phys, GFP_KERNEL);
- if (txq->descs == NULL)
+ if (!txq->descs)
return -ENOMEM;
txq->last_desc = txq->size - 1;
@@ -2935,7 +2935,7 @@ static int mvneta_txq_init(struct mvneta_port *pp,
txq->tx_skb = kmalloc_array(txq->size, sizeof(*txq->tx_skb),
GFP_KERNEL);
- if (txq->tx_skb == NULL) {
+ if (!txq->tx_skb) {
dma_free_coherent(pp->dev->dev.parent,
txq->size * MVNETA_DESC_ALIGNED_SIZE,
txq->descs, txq->descs_phys);
@@ -2946,7 +2946,7 @@ static int mvneta_txq_init(struct mvneta_port *pp,
txq->tso_hdrs = dma_alloc_coherent(pp->dev->dev.parent,
txq->size * TSO_HEADER_SIZE,
&txq->tso_hdrs_phys, GFP_KERNEL);
- if (txq->tso_hdrs == NULL) {
+ if (!txq->tso_hdrs) {
kfree(txq->tx_skb);
dma_free_coherent(pp->dev->dev.parent,
txq->size * MVNETA_DESC_ALIGNED_SIZE,
--
2.12.2
^ permalink raw reply related
* [PATCH 05/25] net: mvpp2: Use kmalloc_array() in mvpp2_txq_init()
From: SF Markus Elfring @ 2017-04-17 15:15 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 08:09:07 +0200
* A multiplication for the size determination of a memory allocation
indicated that an array data structure should be processed.
Thus use the corresponding function "kmalloc_array".
This issue was detected by using the Coccinelle software.
* Replace the specification of a data structure by a pointer dereference
to make the corresponding size determination a bit safer according to
the Linux coding style convention.
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 af5bfa13d976..a86d9111c476 100644
--- a/drivers/net/ethernet/marvell/mvpp2.c
+++ b/drivers/net/ethernet/marvell/mvpp2.c
@@ -5083,9 +5083,9 @@ static int mvpp2_txq_init(struct mvpp2_port *port,
for_each_present_cpu(cpu) {
txq_pcpu = per_cpu_ptr(txq->pcpu, cpu);
txq_pcpu->size = txq->size;
- txq_pcpu->buffs = kmalloc(txq_pcpu->size *
- sizeof(struct mvpp2_txq_pcpu_buf),
- GFP_KERNEL);
+ txq_pcpu->buffs = kmalloc_array(txq_pcpu->size,
+ sizeof(*txq_pcpu->buffs),
+ GFP_KERNEL);
if (!txq_pcpu->buffs)
goto error;
--
2.12.2
^ permalink raw reply related
* [PATCH 06/25] net: mvpp2: Improve two size determinations in mvpp2_probe()
From: SF Markus Elfring @ 2017-04-17 15:16 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 08:38:32 +0200
Replace the specification of two data structures by pointer dereferences
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.
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 a86d9111c476..04aba2307b60 100644
--- a/drivers/net/ethernet/marvell/mvpp2.c
+++ b/drivers/net/ethernet/marvell/mvpp2.c
@@ -6873,7 +6873,7 @@ static int mvpp2_probe(struct platform_device *pdev)
int port_count, cpu;
int err;
- priv = devm_kzalloc(&pdev->dev, sizeof(struct mvpp2), GFP_KERNEL);
+ priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
if (!priv)
return -ENOMEM;
@@ -6970,8 +6970,8 @@ static int mvpp2_probe(struct platform_device *pdev)
}
priv->port_list = devm_kcalloc(&pdev->dev, port_count,
- sizeof(struct mvpp2_port *),
- GFP_KERNEL);
+ sizeof(*priv->port_list),
+ GFP_KERNEL);
if (!priv->port_list) {
err = -ENOMEM;
goto err_mg_clk;
--
2.12.2
^ permalink raw reply related
* [PATCH 07/25] net: mvpp2: Improve another size determination in mvpp2_init()
From: SF Markus Elfring @ 2017-04-17 15:17 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 08:48:23 +0200
Replace the specification of a data structure by a pointer dereference
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.
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 04aba2307b60..e35c4d0b112a 100644
--- a/drivers/net/ethernet/marvell/mvpp2.c
+++ b/drivers/net/ethernet/marvell/mvpp2.c
@@ -6806,7 +6806,7 @@ static int mvpp2_init(struct platform_device *pdev, struct mvpp2 *priv)
/* Allocate and initialize aggregated TXQs */
priv->aggr_txqs = devm_kcalloc(&pdev->dev, num_present_cpus(),
- sizeof(struct mvpp2_tx_queue),
+ sizeof(*priv->aggr_txqs),
GFP_KERNEL);
if (!priv->aggr_txqs)
return -ENOMEM;
--
2.12.2
^ permalink raw reply related
* [PATCH 08/25] net: mvpp2: Improve another size determination in mvpp2_port_probe()
From: SF Markus Elfring @ 2017-04-17 15:18 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 08:55:42 +0200
Replace the specification of a data structure by a pointer dereference
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/net/ethernet/marvell/mvpp2.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/marvell/mvpp2.c b/drivers/net/ethernet/marvell/mvpp2.c
index e35c4d0b112a..8f1fec2986f9 100644
--- a/drivers/net/ethernet/marvell/mvpp2.c
+++ b/drivers/net/ethernet/marvell/mvpp2.c
@@ -6487,8 +6487,7 @@ static int mvpp2_port_probe(struct platform_device *pdev,
int phy_mode;
int err, i, cpu;
- dev = alloc_etherdev_mqs(sizeof(struct mvpp2_port), txq_number,
- rxq_number);
+ dev = alloc_etherdev_mqs(sizeof(*port), txq_number, rxq_number);
if (!dev)
return -ENOMEM;
--
2.12.2
^ permalink raw reply related
* [PATCH 09/25] net: mvpp2: Improve another size determination in mvpp2_bm_init()
From: SF Markus Elfring @ 2017-04-17 15:19 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 09:06:33 +0200
Replace the specification of a data structure by a pointer dereference
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.
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 8f1fec2986f9..8fb039b2073e 100644
--- a/drivers/net/ethernet/marvell/mvpp2.c
+++ b/drivers/net/ethernet/marvell/mvpp2.c
@@ -3833,7 +3833,7 @@ static int mvpp2_bm_init(struct platform_device *pdev, struct mvpp2 *priv)
/* Allocate and initialize BM pools */
priv->bm_pools = devm_kcalloc(&pdev->dev, MVPP2_BM_POOLS_NUM,
- sizeof(struct mvpp2_bm_pool), GFP_KERNEL);
+ sizeof(*priv->bm_pools), GFP_KERNEL);
if (!priv->bm_pools)
return -ENOMEM;
--
2.12.2
^ permalink raw reply related
* [PATCH 10/25] net: mvpp2: Improve another size determination in mvpp2_prs_default_init()
From: SF Markus Elfring @ 2017-04-17 15:20 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 09:12:34 +0200
Replace the specification of a data structure by a pointer dereference
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.
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 8fb039b2073e..abf084b43af7 100644
--- a/drivers/net/ethernet/marvell/mvpp2.c
+++ b/drivers/net/ethernet/marvell/mvpp2.c
@@ -3205,7 +3205,7 @@ static int mvpp2_prs_default_init(struct platform_device *pdev,
mvpp2_prs_hw_inv(priv, index);
priv->prs_shadow = devm_kcalloc(&pdev->dev, MVPP2_PRS_TCAM_SRAM_SIZE,
- sizeof(struct mvpp2_prs_shadow),
+ sizeof(*priv->prs_shadow),
GFP_KERNEL);
if (!priv->prs_shadow)
return -ENOMEM;
--
2.12.2
^ permalink raw reply related
* [PATCH 11/25] net: mvpp2: Improve 27 size determinations
From: SF Markus Elfring @ 2017-04-17 15:21 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 10:30:29 +0200
Replace the specification of data structures by references to
a local variable as the parameter for the operator "sizeof"
to make the corresponding size determination a bit safer.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/net/ethernet/marvell/mvpp2.c | 54 ++++++++++++++++++------------------
1 file changed, 27 insertions(+), 27 deletions(-)
diff --git a/drivers/net/ethernet/marvell/mvpp2.c b/drivers/net/ethernet/marvell/mvpp2.c
index abf084b43af7..61fd87d0a4ec 100644
--- a/drivers/net/ethernet/marvell/mvpp2.c
+++ b/drivers/net/ethernet/marvell/mvpp2.c
@@ -1689,7 +1689,7 @@ static void mvpp2_prs_mac_drop_all_set(struct mvpp2 *priv, int port, bool add)
mvpp2_prs_hw_read(priv, &pe);
} else {
/* Entry doesn't exist - create new */
- memset(&pe, 0, sizeof(struct mvpp2_prs_entry));
+ memset(&pe, 0, sizeof(pe));
mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_MAC);
pe.index = MVPP2_PE_DROP_ALL;
@@ -1726,7 +1726,7 @@ static void mvpp2_prs_mac_promisc_set(struct mvpp2 *priv, int port, bool add)
mvpp2_prs_hw_read(priv, &pe);
} else {
/* Entry doesn't exist - create new */
- memset(&pe, 0, sizeof(struct mvpp2_prs_entry));
+ memset(&pe, 0, sizeof(pe));
mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_MAC);
pe.index = MVPP2_PE_MAC_PROMISCUOUS;
@@ -1772,7 +1772,7 @@ static void mvpp2_prs_mac_multi_set(struct mvpp2 *priv, int port, int index,
mvpp2_prs_hw_read(priv, &pe);
} else {
/* Entry doesn't exist - create new */
- memset(&pe, 0, sizeof(struct mvpp2_prs_entry));
+ memset(&pe, 0, sizeof(pe));
mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_MAC);
pe.index = index;
@@ -1824,7 +1824,7 @@ static void mvpp2_prs_dsa_tag_set(struct mvpp2 *priv, int port, bool add,
mvpp2_prs_hw_read(priv, &pe);
} else {
/* Entry doesn't exist - create new */
- memset(&pe, 0, sizeof(struct mvpp2_prs_entry));
+ memset(&pe, 0, sizeof(pe));
mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_DSA);
pe.index = tid;
@@ -1887,7 +1887,7 @@ static void mvpp2_prs_dsa_tag_ethertype_set(struct mvpp2 *priv, int port,
mvpp2_prs_hw_read(priv, &pe);
} else {
/* Entry doesn't exist - create new */
- memset(&pe, 0, sizeof(struct mvpp2_prs_entry));
+ memset(&pe, 0, sizeof(pe));
mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_DSA);
pe.index = tid;
@@ -2212,7 +2212,7 @@ static int mvpp2_prs_ip4_proto(struct mvpp2 *priv, unsigned short proto,
if (tid < 0)
return tid;
- memset(&pe, 0, sizeof(struct mvpp2_prs_entry));
+ memset(&pe, 0, sizeof(pe));
mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_IP4);
pe.index = tid;
@@ -2270,7 +2270,7 @@ static int mvpp2_prs_ip4_cast(struct mvpp2 *priv, unsigned short l3_cast)
if (tid < 0)
return tid;
- memset(&pe, 0, sizeof(struct mvpp2_prs_entry));
+ memset(&pe, 0, sizeof(pe));
mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_IP4);
pe.index = tid;
@@ -2326,7 +2326,7 @@ static int mvpp2_prs_ip6_proto(struct mvpp2 *priv, unsigned short proto,
if (tid < 0)
return tid;
- memset(&pe, 0, sizeof(struct mvpp2_prs_entry));
+ memset(&pe, 0, sizeof(pe));
mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_IP6);
pe.index = tid;
@@ -2365,7 +2365,7 @@ static int mvpp2_prs_ip6_cast(struct mvpp2 *priv, unsigned short l3_cast)
if (tid < 0)
return tid;
- memset(&pe, 0, sizeof(struct mvpp2_prs_entry));
+ memset(&pe, 0, sizeof(pe));
mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_IP6);
pe.index = tid;
@@ -2425,7 +2425,7 @@ static void mvpp2_prs_def_flow_init(struct mvpp2 *priv)
int port;
for (port = 0; port < MVPP2_MAX_PORTS; port++) {
- memset(&pe, 0, sizeof(struct mvpp2_prs_entry));
+ memset(&pe, 0, sizeof(pe));
mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_FLOWS);
pe.index = MVPP2_PE_FIRST_DEFAULT_FLOW - port;
@@ -2447,7 +2447,7 @@ static void mvpp2_prs_mh_init(struct mvpp2 *priv)
{
struct mvpp2_prs_entry pe;
- memset(&pe, 0, sizeof(struct mvpp2_prs_entry));
+ memset(&pe, 0, sizeof(pe));
pe.index = MVPP2_PE_MH_DEFAULT;
mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_MH);
@@ -2470,7 +2470,7 @@ static void mvpp2_prs_mac_init(struct mvpp2 *priv)
{
struct mvpp2_prs_entry pe;
- memset(&pe, 0, sizeof(struct mvpp2_prs_entry));
+ memset(&pe, 0, sizeof(pe));
/* Non-promiscuous mode for all ports - DROP unknown packets */
pe.index = MVPP2_PE_MAC_NON_PROMISCUOUS;
@@ -2531,7 +2531,7 @@ static void mvpp2_prs_dsa_init(struct mvpp2 *priv)
MVPP2_PRS_TAGGED, MVPP2_PRS_DSA);
/* Set default entry, in case DSA or EDSA tag not found */
- memset(&pe, 0, sizeof(struct mvpp2_prs_entry));
+ memset(&pe, 0, sizeof(pe));
mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_DSA);
pe.index = MVPP2_PE_DSA_DEFAULT;
mvpp2_prs_sram_next_lu_set(&pe, MVPP2_PRS_LU_VLAN);
@@ -2561,7 +2561,7 @@ static int mvpp2_prs_etype_init(struct mvpp2 *priv)
if (tid < 0)
return tid;
- memset(&pe, 0, sizeof(struct mvpp2_prs_entry));
+ memset(&pe, 0, sizeof(pe));
mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_L2);
pe.index = tid;
@@ -2587,7 +2587,7 @@ static int mvpp2_prs_etype_init(struct mvpp2 *priv)
if (tid < 0)
return tid;
- memset(&pe, 0, sizeof(struct mvpp2_prs_entry));
+ memset(&pe, 0, sizeof(pe));
mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_L2);
pe.index = tid;
@@ -2617,7 +2617,7 @@ static int mvpp2_prs_etype_init(struct mvpp2 *priv)
if (tid < 0)
return tid;
- memset(&pe, 0, sizeof(struct mvpp2_prs_entry));
+ memset(&pe, 0, sizeof(pe));
mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_L2);
pe.index = tid;
@@ -2651,7 +2651,7 @@ static int mvpp2_prs_etype_init(struct mvpp2 *priv)
if (tid < 0)
return tid;
- memset(&pe, 0, sizeof(struct mvpp2_prs_entry));
+ memset(&pe, 0, sizeof(pe));
mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_L2);
pe.index = tid;
@@ -2716,7 +2716,7 @@ static int mvpp2_prs_etype_init(struct mvpp2 *priv)
if (tid < 0)
return tid;
- memset(&pe, 0, sizeof(struct mvpp2_prs_entry));
+ memset(&pe, 0, sizeof(pe));
mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_L2);
pe.index = tid;
@@ -2813,7 +2813,7 @@ static int mvpp2_prs_vlan_init(struct platform_device *pdev, struct mvpp2 *priv)
return err;
/* Set default double vlan entry */
- memset(&pe, 0, sizeof(struct mvpp2_prs_entry));
+ memset(&pe, 0, sizeof(pe));
mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_VLAN);
pe.index = MVPP2_PE_VLAN_DBL;
@@ -2833,7 +2833,7 @@ static int mvpp2_prs_vlan_init(struct platform_device *pdev, struct mvpp2 *priv)
mvpp2_prs_hw_write(priv, &pe);
/* Set default vlan none entry */
- memset(&pe, 0, sizeof(struct mvpp2_prs_entry));
+ memset(&pe, 0, sizeof(pe));
mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_VLAN);
pe.index = MVPP2_PE_VLAN_NONE;
@@ -2863,7 +2863,7 @@ static int mvpp2_prs_pppoe_init(struct mvpp2 *priv)
if (tid < 0)
return tid;
- memset(&pe, 0, sizeof(struct mvpp2_prs_entry));
+ memset(&pe, 0, sizeof(pe));
mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_PPPOE);
pe.index = tid;
@@ -2913,7 +2913,7 @@ static int mvpp2_prs_pppoe_init(struct mvpp2 *priv)
if (tid < 0)
return tid;
- memset(&pe, 0, sizeof(struct mvpp2_prs_entry));
+ memset(&pe, 0, sizeof(pe));
mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_PPPOE);
pe.index = tid;
@@ -2940,7 +2940,7 @@ static int mvpp2_prs_pppoe_init(struct mvpp2 *priv)
if (tid < 0)
return tid;
- memset(&pe, 0, sizeof(struct mvpp2_prs_entry));
+ memset(&pe, 0, sizeof(pe));
mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_PPPOE);
pe.index = tid;
@@ -2998,7 +2998,7 @@ static int mvpp2_prs_ip4_init(struct mvpp2 *priv)
return err;
/* Default IPv4 entry for unknown protocols */
- memset(&pe, 0, sizeof(struct mvpp2_prs_entry));
+ memset(&pe, 0, sizeof(pe));
mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_IP4);
pe.index = MVPP2_PE_IP4_PROTO_UN;
@@ -3023,7 +3023,7 @@ static int mvpp2_prs_ip4_init(struct mvpp2 *priv)
mvpp2_prs_hw_write(priv, &pe);
/* Default IPv4 entry for unicast address */
- memset(&pe, 0, sizeof(struct mvpp2_prs_entry));
+ memset(&pe, 0, sizeof(pe));
mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_IP4);
pe.index = MVPP2_PE_IP4_ADDR_UN;
@@ -3091,7 +3091,7 @@ static int mvpp2_prs_ip6_init(struct mvpp2 *priv)
if (tid < 0)
return tid;
- memset(&pe, 0, sizeof(struct mvpp2_prs_entry));
+ memset(&pe, 0, sizeof(pe));
mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_IP6);
pe.index = tid;
@@ -3112,7 +3112,7 @@ static int mvpp2_prs_ip6_init(struct mvpp2 *priv)
mvpp2_prs_hw_write(priv, &pe);
/* Default IPv6 entry for unknown protocols */
- memset(&pe, 0, sizeof(struct mvpp2_prs_entry));
+ memset(&pe, 0, sizeof(pe));
mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_IP6);
pe.index = MVPP2_PE_IP6_PROTO_UN;
--
2.12.2
^ permalink raw reply related
* Re: [PATCH v2] bridge: ebtables: fix reception of frames DNAT-ed to bridge device
From: Linus Lüssing @ 2017-04-17 15:21 UTC (permalink / raw)
To: Stephen Hemminger
Cc: netdev, bridge, linux-kernel, coreteam, netfilter-devel,
Jozsef Kadlecsik, David S . Miller, Pablo Neira Ayuso
In-Reply-To: <20170321163245.34159349@xeon-e3>
On Tue, Mar 21, 2017 at 04:32:45PM -0700, Stephen Hemminger wrote:
> On Tue, 21 Mar 2017 23:28:45 +0100
> Linus Lüssing <linus.luessing@c0d3.blue> wrote:
>
> > However, the IP code drops it in the beginning of ip_input.c/ip_rcv()
> > as the dnat target did not update the skb->pkt_type. If after
> > dnat'ing the packet is now destined to us then the skb->pkt_type
> > needs to be updated from PACKET_OTHERHOST to PACKET_HOST, too.
>
> Why not fix DNAT netfilter module rather than hacking bridge code here.
Sorry for the late response. Wanted to do some more testing before
replying.
My assumptions regarding macvlan were wrong:
A) The code my patch adds is not touched in the case of a macvlan
device on top of a bridge - with macvlan there seems to be no FDB entry
for the MAC address of the macvlan device at all, actually, resulting
in the flooding of a frame intended for that device (is this, ehm,
known/intended?).
B) ip_rcv() does not drop for a macvlan device, because macvlan
unconditionally sets skb->pkt_type to PACKET_HOST in macvlan_handle_frame().
(And I guess, maybe I shouldn't actually care that much about
macvlans on top of a bridge, as a veth-pair is much cleaner for that?)
Regarding netdev::dev_addrs, if I understand the kernel code correctly, it
is only, potentially populated with more than netdev::dev_addr for two
drivers, via dev_addr_add(): bnx2x and ixgbe. So for a bridge device,
there should never be more than one item in netdev::dev_addrs
(= netdev::dev_addr), correct?
So, currently I'm happy with moving the fix into the ebtables dnat
code and just checking against the netdev::dev_addr of the bridge
device now. (if anyone has any suggestions regarding upper devices
I should test with that, then please let me know)
(Sorry, Pablo, for me pressing against your earlier suggestion to
put the fix in the ebtables dnat instead of bridge code. :( )
Regards, Linus
^ permalink raw reply
* [PATCH 12/25] net: mvpp2: Improve a size determination in two functions
From: SF Markus Elfring @ 2017-04-17 15:22 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 10:40:32 +0200
Replace the specification of two data structures by pointer dereferences
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/net/ethernet/marvell/mvpp2.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/marvell/mvpp2.c b/drivers/net/ethernet/marvell/mvpp2.c
index 61fd87d0a4ec..3bddb8fcd595 100644
--- a/drivers/net/ethernet/marvell/mvpp2.c
+++ b/drivers/net/ethernet/marvell/mvpp2.c
@@ -2024,7 +2024,7 @@ static int mvpp2_prs_vlan_add(struct mvpp2 *priv, unsigned short tpid, int ai,
goto error;
}
- memset(pe, 0 , sizeof(struct mvpp2_prs_entry));
+ memset(pe, 0, sizeof(*pe));
mvpp2_prs_tcam_lu_set(pe, MVPP2_PRS_LU_VLAN);
pe->index = tid;
@@ -2165,7 +2165,7 @@ static int mvpp2_prs_double_vlan_add(struct mvpp2 *priv, unsigned short tpid1,
goto error;
}
- memset(pe, 0, sizeof(struct mvpp2_prs_entry));
+ memset(pe, 0, sizeof(*pe));
mvpp2_prs_tcam_lu_set(pe, MVPP2_PRS_LU_VLAN);
pe->index = tid;
--
2.12.2
^ permalink raw reply related
* [PATCH 13/25] net: mvpp2: Fix a jump label position in mvpp2_rx()
From: SF Markus Elfring @ 2017-04-17 15:23 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 10:52:02 +0200
The script "checkpatch.pl" pointed out that labels should not be indented.
Thus delete two horizontal tabs before the jump label "err_drop_frame"
in the function "mvpp2_rx".
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 3bddb8fcd595..4f4b659d7297 100644
--- a/drivers/net/ethernet/marvell/mvpp2.c
+++ b/drivers/net/ethernet/marvell/mvpp2.c
@@ -5515,7 +5515,7 @@ static int mvpp2_rx(struct mvpp2_port *port, int rx_todo,
* comprised by the RX descriptor.
*/
if (rx_status & MVPP2_RXD_ERR_SUMMARY) {
- err_drop_frame:
+err_drop_frame:
dev->stats.rx_errors++;
mvpp2_rx_error(port, rx_desc);
/* Return the buffer to the pool */
--
2.12.2
^ permalink raw reply related
* [PATCH 14/25] net: mvpp2: Rename a jump label in two functions
From: SF Markus Elfring @ 2017-04-17 15:24 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:10:47 +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 | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/drivers/net/ethernet/marvell/mvpp2.c b/drivers/net/ethernet/marvell/mvpp2.c
index 4f4b659d7297..89237abf386d 100644
--- a/drivers/net/ethernet/marvell/mvpp2.c
+++ b/drivers/net/ethernet/marvell/mvpp2.c
@@ -6065,7 +6065,7 @@ static int mvpp2_set_mac_address(struct net_device *dev, void *p)
if (!is_valid_ether_addr(addr->sa_data)) {
err = -EADDRNOTAVAIL;
- goto error;
+ goto log_error;
}
if (!netif_running(dev)) {
@@ -6075,7 +6075,7 @@ static int mvpp2_set_mac_address(struct net_device *dev, void *p)
/* Reconfigure parser to accept the original MAC address */
err = mvpp2_prs_update_mac_da(dev, dev->dev_addr);
if (err)
- goto error;
+ goto log_error;
}
mvpp2_stop_dev(port);
@@ -6087,14 +6087,13 @@ static int mvpp2_set_mac_address(struct net_device *dev, void *p)
/* Reconfigure parser accept the original MAC address */
err = mvpp2_prs_update_mac_da(dev, dev->dev_addr);
if (err)
- goto error;
+ goto log_error;
out_start:
mvpp2_start_dev(port);
mvpp2_egress_enable(port);
mvpp2_ingress_enable(port);
return 0;
-
-error:
+log_error:
netdev_err(dev, "fail to change MAC address\n");
return err;
}
@@ -6120,7 +6119,7 @@ static int mvpp2_change_mtu(struct net_device *dev, int mtu)
/* Reconfigure BM to the original MTU */
err = mvpp2_bm_update_mtu(dev, dev->mtu);
if (err)
- goto error;
+ goto log_error;
}
mvpp2_stop_dev(port);
@@ -6134,7 +6133,7 @@ static int mvpp2_change_mtu(struct net_device *dev, int mtu)
/* Reconfigure BM to the original MTU */
err = mvpp2_bm_update_mtu(dev, dev->mtu);
if (err)
- goto error;
+ goto log_error;
out_start:
mvpp2_start_dev(port);
@@ -6142,8 +6141,7 @@ static int mvpp2_change_mtu(struct net_device *dev, int mtu)
mvpp2_ingress_enable(port);
return 0;
-
-error:
+log_error:
netdev_err(dev, "fail to change MTU\n");
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