Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Browse files Browse the repository at this point in the history
Merge in the fixes we had queued in case there was another -rc.

Signed-off-by: Jakub Kicinski <[email protected]>
  • Loading branch information
kuba-moo committed Nov 2, 2021
2 parents b7b98f8 + 6b278c0 commit 8a33dcc
Show file tree
Hide file tree
Showing 19 changed files with 233 additions and 39 deletions.
8 changes: 8 additions & 0 deletions drivers/net/ethernet/amd/xgbe/xgbe-common.h
Original file line number Diff line number Diff line change
Expand Up @@ -1331,6 +1331,10 @@
#define MDIO_VEND2_PMA_CDR_CONTROL 0x8056
#endif

#ifndef MDIO_VEND2_PMA_MISC_CTRL0
#define MDIO_VEND2_PMA_MISC_CTRL0 0x8090
#endif

#ifndef MDIO_CTRL1_SPEED1G
#define MDIO_CTRL1_SPEED1G (MDIO_CTRL1_SPEED10G & ~BMCR_SPEED100)
#endif
Expand Down Expand Up @@ -1389,6 +1393,10 @@
#define XGBE_PMA_RX_RST_0_RESET_ON 0x10
#define XGBE_PMA_RX_RST_0_RESET_OFF 0x00

#define XGBE_PMA_PLL_CTRL_MASK BIT(15)
#define XGBE_PMA_PLL_CTRL_ENABLE BIT(15)
#define XGBE_PMA_PLL_CTRL_DISABLE 0x0000

/* Bit setting and getting macros
* The get macro will extract the current bit field value from within
* the variable
Expand Down
20 changes: 19 additions & 1 deletion drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1977,12 +1977,26 @@ static void xgbe_phy_rx_reset(struct xgbe_prv_data *pdata)
}
}

static void xgbe_phy_pll_ctrl(struct xgbe_prv_data *pdata, bool enable)
{
XMDIO_WRITE_BITS(pdata, MDIO_MMD_PMAPMD, MDIO_VEND2_PMA_MISC_CTRL0,
XGBE_PMA_PLL_CTRL_MASK,
enable ? XGBE_PMA_PLL_CTRL_ENABLE
: XGBE_PMA_PLL_CTRL_DISABLE);

/* Wait for command to complete */
usleep_range(100, 200);
}

static void xgbe_phy_perform_ratechange(struct xgbe_prv_data *pdata,
unsigned int cmd, unsigned int sub_cmd)
{
unsigned int s0 = 0;
unsigned int wait;

/* Disable PLL re-initialization during FW command processing */
xgbe_phy_pll_ctrl(pdata, false);

/* Log if a previous command did not complete */
if (XP_IOREAD_BITS(pdata, XP_DRIVER_INT_RO, STATUS)) {
netif_dbg(pdata, link, pdata->netdev,
Expand All @@ -2003,7 +2017,7 @@ static void xgbe_phy_perform_ratechange(struct xgbe_prv_data *pdata,
wait = XGBE_RATECHANGE_COUNT;
while (wait--) {
if (!XP_IOREAD_BITS(pdata, XP_DRIVER_INT_RO, STATUS))
return;
goto reenable_pll;

usleep_range(1000, 2000);
}
Expand All @@ -2013,6 +2027,10 @@ static void xgbe_phy_perform_ratechange(struct xgbe_prv_data *pdata,

/* Reset on error */
xgbe_phy_rx_reset(pdata);

reenable_pll:
/* Enable PLL re-initialization */
xgbe_phy_pll_ctrl(pdata, true);
}

static void xgbe_phy_rrc(struct xgbe_prv_data *pdata)
Expand Down
21 changes: 12 additions & 9 deletions drivers/net/ethernet/ibm/ibmvnic.c
Original file line number Diff line number Diff line change
Expand Up @@ -1914,8 +1914,6 @@ static netdev_tx_t ibmvnic_xmit(struct sk_buff *skb, struct net_device *netdev)
ind_bufp = &tx_scrq->ind_buf;

if (test_bit(0, &adapter->resetting)) {
if (!netif_subqueue_stopped(netdev, skb))
netif_stop_subqueue(netdev, queue_num);
dev_kfree_skb_any(skb);

tx_send_failed++;
Expand Down Expand Up @@ -2757,7 +2755,7 @@ static int ibmvnic_reset(struct ibmvnic_adapter *adapter,

if (adapter->state == VNIC_PROBING) {
netdev_warn(netdev, "Adapter reset during probe\n");
adapter->init_done_rc = EAGAIN;
adapter->init_done_rc = -EAGAIN;
ret = EAGAIN;
goto err;
}
Expand Down Expand Up @@ -5259,11 +5257,6 @@ static void ibmvnic_handle_crq(union ibmvnic_crq *crq,
*/
adapter->login_pending = false;

if (!completion_done(&adapter->init_done)) {
complete(&adapter->init_done);
adapter->init_done_rc = -EIO;
}

if (adapter->state == VNIC_DOWN)
rc = ibmvnic_reset(adapter, VNIC_RESET_PASSIVE_INIT);
else
Expand All @@ -5284,6 +5277,13 @@ static void ibmvnic_handle_crq(union ibmvnic_crq *crq,
rc);
adapter->failover_pending = false;
}

if (!completion_done(&adapter->init_done)) {
complete(&adapter->init_done);
if (!adapter->init_done_rc)
adapter->init_done_rc = -EAGAIN;
}

break;
case IBMVNIC_CRQ_INIT_COMPLETE:
dev_info(dev, "Partner initialization complete\n");
Expand Down Expand Up @@ -5604,6 +5604,9 @@ static int init_crq_queue(struct ibmvnic_adapter *adapter)
crq->cur = 0;
spin_lock_init(&crq->lock);

/* process any CRQs that were queued before we enabled interrupts */
tasklet_schedule(&adapter->tasklet);

return retrc;

req_irq_failed:
Expand Down Expand Up @@ -5753,7 +5756,7 @@ static int ibmvnic_probe(struct vio_dev *dev, const struct vio_device_id *id)
}

rc = ibmvnic_reset_init(adapter, false);
} while (rc == EAGAIN);
} while (rc == -EAGAIN);

/* We are ignoring the error from ibmvnic_reset_init() assuming that the
* partner is not ready. CRQ is not active. When the partner becomes
Expand Down
8 changes: 2 additions & 6 deletions drivers/net/ethernet/netronome/nfp/nfp_net_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -2067,7 +2067,7 @@ static int nfp_net_poll(struct napi_struct *napi, int budget)
if (napi_complete_done(napi, pkts_polled))
nfp_net_irq_unmask(r_vec->nfp_net, r_vec->irq_entry);

if (r_vec->nfp_net->rx_coalesce_adapt_on) {
if (r_vec->nfp_net->rx_coalesce_adapt_on && r_vec->rx_ring) {
struct dim_sample dim_sample = {};
unsigned int start;
u64 pkts, bytes;
Expand All @@ -2082,7 +2082,7 @@ static int nfp_net_poll(struct napi_struct *napi, int budget)
net_dim(&r_vec->rx_dim, dim_sample);
}

if (r_vec->nfp_net->tx_coalesce_adapt_on) {
if (r_vec->nfp_net->tx_coalesce_adapt_on && r_vec->tx_ring) {
struct dim_sample dim_sample = {};
unsigned int start;
u64 pkts, bytes;
Expand Down Expand Up @@ -3016,10 +3016,8 @@ static void nfp_net_rx_dim_work(struct work_struct *work)

/* copy RX interrupt coalesce parameters */
value = (moder.pkts << 16) | (factor * moder.usec);
rtnl_lock();
nn_writel(nn, NFP_NET_CFG_RXR_IRQ_MOD(r_vec->rx_ring->idx), value);
(void)nfp_net_reconfig(nn, NFP_NET_CFG_UPDATE_IRQMOD);
rtnl_unlock();

dim->state = DIM_START_MEASURE;
}
Expand Down Expand Up @@ -3047,10 +3045,8 @@ static void nfp_net_tx_dim_work(struct work_struct *work)

/* copy TX interrupt coalesce parameters */
value = (moder.pkts << 16) | (factor * moder.usec);
rtnl_lock();
nn_writel(nn, NFP_NET_CFG_TXR_IRQ_MOD(r_vec->tx_ring->idx), value);
(void)nfp_net_reconfig(nn, NFP_NET_CFG_UPDATE_IRQMOD);
rtnl_unlock();

dim->state = DIM_START_MEASURE;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/phy/phylink.c
Original file line number Diff line number Diff line change
Expand Up @@ -1780,7 +1780,7 @@ int phylink_ethtool_set_pauseparam(struct phylink *pl,
return -EOPNOTSUPP;

if (!phylink_test(pl->supported, Asym_Pause) &&
!pause->autoneg && pause->rx_pause != pause->tx_pause)
pause->rx_pause != pause->tx_pause)
return -EINVAL;

pause_state = 0;
Expand Down
1 change: 1 addition & 0 deletions include/net/flow_dissector.h
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ enum flow_dissector_key_id {
#define FLOW_DISSECTOR_F_PARSE_1ST_FRAG BIT(0)
#define FLOW_DISSECTOR_F_STOP_AT_FLOW_LABEL BIT(1)
#define FLOW_DISSECTOR_F_STOP_AT_ENCAP BIT(2)
#define FLOW_DISSECTOR_F_STOP_BEFORE_ENCAP BIT(3)

struct flow_dissector_key {
enum flow_dissector_key_id key_id;
Expand Down
7 changes: 3 additions & 4 deletions include/net/sctp/sctp.h
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,8 @@ static inline __u32 sctp_min_frag_point(struct sctp_sock *sp, __u16 datasize)

static inline int sctp_transport_pl_hlen(struct sctp_transport *t)
{
return __sctp_mtu_payload(sctp_sk(t->asoc->base.sk), t, 0, 0);
return __sctp_mtu_payload(sctp_sk(t->asoc->base.sk), t, 0, 0) -
sizeof(struct sctphdr);
}

static inline void sctp_transport_pl_reset(struct sctp_transport *t)
Expand All @@ -653,12 +654,10 @@ static inline void sctp_transport_pl_update(struct sctp_transport *t)
if (t->pl.state == SCTP_PL_DISABLED)
return;

if (del_timer(&t->probe_timer))
sctp_transport_put(t);

t->pl.state = SCTP_PL_BASE;
t->pl.pmtu = SCTP_BASE_PLPMTU;
t->pl.probe_size = SCTP_BASE_PLPMTU;
sctp_transport_reset_probe_timer(t);
}

static inline bool sctp_transport_pl_enabled(struct sctp_transport *t)
Expand Down
2 changes: 2 additions & 0 deletions net/bridge/br_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -1893,11 +1893,13 @@ static inline int br_cfm_status_fill_info(struct sk_buff *skb,

static inline int br_cfm_mep_count(struct net_bridge *br, u32 *count)
{
*count = 0;
return -EOPNOTSUPP;
}

static inline int br_cfm_peer_mep_count(struct net_bridge *br, u32 *count)
{
*count = 0;
return -EOPNOTSUPP;
}
#endif
Expand Down
15 changes: 15 additions & 0 deletions net/core/flow_dissector.c
Original file line number Diff line number Diff line change
Expand Up @@ -1306,6 +1306,11 @@ bool __skb_flow_dissect(const struct net *net,

switch (ip_proto) {
case IPPROTO_GRE:
if (flags & FLOW_DISSECTOR_F_STOP_BEFORE_ENCAP) {
fdret = FLOW_DISSECT_RET_OUT_GOOD;
break;
}

fdret = __skb_flow_dissect_gre(skb, key_control, flow_dissector,
target_container, data,
&proto, &nhoff, &hlen, flags);
Expand Down Expand Up @@ -1363,6 +1368,11 @@ bool __skb_flow_dissect(const struct net *net,
break;
}
case IPPROTO_IPIP:
if (flags & FLOW_DISSECTOR_F_STOP_BEFORE_ENCAP) {
fdret = FLOW_DISSECT_RET_OUT_GOOD;
break;
}

proto = htons(ETH_P_IP);

key_control->flags |= FLOW_DIS_ENCAPSULATION;
Expand All @@ -1375,6 +1385,11 @@ bool __skb_flow_dissect(const struct net *net,
break;

case IPPROTO_IPV6:
if (flags & FLOW_DISSECTOR_F_STOP_BEFORE_ENCAP) {
fdret = FLOW_DISSECT_RET_OUT_GOOD;
break;
}

proto = htons(ETH_P_IPV6);

key_control->flags |= FLOW_DIS_ENCAPSULATION;
Expand Down
2 changes: 1 addition & 1 deletion net/ipv6/udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1435,7 +1435,6 @@ int udpv6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
if (!fl6.flowi6_oif)
fl6.flowi6_oif = np->sticky_pktinfo.ipi6_ifindex;

fl6.flowi6_mark = ipc6.sockc.mark;
fl6.flowi6_uid = sk->sk_uid;

if (msg->msg_controllen) {
Expand Down Expand Up @@ -1471,6 +1470,7 @@ int udpv6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
ipc6.opt = opt;

fl6.flowi6_proto = sk->sk_protocol;
fl6.flowi6_mark = ipc6.sockc.mark;
fl6.daddr = *daddr;
if (ipv6_addr_any(&fl6.saddr) && !ipv6_addr_any(&np->saddr))
fl6.saddr = np->saddr;
Expand Down
3 changes: 2 additions & 1 deletion net/sched/cls_flower.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,8 @@ static int fl_classify(struct sk_buff *skb, const struct tcf_proto *tp,
ARRAY_SIZE(fl_ct_info_to_flower_map),
post_ct);
skb_flow_dissect_hash(skb, &mask->dissector, &skb_key);
skb_flow_dissect(skb, &mask->dissector, &skb_key, 0);
skb_flow_dissect(skb, &mask->dissector, &skb_key,
FLOW_DISSECTOR_F_STOP_BEFORE_ENCAP);

f = fl_mask_lookup(mask, &skb_key);
if (f && !tc_skip_sw(f->flags)) {
Expand Down
13 changes: 8 additions & 5 deletions net/sctp/output.c
Original file line number Diff line number Diff line change
Expand Up @@ -581,13 +581,16 @@ int sctp_packet_transmit(struct sctp_packet *packet, gfp_t gfp)
chunk = list_entry(packet->chunk_list.next, struct sctp_chunk, list);
sk = chunk->skb->sk;

/* check gso */
if (packet->size > tp->pathmtu && !packet->ipfragok && !chunk->pmtu_probe) {
if (!sk_can_gso(sk)) {
pr_err_once("Trying to GSO but underlying device doesn't support it.");
goto out;
if (tp->pl.state == SCTP_PL_ERROR) { /* do IP fragmentation if in Error state */
packet->ipfragok = 1;
} else {
if (!sk_can_gso(sk)) { /* check gso */
pr_err_once("Trying to GSO but underlying device doesn't support it.");
goto out;
}
gso = 1;
}
gso = 1;
}

/* alloc head skb */
Expand Down
11 changes: 6 additions & 5 deletions net/sctp/transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ bool sctp_transport_pl_send(struct sctp_transport *t)
if (t->pl.probe_size == SCTP_BASE_PLPMTU) { /* BASE_PLPMTU Confirmation Failed */
t->pl.state = SCTP_PL_ERROR; /* Base -> Error */

t->pl.pmtu = SCTP_MIN_PLPMTU;
t->pl.pmtu = SCTP_BASE_PLPMTU;
t->pathmtu = t->pl.pmtu + sctp_transport_pl_hlen(t);
sctp_assoc_sync_pmtu(t->asoc);
}
Expand Down Expand Up @@ -366,8 +366,9 @@ static bool sctp_transport_pl_toobig(struct sctp_transport *t, u32 pmtu)
if (pmtu >= SCTP_MIN_PLPMTU && pmtu < SCTP_BASE_PLPMTU) {
t->pl.state = SCTP_PL_ERROR; /* Base -> Error */

t->pl.pmtu = SCTP_MIN_PLPMTU;
t->pl.pmtu = SCTP_BASE_PLPMTU;
t->pathmtu = t->pl.pmtu + sctp_transport_pl_hlen(t);
return true;
}
} else if (t->pl.state == SCTP_PL_SEARCH) {
if (pmtu >= SCTP_BASE_PLPMTU && pmtu < t->pl.pmtu) {
Expand All @@ -378,11 +379,10 @@ static bool sctp_transport_pl_toobig(struct sctp_transport *t, u32 pmtu)
t->pl.probe_high = 0;
t->pl.pmtu = SCTP_BASE_PLPMTU;
t->pathmtu = t->pl.pmtu + sctp_transport_pl_hlen(t);
return true;
} else if (pmtu > t->pl.pmtu && pmtu < t->pl.probe_size) {
t->pl.probe_size = pmtu;
t->pl.probe_count = 0;

return false;
}
} else if (t->pl.state == SCTP_PL_COMPLETE) {
if (pmtu >= SCTP_BASE_PLPMTU && pmtu < t->pl.pmtu) {
Expand All @@ -393,10 +393,11 @@ static bool sctp_transport_pl_toobig(struct sctp_transport *t, u32 pmtu)
t->pl.probe_high = 0;
t->pl.pmtu = SCTP_BASE_PLPMTU;
t->pathmtu = t->pl.pmtu + sctp_transport_pl_hlen(t);
return true;
}
}

return true;
return false;
}

bool sctp_transport_update_pmtu(struct sctp_transport *t, u32 pmtu)
Expand Down
5 changes: 5 additions & 0 deletions tools/testing/selftests/net/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,8 @@ rxtimestamp
timestamping
txtimestamp
so_netns_cookie
test_unix_oob
gro
ioam6_parser
toeplitz
cmsg_so_mark
2 changes: 2 additions & 0 deletions tools/testing/selftests/net/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ TEST_PROGS += veth.sh
TEST_PROGS += ioam6.sh
TEST_PROGS += gro.sh
TEST_PROGS += gre_gso.sh
TEST_PROGS += cmsg_so_mark.sh
TEST_PROGS_EXTENDED := in_netns.sh
TEST_GEN_FILES = socket nettest
TEST_GEN_FILES += psock_fanout psock_tpacket msg_zerocopy reuseport_addr_any
Expand All @@ -45,6 +46,7 @@ TEST_GEN_FILES += gro
TEST_GEN_PROGS = reuseport_bpf reuseport_bpf_cpu reuseport_bpf_numa
TEST_GEN_PROGS += reuseport_dualstack reuseaddr_conflict tls
TEST_GEN_FILES += toeplitz
TEST_GEN_FILES += cmsg_so_mark

TEST_FILES := settings

Expand Down
Loading

0 comments on commit 8a33dcc

Please sign in to comment.