* [PATCH] net: phy: dp83848: add DP83620 PHY support
From: Alvaro Gamez Machado @ 2017-01-17 8:08 UTC (permalink / raw)
To: Florian Fainelli, netdev; +Cc: Alvaro Gamez Machado
This PHY with fiber support is register compatible with DP83848,
so add support for it.
Signed-off-by: Alvaro Gamez Machado <alvaro.gamez@hazent.com>
---
drivers/net/phy/dp83848.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/phy/dp83848.c b/drivers/net/phy/dp83848.c
index 800b39f06279..a10d0e7fc5f7 100644
--- a/drivers/net/phy/dp83848.c
+++ b/drivers/net/phy/dp83848.c
@@ -17,6 +17,7 @@
#include <linux/phy.h>
#define TI_DP83848C_PHY_ID 0x20005ca0
+#define TI_DP83620_PHY_ID 0x20005ce0
#define NS_DP83848C_PHY_ID 0x20005c90
#define TLK10X_PHY_ID 0x2000a210
#define TI_DP83822_PHY_ID 0x2000a240
@@ -77,6 +78,7 @@ static int dp83848_config_intr(struct phy_device *phydev)
static struct mdio_device_id __maybe_unused dp83848_tbl[] = {
{ TI_DP83848C_PHY_ID, 0xfffffff0 },
{ NS_DP83848C_PHY_ID, 0xfffffff0 },
+ { TI_DP83620_PHY_ID, 0xfffffff0 },
{ TLK10X_PHY_ID, 0xfffffff0 },
{ TI_DP83822_PHY_ID, 0xfffffff0 },
{ }
@@ -106,6 +108,7 @@ MODULE_DEVICE_TABLE(mdio, dp83848_tbl);
static struct phy_driver dp83848_driver[] = {
DP83848_PHY_DRIVER(TI_DP83848C_PHY_ID, "TI DP83848C 10/100 Mbps PHY"),
DP83848_PHY_DRIVER(NS_DP83848C_PHY_ID, "NS DP83848C 10/100 Mbps PHY"),
+ DP83848_PHY_DRIVER(TI_DP83620_PHY_ID, "TI DP83620 10/100 Mbps PHY"),
DP83848_PHY_DRIVER(TLK10X_PHY_ID, "TI TLK10X 10/100 Mbps PHY"),
DP83848_PHY_DRIVER(TI_DP83822_PHY_ID, "TI DP83822 10/100 Mbps PHY"),
};
--
2.11.0
^ permalink raw reply related
* Re: [PATCH 1/1] ip: fix igmp parsing when iface is long
From: Petr Vorel @ 2017-01-17 8:08 UTC (permalink / raw)
To: netdev
In-Reply-To: <20170116232550.7764-1-pvorel@suse.cz>
Hi,
> Entries with long vhost names in /proc/net/igmp have no whitespace
> between name and colon, so sscanf() adds it to vhost and
> 'ip maddr show iface' doesn't include inet result.
Bug was also reported to bugzilla (https://bugzilla.kernel.org/show_bug.cgi?id=192741),
with updated comment in the patch.
Kind regards,
Petr
^ permalink raw reply
* Re: [patch net-next] stmmac: indent an if statement
From: Alexandre Torgue @ 2017-01-17 8:25 UTC (permalink / raw)
To: Julia Lawall, Dan Carpenter
Cc: David Miller, peppe.cavallaro, Joao.Pinto, netdev, linux-kernel,
kernel-janitors
In-Reply-To: <alpine.DEB.2.20.1701162308540.2031@hadrien>
Hi Julia
On 01/16/2017 11:10 PM, Julia Lawall wrote:
>
>
> On Tue, 17 Jan 2017, Dan Carpenter wrote:
>
>> On Mon, Jan 16, 2017 at 10:46:22PM +0100, Julia Lawall wrote:
>>>
>>>
>>> On Mon, 16 Jan 2017, Dan Carpenter wrote:
>>>
>>>> On Mon, Jan 16, 2017 at 12:19:24PM +0300, Dan Carpenter wrote:
>>>>> On Sun, Jan 15, 2017 at 10:14:38PM -0500, David Miller wrote:
>>>>>> From: Dan Carpenter <dan.carpenter@oracle.com>
>>>>>> Date: Thu, 12 Jan 2017 21:46:32 +0300
>>>>>>
>>>>>>> The break statement should be indented one more tab.
>>>>>>>
>>>>>>> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>>>>>>
>>>>>> Applied, but like Julia I think we might have a missing of_node_put()
>>>>>> here.
>>>>>
>>>>> Of course, sorry for dropping the ball on this. I'll send a patch for
>>>>> that.
>>>>>
>>>>
>>>> Actually, I've looked at it some more and I think this function is OK.
>>>> We're supposed to do an of_node_put() later... I can't find where that
>>>> happens, but presumably that's because I don't know stmmac well. This
>>>> code here, though, is fine.
>>>
>>> Why do you think it is fine? Does anyone in the calling context know
>>> which child would have caused the break?
>>
>> Yeah. It's saved in plat->mdio_node and we expect to be holding on
>> either path through the function.
>>
>> (It would be better if one of the stmmac people were responding here
>> insead of a random fix the indenting weenie like myself.)
>
> OK, I agree that there should not be an of_node_put with the break.
>
> Perhaps there should be an of_node_put on plat->mdio_node in
> stmmac_remove_config_dt, like there is an of_node_put on plat->phy_node.
> But it would certainly be helpful to hear from someone who knows the code
> better.
I also think it's missing! Can you propose a patch ?
br
Alex
>
> julia
>
^ permalink raw reply
* Re: [patch net-next] stmmac: indent an if statement
From: Alexandre Torgue @ 2017-01-17 8:28 UTC (permalink / raw)
To: David Miller, dan.carpenter
Cc: julia.lawall, peppe.cavallaro, Joao.Pinto, netdev, linux-kernel,
kernel-janitors
In-Reply-To: <20170116.170012.547874320348560448.davem@davemloft.net>
Dear David
On 01/16/2017 11:00 PM, David Miller wrote:
> From: Dan Carpenter <dan.carpenter@oracle.com>
> Date: Tue, 17 Jan 2017 00:56:15 +0300
>
>> (It would be better if one of the stmmac people were responding here
>> insead of a random fix the indenting weenie like myself.)
>
> They are all too busy trying to rename the driver, because that's so
> much more important.
No, we don't spend all our times to deals with stmmac renaming. Just
busy on other topic and we continue to do our best with Peppe to review
stmmac patch.
Regards
Alexandre
>
^ permalink raw reply
* [PATCH net-next] cxgb4: Implement ndo_get_phys_port_id for mgmt dev
From: Ganesh Goudar @ 2017-01-17 8:39 UTC (permalink / raw)
To: netdev, davem; +Cc: nirranjan, hariprasad, Ganesh Goudar
Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com>
---
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 27 +++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
index e95bb6a..668acfc 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
@@ -2583,6 +2583,19 @@ static int cxgb_get_vf_config(struct net_device *dev,
ether_addr_copy(ivi->mac, adap->vfinfo[vf].vf_mac_addr);
return 0;
}
+
+static int cxgb_get_phys_port_id(struct net_device *dev,
+ struct netdev_phys_item_id *ppid)
+{
+ struct port_info *pi = netdev_priv(dev);
+ unsigned int phy_port_id;
+
+ phy_port_id = pi->adapter->adap_idx * 10 + pi->port_id;
+ ppid->id_len = sizeof(phy_port_id);
+ memcpy(ppid->id, &phy_port_id, ppid->id_len);
+ return 0;
+}
+
#endif
static int cxgb_set_mac_addr(struct net_device *dev, void *p)
@@ -2762,6 +2775,7 @@ static const struct net_device_ops cxgb4_mgmt_netdev_ops = {
.ndo_open = dummy_open,
.ndo_set_vf_mac = cxgb_set_vf_mac,
.ndo_get_vf_config = cxgb_get_vf_config,
+ .ndo_get_phys_port_id = cxgb_get_phys_port_id,
};
#endif
@@ -4523,6 +4537,7 @@ static int config_mgmt_dev(struct pci_dev *pdev)
pi = netdev_priv(netdev);
pi->adapter = adap;
+ pi->port_id = adap->pf % adap->params.nports;
SET_NETDEV_DEV(netdev, &pdev->dev);
adap->port[0] = netdev;
@@ -4612,6 +4627,7 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
u32 whoami, pl_rev;
enum chip_type chip;
static int adap_idx = 1;
+ u32 v, port_vec;
printk_once(KERN_INFO "%s - version %s\n", DRV_DESC, DRV_VERSION);
@@ -4993,6 +5009,17 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
}
spin_lock_init(&adapter->mbox_lock);
INIT_LIST_HEAD(&adapter->mlist.list);
+
+ v = FW_PARAMS_MNEM_V(FW_PARAMS_MNEM_DEV) |
+ FW_PARAMS_PARAM_X_V(FW_PARAMS_PARAM_DEV_PORTVEC);
+ err = t4_query_params(adapter, adapter->mbox, adapter->pf, 0, 1,
+ &v, &port_vec);
+ if (err < 0) {
+ dev_err(adapter->pdev_dev, "Could not fetch port params\n");
+ goto free_adapter;
+ }
+
+ adapter->params.nports = hweight32(port_vec);
pci_set_drvdata(pdev, adapter);
return 0;
--
2.1.0
^ permalink raw reply related
* Re: [PATCH] bpf: Fix test_lru_sanity5() in test_lru_map.c
From: Daniel Borkmann @ 2017-01-17 9:07 UTC (permalink / raw)
To: Martin KaFai Lau, netdev; +Cc: Alexei Starovoitov, Kernel Team
In-Reply-To: <1484633849-2742833-1-git-send-email-kafai@fb.com>
On 01/17/2017 07:17 AM, Martin KaFai Lau wrote:
> test_lru_sanity5() fails when the number of online cpus
> is fewer than the number of possible cpus. It can be
> reproduced with qemu by using cmd args "--smp cpus=2,maxcpus=8".
>
> The problem is the loop in test_lru_sanity5() is testing
> 'i' which is incorrect.
>
> This patch:
> 1. Make sched_next_online() always return -1 if it cannot
> find a next cpu to schedule the process.
> 2. In test_lru_sanity5(), the parent process does
> sched_setaffinity() first (through sched_next_online())
> and the forked process will inherit it according to
> the 'man sched_setaffinity'.
>
> Fixes: 5db58faf989f ("bpf: Add tests for the LRU bpf_htab")
> Reported-by: Daniel Borkmann <daniel@iogearbox.net>
> Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Looks good, thanks for fixing!
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
(Patch is against -net tree.)
^ permalink raw reply
* Re: [PATCH v4 0/4] vsock: cancel connect packets when failing to connect
From: Jorgen S. Hansen @ 2017-01-17 9:25 UTC (permalink / raw)
To: Stefan Hajnoczi
Cc: Peng Tao, David Miller, netdev@vger.kernel.org,
virtualization@lists.linux-foundation.org, Stefan Hajnoczi,
kvm@vger.kernel.org
In-Reply-To: <20170109100607.GA30228@stefanha-x1.localdomain>
> On Jan 9, 2017, at 11:06 AM, Stefan Hajnoczi <stefanha@gmail.com> wrote:
>
> On Fri, Jan 06, 2017 at 10:22:56AM +0800, Peng Tao wrote:
>> On Tue, Dec 13, 2016 at 5:50 PM, Stefan Hajnoczi <stefanha@gmail.com> wrote:
>>> On Mon, Dec 12, 2016 at 08:21:05PM +0800, Peng Tao wrote:
>>>> Currently, if a connect call fails on a signal or timeout (e.g., guest is still
>>>> in the process of starting up), we'll just return to caller and leave the connect
>>>> packet queued and they are sent even though the connection is considered a failure,
>>>> which can confuse applications with unwanted false connect attempt.
>>>>
>>>> The patchset enables vsock (both host and guest) to cancel queued packets when
>>>> a connect attempt is considered to fail.
>>>>
>>>> v4 changelog:
>>>> - drop two unnecessary void * cast
>>>> - update new callback commnet
>>>> v3 changelog:
>>>> - define cancel_pkt callback in struct vsock_transport rather than struct virtio_transport
>>>> - rename virtio_vsock_pkt->vsk to virtio_vsock_pkt->cancel_token
>>>> v2 changelog:
>>>> - fix queued_replies counting and resume tx/rx when necessary
>>>>
>>>> Cheers,
>>>> Tao
>>>>
>>>> Peng Tao (4):
>>>> vsock: track pkt owner vsock
>>>> vhost-vsock: add pkt cancel capability
>>>> vsock: add pkt cancel capability
>>>> vsock: cancel packets when failing to connect
>>>>
>>>> drivers/vhost/vsock.c | 41 ++++++++++++++++++++++++++++++++
>>>> include/linux/virtio_vsock.h | 2 ++
>>>> include/net/af_vsock.h | 3 +++
>>>> net/vmw_vsock/af_vsock.c | 14 +++++++++++
>>>> net/vmw_vsock/virtio_transport.c | 42 +++++++++++++++++++++++++++++++++
>>>> net/vmw_vsock/virtio_transport_common.c | 7 ++++++
>>>> 6 files changed, 109 insertions(+)
>>>>
>>>> --
>>>> 2.7.4
>>>>
>>>> _______________________________________________
>>>> Virtualization mailing list
>>>> Virtualization@lists.linux-foundation.org
>>>> https://lists.linuxfoundation.org/mailman/listinfo/virtualization
>>>
>>> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
>> ping~
>>
>> It looks like the patchsets are reviewed but not merged. Is there any blocker?
>
> If Jorgen is sending pull requests then it should go through him.
>
> Otherwise David Miller could apply it.
We are usually not involved in applying changes from outside VMware; those are applied by David Miller.
Thanks,
Jørgen
^ permalink raw reply
* [PATCH iproute2 net-next 0/5] add latest bridge netlink options
From: Hangbin Liu @ 2017-01-17 9:32 UTC (permalink / raw)
To: netdev; +Cc: Stephen Hemminger, Hangbin Liu
Add the bridge netlink attributes added to kernel recently.
Hangbin Liu (5):
iplink: bridge: add support for IFLA_BR_FDB_FLUSH
iplink: bridge: add support for IFLA_BR_VLAN_STATS_ENABLED
iplink: bridge: add support for IFLA_BR_MCAST_STATS_ENABLED
iplink: bridge: add support for IFLA_BR_MCAST_IGMP_VERSION
iplink: bridge: add support for IFLA_BR_MCAST_MLD_VERSION
ip/iplink_bridge.c | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 56 insertions(+), 1 deletion(-)
--
2.5.5
^ permalink raw reply
* [PATCH iproute2 net-next 1/5] iplink: bridge: add support for IFLA_BR_FDB_FLUSH
From: Hangbin Liu @ 2017-01-17 9:32 UTC (permalink / raw)
To: netdev; +Cc: Stephen Hemminger, Hangbin Liu
In-Reply-To: <1484645552-29440-1-git-send-email-liuhangbin@gmail.com>
This patch implements support for the IFLA_BR_FDB_FLUSH attribute
in iproute2 so it can flush bridge fdb dynamic entries.
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
---
ip/iplink_bridge.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/ip/iplink_bridge.c b/ip/iplink_bridge.c
index d2d4202..85e6597 100644
--- a/ip/iplink_bridge.c
+++ b/ip/iplink_bridge.c
@@ -22,7 +22,8 @@
static void print_explain(FILE *f)
{
fprintf(f,
- "Usage: ... bridge [ forward_delay FORWARD_DELAY ]\n"
+ "Usage: ... bridge [ fdb_flush ]\n"
+ " [ forward_delay FORWARD_DELAY ]\n"
" [ hello_time HELLO_TIME ]\n"
" [ max_age MAX_AGE ]\n"
" [ ageing_time AGEING_TIME ]\n"
@@ -145,6 +146,8 @@ static int bridge_parse_opt(struct link_util *lu, int argc, char **argv,
if (len < 0)
return -1;
addattr_l(n, 1024, IFLA_BR_GROUP_ADDR, llabuf, len);
+ } else if (matches(*argv, "fdb_flush") == 0) {
+ addattr(n, 1024, IFLA_BR_FDB_FLUSH);
} else if (matches(*argv, "vlan_default_pvid") == 0) {
__u16 default_pvid;
--
2.5.5
^ permalink raw reply related
* [PATCH iproute2 net-next 5/5] iplink: bridge: add support for IFLA_BR_MCAST_MLD_VERSION
From: Hangbin Liu @ 2017-01-17 9:32 UTC (permalink / raw)
To: netdev; +Cc: Stephen Hemminger, Hangbin Liu
In-Reply-To: <1484645552-29440-1-git-send-email-liuhangbin@gmail.com>
This patch implements support for the IFLA_BR_MCAST_MLD_VERSION
attribute in iproute2 so it can change the mcast mld version.
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
---
ip/iplink_bridge.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/ip/iplink_bridge.c b/ip/iplink_bridge.c
index 6611a85..f484d05 100644
--- a/ip/iplink_bridge.c
+++ b/ip/iplink_bridge.c
@@ -51,6 +51,7 @@ static void print_explain(FILE *f)
" [ mcast_startup_query_interval STARTUP_QUERY_INTERVAL ]\n"
" [ mcast_state MCAST_STATE ]\n"
" [ mcast_igmp_version IGMP_VERSION ]\n"
+ " [ mcast_mld_version MLD_VERSION ]\n"
" [ nf_call_iptables NF_CALL_IPTABLES ]\n"
" [ nf_call_ip6tables NF_CALL_IP6TABLES ]\n"
" [ nf_call_arptables NF_CALL_ARPTABLES ]\n"
@@ -317,6 +318,14 @@ static int bridge_parse_opt(struct link_util *lu, int argc, char **argv,
invarg("invalid mcast_igmp_version", *argv);
addattr8(n, 1024, IFLA_BR_MCAST_IGMP_VERSION,
igmp_version);
+ } else if (matches(*argv, "mcast_mld_version") == 0) {
+ __u8 mld_version;
+
+ NEXT_ARG();
+ if (get_u8(&mld_version, *argv, 0))
+ invarg("invalid mcast_mld_version", *argv);
+ addattr8(n, 1024, IFLA_BR_MCAST_MLD_VERSION,
+ mld_version);
} else if (matches(*argv, "nf_call_iptables") == 0) {
__u8 nf_call_ipt;
@@ -550,6 +559,10 @@ static void bridge_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
fprintf(f, "mcast_igmp_version %u ",
rta_getattr_u8(tb[IFLA_BR_MCAST_IGMP_VERSION]));
+ if (tb[IFLA_BR_MCAST_MLD_VERSION])
+ fprintf(f, "mcast_mld_version %u ",
+ rta_getattr_u8(tb[IFLA_BR_MCAST_MLD_VERSION]));
+
if (tb[IFLA_BR_NF_CALL_IPTABLES])
fprintf(f, "nf_call_iptables %u ",
rta_getattr_u8(tb[IFLA_BR_NF_CALL_IPTABLES]));
--
2.5.5
^ permalink raw reply related
* [PATCH iproute2 net-next 3/5] iplink: bridge: add support for IFLA_BR_MCAST_STATS_ENABLED
From: Hangbin Liu @ 2017-01-17 9:32 UTC (permalink / raw)
To: netdev; +Cc: Stephen Hemminger, Hangbin Liu
In-Reply-To: <1484645552-29440-1-git-send-email-liuhangbin@gmail.com>
This patch implements support for the IFLA_BR_MCAST_STATS_ENABLED
attribute in iproute2 so it can change the mcast state.
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
---
ip/iplink_bridge.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/ip/iplink_bridge.c b/ip/iplink_bridge.c
index 8caf53a..622bd07 100644
--- a/ip/iplink_bridge.c
+++ b/ip/iplink_bridge.c
@@ -49,6 +49,7 @@ static void print_explain(FILE *f)
" [ mcast_query_interval QUERY_INTERVAL ]\n"
" [ mcast_query_response_interval QUERY_RESPONSE_INTERVAL ]\n"
" [ mcast_startup_query_interval STARTUP_QUERY_INTERVAL ]\n"
+ " [ mcast_state MCAST_STATE ]\n"
" [ nf_call_iptables NF_CALL_IPTABLES ]\n"
" [ nf_call_ip6tables NF_CALL_IP6TABLES ]\n"
" [ nf_call_arptables NF_CALL_ARPTABLES ]\n"
@@ -299,6 +300,14 @@ static int bridge_parse_opt(struct link_util *lu, int argc, char **argv,
addattr64(n, 1024, IFLA_BR_MCAST_STARTUP_QUERY_INTVL,
mcast_startup_query_intvl);
+ } else if (matches(*argv, "mcast_state") == 0) {
+ __u8 mcast_state;
+
+ NEXT_ARG();
+ if (get_u8(&mcast_state, *argv, 0))
+ invarg("invalid mcast_state", *argv);
+ addattr8(n, 1024, IFLA_BR_MCAST_STATS_ENABLED,
+ mcast_state);
} else if (matches(*argv, "nf_call_iptables") == 0) {
__u8 nf_call_ipt;
@@ -524,6 +533,10 @@ static void bridge_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
fprintf(f, "mcast_startup_query_interval %llu ",
rta_getattr_u64(tb[IFLA_BR_MCAST_STARTUP_QUERY_INTVL]));
+ if (tb[IFLA_BR_MCAST_STATS_ENABLED])
+ fprintf(f, "mcast_state %u ",
+ rta_getattr_u8(tb[IFLA_BR_MCAST_STATS_ENABLED]));
+
if (tb[IFLA_BR_NF_CALL_IPTABLES])
fprintf(f, "nf_call_iptables %u ",
rta_getattr_u8(tb[IFLA_BR_NF_CALL_IPTABLES]));
--
2.5.5
^ permalink raw reply related
* [PATCH iproute2 net-next 2/5] iplink: bridge: add support for IFLA_BR_VLAN_STATS_ENABLED
From: Hangbin Liu @ 2017-01-17 9:32 UTC (permalink / raw)
To: netdev; +Cc: Stephen Hemminger, Hangbin Liu
In-Reply-To: <1484645552-29440-1-git-send-email-liuhangbin@gmail.com>
This patch implements support for the IFLA_BR_VLAN_STATS_ENABLED
attribute in iproute2 so it can change the vlan state.
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
---
ip/iplink_bridge.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/ip/iplink_bridge.c b/ip/iplink_bridge.c
index 85e6597..8caf53a 100644
--- a/ip/iplink_bridge.c
+++ b/ip/iplink_bridge.c
@@ -34,6 +34,7 @@ static void print_explain(FILE *f)
" [ vlan_filtering VLAN_FILTERING ]\n"
" [ vlan_protocol VLAN_PROTOCOL ]\n"
" [ vlan_default_pvid VLAN_DEFAULT_PVID ]\n"
+ " [ vlan_state VLAN_STATE ]\n"
" [ mcast_snooping MULTICAST_SNOOPING ]\n"
" [ mcast_router MULTICAST_ROUTER ]\n"
" [ mcast_query_use_ifaddr MCAST_QUERY_USE_IFADDR ]\n"
@@ -157,6 +158,14 @@ static int bridge_parse_opt(struct link_util *lu, int argc, char **argv,
addattr16(n, 1024, IFLA_BR_VLAN_DEFAULT_PVID,
default_pvid);
+ } else if (matches(*argv, "vlan_state") == 0) {
+ __u8 vlan_state;
+
+ NEXT_ARG();
+ if (get_u8(&vlan_state, *argv, 0))
+ invarg("invalid vlan_state", *argv);
+ addattr8(n, 1024, IFLA_BR_VLAN_STATS_ENABLED,
+ vlan_state);
} else if (matches(*argv, "mcast_router") == 0) {
__u8 mcast_router;
@@ -442,6 +451,10 @@ static void bridge_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
fprintf(f, "vlan_default_pvid %u ",
rta_getattr_u16(tb[IFLA_BR_VLAN_DEFAULT_PVID]));
+ if (tb[IFLA_BR_VLAN_STATS_ENABLED])
+ fprintf(f, "vlan_state %u ",
+ rta_getattr_u8(tb[IFLA_BR_VLAN_STATS_ENABLED]));
+
if (tb[IFLA_BR_GROUP_FWD_MASK])
fprintf(f, "group_fwd_mask %#x ",
rta_getattr_u16(tb[IFLA_BR_GROUP_FWD_MASK]));
--
2.5.5
^ permalink raw reply related
* [PATCH iproute2 net-next 4/5] iplink: bridge: add support for IFLA_BR_MCAST_IGMP_VERSION
From: Hangbin Liu @ 2017-01-17 9:32 UTC (permalink / raw)
To: netdev; +Cc: Stephen Hemminger, Hangbin Liu
In-Reply-To: <1484645552-29440-1-git-send-email-liuhangbin@gmail.com>
This patch implements support for the IFLA_BR_MCAST_IGMP_VERSION
attribute in iproute2 so it can change the mcast igmp version.
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
---
ip/iplink_bridge.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/ip/iplink_bridge.c b/ip/iplink_bridge.c
index 622bd07..6611a85 100644
--- a/ip/iplink_bridge.c
+++ b/ip/iplink_bridge.c
@@ -50,6 +50,7 @@ static void print_explain(FILE *f)
" [ mcast_query_response_interval QUERY_RESPONSE_INTERVAL ]\n"
" [ mcast_startup_query_interval STARTUP_QUERY_INTERVAL ]\n"
" [ mcast_state MCAST_STATE ]\n"
+ " [ mcast_igmp_version IGMP_VERSION ]\n"
" [ nf_call_iptables NF_CALL_IPTABLES ]\n"
" [ nf_call_ip6tables NF_CALL_IP6TABLES ]\n"
" [ nf_call_arptables NF_CALL_ARPTABLES ]\n"
@@ -308,6 +309,14 @@ static int bridge_parse_opt(struct link_util *lu, int argc, char **argv,
invarg("invalid mcast_state", *argv);
addattr8(n, 1024, IFLA_BR_MCAST_STATS_ENABLED,
mcast_state);
+ } else if (matches(*argv, "mcast_igmp_version") == 0) {
+ __u8 igmp_version;
+
+ NEXT_ARG();
+ if (get_u8(&igmp_version, *argv, 0))
+ invarg("invalid mcast_igmp_version", *argv);
+ addattr8(n, 1024, IFLA_BR_MCAST_IGMP_VERSION,
+ igmp_version);
} else if (matches(*argv, "nf_call_iptables") == 0) {
__u8 nf_call_ipt;
@@ -537,6 +546,10 @@ static void bridge_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
fprintf(f, "mcast_state %u ",
rta_getattr_u8(tb[IFLA_BR_MCAST_STATS_ENABLED]));
+ if (tb[IFLA_BR_MCAST_IGMP_VERSION])
+ fprintf(f, "mcast_igmp_version %u ",
+ rta_getattr_u8(tb[IFLA_BR_MCAST_IGMP_VERSION]));
+
if (tb[IFLA_BR_NF_CALL_IPTABLES])
fprintf(f, "nf_call_iptables %u ",
rta_getattr_u8(tb[IFLA_BR_NF_CALL_IPTABLES]));
--
2.5.5
^ permalink raw reply related
* Re: [PATCH iproute2 net-next 3/5] iplink: bridge: add support for IFLA_BR_MCAST_STATS_ENABLED
From: Nikolay Aleksandrov @ 2017-01-17 9:51 UTC (permalink / raw)
To: Hangbin Liu, netdev; +Cc: Stephen Hemminger
In-Reply-To: <1484645552-29440-4-git-send-email-liuhangbin@gmail.com>
On 17/01/17 10:32, Hangbin Liu wrote:
> This patch implements support for the IFLA_BR_MCAST_STATS_ENABLED
> attribute in iproute2 so it can change the mcast state.
>
> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
> ---
It is not state, it is _stats_. Calling it mcast_state is completely wrong, please
change the name to something like mcast_stats_enabled which is closer to the sysfs
and netlink attribute.
> ip/iplink_bridge.c | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/ip/iplink_bridge.c b/ip/iplink_bridge.c
> index 8caf53a..622bd07 100644
> --- a/ip/iplink_bridge.c
> +++ b/ip/iplink_bridge.c
> @@ -49,6 +49,7 @@ static void print_explain(FILE *f)
> " [ mcast_query_interval QUERY_INTERVAL ]\n"
> " [ mcast_query_response_interval QUERY_RESPONSE_INTERVAL ]\n"
> " [ mcast_startup_query_interval STARTUP_QUERY_INTERVAL ]\n"
> + " [ mcast_state MCAST_STATE ]\n"
> " [ nf_call_iptables NF_CALL_IPTABLES ]\n"
> " [ nf_call_ip6tables NF_CALL_IP6TABLES ]\n"
> " [ nf_call_arptables NF_CALL_ARPTABLES ]\n"
> @@ -299,6 +300,14 @@ static int bridge_parse_opt(struct link_util *lu, int argc, char **argv,
>
> addattr64(n, 1024, IFLA_BR_MCAST_STARTUP_QUERY_INTVL,
> mcast_startup_query_intvl);
> + } else if (matches(*argv, "mcast_state") == 0) {
> + __u8 mcast_state;
> +
> + NEXT_ARG();
> + if (get_u8(&mcast_state, *argv, 0))
> + invarg("invalid mcast_state", *argv);
> + addattr8(n, 1024, IFLA_BR_MCAST_STATS_ENABLED,
> + mcast_state);
> } else if (matches(*argv, "nf_call_iptables") == 0) {
> __u8 nf_call_ipt;
>
> @@ -524,6 +533,10 @@ static void bridge_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
> fprintf(f, "mcast_startup_query_interval %llu ",
> rta_getattr_u64(tb[IFLA_BR_MCAST_STARTUP_QUERY_INTVL]));
>
> + if (tb[IFLA_BR_MCAST_STATS_ENABLED])
> + fprintf(f, "mcast_state %u ",
> + rta_getattr_u8(tb[IFLA_BR_MCAST_STATS_ENABLED]));
> +
> if (tb[IFLA_BR_NF_CALL_IPTABLES])
> fprintf(f, "nf_call_iptables %u ",
> rta_getattr_u8(tb[IFLA_BR_NF_CALL_IPTABLES]));
>
^ permalink raw reply
* Re: [PATCH iproute2 net-next 2/5] iplink: bridge: add support for IFLA_BR_VLAN_STATS_ENABLED
From: Nikolay Aleksandrov @ 2017-01-17 9:52 UTC (permalink / raw)
To: Hangbin Liu, netdev; +Cc: Stephen Hemminger
In-Reply-To: <1484645552-29440-3-git-send-email-liuhangbin@gmail.com>
On 17/01/17 10:32, Hangbin Liu wrote:
> This patch implements support for the IFLA_BR_VLAN_STATS_ENABLED
> attribute in iproute2 so it can change the vlan state.
>
> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
> ---
Again it is not state, it is _stats_. Please change the name to something like vlan_stats_enabled which is closer to the netlink attribute.
> ip/iplink_bridge.c | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/ip/iplink_bridge.c b/ip/iplink_bridge.c
> index 85e6597..8caf53a 100644
> --- a/ip/iplink_bridge.c
> +++ b/ip/iplink_bridge.c
> @@ -34,6 +34,7 @@ static void print_explain(FILE *f)
> " [ vlan_filtering VLAN_FILTERING ]\n"
> " [ vlan_protocol VLAN_PROTOCOL ]\n"
> " [ vlan_default_pvid VLAN_DEFAULT_PVID ]\n"
> + " [ vlan_state VLAN_STATE ]\n"
> " [ mcast_snooping MULTICAST_SNOOPING ]\n"
> " [ mcast_router MULTICAST_ROUTER ]\n"
> " [ mcast_query_use_ifaddr MCAST_QUERY_USE_IFADDR ]\n"
> @@ -157,6 +158,14 @@ static int bridge_parse_opt(struct link_util *lu, int argc, char **argv,
>
> addattr16(n, 1024, IFLA_BR_VLAN_DEFAULT_PVID,
> default_pvid);
> + } else if (matches(*argv, "vlan_state") == 0) {
> + __u8 vlan_state;
> +
> + NEXT_ARG();
> + if (get_u8(&vlan_state, *argv, 0))
> + invarg("invalid vlan_state", *argv);
> + addattr8(n, 1024, IFLA_BR_VLAN_STATS_ENABLED,
> + vlan_state);
> } else if (matches(*argv, "mcast_router") == 0) {
> __u8 mcast_router;
>
> @@ -442,6 +451,10 @@ static void bridge_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
> fprintf(f, "vlan_default_pvid %u ",
> rta_getattr_u16(tb[IFLA_BR_VLAN_DEFAULT_PVID]));
>
> + if (tb[IFLA_BR_VLAN_STATS_ENABLED])
> + fprintf(f, "vlan_state %u ",
> + rta_getattr_u8(tb[IFLA_BR_VLAN_STATS_ENABLED]));
> +
> if (tb[IFLA_BR_GROUP_FWD_MASK])
> fprintf(f, "group_fwd_mask %#x ",
> rta_getattr_u16(tb[IFLA_BR_GROUP_FWD_MASK]));
>
^ permalink raw reply
* Re: [PATCH iproute2 net-next 0/5] add latest bridge netlink options
From: Nikolay Aleksandrov @ 2017-01-17 10:03 UTC (permalink / raw)
To: Hangbin Liu, netdev; +Cc: Stephen Hemminger
In-Reply-To: <1484645552-29440-1-git-send-email-liuhangbin@gmail.com>
On 17/01/17 10:32, Hangbin Liu wrote:
> Add the bridge netlink attributes added to kernel recently.
>
> Hangbin Liu (5):
> iplink: bridge: add support for IFLA_BR_FDB_FLUSH
> iplink: bridge: add support for IFLA_BR_VLAN_STATS_ENABLED
> iplink: bridge: add support for IFLA_BR_MCAST_STATS_ENABLED
> iplink: bridge: add support for IFLA_BR_MCAST_IGMP_VERSION
> iplink: bridge: add support for IFLA_BR_MCAST_MLD_VERSION
>
> ip/iplink_bridge.c | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++-
> 1 file changed, 56 insertions(+), 1 deletion(-)
>
Cool, I also have a version of all of these patches just didn't get around to send them yet. :-)
Anyway since you're at it, you should also add support for IFLA_BRPORT_FLUSH,
but TBH I don't think the flush attributes should be used via this command, they seem
like an action that you do rather than an option that you set. That is the reason I
didn't add support for them awhile back when I added the others. But I don't have a
strong feeling about doing it via ip link set or not, so if the others are fine, I'm good too.
Cheers,
Nik
^ permalink raw reply
* Re: [PATCH net] vxlan: fix byte order of vxlan-gpe port number
From: Jiri Benc @ 2017-01-17 10:15 UTC (permalink / raw)
To: Lance Richardson; +Cc: netdev
In-Reply-To: <1484609878-7288-1-git-send-email-lrichard@redhat.com>
On Mon, 16 Jan 2017 18:37:58 -0500, Lance Richardson wrote:
> vxlan->cfg.dst_port is in network byte order, so an htons()
> is needed here. Also reduced comment length to stay closer
> to 80 column width (still slightly over, however).
Ouch. A stupid mistake I made. I think it's still okay to fix this, I'm
not aware of anyone using VXLAN-GPE yet, it's main user is going to be
NSH which is still under development.
Acked-by: Jiri Benc <jbenc@redhat.com>
Please apply also to stable.
Thanks,
Jiri
^ permalink raw reply
* Re: [PATCH] stmicro: rename it to dwc to improve future development
From: Joao Pinto @ 2017-01-17 10:16 UTC (permalink / raw)
To: David Miller, Joao.Pinto; +Cc: peppe.cavallaro, alexandre.torgue, netdev
In-Reply-To: <20170116.135850.618334211623485798.davem@davemloft.net>
Hello,
Às 6:58 PM de 1/16/2017, David Miller escreveu:
> From: Joao Pinto <Joao.Pinto@synopsys.com>
> Date: Mon, 16 Jan 2017 13:26:31 +0000
>
>> The goal of this patch is to create an oficial Designware Ethernet place
>> to deploy new drivers based on this family of IPs. stmmac was left
>> untouched since it is a designware based driver. New ethernet designware
>> IP based drivers should be placed in this place, improving code organization
>> and it becomes clear to the kernel user the purpose and scope of each driver.
>>
>> Signed-off-by: Joao Pinto <jpinto@synopsys.com>
>
> Sorry, I am not applying this.
>
> This would mean that every single -stable backport of a fix to this
> driver would require fixing up the directory and/or file name of every
> single change without any exception.
>
> This is an unreasonable burdon to put upon me, and every single person
> who has to backport bug fixes into older releases of the kernel.
>
> Please stop submitting this rename change. It is fine to leave the
> driver with the stmmac name, and there is zero user benefit to the
> rename and only negatives for people who have to work on backports.
>
> I saw no agreement reached between yourself and anyone who voiced
> opposition to this driver rename. Therefore it was entirely
> inappropriate for you to resubmit this change again.
Just submited an alternative to the initial rename patch with 0 impact to
STMicroelectronics, so I tried to find a better solution.
I respect your decision.
A new Designware Ethernet IP title driver is being developed at this moment.
Could you please suggest a suitable place to put it, in order to avoid problems
when we reach the upstream phase?
Thanks.
>
> I heard very clearly your argument that you would help with the problem
> with the backports, but that is a completely empty gesture. Here's why.
>
> You cannot help with the problem, nor can any other developer working
> on this driver. People all over the world are going to want to
> backport this patch or that, and I myself work in my own little
> routine and can't depend on having to have a back and forth with you
> over and over again for every single fix to this driver I decide is
> reasonable for a -stable backport.
>
^ permalink raw reply
* Re: [PATCH iproute2 net-next 4/5] iplink: bridge: add support for IFLA_BR_MCAST_IGMP_VERSION
From: Nikolay Aleksandrov @ 2017-01-17 10:34 UTC (permalink / raw)
To: Hangbin Liu, netdev; +Cc: Stephen Hemminger
In-Reply-To: <1484645552-29440-5-git-send-email-liuhangbin@gmail.com>
On 17/01/17 10:32, Hangbin Liu wrote:
> This patch implements support for the IFLA_BR_MCAST_IGMP_VERSION
> attribute in iproute2 so it can change the mcast igmp version.
>
> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
> ---
> ip/iplink_bridge.c | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
Reviewed-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
^ permalink raw reply
* Re: [PATCH iproute2 net-next 5/5] iplink: bridge: add support for IFLA_BR_MCAST_MLD_VERSION
From: Nikolay Aleksandrov @ 2017-01-17 10:35 UTC (permalink / raw)
To: Hangbin Liu, netdev; +Cc: Stephen Hemminger
In-Reply-To: <1484645552-29440-6-git-send-email-liuhangbin@gmail.com>
On 17/01/17 10:32, Hangbin Liu wrote:
> This patch implements support for the IFLA_BR_MCAST_MLD_VERSION
> attribute in iproute2 so it can change the mcast mld version.
>
> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
> ---
> ip/iplink_bridge.c | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
Reviewed-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
^ permalink raw reply
* Re: [PATCH iproute2 net-next 1/5] iplink: bridge: add support for IFLA_BR_FDB_FLUSH
From: Nikolay Aleksandrov @ 2017-01-17 10:36 UTC (permalink / raw)
To: Hangbin Liu, netdev; +Cc: Stephen Hemminger
In-Reply-To: <1484645552-29440-2-git-send-email-liuhangbin@gmail.com>
On 17/01/17 10:32, Hangbin Liu wrote:
> This patch implements support for the IFLA_BR_FDB_FLUSH attribute
> in iproute2 so it can flush bridge fdb dynamic entries.
>
> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
> ---
> ip/iplink_bridge.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
Reviewed-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
^ permalink raw reply
* Re: [PATCH net] lwtunnel: fix autoload of lwt modules
From: Robert Shearman @ 2017-01-17 10:04 UTC (permalink / raw)
To: David Ahern, netdev
In-Reply-To: <1484631185-9428-1-git-send-email-dsa@cumulusnetworks.com>
On 17/01/17 05:33, David Ahern wrote:
> Trying to add an mpls encap route when the MPLS modules are not loaded
> hangs. For example:
>
> CONFIG_MPLS=y
> CONFIG_NET_MPLS_GSO=m
> CONFIG_MPLS_ROUTING=m
> CONFIG_MPLS_IPTUNNEL=m
>
> $ ip route add 10.10.10.10/32 encap mpls 100 via inet 10.100.1.2
>
> The ip command hangs:
> root 880 826 0 21:25 pts/0 00:00:00 ip route add 10.10.10.10/32 encap mpls 100 via inet 10.100.1.2
>
> $ cat /proc/880/stack
> [<ffffffff81065a9b>] call_usermodehelper_exec+0xd6/0x134
> [<ffffffff81065efc>] __request_module+0x27b/0x30a
> [<ffffffff814542f6>] lwtunnel_build_state+0xe4/0x178
> [<ffffffff814aa1e4>] fib_create_info+0x47f/0xdd4
> [<ffffffff814ae451>] fib_table_insert+0x90/0x41f
> [<ffffffff814a8010>] inet_rtm_newroute+0x4b/0x52
> ...
>
> modprobe is trying to load rtnl-lwt-MPLS:
>
> root 881 5 0 21:25 ? 00:00:00 /sbin/modprobe -q -- rtnl-lwt-MPLS
>
> and it hangs after loading mpls_router:
>
> $ cat /proc/881/stack
> [<ffffffff81441537>] rtnl_lock+0x12/0x14
> [<ffffffff8142ca2a>] register_netdevice_notifier+0x16/0x179
> [<ffffffffa0033025>] mpls_init+0x25/0x1000 [mpls_router]
> [<ffffffff81000471>] do_one_initcall+0x8e/0x13f
> [<ffffffff81119961>] do_init_module+0x5a/0x1e5
> [<ffffffff810bd070>] load_module+0x13bd/0x17d6
> ...
>
> The problem is that lwtunnel_build_state is called with rtnl lock
> held preventing mpls_init from registering. Fix by dropping the
> lock before invoking request_module.
>
> Fixes: 745041e2aaf1 ("lwtunnel: autoload of lwt modules")
> Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
> ---
> This is a best guess at the Fixes.
>
> net/core/lwtunnel.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/net/core/lwtunnel.c b/net/core/lwtunnel.c
> index a5d4e866ce88..c14ee4d62a8a 100644
> --- a/net/core/lwtunnel.c
> +++ b/net/core/lwtunnel.c
> @@ -120,7 +120,9 @@ int lwtunnel_build_state(struct net_device *dev, u16 encap_type,
>
> if (encap_type_str) {
> rcu_read_unlock();
> + __rtnl_unlock();
> request_module("rtnl-lwt-%s", encap_type_str);
> + rtnl_lock();
> rcu_read_lock();
> ops = rcu_dereference(lwtun_encaps[encap_type]);
> }
>
Is it safe to release the rtnl lock here? E.g. neither fib_get_nhs nor
fib_create_info take a reference on the device and further up
inet_rtm_newroute has a pointer to the struct fib_table without taking a
reference.
Unfortunately, I think more invasive changes are required to solve this.
I'm happy to work on solving this.
Thanksm
Rob
^ permalink raw reply
* Re: [PATCH net-next v3 1/1] net sched actions: Add support for user cookies
From: Jamal Hadi Salim @ 2017-01-17 10:52 UTC (permalink / raw)
To: David Miller
Cc: netdev, jiri, paulb, john.fastabend, simon.horman, mrv, hadarh,
ogerlitz, roid, xiyou.wangcong, daniel
In-Reply-To: <20170116.144644.977968311370245919.davem@davemloft.net>
On 17-01-16 02:46 PM, David Miller wrote:
>
> Jamal, please don't mix coding style and real changes.
>
> Have one patch that adds the user cookies and one that cleans up the
> coding style stuff.
>
> Thanks.
>
I will separate those changes (gives me an opportunity to make
more stylistic changes).
Having said that: Is this rule really cast in stone?;->
I have seen many other people (including myself) sneak in whitespace
changes and other trivialities in a general change. I thought the rule
was to not do such things for bug fixes.
cheers,
jamal
^ permalink raw reply
* RE: [PATCH] net: fec: Fixed panic problem with non-tso
From: Andy Duan @ 2017-01-17 11:02 UTC (permalink / raw)
To: Yuusuke Ashiduka; +Cc: netdev@vger.kernel.org
In-Reply-To: <20170117074820.5106-1-ashiduka@jp.fujitsu.com>
From: Yuusuke Ashiduka <ashiduka@jp.fujitsu.com> Sent: Tuesday, January 17, 2017 3:48 PM
>To: Andy Duan <fugang.duan@nxp.com>
>Cc: netdev@vger.kernel.org; Yuusuke Ashiduka <ashiduka@jp.fujitsu.com>
>Subject: [PATCH] net: fec: Fixed panic problem with non-tso
>
>If highmem and 2GB or more of memory are valid, "this_frag-> page.p"
>indicates the highmem area, so the result of page_address() is NULL and panic
>occurs.
>
>This commit fixes this by using the skb_frag_dma_map() helper, which takes
>care of mapping the skb fragment properly. Additionally, the type of mapping
>is now tracked, so it can be unmapped using dma_unmap_page or
>dma_unmap_single when appropriate.
>---
> drivers/net/ethernet/freescale/fec.h | 1 +
> drivers/net/ethernet/freescale/fec_main.c | 48
>+++++++++++++++++++++++--------
> 2 files changed, 37 insertions(+), 12 deletions(-)
>
The patch itself seems fine.
The driver doesn't support skb from highmem, if to support highmem, it should add frag_skb (highmem) support for tso and non-tso.
In driver net/core/tso.c, it also add highmem support, right ?
Thanks.
>diff --git a/drivers/net/ethernet/freescale/fec.h
>b/drivers/net/ethernet/freescale/fec.h
>index 5ea740b4cf14..5b187e8aacf0 100644
>--- a/drivers/net/ethernet/freescale/fec.h
>+++ b/drivers/net/ethernet/freescale/fec.h
>@@ -463,6 +463,7 @@ struct bufdesc_prop { struct fec_enet_priv_tx_q {
> struct bufdesc_prop bd;
> unsigned char *tx_bounce[TX_RING_SIZE];
>+ int tx_page_mapping[TX_RING_SIZE];
> struct sk_buff *tx_skbuff[TX_RING_SIZE];
>
> unsigned short tx_stop_threshold;
>diff --git a/drivers/net/ethernet/freescale/fec_main.c
>b/drivers/net/ethernet/freescale/fec_main.c
>index 38160c2bebcb..b1562107e337 100644
>--- a/drivers/net/ethernet/freescale/fec_main.c
>+++ b/drivers/net/ethernet/freescale/fec_main.c
>@@ -60,6 +60,7 @@
> #include <linux/if_vlan.h>
> #include <linux/pinctrl/consumer.h>
> #include <linux/prefetch.h>
>+#include <linux/highmem.h>
> #include <soc/imx/cpuidle.h>
>
> #include <asm/cacheflush.h>
>@@ -377,20 +378,28 @@ fec_enet_txq_submit_frag_skb(struct
>fec_enet_priv_tx_q *txq,
> ebdp->cbd_esc = cpu_to_fec32(estatus);
> }
>
>- bufaddr = page_address(this_frag->page.p) + this_frag-
>>page_offset;
>-
> index = fec_enet_get_bd_index(bdp, &txq->bd);
>- if (((unsigned long) bufaddr) & fep->tx_align ||
>+ txq->tx_page_mapping[index] = 0;
>+ if (this_frag->page_offset & fep->tx_align ||
> fep->quirks & FEC_QUIRK_SWAP_FRAME) {
>+ bufaddr = kmap_atomic(this_frag->page.p) +
>+ this_frag->page_offset;
> memcpy(txq->tx_bounce[index], bufaddr, frag_len);
>+ kunmap_atomic(bufaddr);
> bufaddr = txq->tx_bounce[index];
>
> if (fep->quirks & FEC_QUIRK_SWAP_FRAME)
> swap_buffer(bufaddr, frag_len);
>+ addr = dma_map_single(&fep->pdev->dev,
>+ bufaddr,
>+ frag_len,
>+ DMA_TO_DEVICE);
>+ } else {
>+ txq->tx_page_mapping[index] = 1;
>+ addr = skb_frag_dma_map(&fep->pdev->dev,
>this_frag, 0,
>+ frag_len, DMA_TO_DEVICE);
> }
>
>- addr = dma_map_single(&fep->pdev->dev, bufaddr, frag_len,
>- DMA_TO_DEVICE);
> if (dma_mapping_error(&fep->pdev->dev, addr)) {
> if (net_ratelimit())
> netdev_err(ndev, "Tx DMA memory map
>failed\n"); @@ -411,8 +420,16 @@ fec_enet_txq_submit_frag_skb(struct
>fec_enet_priv_tx_q *txq,
> bdp = txq->bd.cur;
> for (i = 0; i < frag; i++) {
> bdp = fec_enet_get_nextdesc(bdp, &txq->bd);
>- dma_unmap_single(&fep->pdev->dev, fec32_to_cpu(bdp-
>>cbd_bufaddr),
>- fec16_to_cpu(bdp->cbd_datlen),
>DMA_TO_DEVICE);
>+ if (txq->tx_page_mapping[index])
>+ dma_unmap_page(&fep->pdev->dev,
>+ fec32_to_cpu(bdp->cbd_bufaddr),
>+ fec16_to_cpu(bdp->cbd_datlen),
>+ DMA_TO_DEVICE);
>+ else
>+ dma_unmap_single(&fep->pdev->dev,
>+ fec32_to_cpu(bdp->cbd_bufaddr),
>+ fec16_to_cpu(bdp->cbd_datlen),
>+ DMA_TO_DEVICE);
> }
> return ERR_PTR(-ENOMEM);
> }
>@@ -1201,11 +1218,18 @@ fec_enet_tx_queue(struct net_device *ndev, u16
>queue_id)
>
> skb = txq->tx_skbuff[index];
> txq->tx_skbuff[index] = NULL;
>- if (!IS_TSO_HEADER(txq, fec32_to_cpu(bdp->cbd_bufaddr)))
>- dma_unmap_single(&fep->pdev->dev,
>- fec32_to_cpu(bdp->cbd_bufaddr),
>- fec16_to_cpu(bdp->cbd_datlen),
>- DMA_TO_DEVICE);
>+ if (!IS_TSO_HEADER(txq, fec32_to_cpu(bdp->cbd_bufaddr)))
>{
>+ if (txq->tx_page_mapping[index])
>+ dma_unmap_page(&fep->pdev->dev,
>+ fec32_to_cpu(bdp->cbd_bufaddr),
>+ fec16_to_cpu(bdp->cbd_datlen),
>+ DMA_TO_DEVICE);
>+ else
>+ dma_unmap_single(&fep->pdev->dev,
>+ fec32_to_cpu(bdp-
>>cbd_bufaddr),
>+ fec16_to_cpu(bdp-
>>cbd_datlen),
>+ DMA_TO_DEVICE);
>+ }
> bdp->cbd_bufaddr = cpu_to_fec32(0);
> if (!skb)
> goto skb_done;
>--
>2.11.0
^ permalink raw reply
* [PATCH net-next v4 1/2] net sched actions: Add support for user cookies
From: Jamal Hadi Salim @ 2017-01-17 11:11 UTC (permalink / raw)
To: davem
Cc: netdev, jiri, paulb, john.fastabend, simon.horman, mrv, hadarh,
ogerlitz, roid, xiyou.wangcong, daniel, Jamal Hadi Salim
In-Reply-To: <1484651509-27500-1-git-send-email-jhs@emojatatu.com>
From: Jamal Hadi Salim <jhs@mojatatu.com>
Introduce optional 128-bit action cookie.
Like all other cookie schemes in the networking world (eg in protocols
like http or existing kernel fib protocol field, etc) the idea is to save
user state that when retrieved serves as a correlator. The kernel
_should not_ intepret it. The user can store whatever they wish in the
128 bits.
Sample exercise(showing variable length use of cookie)
.. create an accept action with cookie a1b2c3d4
sudo $TC actions add action ok index 1 cookie a1b2c3d4
.. dump all gact actions..
sudo $TC -s actions ls action gact
action order 0: gact action pass
random type none pass val 0
index 1 ref 1 bind 0 installed 5 sec used 5 sec
Action statistics:
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
cookie a1b2c3d4
.. bind the accept action to a filter..
sudo $TC filter add dev lo parent ffff: protocol ip prio 1 \
u32 match ip dst 127.0.0.1/32 flowid 1:1 action gact index 1
... send some traffic..
$ ping 127.0.0.1 -c 3
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.020 ms
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.027 ms
64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.038 ms
--- 127.0.0.1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2109ms
rtt min/avg/max/mdev = 0.020/0.028/0.038/0.008 ms 1
... show some stats
$ sudo $TC -s actions get action gact index 1
action order 1: gact action pass
random type none pass val 0
index 1 ref 2 bind 1 installed 204 sec used 5 sec
Action statistics:
Sent 12168 bytes 164 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
cookie a1b2c3d4
.. try longer cookie...
$ sudo $TC actions replace action ok index 1 cookie 1234567890abcdef
.. dump..
$ sudo $TC -s actions ls action gact
action order 1: gact action pass
random type none pass val 0
index 1 ref 2 bind 1 installed 204 sec used 5 sec
Action statistics:
Sent 12168 bytes 164 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
cookie 1234567890abcdef
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
---
include/net/act_api.h | 1 +
include/net/pkt_cls.h | 8 ++++++++
include/uapi/linux/pkt_cls.h | 3 +++
net/sched/act_api.c | 25 +++++++++++++++++++++++++
4 files changed, 37 insertions(+)
diff --git a/include/net/act_api.h b/include/net/act_api.h
index 1d71644..0692458 100644
--- a/include/net/act_api.h
+++ b/include/net/act_api.h
@@ -41,6 +41,7 @@ struct tc_action {
struct rcu_head tcfa_rcu;
struct gnet_stats_basic_cpu __percpu *cpu_bstats;
struct gnet_stats_queue __percpu *cpu_qstats;
+ struct tc_cookie *act_ck;
};
#define tcf_head common.tcfa_head
#define tcf_index common.tcfa_index
diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h
index f0a0514..e0bc7e8 100644
--- a/include/net/pkt_cls.h
+++ b/include/net/pkt_cls.h
@@ -515,4 +515,12 @@ struct tc_cls_bpf_offload {
u32 gen_flags;
};
+
+/* This structure holds cookie structure that is passed from user
+ * to the kernel for actions and classifiers
+ */
+struct tc_cookie {
+ unsigned char ck[TC_COOKIE_MAX_SIZE];
+ unsigned char ck_len;
+};
#endif
diff --git a/include/uapi/linux/pkt_cls.h b/include/uapi/linux/pkt_cls.h
index 1e5e1dd..2d2414e 100644
--- a/include/uapi/linux/pkt_cls.h
+++ b/include/uapi/linux/pkt_cls.h
@@ -4,6 +4,8 @@
#include <linux/types.h>
#include <linux/pkt_sched.h>
+#define TC_COOKIE_MAX_SIZE 16
+
/* Action attributes */
enum {
TCA_ACT_UNSPEC,
@@ -12,6 +14,7 @@ enum {
TCA_ACT_INDEX,
TCA_ACT_STATS,
TCA_ACT_PAD,
+ TCA_ACT_COOKIE,
__TCA_ACT_MAX
};
diff --git a/net/sched/act_api.c b/net/sched/act_api.c
index f04715a..43f1f42 100644
--- a/net/sched/act_api.c
+++ b/net/sched/act_api.c
@@ -24,6 +24,7 @@
#include <net/net_namespace.h>
#include <net/sock.h>
#include <net/sch_generic.h>
+#include <net/pkt_cls.h>
#include <net/act_api.h>
#include <net/netlink.h>
@@ -33,6 +34,7 @@ static void free_tcf(struct rcu_head *head)
free_percpu(p->cpu_bstats);
free_percpu(p->cpu_qstats);
+ kfree(p->act_ck);
kfree(p);
}
@@ -475,6 +477,12 @@ int tcf_action_destroy(struct list_head *actions, int bind)
goto nla_put_failure;
if (tcf_action_copy_stats(skb, a, 0))
goto nla_put_failure;
+ if (a->act_ck) {
+ if (nla_put(skb, TCA_ACT_COOKIE, a->act_ck->ck_len,
+ a->act_ck))
+ goto nla_put_failure;
+ }
+
nest = nla_nest_start(skb, TCA_OPTIONS);
if (nest == NULL)
goto nla_put_failure;
@@ -575,6 +583,23 @@ struct tc_action *tcf_action_init_1(struct net *net, struct nlattr *nla,
if (err < 0)
goto err_mod;
+ if (tb[TCA_ACT_COOKIE]) {
+ if (nla_len(tb[TCA_ACT_COOKIE]) > TC_COOKIE_MAX_SIZE) {
+ err = -EINVAL;
+ goto err_mod;
+ }
+
+ a->act_ck = kzalloc(sizeof(*a->act_ck), GFP_KERNEL);
+ if (unlikely(!a->act_ck)) {
+ err = -ENOMEM;
+ goto err_mod;
+ }
+
+ memcpy(a->act_ck->ck, nla_data(tb[TCA_ACT_COOKIE]),
+ nla_len(tb[TCA_ACT_COOKIE]));
+ a->act_ck->ck_len = nla_len(tb[TCA_ACT_COOKIE]);
+ }
+
/* module count goes up only when brand new policy is created
* if it exists and is only bound to in a_o->init() then
* ACT_P_CREATED is not returned (a zero is).
--
1.9.1
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox