Skip to content

Commit

Permalink
Changes representative of linux-3.10.0-123.20.1.el7.tar.xz
Browse files Browse the repository at this point in the history
  • Loading branch information
da-x committed Dec 21, 2015
1 parent 424c357 commit 7778331
Show file tree
Hide file tree
Showing 37 changed files with 1,002 additions and 310 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ EXTRAVERSION =
NAME = Unicycling Gorilla
RHEL_MAJOR = 7
RHEL_MINOR = 0
RHEL_RELEASE = 123.13.2
RHEL_RELEASE = 123.20.1

# *DOCUMENTATION*
# To see a list of typical targets execute "make help"
Expand Down
11 changes: 9 additions & 2 deletions block/blk-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,7 @@ blk_init_allocated_queue(struct request_queue *q, request_fn_proc *rfn,

q->request_fn = rfn;
q->prep_rq_fn = NULL;
q->unprep_rq_fn = NULL;
q->queue_flags |= QUEUE_FLAG_DEFAULT;

/* Override internal queue lock with supplied lock pointer */
Expand Down Expand Up @@ -2480,12 +2481,18 @@ static bool blk_update_bidi_request(struct request *rq, int error,
* @req: the request
*
* This function makes a request ready for complete resubmission (or
* completion). It happens only after all error handling is complete.
* The queue lock is held when calling this.
* completion). It happens only after all error handling is complete,
* so represents the appropriate moment to deallocate any resources
* that were allocated to the request in the prep_rq_fn. The queue
* lock is held when calling this.
*/
void blk_unprep_request(struct request *req)
{
struct request_queue *q = req->q;

req->cmd_flags &= ~REQ_DONTPREP;
if (q->unprep_rq_fn)
q->unprep_rq_fn(q, req);
}
EXPORT_SYMBOL_GPL(blk_unprep_request);

Expand Down
17 changes: 17 additions & 0 deletions block/blk-settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,23 @@ void blk_queue_prep_rq(struct request_queue *q, prep_rq_fn *pfn)
}
EXPORT_SYMBOL(blk_queue_prep_rq);

/**
* blk_queue_unprep_rq - set an unprepare_request function for queue
* @q: queue
* @ufn: unprepare_request function
*
* It's possible for a queue to register an unprepare_request callback
* which is invoked before the request is finally completed. The goal
* of the function is to deallocate any data that was allocated in the
* prepare_request callback.
*
*/
void blk_queue_unprep_rq(struct request_queue *q, unprep_rq_fn *ufn)
{
q->unprep_rq_fn = ufn;
}
EXPORT_SYMBOL(blk_queue_unprep_rq);

/**
* blk_queue_merge_bvec - set a merge_bvec function for queue
* @q: queue
Expand Down
9 changes: 8 additions & 1 deletion drivers/net/ethernet/mellanox/mlx4/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -829,9 +829,12 @@ static ssize_t set_port_type(struct device *dev,
struct mlx4_priv *priv = mlx4_priv(mdev);
enum mlx4_port_type types[MLX4_MAX_PORTS];
enum mlx4_port_type new_types[MLX4_MAX_PORTS];
static DEFINE_MUTEX(set_port_type_mutex);
int i;
int err = 0;

mutex_lock(&set_port_type_mutex);

if (!strcmp(buf, "ib\n"))
info->tmp_type = MLX4_PORT_TYPE_IB;
else if (!strcmp(buf, "eth\n"))
Expand All @@ -840,7 +843,8 @@ static ssize_t set_port_type(struct device *dev,
info->tmp_type = MLX4_PORT_TYPE_AUTO;
else {
mlx4_err(mdev, "%s is not supported port type\n", buf);
return -EINVAL;
err = -EINVAL;
goto err_out;
}

mlx4_stop_sense(mdev);
Expand Down Expand Up @@ -888,6 +892,9 @@ static ssize_t set_port_type(struct device *dev,
out:
mlx4_start_sense(mdev);
mutex_unlock(&priv->port_mutex);
err_out:
mutex_unlock(&set_port_type_mutex);

return err ? err : count;
}

Expand Down
146 changes: 124 additions & 22 deletions drivers/net/vxlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,6 @@ static inline struct hlist_head *vxlan_fdb_head(struct vxlan_dev *vxlan,
/* Look up Ethernet address in forwarding table */
static struct vxlan_fdb *__vxlan_find_mac(struct vxlan_dev *vxlan,
const u8 *mac)

{
struct hlist_head *head = vxlan_fdb_head(vxlan, mac);
struct vxlan_fdb *f;
Expand Down Expand Up @@ -878,6 +877,9 @@ static int vxlan_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
if (err)
return err;

if (vxlan->default_dst.remote_ip.sa.sa_family != ip.sa.sa_family)
return -EAFNOSUPPORT;

spin_lock_bh(&vxlan->hash_lock);
err = vxlan_fdb_create(vxlan, addr, &ip, ndm->ndm_state, flags,
port, vni, ifindex, ndm->ndm_flags);
Expand Down Expand Up @@ -1124,7 +1126,6 @@ static int vxlan_udp_encap_recv(struct sock *sk, struct sk_buff *skb)
{
struct vxlan_sock *vs;
struct vxlanhdr *vxh;
__be16 port;

/* Need Vxlan and inner Ethernet header to be present */
if (!pskb_may_pull(skb, VXLAN_HLEN))
Expand All @@ -1142,8 +1143,6 @@ static int vxlan_udp_encap_recv(struct sock *sk, struct sk_buff *skb)
if (iptunnel_pull_header(skb, VXLAN_HLEN, htons(ETH_P_TEB)))
goto drop;

port = inet_sk(sk)->inet_sport;

vs = rcu_dereference_sk_user_data(sk);
if (!vs)
goto drop;
Expand Down Expand Up @@ -1311,6 +1310,9 @@ static int arp_reduce(struct net_device *dev, struct sk_buff *skb)

neigh_release(n);

if (reply == NULL)
goto out;

skb_reset_mac_header(reply);
__skb_pull(reply, skb_network_offset(reply));
reply->ip_summed = CHECKSUM_UNNECESSARY;
Expand All @@ -1321,7 +1323,7 @@ static int arp_reduce(struct net_device *dev, struct sk_buff *skb)
} else if (vxlan->flags & VXLAN_F_L3MISS) {
union vxlan_addr ipa = {
.sin.sin_addr.s_addr = tip,
.sa.sa_family = AF_INET,
.sin.sin_family = AF_INET,
};

vxlan_ip_miss(dev, &ipa);
Expand All @@ -1332,15 +1334,103 @@ static int arp_reduce(struct net_device *dev, struct sk_buff *skb)
}

#if IS_ENABLED(CONFIG_IPV6)

static struct sk_buff *vxlan_na_create(struct sk_buff *request,
struct neighbour *n, bool isrouter)
{
struct net_device *dev = request->dev;
struct sk_buff *reply;
struct nd_msg *ns, *na;
struct ipv6hdr *pip6;
u8 *daddr;
int na_olen = 8; /* opt hdr + ETH_ALEN for target */
int ns_olen;
int i, len;

if (dev == NULL)
return NULL;

len = LL_RESERVED_SPACE(dev) + sizeof(struct ipv6hdr) +
sizeof(*na) + na_olen + dev->needed_tailroom;
reply = alloc_skb(len, GFP_ATOMIC);
if (reply == NULL)
return NULL;

reply->protocol = htons(ETH_P_IPV6);
reply->dev = dev;
skb_reserve(reply, LL_RESERVED_SPACE(request->dev));
skb_push(reply, sizeof(struct ethhdr));
skb_set_mac_header(reply, 0);

ns = (struct nd_msg *)skb_transport_header(request);

daddr = eth_hdr(request)->h_source;
ns_olen = request->len - skb_transport_offset(request) - sizeof(*ns);
for (i = 0; i < ns_olen-1; i += (ns->opt[i+1]<<3)) {
if (ns->opt[i] == ND_OPT_SOURCE_LL_ADDR) {
daddr = ns->opt + i + sizeof(struct nd_opt_hdr);
break;
}
}

/* Ethernet header */
ether_addr_copy(eth_hdr(reply)->h_dest, daddr);
ether_addr_copy(eth_hdr(reply)->h_source, n->ha);
eth_hdr(reply)->h_proto = htons(ETH_P_IPV6);
reply->protocol = htons(ETH_P_IPV6);

skb_pull(reply, sizeof(struct ethhdr));
skb_set_network_header(reply, 0);
skb_put(reply, sizeof(struct ipv6hdr));

/* IPv6 header */

pip6 = ipv6_hdr(reply);
memset(pip6, 0, sizeof(struct ipv6hdr));
pip6->version = 6;
pip6->priority = ipv6_hdr(request)->priority;
pip6->nexthdr = IPPROTO_ICMPV6;
pip6->hop_limit = 255;
pip6->daddr = ipv6_hdr(request)->saddr;
pip6->saddr = *(struct in6_addr *)n->primary_key;

skb_pull(reply, sizeof(struct ipv6hdr));
skb_set_transport_header(reply, 0);

na = (struct nd_msg *)skb_put(reply, sizeof(*na) + na_olen);

/* Neighbor Advertisement */
memset(na, 0, sizeof(*na)+na_olen);
na->icmph.icmp6_type = NDISC_NEIGHBOUR_ADVERTISEMENT;
na->icmph.icmp6_router = isrouter;
na->icmph.icmp6_override = 1;
na->icmph.icmp6_solicited = 1;
na->target = ns->target;
ether_addr_copy(&na->opt[2], n->ha);
na->opt[0] = ND_OPT_TARGET_LL_ADDR;
na->opt[1] = na_olen >> 3;

na->icmph.icmp6_cksum = csum_ipv6_magic(&pip6->saddr,
&pip6->daddr, sizeof(*na)+na_olen, IPPROTO_ICMPV6,
csum_partial(na, sizeof(*na)+na_olen, 0));

pip6->payload_len = htons(sizeof(*na)+na_olen);

skb_push(reply, sizeof(struct ipv6hdr));

reply->ip_summed = CHECKSUM_UNNECESSARY;

return reply;
}

static int neigh_reduce(struct net_device *dev, struct sk_buff *skb)
{
struct vxlan_dev *vxlan = netdev_priv(dev);
struct neighbour *n;
union vxlan_addr ipa;
struct nd_msg *msg;
const struct ipv6hdr *iphdr;
const struct in6_addr *saddr, *daddr;
struct nd_msg *msg;
struct inet6_dev *in6_dev = NULL;
struct neighbour *n;
struct inet6_dev *in6_dev;

in6_dev = __in6_dev_get(dev);
if (!in6_dev)
Expand All @@ -1353,19 +1443,20 @@ static int neigh_reduce(struct net_device *dev, struct sk_buff *skb)
saddr = &iphdr->saddr;
daddr = &iphdr->daddr;

if (ipv6_addr_loopback(daddr) ||
ipv6_addr_is_multicast(daddr))
goto out;

msg = (struct nd_msg *)skb_transport_header(skb);
if (msg->icmph.icmp6_code != 0 ||
msg->icmph.icmp6_type != NDISC_NEIGHBOUR_SOLICITATION)
goto out;

n = neigh_lookup(ipv6_stub->nd_tbl, daddr, dev);
if (ipv6_addr_loopback(daddr) ||
ipv6_addr_is_multicast(&msg->target))
goto out;

n = neigh_lookup(ipv6_stub->nd_tbl, &msg->target, dev);

if (n) {
struct vxlan_fdb *f;
struct sk_buff *reply;

if (!(n->nud_state & NUD_CONNECTED)) {
neigh_release(n);
Expand All @@ -1379,13 +1470,23 @@ static int neigh_reduce(struct net_device *dev, struct sk_buff *skb)
goto out;
}

ipv6_stub->ndisc_send_na(dev, n, saddr, &msg->target,
!!in6_dev->cnf.forwarding,
true, false, false);
reply = vxlan_na_create(skb, n,
!!(f ? f->flags & NTF_ROUTER : 0));

neigh_release(n);

if (reply == NULL)
goto out;

if (netif_rx_ni(reply) == NET_RX_DROP)
dev->stats.rx_dropped++;

} else if (vxlan->flags & VXLAN_F_L3MISS) {
ipa.sin6.sin6_addr = *daddr;
ipa.sa.sa_family = AF_INET6;
union vxlan_addr ipa = {
.sin6.sin6_addr = msg->target,
.sin6.sin6_family = AF_INET6,
};

vxlan_ip_miss(dev, &ipa);
}

Expand Down Expand Up @@ -1416,7 +1517,7 @@ static bool route_shortcircuit(struct net_device *dev, struct sk_buff *skb)
if (!n && (vxlan->flags & VXLAN_F_L3MISS)) {
union vxlan_addr ipa = {
.sin.sin_addr.s_addr = pip->daddr,
.sa.sa_family = AF_INET,
.sin.sin_family = AF_INET,
};

vxlan_ip_miss(dev, &ipa);
Expand All @@ -1437,7 +1538,7 @@ static bool route_shortcircuit(struct net_device *dev, struct sk_buff *skb)
if (!n && (vxlan->flags & VXLAN_F_L3MISS)) {
union vxlan_addr ipa = {
.sin6.sin6_addr = pip6->daddr,
.sa.sa_family = AF_INET6,
.sin6.sin6_family = AF_INET6,
};

vxlan_ip_miss(dev, &ipa);
Expand Down Expand Up @@ -2493,9 +2594,10 @@ static int vxlan_newlink(struct net *net, struct net_device *dev,
vni = nla_get_u32(data[IFLA_VXLAN_ID]);
dst->remote_vni = vni;

/* Unless IPv6 is explicitly requested, assume IPv4 */
dst->remote_ip.sa.sa_family = AF_INET;
if (data[IFLA_VXLAN_GROUP]) {
dst->remote_ip.sin.sin_addr.s_addr = nla_get_be32(data[IFLA_VXLAN_GROUP]);
dst->remote_ip.sa.sa_family = AF_INET;
} else if (data[IFLA_VXLAN_GROUP6]) {
if (!IS_ENABLED(CONFIG_IPV6))
return -EPFNOSUPPORT;
Expand Down
Loading

0 comments on commit 7778331

Please sign in to comment.