* [PATCH net-next] packet: pdiag_put_ring() should return TX_RING info for TPACKET_V3
From: Sowmini Varadhan @ 2017-01-10 15:47 UTC (permalink / raw)
To: netdev, sowmini.varadhan; +Cc: daniel, willemb, davem
In-Reply-To: <cover.1484060892.git.sowmini.varadhan@oracle.com>
Commit 7f953ab2ba46 ("af_packet: TX_RING support for TPACKET_V3")
now makes it possible to use TX_RING with TPACKET_V3, so make the
the relevant information available via 'ss -e -a --packet'
Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
---
net/packet/diag.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/net/packet/diag.c b/net/packet/diag.c
index 0ed68f0..7ef1c88 100644
--- a/net/packet/diag.c
+++ b/net/packet/diag.c
@@ -73,8 +73,7 @@ static int pdiag_put_ring(struct packet_ring_buffer *ring, int ver, int nl_type,
{
struct packet_diag_ring pdr;
- if (!ring->pg_vec || ((ver > TPACKET_V2) &&
- (nl_type == PACKET_DIAG_TX_RING)))
+ if (!ring->pg_vec)
return 0;
pdr.pdr_block_size = ring->pg_vec_pages << PAGE_SHIFT;
--
1.7.1
^ permalink raw reply related
* [PATCH net] netvsc: add rcu_read locking to netvsc callback
From: Stephen Hemminger @ 2017-01-10 15:50 UTC (permalink / raw)
To: davem; +Cc: netdev, Stephen Hemminger
Lockdep finds a case where netvsc receive processing is incorrectly
assuming it is in RCU safe zone. The driver is using RCU to handle
VF reference but RCU read lock not held.
Fixes 0c9d3ba9a87b ("hv_netvsc: use RCU to protect vf_netdev")
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
---
drivers/net/hyperv/netvsc_drv.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index c9414c054852..fcab8019dda0 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -659,6 +659,7 @@ int netvsc_recv_callback(struct hv_device *device_obj,
* policy filters on the host). Deliver these via the VF
* interface in the guest.
*/
+ rcu_read_lock();
vf_netdev = rcu_dereference(net_device_ctx->vf_netdev);
if (vf_netdev && (vf_netdev->flags & IFF_UP))
net = vf_netdev;
@@ -667,6 +668,7 @@ int netvsc_recv_callback(struct hv_device *device_obj,
skb = netvsc_alloc_recv_skb(net, packet, csum_info, *data, vlan_tci);
if (unlikely(!skb)) {
++net->stats.rx_dropped;
+ rcu_read_unlock();
return NVSP_STAT_FAIL;
}
@@ -696,6 +698,7 @@ int netvsc_recv_callback(struct hv_device *device_obj,
* TODO - use NAPI?
*/
netif_rx(skb);
+ rcu_read_unlock();
return 0;
}
--
2.11.0
^ permalink raw reply related
* Re: [PATCH net-next 0/4] net: switchdev: Avoid sleep in atomic with DSA
From: Ido Schimmel @ 2017-01-10 16:08 UTC (permalink / raw)
To: Jiri Pirko; +Cc: Florian Fainelli, netdev, davem, vivien.didelot, andrew
In-Reply-To: <20170110141807.GD1827@nanopsycho>
On Tue, Jan 10, 2017 at 03:18:07PM +0100, Jiri Pirko wrote:
> Tue, Jan 10, 2017 at 02:25:06PM CET, idosch@idosch.org wrote:
> >On Tue, Jan 10, 2017 at 01:08:46PM +0100, Jiri Pirko wrote:
> >> Mon, Jan 09, 2017 at 10:14:36PM CET, idosch@idosch.org wrote:
> >> >On Mon, Jan 09, 2017 at 12:56:48PM -0800, Florian Fainelli wrote:
> >> >> On 01/09/2017 12:48 PM, Ido Schimmel wrote:
> >> >> > Hi Florian,
> >> >> >
> >> >> > On Mon, Jan 09, 2017 at 11:44:59AM -0800, Florian Fainelli wrote:
> >> >> >> Hi all,
> >> >> >>
> >> >> >> This patch series is to resolve a sleeping function called in atomic context
> >> >> >> debug splat that we observe with DSA.
> >> >> >>
> >> >> >> Let me know what you think, I was also wondering if we should just always
> >> >> >> make switchdev_port_vlan_fill() set SWITCHDEV_F_DEFER, but was afraid this
> >> >> >> could cause invalid contexts to be used for rocker, mlxsw, i40e etc.
> >> >> >
> >> >> > Isn't this a bit of overkill? All the drivers you mention fill the VLAN
> >> >> > dump from their cache and don't require sleeping. Even b53 that you
> >> >> > mention in the last patch does that, but reads the PVID from the device,
> >> >> > which entails taking a mutex.
> >> >>
> >> >> Correct.
> >> >>
> >> >> >
> >> >> > Can't you just cache the PVID as well? I think this will solve your
> >> >> > problem. Didn't look too much into the b53 code, so maybe I'm missing
> >> >> > something. Seems that mv88e6xxx has a similar problem.
> >> >>
> >> >> I suppose we could indeed cache the PVID for b53, but for mv88e6xxx it
> >> >> seems like we need to perform a bunch of VTU operations, and those
> >> >> access HW registers, Andrew, Vivien, how do you want to solve that, do
> >> >> we want to introduce a general VLAN cache somewhere in switchdev/DSA/driver?
> >> >
> >> >Truth be told, I don't quite understand why switchdev infra even tries
> >> >to dump the VLANs from the device. Like, in which situations is this
> >> >going to be different from what the software bridge reports? Sure, you
> >> >can set the VLAN filters with SELF and skip the software bridge, but how
> >> >does that make sense in a model where you want to reflect the software
> >> >datapath?
> >>
> >> But the vlans added by rtnl_bridge_setlink & SELF are not tracked by the
> >> bridge and therefore driver needs to dump them. You would have to pass
> >> some flag down to driver when adding SWITCHDEV_OBJ_ID_PORT_VLAN
> >> indicating the need to track the vlan and dump it. Right?
> >
> >Right, but back to my question - what's the use case for the SELF flag
> >in the switchdev model? Why would I configure a VLAN filter in the
> >hardware but not in the software bridge? The whole point is reflecting
> >the software bridge to the hardware.
>
> I agree. For the bridge-switchdev usecase, I don't see a reason to use
> SELF for vlans as well. Do you suggest to simply remove this possibility?
Yes. This would also solve Florian's problem.
Florian, what do you think?
^ permalink raw reply
* [PATCH net 0/1] af_iucv: don't use paged skbs for TX on HiperSockets
From: Ursula Braun @ 2017-01-10 16:10 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-s390, schwidefsky, heiko.carstens, stable, ubraun
Dave,
here is an af_iucv patch built for the net-tree.
Thanks, Ursula
Julian Wiedmann (1):
net/af_iucv: don't use paged skbs for TX on HiperSockets
net/iucv/af_iucv.c | 25 ++++++++++++++-----------
1 file changed, 14 insertions(+), 11 deletions(-)
--
2.8.4
^ permalink raw reply
* [PATCH net 1/1] net/af_iucv: don't use paged skbs for TX on HiperSockets
From: Ursula Braun @ 2017-01-10 16:10 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-s390, schwidefsky, heiko.carstens, stable, ubraun
In-Reply-To: <20170110161034.82445-1-ubraun@linux.vnet.ibm.com>
From: Julian Wiedmann <jwi@linux.vnet.ibm.com>
With commit e53743994e21
("af_iucv: use paged SKBs for big outbound messages"),
we transmit paged skbs for both of AF_IUCV's transport modes
(IUCV or HiperSockets).
The qeth driver for Layer 3 HiperSockets currently doesn't
support NETIF_F_SG, so these skbs would just be linearized again
by the stack.
Avoid that overhead by using paged skbs only for IUCV transport.
cc stable, since this also circumvents a significant skb leak when
sending large messages (where the skb then needs to be linearized).
Signed-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com>
Signed-off-by: Ursula Braun <ubraun@linux.vnet.ibm.com>
Cc: <stable@vger.kernel.org> # v4.8+
Fixes: e53743994e21 ("af_iucv: use paged SKBs for big outbound messages")
---
net/iucv/af_iucv.c | 25 ++++++++++++++-----------
1 file changed, 14 insertions(+), 11 deletions(-)
diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c
index cfb9e5f..13190b3 100644
--- a/net/iucv/af_iucv.c
+++ b/net/iucv/af_iucv.c
@@ -1044,7 +1044,8 @@ static int iucv_sock_sendmsg(struct socket *sock, struct msghdr *msg,
{
struct sock *sk = sock->sk;
struct iucv_sock *iucv = iucv_sk(sk);
- size_t headroom, linear;
+ size_t headroom = 0;
+ size_t linear;
struct sk_buff *skb;
struct iucv_message txmsg = {0};
struct cmsghdr *cmsg;
@@ -1122,18 +1123,20 @@ static int iucv_sock_sendmsg(struct socket *sock, struct msghdr *msg,
* this is fine for SOCK_SEQPACKET (unless we want to support
* segmented records using the MSG_EOR flag), but
* for SOCK_STREAM we might want to improve it in future */
- headroom = (iucv->transport == AF_IUCV_TRANS_HIPER)
- ? sizeof(struct af_iucv_trans_hdr) + ETH_HLEN : 0;
- if (headroom + len < PAGE_SIZE) {
+ if (iucv->transport == AF_IUCV_TRANS_HIPER) {
+ headroom = sizeof(struct af_iucv_trans_hdr) + ETH_HLEN;
linear = len;
} else {
- /* In nonlinear "classic" iucv skb,
- * reserve space for iucv_array
- */
- if (iucv->transport != AF_IUCV_TRANS_HIPER)
- headroom += sizeof(struct iucv_array) *
- (MAX_SKB_FRAGS + 1);
- linear = PAGE_SIZE - headroom;
+ if (len < PAGE_SIZE) {
+ linear = len;
+ } else {
+ /* In nonlinear "classic" iucv skb,
+ * reserve space for iucv_array
+ */
+ headroom = sizeof(struct iucv_array) *
+ (MAX_SKB_FRAGS + 1);
+ linear = PAGE_SIZE - headroom;
+ }
}
skb = sock_alloc_send_pskb(sk, headroom + linear, len - linear,
noblock, &err, 0);
--
2.8.4
^ permalink raw reply related
* Re: [PATCH net-next 0/4] net: switchdev: Avoid sleep in atomic with DSA
From: Jiri Pirko @ 2017-01-10 16:13 UTC (permalink / raw)
To: Ido Schimmel; +Cc: Florian Fainelli, netdev, davem, vivien.didelot, andrew
In-Reply-To: <20170110160852.GA18050@splinter.mtl.com>
Tue, Jan 10, 2017 at 05:08:52PM CET, idosch@idosch.org wrote:
>On Tue, Jan 10, 2017 at 03:18:07PM +0100, Jiri Pirko wrote:
>> Tue, Jan 10, 2017 at 02:25:06PM CET, idosch@idosch.org wrote:
>> >On Tue, Jan 10, 2017 at 01:08:46PM +0100, Jiri Pirko wrote:
>> >> Mon, Jan 09, 2017 at 10:14:36PM CET, idosch@idosch.org wrote:
>> >> >On Mon, Jan 09, 2017 at 12:56:48PM -0800, Florian Fainelli wrote:
>> >> >> On 01/09/2017 12:48 PM, Ido Schimmel wrote:
>> >> >> > Hi Florian,
>> >> >> >
>> >> >> > On Mon, Jan 09, 2017 at 11:44:59AM -0800, Florian Fainelli wrote:
>> >> >> >> Hi all,
>> >> >> >>
>> >> >> >> This patch series is to resolve a sleeping function called in atomic context
>> >> >> >> debug splat that we observe with DSA.
>> >> >> >>
>> >> >> >> Let me know what you think, I was also wondering if we should just always
>> >> >> >> make switchdev_port_vlan_fill() set SWITCHDEV_F_DEFER, but was afraid this
>> >> >> >> could cause invalid contexts to be used for rocker, mlxsw, i40e etc.
>> >> >> >
>> >> >> > Isn't this a bit of overkill? All the drivers you mention fill the VLAN
>> >> >> > dump from their cache and don't require sleeping. Even b53 that you
>> >> >> > mention in the last patch does that, but reads the PVID from the device,
>> >> >> > which entails taking a mutex.
>> >> >>
>> >> >> Correct.
>> >> >>
>> >> >> >
>> >> >> > Can't you just cache the PVID as well? I think this will solve your
>> >> >> > problem. Didn't look too much into the b53 code, so maybe I'm missing
>> >> >> > something. Seems that mv88e6xxx has a similar problem.
>> >> >>
>> >> >> I suppose we could indeed cache the PVID for b53, but for mv88e6xxx it
>> >> >> seems like we need to perform a bunch of VTU operations, and those
>> >> >> access HW registers, Andrew, Vivien, how do you want to solve that, do
>> >> >> we want to introduce a general VLAN cache somewhere in switchdev/DSA/driver?
>> >> >
>> >> >Truth be told, I don't quite understand why switchdev infra even tries
>> >> >to dump the VLANs from the device. Like, in which situations is this
>> >> >going to be different from what the software bridge reports? Sure, you
>> >> >can set the VLAN filters with SELF and skip the software bridge, but how
>> >> >does that make sense in a model where you want to reflect the software
>> >> >datapath?
>> >>
>> >> But the vlans added by rtnl_bridge_setlink & SELF are not tracked by the
>> >> bridge and therefore driver needs to dump them. You would have to pass
>> >> some flag down to driver when adding SWITCHDEV_OBJ_ID_PORT_VLAN
>> >> indicating the need to track the vlan and dump it. Right?
>> >
>> >Right, but back to my question - what's the use case for the SELF flag
>> >in the switchdev model? Why would I configure a VLAN filter in the
>> >hardware but not in the software bridge? The whole point is reflecting
>> >the software bridge to the hardware.
>>
>> I agree. For the bridge-switchdev usecase, I don't see a reason to use
>> SELF for vlans as well. Do you suggest to simply remove this possibility?
>
>Yes. This would also solve Florian's problem.
I agree, for switchdev usecase it makes no sense to implement this. I
vote for removing that.
>
>Florian, what do you think?
^ permalink raw reply
* [PATCH net-next 0/3] sfc: physical port ids
From: Edward Cree @ 2017-01-10 16:22 UTC (permalink / raw)
To: linux-net-drivers, davem; +Cc: netdev
This series brings our handling of ndo_get_phys_port_id and related
interfaces into line with the behaviour of other drivers.
Bert Kenward (3):
sfc: support ndo_get_phys_port_id even when !CONFIG_SFC_SRIOV
sfc: implement ndo_get_phys_port_name
sfc: stop setting dev_port
drivers/net/ethernet/sfc/ef10.c | 19 ++++++++++++++++---
drivers/net/ethernet/sfc/ef10_sriov.c | 14 --------------
drivers/net/ethernet/sfc/ef10_sriov.h | 3 ---
drivers/net/ethernet/sfc/efx.c | 24 +++++++++++++++++++++++-
drivers/net/ethernet/sfc/net_driver.h | 5 +++--
drivers/net/ethernet/sfc/sriov.c | 11 -----------
drivers/net/ethernet/sfc/sriov.h | 3 ---
7 files changed, 42 insertions(+), 37 deletions(-)
^ permalink raw reply
* [PATCH net-next 1/3] sfc: support ndo_get_phys_port_id even when !CONFIG_SFC_SRIOV
From: Edward Cree @ 2017-01-10 16:23 UTC (permalink / raw)
To: linux-net-drivers, davem; +Cc: netdev
In-Reply-To: <78b911fa-ba82-093e-ba00-f4bdb09f1896@solarflare.com>
From: Bert Kenward <bkenward@solarflare.com>
There's no good reason why this should be an SRIOV-only thing.
Thus, also move it out of SRIOV-specific files.
Signed-off-by: Edward Cree <ecree@solarflare.com>
---
drivers/net/ethernet/sfc/ef10.c | 17 ++++++++++++++++-
drivers/net/ethernet/sfc/ef10_sriov.c | 14 --------------
drivers/net/ethernet/sfc/ef10_sriov.h | 3 ---
drivers/net/ethernet/sfc/efx.c | 13 ++++++++++++-
drivers/net/ethernet/sfc/net_driver.h | 5 +++--
drivers/net/ethernet/sfc/sriov.c | 11 -----------
drivers/net/ethernet/sfc/sriov.h | 3 ---
7 files changed, 31 insertions(+), 35 deletions(-)
diff --git a/drivers/net/ethernet/sfc/ef10.c b/drivers/net/ethernet/sfc/ef10.c
index 5eb0e68..4f3c965 100644
--- a/drivers/net/ethernet/sfc/ef10.c
+++ b/drivers/net/ethernet/sfc/ef10.c
@@ -5540,6 +5540,20 @@ static int efx_ef10_ptp_set_ts_config(struct efx_nic *efx,
}
}
+static int efx_ef10_get_phys_port_id(struct efx_nic *efx,
+ struct netdev_phys_item_id *ppid)
+{
+ struct efx_ef10_nic_data *nic_data = efx->nic_data;
+
+ if (!is_valid_ether_addr(nic_data->port_id))
+ return -EOPNOTSUPP;
+
+ ppid->id_len = ETH_ALEN;
+ memcpy(ppid->id, nic_data->port_id, ppid->id_len);
+
+ return 0;
+}
+
static int efx_ef10_vlan_rx_add_vid(struct efx_nic *efx, __be16 proto, u16 vid)
{
if (proto != htons(ETH_P_8021Q))
@@ -5647,11 +5661,11 @@ const struct efx_nic_type efx_hunt_a0_vf_nic_type = {
.vswitching_probe = efx_ef10_vswitching_probe_vf,
.vswitching_restore = efx_ef10_vswitching_restore_vf,
.vswitching_remove = efx_ef10_vswitching_remove_vf,
- .sriov_get_phys_port_id = efx_ef10_sriov_get_phys_port_id,
#endif
.get_mac_address = efx_ef10_get_mac_address_vf,
.set_mac_address = efx_ef10_set_mac_address,
+ .get_phys_port_id = efx_ef10_get_phys_port_id,
.revision = EFX_REV_HUNT_A0,
.max_dma_mask = DMA_BIT_MASK(ESF_DZ_TX_KER_BUF_ADDR_WIDTH),
.rx_prefix_size = ES_DZ_RX_PREFIX_SIZE,
@@ -5776,6 +5790,7 @@ const struct efx_nic_type efx_hunt_a0_nic_type = {
.set_mac_address = efx_ef10_set_mac_address,
.tso_versions = efx_ef10_tso_versions,
+ .get_phys_port_id = efx_ef10_get_phys_port_id,
.revision = EFX_REV_HUNT_A0,
.max_dma_mask = DMA_BIT_MASK(ESF_DZ_TX_KER_BUF_ADDR_WIDTH),
.rx_prefix_size = ES_DZ_RX_PREFIX_SIZE,
diff --git a/drivers/net/ethernet/sfc/ef10_sriov.c b/drivers/net/ethernet/sfc/ef10_sriov.c
index a949b9d..a55c53d 100644
--- a/drivers/net/ethernet/sfc/ef10_sriov.c
+++ b/drivers/net/ethernet/sfc/ef10_sriov.c
@@ -760,17 +760,3 @@ int efx_ef10_sriov_get_vf_config(struct efx_nic *efx, int vf_i,
return 0;
}
-
-int efx_ef10_sriov_get_phys_port_id(struct efx_nic *efx,
- struct netdev_phys_item_id *ppid)
-{
- struct efx_ef10_nic_data *nic_data = efx->nic_data;
-
- if (!is_valid_ether_addr(nic_data->port_id))
- return -EOPNOTSUPP;
-
- ppid->id_len = ETH_ALEN;
- memcpy(ppid->id, nic_data->port_id, ppid->id_len);
-
- return 0;
-}
diff --git a/drivers/net/ethernet/sfc/ef10_sriov.h b/drivers/net/ethernet/sfc/ef10_sriov.h
index 9ceb7ef..2aa444e 100644
--- a/drivers/net/ethernet/sfc/ef10_sriov.h
+++ b/drivers/net/ethernet/sfc/ef10_sriov.h
@@ -56,9 +56,6 @@ int efx_ef10_sriov_get_vf_config(struct efx_nic *efx, int vf_i,
int efx_ef10_sriov_set_vf_link_state(struct efx_nic *efx, int vf_i,
int link_state);
-int efx_ef10_sriov_get_phys_port_id(struct efx_nic *efx,
- struct netdev_phys_item_id *ppid);
-
int efx_ef10_vswitching_probe_pf(struct efx_nic *efx);
int efx_ef10_vswitching_probe_vf(struct efx_nic *efx);
int efx_ef10_vswitching_restore_pf(struct efx_nic *efx);
diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c
index bbbed2e..c1aefbd9 100644
--- a/drivers/net/ethernet/sfc/efx.c
+++ b/drivers/net/ethernet/sfc/efx.c
@@ -2336,6 +2336,17 @@ static int efx_set_features(struct net_device *net_dev, netdev_features_t data)
return 0;
}
+int efx_get_phys_port_id(struct net_device *net_dev,
+ struct netdev_phys_item_id *ppid)
+{
+ struct efx_nic *efx = netdev_priv(net_dev);
+
+ if (efx->type->get_phys_port_id)
+ return efx->type->get_phys_port_id(efx, ppid);
+ else
+ return -EOPNOTSUPP;
+}
+
static int efx_vlan_rx_add_vid(struct net_device *net_dev, __be16 proto, u16 vid)
{
struct efx_nic *efx = netdev_priv(net_dev);
@@ -2376,8 +2387,8 @@ static const struct net_device_ops efx_netdev_ops = {
.ndo_set_vf_spoofchk = efx_sriov_set_vf_spoofchk,
.ndo_get_vf_config = efx_sriov_get_vf_config,
.ndo_set_vf_link_state = efx_sriov_set_vf_link_state,
- .ndo_get_phys_port_id = efx_sriov_get_phys_port_id,
#endif
+ .ndo_get_phys_port_id = efx_get_phys_port_id,
#ifdef CONFIG_NET_POLL_CONTROLLER
.ndo_poll_controller = efx_netpoll,
#endif
diff --git a/drivers/net/ethernet/sfc/net_driver.h b/drivers/net/ethernet/sfc/net_driver.h
index 1c62c1a..49db9e8 100644
--- a/drivers/net/ethernet/sfc/net_driver.h
+++ b/drivers/net/ethernet/sfc/net_driver.h
@@ -1220,6 +1220,7 @@ struct efx_mtd_partition {
* @ptp_set_ts_config: Set hardware timestamp configuration. The flags
* and tx_type will already have been validated but this operation
* must validate and update rx_filter.
+ * @get_phys_port_id: Get the underlying physical port id.
* @set_mac_address: Set the MAC address of the device
* @tso_versions: Returns mask of firmware-assisted TSO versions supported.
* If %NULL, then device does not support any TSO version.
@@ -1358,6 +1359,8 @@ struct efx_nic_type {
int (*sriov_configure)(struct efx_nic *efx, int num_vfs);
int (*vlan_rx_add_vid)(struct efx_nic *efx, __be16 proto, u16 vid);
int (*vlan_rx_kill_vid)(struct efx_nic *efx, __be16 proto, u16 vid);
+ int (*get_phys_port_id)(struct efx_nic *efx,
+ struct netdev_phys_item_id *ppid);
int (*sriov_init)(struct efx_nic *efx);
void (*sriov_fini)(struct efx_nic *efx);
bool (*sriov_wanted)(struct efx_nic *efx);
@@ -1372,8 +1375,6 @@ struct efx_nic_type {
struct ifla_vf_info *ivi);
int (*sriov_set_vf_link_state)(struct efx_nic *efx, int vf_i,
int link_state);
- int (*sriov_get_phys_port_id)(struct efx_nic *efx,
- struct netdev_phys_item_id *ppid);
int (*vswitching_probe)(struct efx_nic *efx);
int (*vswitching_restore)(struct efx_nic *efx);
void (*vswitching_remove)(struct efx_nic *efx);
diff --git a/drivers/net/ethernet/sfc/sriov.c b/drivers/net/ethernet/sfc/sriov.c
index 9abcf4a..0b766fd 100644
--- a/drivers/net/ethernet/sfc/sriov.c
+++ b/drivers/net/ethernet/sfc/sriov.c
@@ -73,14 +73,3 @@ int efx_sriov_set_vf_link_state(struct net_device *net_dev, int vf_i,
else
return -EOPNOTSUPP;
}
-
-int efx_sriov_get_phys_port_id(struct net_device *net_dev,
- struct netdev_phys_item_id *ppid)
-{
- struct efx_nic *efx = netdev_priv(net_dev);
-
- if (efx->type->sriov_get_phys_port_id)
- return efx->type->sriov_get_phys_port_id(efx, ppid);
- else
- return -EOPNOTSUPP;
-}
diff --git a/drivers/net/ethernet/sfc/sriov.h b/drivers/net/ethernet/sfc/sriov.h
index ba1762e..84c7984 100644
--- a/drivers/net/ethernet/sfc/sriov.h
+++ b/drivers/net/ethernet/sfc/sriov.h
@@ -23,9 +23,6 @@ int efx_sriov_get_vf_config(struct net_device *net_dev, int vf_i,
struct ifla_vf_info *ivi);
int efx_sriov_set_vf_link_state(struct net_device *net_dev, int vf_i,
int link_state);
-int efx_sriov_get_phys_port_id(struct net_device *net_dev,
- struct netdev_phys_item_id *ppid);
-
#endif /* CONFIG_SFC_SRIOV */
#endif /* EFX_SRIOV_H */
^ permalink raw reply related
* [PATCH net-next 2/3] sfc: implement ndo_get_phys_port_name
From: Edward Cree @ 2017-01-10 16:23 UTC (permalink / raw)
To: linux-net-drivers, davem; +Cc: netdev
In-Reply-To: <78b911fa-ba82-093e-ba00-f4bdb09f1896@solarflare.com>
From: Bert Kenward <bkenward@solarflare.com>
Output is of the form p<port-number>.
Note that the port numbers don't necessarily map one-to-one to physical
cages, partly because of 4x10G port modes on QSFP+ and partly because
of hw/fw implementation details.
Signed-off-by: Edward Cree <ecree@solarflare.com>
---
drivers/net/ethernet/sfc/efx.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c
index c1aefbd9..bdbacb2 100644
--- a/drivers/net/ethernet/sfc/efx.c
+++ b/drivers/net/ethernet/sfc/efx.c
@@ -2347,6 +2347,16 @@ int efx_get_phys_port_id(struct net_device *net_dev,
return -EOPNOTSUPP;
}
+static int efx_get_phys_port_name(struct net_device *net_dev,
+ char *name, size_t len)
+{
+ struct efx_nic *efx = netdev_priv(net_dev);
+
+ if (snprintf(name, len, "p%u", efx->port_num) >= len)
+ return -EINVAL;
+ return 0;
+}
+
static int efx_vlan_rx_add_vid(struct net_device *net_dev, __be16 proto, u16 vid)
{
struct efx_nic *efx = netdev_priv(net_dev);
@@ -2389,6 +2399,7 @@ static const struct net_device_ops efx_netdev_ops = {
.ndo_set_vf_link_state = efx_sriov_set_vf_link_state,
#endif
.ndo_get_phys_port_id = efx_get_phys_port_id,
+ .ndo_get_phys_port_name = efx_get_phys_port_name,
#ifdef CONFIG_NET_POLL_CONTROLLER
.ndo_poll_controller = efx_netpoll,
#endif
^ permalink raw reply related
* [PATCH net-next 3/3] sfc: stop setting dev_port
From: Edward Cree @ 2017-01-10 16:24 UTC (permalink / raw)
To: linux-net-drivers, davem; +Cc: netdev
In-Reply-To: <78b911fa-ba82-093e-ba00-f4bdb09f1896@solarflare.com>
From: Bert Kenward <bkenward@solarflare.com>
Setting dev_port changes the device names allocated by systemd. Any devices
with a dev_port >0 will (in default distro configurations) have a suffix of
"d<port-number>" appended.
This is not something done by other drivers, and causes confusion for users.
Fixes: 8be41320f346 ("sfc: Add code to export port_num in netdev->dev_port")
Signed-off-by: Edward Cree <ecree@solarflare.com>
---
drivers/net/ethernet/sfc/ef10.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/net/ethernet/sfc/ef10.c b/drivers/net/ethernet/sfc/ef10.c
index 4f3c965..208e004 100644
--- a/drivers/net/ethernet/sfc/ef10.c
+++ b/drivers/net/ethernet/sfc/ef10.c
@@ -547,7 +547,6 @@ static DEVICE_ATTR(primary_flag, 0444, efx_ef10_show_primary_flag, NULL);
static int efx_ef10_probe(struct efx_nic *efx)
{
struct efx_ef10_nic_data *nic_data;
- struct net_device *net_dev = efx->net_dev;
int i, rc;
/* We can have one VI for each 8K region. However, until we
@@ -637,7 +636,6 @@ static int efx_ef10_probe(struct efx_nic *efx)
if (rc < 0)
goto fail5;
efx->port_num = rc;
- net_dev->dev_port = rc;
rc = efx->type->get_mac_address(efx, efx->net_dev->perm_addr);
if (rc)
^ permalink raw reply related
* Re: pull-request: wireless-drivers 2017-01-10
From: David Miller @ 2017-01-10 16:28 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless, netdev, linux-kernel
In-Reply-To: <87a8aztp33.fsf@kamboji.qca.qualcomm.com>
From: Kalle Valo <kvalo@codeaurora.org>
Date: Tue, 10 Jan 2017 08:18:40 +0200
> here's the pull request with the important rtlwifi fix, more info in the
> tag below.
>
> During the long weekend we had here I finally updated Ubuntu on my
> workstation and git was updated along that. If you see anything funny or
> problems in my pull request due to the upgrade, please let me know. The
> upgrade might have broken something, at least git-request-pull needs to
> be now called differently.
Looks good, pulled, thanks.
^ permalink raw reply
* Re: [PATCH net] net: socket: Make unnecessarily global sockfs_setattr() static
From: David Miller @ 2017-01-10 16:30 UTC (permalink / raw)
To: tklauser; +Cc: netdev, lorenzo
In-Reply-To: <20170110083051.753-1-tklauser@distanz.ch>
From: Tobias Klauser <tklauser@distanz.ch>
Date: Tue, 10 Jan 2017 09:30:51 +0100
> Make sockfs_setattr() static as it is not used outside of net/socket.c
>
> This fixes the following GCC warning:
> net/socket.c:534:5: warning: no previous prototype for ‘sockfs_setattr’ [-Wmissing-prototypes]
>
> Fixes: 86741ec25462 ("net: core: Add a UID field to struct sock.")
> Cc: Lorenzo Colitti <lorenzo@google.com>
> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Applied, thanks.
^ permalink raw reply
* [PATCH iproute2 2/3] ip: add ip sr command to control SR-IPv6 internal structures
From: David Lebrun @ 2017-01-10 16:41 UTC (permalink / raw)
To: netdev; +Cc: David Lebrun
In-Reply-To: <1484066486-22152-1-git-send-email-david.lebrun@uclouvain.be>
This patch add commands to support the tunnel source properties
("ip sr tunsrc") and the HMAC key -> secret, algorithm binding
("ip sr hmac").
Signed-off-by: David Lebrun <david.lebrun@uclouvain.be>
---
ip/Makefile | 2 +-
ip/ip.c | 3 +-
ip/ip_common.h | 1 +
ip/ipseg6.c | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 242 insertions(+), 2 deletions(-)
create mode 100644 ip/ipseg6.c
diff --git a/ip/Makefile b/ip/Makefile
index 1928489..678a795 100644
--- a/ip/Makefile
+++ b/ip/Makefile
@@ -8,7 +8,7 @@ IPOBJ=ip.o ipaddress.o ipaddrlabel.o iproute.o iprule.o ipnetns.o \
link_iptnl.o link_gre6.o iplink_bond.o iplink_bond_slave.o iplink_hsr.o \
iplink_bridge.o iplink_bridge_slave.o ipfou.o iplink_ipvlan.o \
iplink_geneve.o iplink_vrf.o iproute_lwtunnel.o ipmacsec.o ipila.o \
- ipvrf.o
+ ipvrf.o ipseg6.o
RTMONOBJ=rtmon.o
diff --git a/ip/ip.c b/ip/ip.c
index 07050b0..7c14a8e 100644
--- a/ip/ip.c
+++ b/ip/ip.c
@@ -52,7 +52,7 @@ static void usage(void)
"where OBJECT := { link | address | addrlabel | route | rule | neigh | ntable |\n"
" tunnel | tuntap | maddress | mroute | mrule | monitor | xfrm |\n"
" netns | l2tp | fou | macsec | tcp_metrics | token | netconf | ila |\n"
-" vrf }\n"
+" vrf | sr }\n"
" OPTIONS := { -V[ersion] | -s[tatistics] | -d[etails] | -r[esolve] |\n"
" -h[uman-readable] | -iec |\n"
" -f[amily] { inet | inet6 | ipx | dnet | mpls | bridge | link } |\n"
@@ -101,6 +101,7 @@ static const struct cmd {
{ "netns", do_netns },
{ "netconf", do_ipnetconf },
{ "vrf", do_ipvrf},
+ { "sr", do_seg6 },
{ "help", do_help },
{ 0 }
};
diff --git a/ip/ip_common.h b/ip/ip_common.h
index ab6a834..13108c6 100644
--- a/ip/ip_common.h
+++ b/ip/ip_common.h
@@ -59,6 +59,7 @@ int do_ipnetconf(int argc, char **argv);
int do_iptoken(int argc, char **argv);
int do_ipvrf(int argc, char **argv);
void vrf_reset(void);
+int do_seg6(int argc, char **argv);
int iplink_get(unsigned int flags, char *name, __u32 filt_mask);
diff --git a/ip/ipseg6.c b/ip/ipseg6.c
new file mode 100644
index 0000000..0d4130e
--- /dev/null
+++ b/ip/ipseg6.c
@@ -0,0 +1,238 @@
+/*
+ * seg6.c "ip sr/seg6"
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation;
+ *
+ * Author: David Lebrun <david.lebrun@uclouvain.be>
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <arpa/inet.h>
+#include <sys/ioctl.h>
+#include <linux/if.h>
+
+#include <linux/genetlink.h>
+#include <linux/seg6_genl.h>
+#include <linux/seg6_hmac.h>
+
+#include "utils.h"
+#include "ip_common.h"
+#include "libgenl.h"
+
+#define HMAC_KEY_PROMPT "Enter secret for HMAC key ID (blank to delete): "
+
+static void usage(void)
+{
+ fprintf(stderr, "Usage: ip sr { COMMAND | help }\n");
+ fprintf(stderr, " ip sr hmac show\n");
+ fprintf(stderr, " ip sr hmac set KEYID ALGO\n");
+ fprintf(stderr, " ip sr tunsrc show\n");
+ fprintf(stderr, " ip sr tunsrc set ADDRESS\n");
+ fprintf(stderr, "where ALGO := { sha1 | sha256 }\n");
+ exit(-1);
+}
+
+static struct rtnl_handle grth = { .fd = -1 };
+static int genl_family = -1;
+
+#define SEG6_REQUEST(_req, _bufsiz, _cmd, _flags) \
+ GENL_REQUEST(_req, _bufsiz, genl_family, 0, \
+ SEG6_GENL_VERSION, _cmd, _flags)
+
+static struct {
+ int cmd;
+ struct in6_addr addr;
+ __u32 keyid;
+ char *pass;
+ __u8 alg_id;
+} opts;
+
+static int process_msg(const struct sockaddr_nl *who, struct nlmsghdr *n,
+ void *arg)
+{
+ struct rtattr *attrs[SEG6_ATTR_MAX + 1];
+ struct genlmsghdr *ghdr;
+ FILE *fp = (FILE *)arg;
+ int len = n->nlmsg_len;
+
+ if (n->nlmsg_type != genl_family)
+ return -1;
+
+ len -= NLMSG_LENGTH(GENL_HDRLEN);
+ if (len < 0)
+ return -1;
+
+ ghdr = NLMSG_DATA(n);
+
+ parse_rtattr(attrs, SEG6_ATTR_MAX, (void *)ghdr + GENL_HDRLEN, len);
+
+ switch (ghdr->cmd) {
+ case SEG6_CMD_DUMPHMAC:
+ {
+ char secret[64];
+ char *algstr;
+ __u8 slen = rta_getattr_u8(attrs[SEG6_ATTR_SECRETLEN]);
+ __u8 alg_id = rta_getattr_u8(attrs[SEG6_ATTR_ALGID]);
+
+ memset(secret, 0, 64);
+
+ if (slen > 63) {
+ fprintf(stderr, "HMAC secret length %d > 63, "
+ "truncated\n", slen);
+ slen = 63;
+ }
+ memcpy(secret, RTA_DATA(attrs[SEG6_ATTR_SECRET]), slen);
+
+ switch (alg_id) {
+ case SEG6_HMAC_ALGO_SHA1:
+ algstr = "sha1";
+ break;
+ case SEG6_HMAC_ALGO_SHA256:
+ algstr = "sha256";
+ break;
+ default:
+ algstr = "<unknown>";
+ }
+
+ fprintf(fp, "hmac %u ",
+ rta_getattr_u32(attrs[SEG6_ATTR_HMACKEYID]));
+ fprintf(fp, "algo %s ", algstr);
+ fprintf(fp, "secret \"%s\" ", secret);
+
+ fprintf(fp, "\n");
+ break;
+ }
+ case SEG6_CMD_GET_TUNSRC:
+ {
+ fprintf(fp, "tunsrc addr %s\n",
+ rt_addr_n2a(AF_INET6, 16,
+ RTA_DATA(attrs[SEG6_ATTR_DST])));
+ break;
+ }
+ }
+
+ return 0;
+}
+
+static int seg6_do_cmd(void)
+{
+ SEG6_REQUEST(req, 1024, opts.cmd, NLM_F_REQUEST);
+ int repl = 0, dump = 0;
+
+ if (genl_family < 0) {
+ if (rtnl_open_byproto(&grth, 0, NETLINK_GENERIC) < 0) {
+ fprintf(stderr, "Cannot open generic netlink socket\n");
+ exit(1);
+ }
+ genl_family = genl_resolve_family(&grth, SEG6_GENL_NAME);
+ if (genl_family < 0)
+ exit(1);
+ req.n.nlmsg_type = genl_family;
+ }
+
+ switch (opts.cmd) {
+ case SEG6_CMD_SETHMAC:
+ {
+ addattr32(&req.n, sizeof(req), SEG6_ATTR_HMACKEYID, opts.keyid);
+ addattr8(&req.n, sizeof(req), SEG6_ATTR_SECRETLEN,
+ strlen(opts.pass));
+ addattr8(&req.n, sizeof(req), SEG6_ATTR_ALGID, opts.alg_id);
+ if (strlen(opts.pass))
+ addattr_l(&req.n, sizeof(req), SEG6_ATTR_SECRET,
+ opts.pass, strlen(opts.pass));
+ break;
+ }
+ case SEG6_CMD_SET_TUNSRC:
+ addattr_l(&req.n, sizeof(req), SEG6_ATTR_DST, &opts.addr,
+ sizeof(struct in6_addr));
+ break;
+ case SEG6_CMD_DUMPHMAC:
+ dump = 1;
+ break;
+ case SEG6_CMD_GET_TUNSRC:
+ repl = 1;
+ break;
+ }
+
+ if (!repl && !dump) {
+ if (rtnl_talk(&grth, &req.n, NULL, 0) < 0)
+ return -1;
+ } else if (repl) {
+ if (rtnl_talk(&grth, &req.n, &req.n, sizeof(req)) < 0)
+ return -2;
+ if (process_msg(NULL, &req.n, stdout) < 0) {
+ fprintf(stderr, "Error parsing reply\n");
+ exit(1);
+ }
+ } else {
+ req.n.nlmsg_flags |= NLM_F_DUMP;
+ req.n.nlmsg_seq = grth.dump = ++grth.seq;
+ if (rtnl_send(&grth, &req, req.n.nlmsg_len) < 0) {
+ perror("Failed to send dump request");
+ exit(1);
+ }
+
+ if (rtnl_dump_filter(&grth, process_msg, stdout) < 0) {
+ fprintf(stderr, "Dump terminated\n");
+ exit(1);
+ }
+ }
+
+ return 0;
+}
+
+int do_seg6(int argc, char **argv)
+{
+ if (argc < 1 || matches(*argv, "help") == 0)
+ usage();
+
+ memset(&opts, 0, sizeof(opts));
+
+ if (matches(*argv, "hmac") == 0) {
+ NEXT_ARG();
+ if (matches(*argv, "show") == 0) {
+ opts.cmd = SEG6_CMD_DUMPHMAC;
+ } else if (matches(*argv, "set") == 0) {
+ NEXT_ARG();
+ if (get_u32(&opts.keyid, *argv, 0) || opts.keyid == 0)
+ invarg("hmac KEYID value is invalid", *argv);
+ NEXT_ARG();
+ if (strcmp(*argv, "sha1") == 0) {
+ opts.alg_id = SEG6_HMAC_ALGO_SHA1;
+ } else if (strcmp(*argv, "sha256") == 0) {
+ opts.alg_id = SEG6_HMAC_ALGO_SHA256;
+ } else {
+ invarg("hmac ALGO value is invalid", *argv);
+ }
+ opts.cmd = SEG6_CMD_SETHMAC;
+ opts.pass = getpass(HMAC_KEY_PROMPT);
+ } else {
+ invarg("unknown", *argv);
+ }
+ } else if (matches(*argv, "tunsrc") == 0) {
+ NEXT_ARG();
+ if (matches(*argv, "show") == 0) {
+ opts.cmd = SEG6_CMD_GET_TUNSRC;
+ } else if (matches(*argv, "set") == 0) {
+ NEXT_ARG();
+ opts.cmd = SEG6_CMD_SET_TUNSRC;
+ if (!inet_get_addr(*argv, NULL, &opts.addr))
+ invarg("tunsrc ADDRESS value is invalid",
+ *argv);
+ } else {
+ invarg("unknown", *argv);
+ }
+ } else {
+ invarg("unknown", *argv);
+ }
+
+ return seg6_do_cmd();
+}
--
2.7.3
^ permalink raw reply related
* [PATCH iproute2 3/3] iproute: add support for SR-IPv6 lwtunnel encapsulation
From: David Lebrun @ 2017-01-10 16:41 UTC (permalink / raw)
To: netdev; +Cc: David Lebrun
In-Reply-To: <1484066486-22152-1-git-send-email-david.lebrun@uclouvain.be>
This patch adds support for SEG6 encapsulation type
("ip route add ... encap seg6 ...").
Signed-off-by: David Lebrun <david.lebrun@uclouvain.be>
---
ip/iproute.c | 6 +-
ip/iproute_lwtunnel.c | 160 ++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 164 insertions(+), 2 deletions(-)
diff --git a/ip/iproute.c b/ip/iproute.c
index e433de8..a102e33 100644
--- a/ip/iproute.c
+++ b/ip/iproute.c
@@ -98,8 +98,10 @@ static void usage(void)
fprintf(stderr, "TIME := NUMBER[s|ms]\n");
fprintf(stderr, "BOOL := [1|0]\n");
fprintf(stderr, "FEATURES := ecn\n");
- fprintf(stderr, "ENCAPTYPE := [ mpls | ip | ip6 ]\n");
- fprintf(stderr, "ENCAPHDR := [ MPLSLABEL ]\n");
+ fprintf(stderr, "ENCAPTYPE := [ mpls | ip | ip6 | seg6 ]\n");
+ fprintf(stderr, "ENCAPHDR := [ MPLSLABEL | SEG6HDR ]\n");
+ fprintf(stderr, "SEG6HDR := [ mode SEGMODE ] segs ADDR1,ADDRi,ADDRn [hmac HMACKEYID] [cleanup]\n");
+ fprintf(stderr, "SEGMODE := [ encap | inline ]\n");
exit(-1);
}
diff --git a/ip/iproute_lwtunnel.c b/ip/iproute_lwtunnel.c
index 1a92cec..3ee6dcc 100644
--- a/ip/iproute_lwtunnel.c
+++ b/ip/iproute_lwtunnel.c
@@ -26,6 +26,10 @@
#include "iproute_lwtunnel.h"
#include "bpf_util.h"
+#include <linux/seg6.h>
+#include <linux/seg6_iptunnel.h>
+#include <linux/seg6_hmac.h>
+
static const char *format_encap_type(int type)
{
switch (type) {
@@ -39,6 +43,8 @@ static const char *format_encap_type(int type)
return "ila";
case LWTUNNEL_ENCAP_BPF:
return "bpf";
+ case LWTUNNEL_ENCAP_SEG6:
+ return "seg6";
default:
return "unknown";
}
@@ -69,12 +75,51 @@ static int read_encap_type(const char *name)
return LWTUNNEL_ENCAP_ILA;
else if (strcmp(name, "bpf") == 0)
return LWTUNNEL_ENCAP_BPF;
+ else if (strcmp(name, "seg6") == 0)
+ return LWTUNNEL_ENCAP_SEG6;
else if (strcmp(name, "help") == 0)
encap_type_usage();
return LWTUNNEL_ENCAP_NONE;
}
+static void print_encap_seg6(FILE *fp, struct rtattr *encap)
+{
+ struct rtattr *tb[SEG6_IPTUNNEL_MAX+1];
+ struct seg6_iptunnel_encap *tuninfo;
+ struct ipv6_sr_hdr *srh;
+ int i;
+
+ parse_rtattr_nested(tb, SEG6_IPTUNNEL_MAX, encap);
+
+ if (!tb[SEG6_IPTUNNEL_SRH])
+ return;
+
+ tuninfo = RTA_DATA(tb[SEG6_IPTUNNEL_SRH]);
+ fprintf(fp, "mode %s ",
+ (tuninfo->mode == SEG6_IPTUN_MODE_ENCAP) ? "encap" : "inline");
+
+ srh = tuninfo->srh;
+
+ fprintf(fp, "segs %d [ ", srh->first_segment + 1);
+
+ for (i = srh->first_segment; i >= 0; i--)
+ fprintf(fp, "%s ",
+ rt_addr_n2a(AF_INET6, 16, &srh->segments[i]));
+
+ fprintf(fp, "] ");
+
+ if (sr_has_cleanup(srh))
+
+ if (sr_has_hmac(srh)) {
+ unsigned int offset = ((srh->hdrlen + 1) << 3) - 40;
+ struct sr6_tlv_hmac *tlv;
+
+ tlv = (struct sr6_tlv_hmac *)((char *)srh + offset);
+ fprintf(fp, "hmac 0x%X ", ntohl(tlv->hmackeyid));
+ }
+}
+
static void print_encap_mpls(FILE *fp, struct rtattr *encap)
{
struct rtattr *tb[MPLS_IPTUNNEL_MAX+1];
@@ -238,9 +283,121 @@ void lwt_print_encap(FILE *fp, struct rtattr *encap_type,
case LWTUNNEL_ENCAP_BPF:
print_encap_bpf(fp, encap);
break;
+ case LWTUNNEL_ENCAP_SEG6:
+ print_encap_seg6(fp, encap);
+ break;
}
}
+static int parse_encap_seg6(struct rtattr *rta, size_t len, int *argcp,
+ char ***argvp)
+{
+ int mode_ok = 0, segs_ok = 0, cleanup_ok = 0, hmac_ok = 0;
+ struct seg6_iptunnel_encap *tuninfo;
+ struct ipv6_sr_hdr *srh;
+ char **argv = *argvp;
+ char segbuf[1024];
+ int argc = *argcp;
+ __u8 cleanup = 0;
+ int encap = -1;
+ __u32 hmac = 0;
+ int nsegs = 0;
+ int srhlen;
+ char *s;
+ int i;
+
+ while (argc > 0) {
+ if (strcmp(*argv, "mode") == 0) {
+ NEXT_ARG();
+ if (mode_ok++)
+ duparg2("mode", *argv);
+ if (strcmp(*argv, "encap") == 0)
+ encap = 1;
+ else if (strcmp(*argv, "inline") == 0)
+ encap = 0;
+ else
+ invarg("\"mode\" value is invalid\n", *argv);
+ } else if (strcmp(*argv, "segs") == 0) {
+ NEXT_ARG();
+ if (segs_ok++)
+ duparg2("segs", *argv);
+ if (encap == -1)
+ invarg("\"segs\" provided before \"mode\"\n",
+ *argv);
+
+ strncpy(segbuf, *argv, 1024);
+ segbuf[1023] = 0;
+ } else if (strcmp(*argv, "cleanup") == 0) {
+ if (cleanup_ok++)
+ duparg2("cleanup", *argv);
+ cleanup = 1;
+ } else if (strcmp(*argv, "hmac") == 0) {
+ NEXT_ARG();
+ if (hmac_ok++)
+ duparg2("hmac", *argv);
+ get_u32(&hmac, *argv, 0);
+ } else {
+ break;
+ }
+ argc--; argv++;
+ }
+
+ s = segbuf;
+ for (i = 0; *s; *s++ == ',' ? i++ : *s);
+ nsegs = i + 1;
+
+ if (!encap)
+ nsegs++;
+
+ srhlen = 8 + 16*nsegs;
+
+ if (hmac)
+ srhlen += 40;
+
+ tuninfo = malloc(sizeof(*tuninfo) + srhlen);
+ memset(tuninfo, 0, sizeof(*tuninfo) + srhlen);
+
+ if (encap)
+ tuninfo->mode = SEG6_IPTUN_MODE_ENCAP;
+ else
+ tuninfo->mode = SEG6_IPTUN_MODE_INLINE;
+
+ srh = tuninfo->srh;
+ srh->hdrlen = (srhlen >> 3) - 1;
+ srh->type = 4;
+ srh->segments_left = nsegs - 1;
+ srh->first_segment = nsegs - 1;
+
+ if (cleanup)
+ srh->flag_1 |= SR6_FLAG1_CLEANUP;
+ if (hmac)
+ srh->flag_1 |= SR6_FLAG1_HMAC;
+
+ i = srh->first_segment;
+ for (s = strtok(segbuf, ","); s; s = strtok(NULL, ",")) {
+ inet_get_addr(s, NULL, &srh->segments[i]);
+ i--;
+ }
+
+ if (hmac) {
+ struct sr6_tlv_hmac *tlv;
+
+ tlv = (struct sr6_tlv_hmac *)((char *)srh + srhlen - 40);
+ tlv->tlvhdr.type = SR6_TLV_HMAC;
+ tlv->tlvhdr.len = 38;
+ tlv->hmackeyid = htonl(hmac);
+ }
+
+ rta_addattr_l(rta, len, SEG6_IPTUNNEL_SRH, tuninfo,
+ sizeof(*tuninfo) + srhlen);
+ free(tuninfo);
+
+ *argcp = argc + 1;
+ *argvp = argv - 1;
+
+ return 0;
+}
+
static int parse_encap_mpls(struct rtattr *rta, size_t len,
int *argcp, char ***argvp)
{
@@ -573,6 +730,9 @@ int lwt_parse_encap(struct rtattr *rta, size_t len, int *argcp, char ***argvp)
if (parse_encap_bpf(rta, len, &argc, &argv) < 0)
exit(-1);
break;
+ case LWTUNNEL_ENCAP_SEG6:
+ parse_encap_seg6(rta, len, &argc, &argv);
+ break;
default:
fprintf(stderr, "Error: unsupported encap type\n");
break;
--
2.7.3
^ permalink raw reply related
* [PATCH iproute2 0/3] add support for IPv6 Segment Routing
From: David Lebrun @ 2017-01-10 16:41 UTC (permalink / raw)
To: netdev; +Cc: David Lebrun
This patch series adds support for the IPv6 Segment Routing implementation in
the Linux kernel. The following features are supported.
* IPv6 SR lightweight tunnels encapsulation ("ip route add ... encap seg6 ...")
* Parsing of routes with a seg6 lwt encap ("ip route show")
* Control of internal SR structures: tunnel source ("ip sr tunsrc") and
HMAC ("ip sr hmac"). HMAC support enables to map an HMAC Key ID to
a pair of algorithm + secret.
Signed-off-by: David Lebrun <david.lebrun@uclouvain.be>
David Lebrun (3):
sr: add header files for SR-IPv6
ip: add ip sr command to control SR-IPv6 internal structures
iproute: add support for SR-IPv6 lwtunnel encapsulation
include/linux/seg6.h | 54 ++++++++++
include/linux/seg6_genl.h | 32 ++++++
include/linux/seg6_hmac.h | 21 ++++
include/linux/seg6_iptunnel.h | 38 +++++++
ip/Makefile | 2 +-
ip/ip.c | 3 +-
ip/ip_common.h | 1 +
ip/iproute.c | 6 +-
ip/iproute_lwtunnel.c | 160 ++++++++++++++++++++++++++++
ip/ipseg6.c | 238 ++++++++++++++++++++++++++++++++++++++++++
10 files changed, 551 insertions(+), 4 deletions(-)
create mode 100644 include/linux/seg6.h
create mode 100644 include/linux/seg6_genl.h
create mode 100644 include/linux/seg6_hmac.h
create mode 100644 include/linux/seg6_iptunnel.h
create mode 100644 ip/ipseg6.c
--
2.7.3
^ permalink raw reply
* [PATCH iproute2 1/3] sr: add header files for SR-IPv6
From: David Lebrun @ 2017-01-10 16:41 UTC (permalink / raw)
To: netdev; +Cc: David Lebrun
In-Reply-To: <1484066486-22152-1-git-send-email-david.lebrun@uclouvain.be>
This patch add the necessary header files to interface with the SR-IPv6 kernel
implementation.
Signed-off-by: David Lebrun <david.lebrun@uclouvain.be>
---
include/linux/seg6.h | 54 +++++++++++++++++++++++++++++++++++++++++++
include/linux/seg6_genl.h | 32 +++++++++++++++++++++++++
include/linux/seg6_hmac.h | 21 +++++++++++++++++
include/linux/seg6_iptunnel.h | 38 ++++++++++++++++++++++++++++++
4 files changed, 145 insertions(+)
create mode 100644 include/linux/seg6.h
create mode 100644 include/linux/seg6_genl.h
create mode 100644 include/linux/seg6_hmac.h
create mode 100644 include/linux/seg6_iptunnel.h
diff --git a/include/linux/seg6.h b/include/linux/seg6.h
new file mode 100644
index 0000000..8f651bf
--- /dev/null
+++ b/include/linux/seg6.h
@@ -0,0 +1,54 @@
+/*
+ * SR-IPv6 implementation
+ *
+ * Author:
+ * David Lebrun <david.lebrun@uclouvain.be>
+ *
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+#ifndef _SEG6_H
+#define _SEG6_H
+
+/*
+ * SRH
+ */
+struct ipv6_sr_hdr {
+ __u8 nexthdr;
+ __u8 hdrlen;
+ __u8 type;
+ __u8 segments_left;
+ __u8 first_segment;
+ __u8 flag_1;
+ __u8 flag_2;
+ __u8 reserved;
+
+ struct in6_addr segments[0];
+};
+
+#define SR6_FLAG1_CLEANUP (1 << 7)
+#define SR6_FLAG1_PROTECTED (1 << 6)
+#define SR6_FLAG1_OAM (1 << 5)
+#define SR6_FLAG1_ALERT (1 << 4)
+#define SR6_FLAG1_HMAC (1 << 3)
+
+#define SR6_TLV_INGRESS 1
+#define SR6_TLV_EGRESS 2
+#define SR6_TLV_OPAQUE 3
+#define SR6_TLV_PADDING 4
+#define SR6_TLV_HMAC 5
+
+#define sr_has_cleanup(srh) ((srh)->flag_1 & SR6_FLAG1_CLEANUP)
+#define sr_has_hmac(srh) ((srh)->flag_1 & SR6_FLAG1_HMAC)
+
+struct sr6_tlv {
+ __u8 type;
+ __u8 len;
+ __u8 data[0];
+};
+
+#endif
diff --git a/include/linux/seg6_genl.h b/include/linux/seg6_genl.h
new file mode 100644
index 0000000..36fcbc8
--- /dev/null
+++ b/include/linux/seg6_genl.h
@@ -0,0 +1,32 @@
+#ifndef _SEG6_GENL_H
+#define _SEG6_GENL_H
+
+#define SEG6_GENL_NAME "SEG6"
+#define SEG6_GENL_VERSION 0x1
+
+enum {
+ SEG6_ATTR_UNSPEC,
+ SEG6_ATTR_DST,
+ SEG6_ATTR_DSTLEN,
+ SEG6_ATTR_HMACKEYID,
+ SEG6_ATTR_SECRET,
+ SEG6_ATTR_SECRETLEN,
+ SEG6_ATTR_ALGID,
+ SEG6_ATTR_HMACINFO,
+ __SEG6_ATTR_MAX,
+};
+
+#define SEG6_ATTR_MAX (__SEG6_ATTR_MAX - 1)
+
+enum {
+ SEG6_CMD_UNSPEC,
+ SEG6_CMD_SETHMAC,
+ SEG6_CMD_DUMPHMAC,
+ SEG6_CMD_SET_TUNSRC,
+ SEG6_CMD_GET_TUNSRC,
+ __SEG6_CMD_MAX,
+};
+
+#define SEG6_CMD_MAX (__SEG6_CMD_MAX - 1)
+
+#endif
diff --git a/include/linux/seg6_hmac.h b/include/linux/seg6_hmac.h
new file mode 100644
index 0000000..71803d2
--- /dev/null
+++ b/include/linux/seg6_hmac.h
@@ -0,0 +1,21 @@
+#ifndef _SEG6_HMAC_H
+#define _SEG6_HMAC_H
+
+#include <linux/seg6.h>
+
+#define SEG6_HMAC_SECRET_LEN 64
+#define SEG6_HMAC_FIELD_LEN 32
+
+struct sr6_tlv_hmac {
+ struct sr6_tlv tlvhdr;
+ __u16 reserved;
+ __be32 hmackeyid;
+ __u8 hmac[SEG6_HMAC_FIELD_LEN];
+};
+
+enum {
+ SEG6_HMAC_ALGO_SHA1 = 1,
+ SEG6_HMAC_ALGO_SHA256 = 2,
+};
+
+#endif
diff --git a/include/linux/seg6_iptunnel.h b/include/linux/seg6_iptunnel.h
new file mode 100644
index 0000000..0d72a58
--- /dev/null
+++ b/include/linux/seg6_iptunnel.h
@@ -0,0 +1,38 @@
+/*
+ * SR-IPv6 implementation
+ *
+ * Author:
+ * David Lebrun <david.lebrun@uclouvain.be>
+ *
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+#ifndef _SEG6_IPTUNNEL_H
+#define _SEG6_IPTUNNEL_H
+
+#include <linux/seg6.h>
+
+enum {
+ SEG6_IPTUNNEL_UNSPEC,
+ SEG6_IPTUNNEL_SRH,
+ __SEG6_IPTUNNEL_MAX,
+};
+#define SEG6_IPTUNNEL_MAX (__SEG6_IPTUNNEL_MAX - 1)
+
+struct seg6_iptunnel_encap {
+ int mode;
+ struct ipv6_sr_hdr srh[0];
+};
+
+#define SEG6_IPTUN_ENCAP_SIZE(x) ((sizeof(*x)) + (((x)->srh->hdrlen + 1) << 3))
+
+enum {
+ SEG6_IPTUN_MODE_INLINE,
+ SEG6_IPTUN_MODE_ENCAP,
+};
+
+#endif
--
2.7.3
^ permalink raw reply related
* Re: [Open-FCoE] [PATCH RFC net-next 1/5] qed: Add support for hardware offloaded FCoE.
From: Arun Easi @ 2017-01-10 16:49 UTC (permalink / raw)
To: Hannes Reinecke
Cc: Dupuis, Chad, Martin K. Petersen, fcoe-devel, netdev,
QLogic-Storage-Upstream, linux-scsi, Yuval Mintz
In-Reply-To: <371bc2ac-c630-0e95-29aa-3fa16fe0c764@suse.de>
Hi Hannes,
Thank you for the review. Please see my comment inline..
On Wed, 28 Dec 2016, 12:41am, Hannes Reinecke wrote:
> On 12/23/2016 08:17 PM, Dupuis, Chad wrote:
> > From: Arun Easi <arun.easi@qlogic.com>
> >
> > This adds the backbone required for the various HW initalizations
> > which are necessary for the FCoE driver (qedf) for QLogic FastLinQ
> > 4xxxx line of adapters - FW notification, resource initializations, etc.
> >
> > Signed-off-by: Arun Easi <arun.easi@cavium.com>
> > Signed-off-by: Yuval Mintz <yuval.mintz@cavium.com>
> > ---
--8<-- snipped --
> > diff --git a/include/linux/qed/qed_fcoe_if.h b/include/linux/qed/qed_fcoe_if.h
> > new file mode 100644
> > index 0000000..bd6bcb8
> > --- /dev/null
> > +++ b/include/linux/qed/qed_fcoe_if.h
> > @@ -0,0 +1,145 @@
> > +#ifndef _QED_FCOE_IF_H
> > +#define _QED_FCOE_IF_H
> > +#include <linux/types.h>
> > +#include <linux/qed/qed_if.h>
> > +struct qed_fcoe_stats {
> > + u64 fcoe_rx_byte_cnt;
> > + u64 fcoe_rx_data_pkt_cnt;
> > + u64 fcoe_rx_xfer_pkt_cnt;
> > + u64 fcoe_rx_other_pkt_cnt;
> > + u32 fcoe_silent_drop_pkt_cmdq_full_cnt;
> > + u32 fcoe_silent_drop_pkt_rq_full_cnt;
> > + u32 fcoe_silent_drop_pkt_crc_error_cnt;
> > + u32 fcoe_silent_drop_pkt_task_invalid_cnt;
> > + u32 fcoe_silent_drop_total_pkt_cnt;
> > +
> > + u64 fcoe_tx_byte_cnt;
> > + u64 fcoe_tx_data_pkt_cnt;
> > + u64 fcoe_tx_xfer_pkt_cnt;
> > + u64 fcoe_tx_other_pkt_cnt;
> > +};
> > +
> > +struct qed_dev_fcoe_info {
> > + struct qed_dev_info common;
> > +
> > + void __iomem *primary_dbq_rq_addr;
> > + void __iomem *secondary_bdq_rq_addr;
> > +};
> > +
> > +struct qed_fcoe_params_offload {
> > + dma_addr_t sq_pbl_addr;
> > + dma_addr_t sq_curr_page_addr;
> > + dma_addr_t sq_next_page_addr;
> > +
> > + u8 src_mac[ETH_ALEN];
> > + u8 dst_mac[ETH_ALEN];
> > +
> > + u16 tx_max_fc_pay_len;
> > + u16 e_d_tov_timer_val;
> > + u16 rec_tov_timer_val;
> > + u16 rx_max_fc_pay_len;
> > + u16 vlan_tag;
> > +
> > + struct fc_addr_nw s_id;
> > + u8 max_conc_seqs_c3;
> > + struct fc_addr_nw d_id;
> > + u8 flags;
> > + u8 def_q_idx;
> > +};
> > +
> > +#define MAX_TID_BLOCKS_FCOE (512)
> > +struct qed_fcoe_tid {
> > + u32 size; /* In bytes per task */
> > + u32 num_tids_per_block;
> > + u8 *blocks[MAX_TID_BLOCKS_FCOE];
> > +};
> > +
> > +struct qed_fcoe_cb_ops {
> > + struct qed_common_cb_ops common;
> > + u32 (*get_login_failures)(void *cookie);
> > +};
> > +
> > +void qed_fcoe_set_pf_params(struct qed_dev *cdev,
> > + struct qed_fcoe_pf_params *params);
> > +
> > +/**
> > + * struct qed_fcoe_ops - qed FCoE operations.
> > + * @common: common operations pointer
> > + * @fill_dev_info: fills FCoE specific information
> > + * @param cdev
> > + * @param info
> > + * @return 0 on sucesss, otherwise error value.
> > + * @register_ops: register FCoE operations
> > + * @param cdev
> > + * @param ops - specified using qed_iscsi_cb_ops
> > + * @param cookie - driver private
> > + * @ll2: light L2 operations pointer
> > + * @start: fcoe in FW
> > + * @param cdev
> > + * @param tasks - qed will fill information about tasks
> > + * return 0 on success, otherwise error value.
> > + * @stop: stops fcoe in FW
> > + * @param cdev
> > + * return 0 on success, otherwise error value.
> > + * @acquire_conn: acquire a new fcoe connection
> > + * @param cdev
> > + * @param handle - qed will fill handle that should be
> > + * used henceforth as identifier of the
> > + * connection.
> > + * @param p_doorbell - qed will fill the address of the
> > + * doorbell.
> > + * return 0 on sucesss, otherwise error value.
> > + * @release_conn: release a previously acquired fcoe connection
> > + * @param cdev
> > + * @param handle - the connection handle.
> > + * return 0 on success, otherwise error value.
> > + * @offload_conn: configures an offloaded connection
> > + * @param cdev
> > + * @param handle - the connection handle.
> > + * @param conn_info - the configuration to use for the
> > + * offload.
> > + * return 0 on success, otherwise error value.
> > + * @destroy_conn: stops an offloaded connection
> > + * @param cdev
> > + * @param handle - the connection handle.
> > + * @param terminate_params
> > + * return 0 on success, otherwise error value.
> > + * @get_stats: gets FCoE related statistics
> > + * @param cdev
> > + * @param stats - pointer to struck that would be filled
> > + * we stats
> > + * return 0 on success, error otherwise.
> > + */
> > +struct qed_fcoe_ops {
> > + const struct qed_common_ops *common;
> > +
> > + int (*fill_dev_info)(struct qed_dev *cdev,
> > + struct qed_dev_fcoe_info *info);
> > +
> > + void (*register_ops)(struct qed_dev *cdev,
> > + struct qed_fcoe_cb_ops *ops, void *cookie);
> > +
> > + const struct qed_ll2_ops *ll2;
> > +
> > + int (*start)(struct qed_dev *cdev, struct qed_fcoe_tid *tasks);
> > +
> > + int (*stop)(struct qed_dev *cdev);
> > +
> > + int (*acquire_conn)(struct qed_dev *cdev,
> > + u32 *handle,
> > + u32 *fw_cid, void __iomem **p_doorbell);
> > +
> > + int (*release_conn)(struct qed_dev *cdev, u32 handle);
> > +
> > + int (*offload_conn)(struct qed_dev *cdev,
> > + u32 handle,
> > + struct qed_fcoe_params_offload *conn_info);
> > + int (*destroy_conn)(struct qed_dev *cdev,
> > + u32 handle, dma_addr_t terminate_params);
> > +
> > + int (*get_stats)(struct qed_dev *cdev, struct qed_fcoe_stats *stats);
> > +};
> > +
> I prefer to have to comments directly above the function prototypes;
> that is easier to read and requires editing in one place only; this way
> there's a higher likelyhood of both getting out of sync.
>
> But that may be personal preference only.
>
I too prefer the same, but when I posted the iSCSI qed part sometime ago,
which had comment style like you said, I got a comment to follow
kernel-doc style. So, for the FCoE series, I moved to kernel-doc style
from the get go.
Regards,
-Arun
> > +const struct qed_fcoe_ops *qed_get_fcoe_ops(void);
> > +void qed_put_fcoe_ops(void);
> > +#endif
--8<-- snipped --
^ permalink raw reply
* Re: [PATCH net 0/2] r8152: fix autosuspend issue
From: David Miller @ 2017-01-10 16:50 UTC (permalink / raw)
To: hayeswang; +Cc: netdev, nic_swsd, linux-kernel, linux-usb
In-Reply-To: <1394712342-15778-229-Taiwan-albertk@realtek.com>
From: Hayes Wang <hayeswang@realtek.com>
Date: Tue, 10 Jan 2017 17:04:05 +0800
> Avoid rx is split into two parts when runtime suspend occurs.
Series applied and queued up for -stable.
^ permalink raw reply
* Re: [PATCH] net: netcp: correct netcp_get_stats function signature
From: David Miller @ 2017-01-10 16:52 UTC (permalink / raw)
To: j-keerthy
Cc: w-kwok2, m-karicheri2, netdev, linux-kernel, stephen, m-scherban
In-Reply-To: <1484047585-16733-1-git-send-email-j-keerthy@ti.com>
From: Keerthy <j-keerthy@ti.com>
Date: Tue, 10 Jan 2017 16:56:25 +0530
> @@ -1909,7 +1909,7 @@ static int netcp_setup_tc(struct net_device *dev, u32 handle, __be16 proto,
> return 0;
> }
>
> -static struct rtnl_link_stats64 *
> +void
> netcp_get_stats(struct net_device *ndev, struct rtnl_link_stats64 *stats)
Please do not remove the static qualifier.
^ permalink raw reply
* Re: [PATCH 1/2] synopsys: remove dwc_eth_qos driver
From: David Miller @ 2017-01-10 16:58 UTC (permalink / raw)
To: lars.persson; +Cc: Joao.Pinto, niklass, peppe.cavallaro, netdev
In-Reply-To: <C4CB449E-0540-4521-8A73-9B9EEC2DB7BF@axis.com>
From: Lars Persson <lars.persson@axis.com>
Date: Tue, 10 Jan 2017 12:12:42 +0000
> In the MAINTAINERS file remove the entry for SYNOPSYS DESIGNWARE ETHERNET QOS 4.10a driver.
>
> Please also replace this Kconfig reference with CONFIG_DWMAC_DWC_QOS_ETH:
> arch/arm/configs/multi_v7_defconfig:CONFIG_SYNOPSYS_DWC_ETH_QOS=y
>
> It might need a separate patch through the ARM maintainers’ tree.
Please do not quote a huge patch just to make a small comment like this.
Only quote a small, contextually relevant, part of the email you are
replying to.
Thanks.
^ permalink raw reply
* (unknown)
From: kevin.smith @ 2017-01-10 16:54 UTC (permalink / raw)
To: netdev
unsubscribe
^ permalink raw reply
* Re: using rcu_read_lock() after calling dst_neigh_lookup
From: David Miller @ 2017-01-10 17:02 UTC (permalink / raw)
To: hadarh; +Cc: netdev, ogerlitz, idosch
In-Reply-To: <ead29087-05cc-c586-3b7e-d37c2e6f753c@mellanox.com>
From: Hadar Hen Zion <hadarh@mellanox.com>
Date: Tue, 10 Jan 2017 16:22:51 +0200
> While the documentation in neighbour.c says:
>
> "Neighbour entries are protected:
> - with reference count.
> - with rwlock neigh->lock
> Reference count prevents destruction.
> neigh->lock mainly serializes ll address data and its validity state."
>
> So what is the right way to protect the neigh entry parameters? I
> couldn't find why rcu_read_lock() is helping here (dst_neigh_lookup
> already takes a reference on the neigh).
Documentation is, unfortunately, out of date.
When there is a mis-match, usually the behavior of the code in the
tree trumps whatever the documentation says.
^ permalink raw reply
* Re: [PATCH net-next] bridge: multicast to unicast
From: Dave Taht @ 2017-01-10 17:17 UTC (permalink / raw)
To: Johannes Berg
Cc: Linus Lüssing, Stephen Hemminger, M. Braun, Felix Fietkau,
netdev@vger.kernel.org, David S . Miller, bridge,
linux-kernel@vger.kernel.org, linux-wireless
In-Reply-To: <1484045763.1014.0.camel@sipsolutions.net>
In the case of wifi I have 3 issues with this line of thought.
multicast in wifi has generally supposed to be unreliable. This makes
it reliable. reliability comes at a cost -
multicast is typically set at a fixed low rate today. unicast is
retried at different rates until it succeeds - for every station
listening. If one station is already at the lowest rate, the total
cost of the transmit increases, rather than decreases.
unicast gets block acks until it succeeds. Again, more delay.
I think there is something like 31 soft-retries in the ath9k driver....
what happens to diffserv markings here? for unicast CS1 goes into the
BE queue, CS6, the VO queue. Do we go from one flat queue for all of
multicast to punching it through one of the hardware queues based on
the diffserv mark now with this patch?
I would like it if there was a way to preserve the unreliability
(which multiple mesh protocols depend on), send stuff with QoSNoack,
etc - or dynamically choose (based on the rates of the stations)
between conventional multicast and unicast.
Or - better, IMHO, keep sending multicast as is but pick the best of
the rates available to all the listening stations for it.
Has anyone actually looked at the effects of this with, say, 5-10
stations at middlin to poor quality (longer distance)? using something
to measure the real effect of the multicast conversion? (uftp, mdns?)
^ permalink raw reply
* Re: [PATCH net-next] bridge: multicast to unicast
From: Felix Fietkau @ 2017-01-10 17:23 UTC (permalink / raw)
To: Dave Taht, Johannes Berg
Cc: netdev@vger.kernel.org, bridge, linux-wireless,
linux-kernel@vger.kernel.org, M. Braun, David S . Miller
In-Reply-To: <CAA93jw6+P8um7TxDCYgJ=SJfFzpskboR7njgudMb3NR4JZ34BA@mail.gmail.com>
On 2017-01-10 18:17, Dave Taht wrote:
> In the case of wifi I have 3 issues with this line of thought.
>
> multicast in wifi has generally supposed to be unreliable. This makes
> it reliable. reliability comes at a cost -
>
> multicast is typically set at a fixed low rate today. unicast is
> retried at different rates until it succeeds - for every station
> listening. If one station is already at the lowest rate, the total
> cost of the transmit increases, rather than decreases.
>
> unicast gets block acks until it succeeds. Again, more delay.
>
> I think there is something like 31 soft-retries in the ath9k driver....
If I remember correctly, hardware retries are counted here as well.
> what happens to diffserv markings here? for unicast CS1 goes into the
> BE queue, CS6, the VO queue. Do we go from one flat queue for all of
> multicast to punching it through one of the hardware queues based on
> the diffserv mark now with this patch?
>
> I would like it if there was a way to preserve the unreliability
> (which multiple mesh protocols depend on), send stuff with QoSNoack,
> etc - or dynamically choose (based on the rates of the stations)
> between conventional multicast and unicast.
>
> Or - better, IMHO, keep sending multicast as is but pick the best of
> the rates available to all the listening stations for it.
The advantage of the multicast-to-unicast conversion goes beyond simply
selecting a better rate - aggregation matters a lot as well, and that is
simply incompatible with normal multicast.
Some multicast streams use lots of small-ish packets, the airtime impact
of those is vastly reduced, even if the transmission has to be
duplicated for a few stations.
- Felix
^ permalink raw reply
* Re: [PATCH iproute2 1/3] sr: add header files for SR-IPv6
From: Tom Herbert @ 2017-01-10 17:25 UTC (permalink / raw)
To: David Lebrun; +Cc: Linux Kernel Network Developers
In-Reply-To: <1484066486-22152-2-git-send-email-david.lebrun@uclouvain.be>
Acked-by: Tom Herbert <tom@herbertland.com>
On Tue, Jan 10, 2017 at 8:41 AM, David Lebrun <david.lebrun@uclouvain.be> wrote:
> This patch add the necessary header files to interface with the SR-IPv6 kernel
> implementation.
>
> Signed-off-by: David Lebrun <david.lebrun@uclouvain.be>
> ---
> include/linux/seg6.h | 54 +++++++++++++++++++++++++++++++++++++++++++
> include/linux/seg6_genl.h | 32 +++++++++++++++++++++++++
> include/linux/seg6_hmac.h | 21 +++++++++++++++++
> include/linux/seg6_iptunnel.h | 38 ++++++++++++++++++++++++++++++
> 4 files changed, 145 insertions(+)
> create mode 100644 include/linux/seg6.h
> create mode 100644 include/linux/seg6_genl.h
> create mode 100644 include/linux/seg6_hmac.h
> create mode 100644 include/linux/seg6_iptunnel.h
>
> diff --git a/include/linux/seg6.h b/include/linux/seg6.h
> new file mode 100644
> index 0000000..8f651bf
> --- /dev/null
> +++ b/include/linux/seg6.h
> @@ -0,0 +1,54 @@
> +/*
> + * SR-IPv6 implementation
> + *
> + * Author:
> + * David Lebrun <david.lebrun@uclouvain.be>
> + *
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License
> + * as published by the Free Software Foundation; either version
> + * 2 of the License, or (at your option) any later version.
> + */
> +
> +#ifndef _SEG6_H
> +#define _SEG6_H
> +
> +/*
> + * SRH
> + */
> +struct ipv6_sr_hdr {
> + __u8 nexthdr;
> + __u8 hdrlen;
> + __u8 type;
> + __u8 segments_left;
> + __u8 first_segment;
> + __u8 flag_1;
> + __u8 flag_2;
> + __u8 reserved;
> +
> + struct in6_addr segments[0];
> +};
> +
> +#define SR6_FLAG1_CLEANUP (1 << 7)
> +#define SR6_FLAG1_PROTECTED (1 << 6)
> +#define SR6_FLAG1_OAM (1 << 5)
> +#define SR6_FLAG1_ALERT (1 << 4)
> +#define SR6_FLAG1_HMAC (1 << 3)
> +
> +#define SR6_TLV_INGRESS 1
> +#define SR6_TLV_EGRESS 2
> +#define SR6_TLV_OPAQUE 3
> +#define SR6_TLV_PADDING 4
> +#define SR6_TLV_HMAC 5
> +
> +#define sr_has_cleanup(srh) ((srh)->flag_1 & SR6_FLAG1_CLEANUP)
> +#define sr_has_hmac(srh) ((srh)->flag_1 & SR6_FLAG1_HMAC)
> +
> +struct sr6_tlv {
> + __u8 type;
> + __u8 len;
> + __u8 data[0];
> +};
> +
> +#endif
> diff --git a/include/linux/seg6_genl.h b/include/linux/seg6_genl.h
> new file mode 100644
> index 0000000..36fcbc8
> --- /dev/null
> +++ b/include/linux/seg6_genl.h
> @@ -0,0 +1,32 @@
> +#ifndef _SEG6_GENL_H
> +#define _SEG6_GENL_H
> +
> +#define SEG6_GENL_NAME "SEG6"
> +#define SEG6_GENL_VERSION 0x1
> +
> +enum {
> + SEG6_ATTR_UNSPEC,
> + SEG6_ATTR_DST,
> + SEG6_ATTR_DSTLEN,
> + SEG6_ATTR_HMACKEYID,
> + SEG6_ATTR_SECRET,
> + SEG6_ATTR_SECRETLEN,
> + SEG6_ATTR_ALGID,
> + SEG6_ATTR_HMACINFO,
> + __SEG6_ATTR_MAX,
> +};
> +
> +#define SEG6_ATTR_MAX (__SEG6_ATTR_MAX - 1)
> +
> +enum {
> + SEG6_CMD_UNSPEC,
> + SEG6_CMD_SETHMAC,
> + SEG6_CMD_DUMPHMAC,
> + SEG6_CMD_SET_TUNSRC,
> + SEG6_CMD_GET_TUNSRC,
> + __SEG6_CMD_MAX,
> +};
> +
> +#define SEG6_CMD_MAX (__SEG6_CMD_MAX - 1)
> +
> +#endif
> diff --git a/include/linux/seg6_hmac.h b/include/linux/seg6_hmac.h
> new file mode 100644
> index 0000000..71803d2
> --- /dev/null
> +++ b/include/linux/seg6_hmac.h
> @@ -0,0 +1,21 @@
> +#ifndef _SEG6_HMAC_H
> +#define _SEG6_HMAC_H
> +
> +#include <linux/seg6.h>
> +
> +#define SEG6_HMAC_SECRET_LEN 64
> +#define SEG6_HMAC_FIELD_LEN 32
> +
> +struct sr6_tlv_hmac {
> + struct sr6_tlv tlvhdr;
> + __u16 reserved;
> + __be32 hmackeyid;
> + __u8 hmac[SEG6_HMAC_FIELD_LEN];
> +};
> +
> +enum {
> + SEG6_HMAC_ALGO_SHA1 = 1,
> + SEG6_HMAC_ALGO_SHA256 = 2,
> +};
> +
> +#endif
> diff --git a/include/linux/seg6_iptunnel.h b/include/linux/seg6_iptunnel.h
> new file mode 100644
> index 0000000..0d72a58
> --- /dev/null
> +++ b/include/linux/seg6_iptunnel.h
> @@ -0,0 +1,38 @@
> +/*
> + * SR-IPv6 implementation
> + *
> + * Author:
> + * David Lebrun <david.lebrun@uclouvain.be>
> + *
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License
> + * as published by the Free Software Foundation; either version
> + * 2 of the License, or (at your option) any later version.
> + */
> +
> +#ifndef _SEG6_IPTUNNEL_H
> +#define _SEG6_IPTUNNEL_H
> +
> +#include <linux/seg6.h>
> +
> +enum {
> + SEG6_IPTUNNEL_UNSPEC,
> + SEG6_IPTUNNEL_SRH,
> + __SEG6_IPTUNNEL_MAX,
> +};
> +#define SEG6_IPTUNNEL_MAX (__SEG6_IPTUNNEL_MAX - 1)
> +
> +struct seg6_iptunnel_encap {
> + int mode;
> + struct ipv6_sr_hdr srh[0];
> +};
> +
> +#define SEG6_IPTUN_ENCAP_SIZE(x) ((sizeof(*x)) + (((x)->srh->hdrlen + 1) << 3))
> +
> +enum {
> + SEG6_IPTUN_MODE_INLINE,
> + SEG6_IPTUN_MODE_ENCAP,
> +};
> +
> +#endif
> --
> 2.7.3
>
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox