Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net

Pull networking fixes from David Miller:

 1) Various TCP control block fixes, including one that crashes with
    SELinux, from David Ahern and Eric Dumazet.

 2) Fix ACK generation in rxrpc, from David Howells.

 3) ipvlan doesn't set the mark properly in the ipv4 route lookup key,
    from Gao Feng.

 4) SIT configuration doesn't take on the frag_off ipv4 field
    configuration properly, fix from Hangbin Liu.

 5) TSO can fail after device down/up on stmmac, fix from Lars Persson.

 6) Various bpftool fixes (mostly in JSON handling) from Quentin Monnet.

 7) Various SKB leak fixes in vhost/tun/tap (mostly observed as
    performance problems). From Wei Xu.

 8) mvpps's TX descriptors were not zero initialized, from Yan Markman.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (57 commits)
  tcp: use IPCB instead of TCP_SKB_CB in inet_exact_dif_match()
  tcp: add tcp_v4_fill_cb()/tcp_v4_restore_cb()
  rxrpc: Fix the MAINTAINERS record
  rxrpc: Use correct netns source in rxrpc_release_sock()
  liquidio: fix incorrect indentation of assignment statement
  stmmac: reset last TSO segment size after device open
  ipvlan: Add the skb->mark as flow4's member to lookup route
  s390/qeth: build max size GSO skbs on L2 devices
  s390/qeth: fix GSO throughput regression
  s390/qeth: fix thinko in IPv4 multicast address tracking
  tap: free skb if flags error
  tun: free skb in early errors
  vhost: fix skb leak in handle_rx()
  bnxt_en: Fix a variable scoping in bnxt_hwrm_do_send_msg()
  bnxt_en: fix dst/src fid for vxlan encap/decap actions
  bnxt_en: wildcard smac while creating tunnel decap filter
  bnxt_en: Need to unconditionally shut down RoCE in bnxt_shutdown
  phylink: ensure we take the link down when phylink_stop() is called
  sfp: warn about modules requiring address change sequence
  sfp: improve RX_LOS handling
  ...
This commit is contained in:
Linus Torvalds
2017-12-04 11:14:46 -08:00
54 changed files with 398 additions and 188 deletions
+15 -3
View File
@@ -554,13 +554,13 @@ S: Orphan
F: Documentation/filesystems/affs.txt F: Documentation/filesystems/affs.txt
F: fs/affs/ F: fs/affs/
AFS FILESYSTEM & AF_RXRPC SOCKET DOMAIN AFS FILESYSTEM
M: David Howells <dhowells@redhat.com> M: David Howells <dhowells@redhat.com>
L: linux-afs@lists.infradead.org L: linux-afs@lists.infradead.org
S: Supported S: Supported
F: fs/afs/ F: fs/afs/
F: include/net/af_rxrpc.h F: include/trace/events/afs.h
F: net/rxrpc/af_rxrpc.c F: Documentation/filesystems/afs.txt
W: https://www.infradead.org/~dhowells/kafs/ W: https://www.infradead.org/~dhowells/kafs/
AGPGART DRIVER AGPGART DRIVER
@@ -11776,6 +11776,18 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/jes/linux.git rtl8xxxu-deve
S: Maintained S: Maintained
F: drivers/net/wireless/realtek/rtl8xxxu/ F: drivers/net/wireless/realtek/rtl8xxxu/
RXRPC SOCKETS (AF_RXRPC)
M: David Howells <dhowells@redhat.com>
L: linux-afs@lists.infradead.org
S: Supported
F: net/rxrpc/
F: include/keys/rxrpc-type.h
F: include/net/af_rxrpc.h
F: include/trace/events/rxrpc.h
F: include/uapi/linux/rxrpc.h
F: Documentation/networking/rxrpc.txt
W: https://www.infradead.org/~dhowells/kafs/
S3 SAVAGE FRAMEBUFFER DRIVER S3 SAVAGE FRAMEBUFFER DRIVER
M: Antonino Daplas <adaplas@gmail.com> M: Antonino Daplas <adaplas@gmail.com>
L: linux-fbdev@vger.kernel.org L: linux-fbdev@vger.kernel.org
+5 -4
View File
@@ -184,12 +184,12 @@
* Below is some version info we got: * Below is some version info we got:
* SOC Version IP-Version Glitch- [TR]WRN_INT IRQ Err Memory err RTR re- * SOC Version IP-Version Glitch- [TR]WRN_INT IRQ Err Memory err RTR re-
* Filter? connected? Passive detection ception in MB * Filter? connected? Passive detection ception in MB
* MX25 FlexCAN2 03.00.00.00 no no ? no no * MX25 FlexCAN2 03.00.00.00 no no no no no
* MX28 FlexCAN2 03.00.04.00 yes yes no no no * MX28 FlexCAN2 03.00.04.00 yes yes no no no
* MX35 FlexCAN2 03.00.00.00 no no ? no no * MX35 FlexCAN2 03.00.00.00 no no no no no
* MX53 FlexCAN2 03.00.00.00 yes no no no no * MX53 FlexCAN2 03.00.00.00 yes no no no no
* MX6s FlexCAN3 10.00.12.00 yes yes no no yes * MX6s FlexCAN3 10.00.12.00 yes yes no no yes
* VF610 FlexCAN3 ? no yes ? yes yes? * VF610 FlexCAN3 ? no yes no yes yes?
* *
* Some SOCs do not have the RX_WARN & TX_WARN interrupt line connected. * Some SOCs do not have the RX_WARN & TX_WARN interrupt line connected.
*/ */
@@ -297,7 +297,8 @@ static const struct flexcan_devtype_data fsl_imx6q_devtype_data = {
static const struct flexcan_devtype_data fsl_vf610_devtype_data = { static const struct flexcan_devtype_data fsl_vf610_devtype_data = {
.quirks = FLEXCAN_QUIRK_DISABLE_RXFG | FLEXCAN_QUIRK_ENABLE_EACEN_RRS | .quirks = FLEXCAN_QUIRK_DISABLE_RXFG | FLEXCAN_QUIRK_ENABLE_EACEN_RRS |
FLEXCAN_QUIRK_DISABLE_MECR | FLEXCAN_QUIRK_USE_OFF_TIMESTAMP, FLEXCAN_QUIRK_DISABLE_MECR | FLEXCAN_QUIRK_USE_OFF_TIMESTAMP |
FLEXCAN_QUIRK_BROKEN_PERR_STATE,
}; };
static const struct can_bittiming_const flexcan_bittiming_const = { static const struct can_bittiming_const flexcan_bittiming_const = {
@@ -825,7 +825,10 @@ err_release_regions:
err_disable_pci: err_disable_pci:
pci_disable_device(pdev); pci_disable_device(pdev);
return err; /* pci_xxx_config_word() return positive PCIBIOS_xxx error codes while
* the probe() function must return a negative errno in case of failure
* (err is unchanged if negative) */
return pcibios_err_to_errno(err);
} }
/* free the board structure object, as well as its resources: */ /* free the board structure object, as well as its resources: */
+4 -1
View File
@@ -717,7 +717,10 @@ failure_release_regions:
failure_disable_pci: failure_disable_pci:
pci_disable_device(pdev); pci_disable_device(pdev);
return err; /* pci_xxx_config_word() return positive PCIBIOS_xxx error codes while
* the probe() function must return a negative errno in case of failure
* (err is unchanged if negative) */
return pcibios_err_to_errno(err);
} }
static void peak_pci_remove(struct pci_dev *pdev) static void peak_pci_remove(struct pci_dev *pdev)
+3
View File
@@ -637,6 +637,9 @@ static int ti_hecc_rx_poll(struct napi_struct *napi, int quota)
mbx_mask = hecc_read(priv, HECC_CANMIM); mbx_mask = hecc_read(priv, HECC_CANMIM);
mbx_mask |= HECC_TX_MBOX_MASK; mbx_mask |= HECC_TX_MBOX_MASK;
hecc_write(priv, HECC_CANMIM, mbx_mask); hecc_write(priv, HECC_CANMIM, mbx_mask);
} else {
/* repoll is done only if whole budget is used */
num_pkts = quota;
} }
return num_pkts; return num_pkts;
+7 -4
View File
@@ -609,8 +609,8 @@ static int kvaser_usb_wait_msg(const struct kvaser_usb *dev, u8 id,
} }
if (pos + tmp->len > actual_len) { if (pos + tmp->len > actual_len) {
dev_err(dev->udev->dev.parent, dev_err_ratelimited(dev->udev->dev.parent,
"Format error\n"); "Format error\n");
break; break;
} }
@@ -813,6 +813,7 @@ static int kvaser_usb_simple_msg_async(struct kvaser_usb_net_priv *priv,
if (err) { if (err) {
netdev_err(netdev, "Error transmitting URB\n"); netdev_err(netdev, "Error transmitting URB\n");
usb_unanchor_urb(urb); usb_unanchor_urb(urb);
kfree(buf);
usb_free_urb(urb); usb_free_urb(urb);
return err; return err;
} }
@@ -1333,7 +1334,7 @@ static void kvaser_usb_read_bulk_callback(struct urb *urb)
goto resubmit_urb; goto resubmit_urb;
} }
while (pos <= urb->actual_length - MSG_HEADER_LEN) { while (pos <= (int)(urb->actual_length - MSG_HEADER_LEN)) {
msg = urb->transfer_buffer + pos; msg = urb->transfer_buffer + pos;
/* The Kvaser firmware can only read and write messages that /* The Kvaser firmware can only read and write messages that
@@ -1352,7 +1353,8 @@ static void kvaser_usb_read_bulk_callback(struct urb *urb)
} }
if (pos + msg->len > urb->actual_length) { if (pos + msg->len > urb->actual_length) {
dev_err(dev->udev->dev.parent, "Format error\n"); dev_err_ratelimited(dev->udev->dev.parent,
"Format error\n");
break; break;
} }
@@ -1768,6 +1770,7 @@ static netdev_tx_t kvaser_usb_start_xmit(struct sk_buff *skb,
spin_unlock_irqrestore(&priv->tx_contexts_lock, flags); spin_unlock_irqrestore(&priv->tx_contexts_lock, flags);
usb_unanchor_urb(urb); usb_unanchor_urb(urb);
kfree(buf);
stats->tx_dropped++; stats->tx_dropped++;
+2 -1
View File
@@ -592,6 +592,7 @@ static void mcba_usb_read_bulk_callback(struct urb *urb)
break; break;
case -ENOENT: case -ENOENT:
case -EPIPE:
case -ESHUTDOWN: case -ESHUTDOWN:
return; return;
@@ -862,7 +863,7 @@ static int mcba_usb_probe(struct usb_interface *intf,
goto cleanup_unregister_candev; goto cleanup_unregister_candev;
} }
dev_info(&intf->dev, "Microchip CAN BUS analizer connected\n"); dev_info(&intf->dev, "Microchip CAN BUS Analyzer connected\n");
return 0; return 0;
+2 -2
View File
@@ -625,7 +625,7 @@ static int bcm_sf2_cfp_ipv6_rule_set(struct bcm_sf2_priv *priv, int port,
bcm_sf2_cfp_slice_ipv6(priv, v6_spec->ip6src, v6_spec->psrc, bcm_sf2_cfp_slice_ipv6(priv, v6_spec->ip6src, v6_spec->psrc,
slice_num, false); slice_num, false);
bcm_sf2_cfp_slice_ipv6(priv, v6_m_spec->ip6src, v6_m_spec->psrc, bcm_sf2_cfp_slice_ipv6(priv, v6_m_spec->ip6src, v6_m_spec->psrc,
slice_num, true); SLICE_NUM_MASK, true);
/* Insert into TCAM now because we need to insert a second rule */ /* Insert into TCAM now because we need to insert a second rule */
bcm_sf2_cfp_rule_addr_set(priv, rule_index[0]); bcm_sf2_cfp_rule_addr_set(priv, rule_index[0]);
@@ -699,7 +699,7 @@ static int bcm_sf2_cfp_ipv6_rule_set(struct bcm_sf2_priv *priv, int port,
/* Insert into Action and policer RAMs now, set chain ID to /* Insert into Action and policer RAMs now, set chain ID to
* the one we are chained to * the one we are chained to
*/ */
ret = bcm_sf2_cfp_act_pol_set(priv, rule_index[0], port_num, ret = bcm_sf2_cfp_act_pol_set(priv, rule_index[1], port_num,
queue_num, true); queue_num, true);
if (ret) if (ret)
goto out_err; goto out_err;
+3 -2
View File
@@ -3368,6 +3368,7 @@ static int bnxt_hwrm_do_send_msg(struct bnxt *bp, void *msg, u32 msg_len,
u16 cp_ring_id, len = 0; u16 cp_ring_id, len = 0;
struct hwrm_err_output *resp = bp->hwrm_cmd_resp_addr; struct hwrm_err_output *resp = bp->hwrm_cmd_resp_addr;
u16 max_req_len = BNXT_HWRM_MAX_REQ_LEN; u16 max_req_len = BNXT_HWRM_MAX_REQ_LEN;
struct hwrm_short_input short_input = {0};
req->seq_id = cpu_to_le16(bp->hwrm_cmd_seq++); req->seq_id = cpu_to_le16(bp->hwrm_cmd_seq++);
memset(resp, 0, PAGE_SIZE); memset(resp, 0, PAGE_SIZE);
@@ -3376,7 +3377,6 @@ static int bnxt_hwrm_do_send_msg(struct bnxt *bp, void *msg, u32 msg_len,
if (bp->flags & BNXT_FLAG_SHORT_CMD) { if (bp->flags & BNXT_FLAG_SHORT_CMD) {
void *short_cmd_req = bp->hwrm_short_cmd_req_addr; void *short_cmd_req = bp->hwrm_short_cmd_req_addr;
struct hwrm_short_input short_input = {0};
memcpy(short_cmd_req, req, msg_len); memcpy(short_cmd_req, req, msg_len);
memset(short_cmd_req + msg_len, 0, BNXT_HWRM_MAX_REQ_LEN - memset(short_cmd_req + msg_len, 0, BNXT_HWRM_MAX_REQ_LEN -
@@ -8263,8 +8263,9 @@ static void bnxt_shutdown(struct pci_dev *pdev)
if (netif_running(dev)) if (netif_running(dev))
dev_close(dev); dev_close(dev);
bnxt_ulp_shutdown(bp);
if (system_state == SYSTEM_POWER_OFF) { if (system_state == SYSTEM_POWER_OFF) {
bnxt_ulp_shutdown(bp);
bnxt_clear_int_mode(bp); bnxt_clear_int_mode(bp);
pci_wake_from_d3(pdev, bp->wol); pci_wake_from_d3(pdev, bp->wol);
pci_set_power_state(pdev, PCI_D3hot); pci_set_power_state(pdev, PCI_D3hot);
+28 -27
View File
@@ -56,7 +56,6 @@ static int bnxt_tc_parse_redir(struct bnxt *bp,
{ {
int ifindex = tcf_mirred_ifindex(tc_act); int ifindex = tcf_mirred_ifindex(tc_act);
struct net_device *dev; struct net_device *dev;
u16 dst_fid;
dev = __dev_get_by_index(dev_net(bp->dev), ifindex); dev = __dev_get_by_index(dev_net(bp->dev), ifindex);
if (!dev) { if (!dev) {
@@ -64,15 +63,7 @@ static int bnxt_tc_parse_redir(struct bnxt *bp,
return -EINVAL; return -EINVAL;
} }
/* find the FID from dev */
dst_fid = bnxt_flow_get_dst_fid(bp, dev);
if (dst_fid == BNXT_FID_INVALID) {
netdev_info(bp->dev, "can't get fid for ifindex=%d", ifindex);
return -EINVAL;
}
actions->flags |= BNXT_TC_ACTION_FLAG_FWD; actions->flags |= BNXT_TC_ACTION_FLAG_FWD;
actions->dst_fid = dst_fid;
actions->dst_dev = dev; actions->dst_dev = dev;
return 0; return 0;
} }
@@ -160,13 +151,17 @@ static int bnxt_tc_parse_actions(struct bnxt *bp,
if (rc) if (rc)
return rc; return rc;
/* Tunnel encap/decap action must be accompanied by a redirect action */ if (actions->flags & BNXT_TC_ACTION_FLAG_FWD) {
if ((actions->flags & BNXT_TC_ACTION_FLAG_TUNNEL_ENCAP || if (actions->flags & BNXT_TC_ACTION_FLAG_TUNNEL_ENCAP) {
actions->flags & BNXT_TC_ACTION_FLAG_TUNNEL_DECAP) && /* dst_fid is PF's fid */
!(actions->flags & BNXT_TC_ACTION_FLAG_FWD)) { actions->dst_fid = bp->pf.fw_fid;
netdev_info(bp->dev, } else {
"error: no redir action along with encap/decap"); /* find the FID from dst_dev */
return -EINVAL; actions->dst_fid =
bnxt_flow_get_dst_fid(bp, actions->dst_dev);
if (actions->dst_fid == BNXT_FID_INVALID)
return -EINVAL;
}
} }
return rc; return rc;
@@ -532,10 +527,8 @@ static int hwrm_cfa_decap_filter_alloc(struct bnxt *bp,
} }
if (flow->flags & BNXT_TC_FLOW_FLAGS_TUNL_ETH_ADDRS) { if (flow->flags & BNXT_TC_FLOW_FLAGS_TUNL_ETH_ADDRS) {
enables |= CFA_DECAP_FILTER_ALLOC_REQ_ENABLES_DST_MACADDR | enables |= CFA_DECAP_FILTER_ALLOC_REQ_ENABLES_DST_MACADDR;
CFA_DECAP_FILTER_ALLOC_REQ_ENABLES_SRC_MACADDR;
ether_addr_copy(req.dst_macaddr, l2_info->dmac); ether_addr_copy(req.dst_macaddr, l2_info->dmac);
ether_addr_copy(req.src_macaddr, l2_info->smac);
} }
if (l2_info->num_vlans) { if (l2_info->num_vlans) {
enables |= CFA_DECAP_FILTER_ALLOC_REQ_ENABLES_T_IVLAN_VID; enables |= CFA_DECAP_FILTER_ALLOC_REQ_ENABLES_T_IVLAN_VID;
@@ -901,10 +894,10 @@ static void bnxt_tc_put_decap_handle(struct bnxt *bp,
static int bnxt_tc_resolve_tunnel_hdrs(struct bnxt *bp, static int bnxt_tc_resolve_tunnel_hdrs(struct bnxt *bp,
struct ip_tunnel_key *tun_key, struct ip_tunnel_key *tun_key,
struct bnxt_tc_l2_key *l2_info, struct bnxt_tc_l2_key *l2_info)
struct net_device *real_dst_dev)
{ {
#ifdef CONFIG_INET #ifdef CONFIG_INET
struct net_device *real_dst_dev = bp->dev;
struct flowi4 flow = { {0} }; struct flowi4 flow = { {0} };
struct net_device *dst_dev; struct net_device *dst_dev;
struct neighbour *nbr; struct neighbour *nbr;
@@ -1008,14 +1001,13 @@ static int bnxt_tc_get_decap_handle(struct bnxt *bp, struct bnxt_tc_flow *flow,
*/ */
tun_key.u.ipv4.dst = flow->tun_key.u.ipv4.src; tun_key.u.ipv4.dst = flow->tun_key.u.ipv4.src;
tun_key.tp_dst = flow->tun_key.tp_dst; tun_key.tp_dst = flow->tun_key.tp_dst;
rc = bnxt_tc_resolve_tunnel_hdrs(bp, &tun_key, &l2_info, bp->dev); rc = bnxt_tc_resolve_tunnel_hdrs(bp, &tun_key, &l2_info);
if (rc) if (rc)
goto put_decap; goto put_decap;
decap_key->ttl = tun_key.ttl;
decap_l2_info = &decap_node->l2_info; decap_l2_info = &decap_node->l2_info;
/* decap smac is wildcarded */
ether_addr_copy(decap_l2_info->dmac, l2_info.smac); ether_addr_copy(decap_l2_info->dmac, l2_info.smac);
ether_addr_copy(decap_l2_info->smac, l2_info.dmac);
if (l2_info.num_vlans) { if (l2_info.num_vlans) {
decap_l2_info->num_vlans = l2_info.num_vlans; decap_l2_info->num_vlans = l2_info.num_vlans;
decap_l2_info->inner_vlan_tpid = l2_info.inner_vlan_tpid; decap_l2_info->inner_vlan_tpid = l2_info.inner_vlan_tpid;
@@ -1095,8 +1087,7 @@ static int bnxt_tc_get_encap_handle(struct bnxt *bp, struct bnxt_tc_flow *flow,
if (encap_node->tunnel_handle != INVALID_TUNNEL_HANDLE) if (encap_node->tunnel_handle != INVALID_TUNNEL_HANDLE)
goto done; goto done;
rc = bnxt_tc_resolve_tunnel_hdrs(bp, encap_key, &encap_node->l2_info, rc = bnxt_tc_resolve_tunnel_hdrs(bp, encap_key, &encap_node->l2_info);
flow->actions.dst_dev);
if (rc) if (rc)
goto put_encap; goto put_encap;
@@ -1169,6 +1160,15 @@ static int __bnxt_tc_del_flow(struct bnxt *bp,
return 0; return 0;
} }
static void bnxt_tc_set_src_fid(struct bnxt *bp, struct bnxt_tc_flow *flow,
u16 src_fid)
{
if (flow->actions.flags & BNXT_TC_ACTION_FLAG_TUNNEL_DECAP)
flow->src_fid = bp->pf.fw_fid;
else
flow->src_fid = src_fid;
}
/* Add a new flow or replace an existing flow. /* Add a new flow or replace an existing flow.
* Notes on locking: * Notes on locking:
* There are essentially two critical sections here. * There are essentially two critical sections here.
@@ -1204,7 +1204,8 @@ static int bnxt_tc_add_flow(struct bnxt *bp, u16 src_fid,
rc = bnxt_tc_parse_flow(bp, tc_flow_cmd, flow); rc = bnxt_tc_parse_flow(bp, tc_flow_cmd, flow);
if (rc) if (rc)
goto free_node; goto free_node;
flow->src_fid = src_fid;
bnxt_tc_set_src_fid(bp, flow, src_fid);
if (!bnxt_tc_can_offload(bp, flow)) { if (!bnxt_tc_can_offload(bp, flow)) {
rc = -ENOSPC; rc = -ENOSPC;
@@ -1113,7 +1113,7 @@ static int liquidio_watchdog(void *param)
dev_err(&oct->pci_dev->dev, dev_err(&oct->pci_dev->dev,
"ERROR: Octeon core %d crashed or got stuck! See oct-fwdump for details.\n", "ERROR: Octeon core %d crashed or got stuck! See oct-fwdump for details.\n",
core); core);
err_msg_was_printed[core] = true; err_msg_was_printed[core] = true;
} }
} }
+1 -1
View File
@@ -5598,7 +5598,7 @@ static int mvpp2_aggr_txq_init(struct platform_device *pdev,
u32 txq_dma; u32 txq_dma;
/* Allocate memory for TX descriptors */ /* Allocate memory for TX descriptors */
aggr_txq->descs = dma_alloc_coherent(&pdev->dev, aggr_txq->descs = dma_zalloc_coherent(&pdev->dev,
MVPP2_AGGR_TXQ_SIZE * MVPP2_DESC_ALIGNED_SIZE, MVPP2_AGGR_TXQ_SIZE * MVPP2_DESC_ALIGNED_SIZE,
&aggr_txq->descs_dma, GFP_KERNEL); &aggr_txq->descs_dma, GFP_KERNEL);
if (!aggr_txq->descs) if (!aggr_txq->descs)
@@ -808,8 +808,7 @@ static int sun8i_dwmac_set_syscon(struct stmmac_priv *priv)
val, reg); val, reg);
if (gmac->variant->soc_has_internal_phy) { if (gmac->variant->soc_has_internal_phy) {
if (of_property_read_bool(priv->plat->phy_node, if (of_property_read_bool(node, "allwinner,leds-active-low"))
"allwinner,leds-active-low"))
reg |= H3_EPHY_LED_POL; reg |= H3_EPHY_LED_POL;
else else
reg &= ~H3_EPHY_LED_POL; reg &= ~H3_EPHY_LED_POL;
@@ -2588,6 +2588,7 @@ static int stmmac_open(struct net_device *dev)
priv->dma_buf_sz = STMMAC_ALIGN(buf_sz); priv->dma_buf_sz = STMMAC_ALIGN(buf_sz);
priv->rx_copybreak = STMMAC_RX_COPYBREAK; priv->rx_copybreak = STMMAC_RX_COPYBREAK;
priv->mss = 0;
ret = alloc_dma_desc_resources(priv); ret = alloc_dma_desc_resources(priv);
if (ret < 0) { if (ret < 0) {
+1
View File
@@ -393,6 +393,7 @@ static int ipvlan_process_v4_outbound(struct sk_buff *skb)
.flowi4_oif = dev->ifindex, .flowi4_oif = dev->ifindex,
.flowi4_tos = RT_TOS(ip4h->tos), .flowi4_tos = RT_TOS(ip4h->tos),
.flowi4_flags = FLOWI_FLAG_ANYSRC, .flowi4_flags = FLOWI_FLAG_ANYSRC,
.flowi4_mark = skb->mark,
.daddr = ip4h->daddr, .daddr = ip4h->daddr,
.saddr = ip4h->saddr, .saddr = ip4h->saddr,
}; };
+4 -2
View File
@@ -496,16 +496,18 @@ static int ksz9031_of_load_skew_values(struct phy_device *phydev,
return ksz9031_extended_write(phydev, OP_DATA, 2, reg, newval); return ksz9031_extended_write(phydev, OP_DATA, 2, reg, newval);
} }
/* Center KSZ9031RNX FLP timing at 16ms. */
static int ksz9031_center_flp_timing(struct phy_device *phydev) static int ksz9031_center_flp_timing(struct phy_device *phydev)
{ {
int result; int result;
/* Center KSZ9031RNX FLP timing at 16ms. */
result = ksz9031_extended_write(phydev, OP_DATA, 0, result = ksz9031_extended_write(phydev, OP_DATA, 0,
MII_KSZ9031RN_FLP_BURST_TX_HI, 0x0006); MII_KSZ9031RN_FLP_BURST_TX_HI, 0x0006);
if (result)
return result;
result = ksz9031_extended_write(phydev, OP_DATA, 0, result = ksz9031_extended_write(phydev, OP_DATA, 0,
MII_KSZ9031RN_FLP_BURST_TX_LO, 0x1A80); MII_KSZ9031RN_FLP_BURST_TX_LO, 0x1A80);
if (result) if (result)
return result; return result;
+1
View File
@@ -773,6 +773,7 @@ void phylink_stop(struct phylink *pl)
sfp_upstream_stop(pl->sfp_bus); sfp_upstream_stop(pl->sfp_bus);
set_bit(PHYLINK_DISABLE_STOPPED, &pl->phylink_disable_state); set_bit(PHYLINK_DISABLE_STOPPED, &pl->phylink_disable_state);
queue_work(system_power_efficient_wq, &pl->resolve);
flush_work(&pl->resolve); flush_work(&pl->resolve);
} }
EXPORT_SYMBOL_GPL(phylink_stop); EXPORT_SYMBOL_GPL(phylink_stop);
+30 -11
View File
@@ -351,12 +351,13 @@ static void sfp_sm_link_check_los(struct sfp *sfp)
{ {
unsigned int los = sfp->state & SFP_F_LOS; unsigned int los = sfp->state & SFP_F_LOS;
/* FIXME: what if neither SFP_OPTIONS_LOS_INVERTED nor /* If neither SFP_OPTIONS_LOS_INVERTED nor SFP_OPTIONS_LOS_NORMAL
* SFP_OPTIONS_LOS_NORMAL are set? For now, we assume * are set, we assume that no LOS signal is available.
* the same as SFP_OPTIONS_LOS_NORMAL set.
*/ */
if (sfp->id.ext.options & SFP_OPTIONS_LOS_INVERTED) if (sfp->id.ext.options & cpu_to_be16(SFP_OPTIONS_LOS_INVERTED))
los ^= SFP_F_LOS; los ^= SFP_F_LOS;
else if (!(sfp->id.ext.options & cpu_to_be16(SFP_OPTIONS_LOS_NORMAL)))
los = 0;
if (los) if (los)
sfp_sm_next(sfp, SFP_S_WAIT_LOS, 0); sfp_sm_next(sfp, SFP_S_WAIT_LOS, 0);
@@ -364,6 +365,22 @@ static void sfp_sm_link_check_los(struct sfp *sfp)
sfp_sm_link_up(sfp); sfp_sm_link_up(sfp);
} }
static bool sfp_los_event_active(struct sfp *sfp, unsigned int event)
{
return (sfp->id.ext.options & cpu_to_be16(SFP_OPTIONS_LOS_INVERTED) &&
event == SFP_E_LOS_LOW) ||
(sfp->id.ext.options & cpu_to_be16(SFP_OPTIONS_LOS_NORMAL) &&
event == SFP_E_LOS_HIGH);
}
static bool sfp_los_event_inactive(struct sfp *sfp, unsigned int event)
{
return (sfp->id.ext.options & cpu_to_be16(SFP_OPTIONS_LOS_INVERTED) &&
event == SFP_E_LOS_HIGH) ||
(sfp->id.ext.options & cpu_to_be16(SFP_OPTIONS_LOS_NORMAL) &&
event == SFP_E_LOS_LOW);
}
static void sfp_sm_fault(struct sfp *sfp, bool warn) static void sfp_sm_fault(struct sfp *sfp, bool warn)
{ {
if (sfp->sm_retries && !--sfp->sm_retries) { if (sfp->sm_retries && !--sfp->sm_retries) {
@@ -470,6 +487,11 @@ static int sfp_sm_mod_probe(struct sfp *sfp)
return -EINVAL; return -EINVAL;
} }
/* If the module requires address swap mode, warn about it */
if (sfp->id.ext.diagmon & SFP_DIAGMON_ADDRMODE)
dev_warn(sfp->dev,
"module address swap to access page 0xA2 is not supported.\n");
return sfp_module_insert(sfp->sfp_bus, &sfp->id); return sfp_module_insert(sfp->sfp_bus, &sfp->id);
} }
@@ -581,9 +603,7 @@ static void sfp_sm_event(struct sfp *sfp, unsigned int event)
case SFP_S_WAIT_LOS: case SFP_S_WAIT_LOS:
if (event == SFP_E_TX_FAULT) if (event == SFP_E_TX_FAULT)
sfp_sm_fault(sfp, true); sfp_sm_fault(sfp, true);
else if (event == else if (sfp_los_event_inactive(sfp, event))
(sfp->id.ext.options & SFP_OPTIONS_LOS_INVERTED ?
SFP_E_LOS_HIGH : SFP_E_LOS_LOW))
sfp_sm_link_up(sfp); sfp_sm_link_up(sfp);
break; break;
@@ -591,9 +611,7 @@ static void sfp_sm_event(struct sfp *sfp, unsigned int event)
if (event == SFP_E_TX_FAULT) { if (event == SFP_E_TX_FAULT) {
sfp_sm_link_down(sfp); sfp_sm_link_down(sfp);
sfp_sm_fault(sfp, true); sfp_sm_fault(sfp, true);
} else if (event == } else if (sfp_los_event_active(sfp, event)) {
(sfp->id.ext.options & SFP_OPTIONS_LOS_INVERTED ?
SFP_E_LOS_LOW : SFP_E_LOS_HIGH)) {
sfp_sm_link_down(sfp); sfp_sm_link_down(sfp);
sfp_sm_next(sfp, SFP_S_WAIT_LOS, 0); sfp_sm_next(sfp, SFP_S_WAIT_LOS, 0);
} }
@@ -639,7 +657,8 @@ static int sfp_module_info(struct sfp *sfp, struct ethtool_modinfo *modinfo)
{ {
/* locking... and check module is present */ /* locking... and check module is present */
if (sfp->id.ext.sff8472_compliance) { if (sfp->id.ext.sff8472_compliance &&
!(sfp->id.ext.diagmon & SFP_DIAGMON_ADDRMODE)) {
modinfo->type = ETH_MODULE_SFF_8472; modinfo->type = ETH_MODULE_SFF_8472;
modinfo->eeprom_len = ETH_MODULE_SFF_8472_LEN; modinfo->eeprom_len = ETH_MODULE_SFF_8472_LEN;
} else { } else {
+10 -4
View File
@@ -829,8 +829,11 @@ static ssize_t tap_do_read(struct tap_queue *q,
DEFINE_WAIT(wait); DEFINE_WAIT(wait);
ssize_t ret = 0; ssize_t ret = 0;
if (!iov_iter_count(to)) if (!iov_iter_count(to)) {
if (skb)
kfree_skb(skb);
return 0; return 0;
}
if (skb) if (skb)
goto put; goto put;
@@ -1154,11 +1157,14 @@ static int tap_recvmsg(struct socket *sock, struct msghdr *m,
size_t total_len, int flags) size_t total_len, int flags)
{ {
struct tap_queue *q = container_of(sock, struct tap_queue, sock); struct tap_queue *q = container_of(sock, struct tap_queue, sock);
struct sk_buff *skb = m->msg_control;
int ret; int ret;
if (flags & ~(MSG_DONTWAIT|MSG_TRUNC)) if (flags & ~(MSG_DONTWAIT|MSG_TRUNC)) {
if (skb)
kfree_skb(skb);
return -EINVAL; return -EINVAL;
ret = tap_do_read(q, &m->msg_iter, flags & MSG_DONTWAIT, }
m->msg_control); ret = tap_do_read(q, &m->msg_iter, flags & MSG_DONTWAIT, skb);
if (ret > total_len) { if (ret > total_len) {
m->msg_flags |= MSG_TRUNC; m->msg_flags |= MSG_TRUNC;
ret = flags & MSG_TRUNC ? ret : total_len; ret = flags & MSG_TRUNC ? ret : total_len;
+18 -6
View File
@@ -1952,8 +1952,11 @@ static ssize_t tun_do_read(struct tun_struct *tun, struct tun_file *tfile,
tun_debug(KERN_INFO, tun, "tun_do_read\n"); tun_debug(KERN_INFO, tun, "tun_do_read\n");
if (!iov_iter_count(to)) if (!iov_iter_count(to)) {
if (skb)
kfree_skb(skb);
return 0; return 0;
}
if (!skb) { if (!skb) {
/* Read frames from ring */ /* Read frames from ring */
@@ -2069,22 +2072,24 @@ static int tun_recvmsg(struct socket *sock, struct msghdr *m, size_t total_len,
{ {
struct tun_file *tfile = container_of(sock, struct tun_file, socket); struct tun_file *tfile = container_of(sock, struct tun_file, socket);
struct tun_struct *tun = tun_get(tfile); struct tun_struct *tun = tun_get(tfile);
struct sk_buff *skb = m->msg_control;
int ret; int ret;
if (!tun) if (!tun) {
return -EBADFD; ret = -EBADFD;
goto out_free_skb;
}
if (flags & ~(MSG_DONTWAIT|MSG_TRUNC|MSG_ERRQUEUE)) { if (flags & ~(MSG_DONTWAIT|MSG_TRUNC|MSG_ERRQUEUE)) {
ret = -EINVAL; ret = -EINVAL;
goto out; goto out_put_tun;
} }
if (flags & MSG_ERRQUEUE) { if (flags & MSG_ERRQUEUE) {
ret = sock_recv_errqueue(sock->sk, m, total_len, ret = sock_recv_errqueue(sock->sk, m, total_len,
SOL_PACKET, TUN_TX_TIMESTAMP); SOL_PACKET, TUN_TX_TIMESTAMP);
goto out; goto out;
} }
ret = tun_do_read(tun, tfile, &m->msg_iter, flags & MSG_DONTWAIT, ret = tun_do_read(tun, tfile, &m->msg_iter, flags & MSG_DONTWAIT, skb);
m->msg_control);
if (ret > (ssize_t)total_len) { if (ret > (ssize_t)total_len) {
m->msg_flags |= MSG_TRUNC; m->msg_flags |= MSG_TRUNC;
ret = flags & MSG_TRUNC ? ret : total_len; ret = flags & MSG_TRUNC ? ret : total_len;
@@ -2092,6 +2097,13 @@ static int tun_recvmsg(struct socket *sock, struct msghdr *m, size_t total_len,
out: out:
tun_put(tun); tun_put(tun);
return ret; return ret;
out_put_tun:
tun_put(tun);
out_free_skb:
if (skb)
kfree_skb(skb);
return ret;
} }
static int tun_peek_len(struct socket *sock) static int tun_peek_len(struct socket *sock)

Some files were not shown because too many files have changed in this diff Show More