Commit 0461b766 authored by David S. Miller's avatar David S. Miller

Merge branch 's390-next'

Julian Wiedmann says:

====================
s390/net: updates for 4.14

a mixed bag of minor fixes, cleanups and refactors for net-next. Please apply.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents d396179c cb816192
...@@ -305,7 +305,7 @@ static long ctcm_check_irb_error(struct ccw_device *cdev, struct irb *irb) ...@@ -305,7 +305,7 @@ static long ctcm_check_irb_error(struct ccw_device *cdev, struct irb *irb)
* ch The channel, the sense code belongs to. * ch The channel, the sense code belongs to.
* sense The sense code to inspect. * sense The sense code to inspect.
*/ */
static inline void ccw_unit_check(struct channel *ch, __u8 sense) static void ccw_unit_check(struct channel *ch, __u8 sense)
{ {
CTCM_DBF_TEXT_(TRACE, CTC_DBF_DEBUG, CTCM_DBF_TEXT_(TRACE, CTC_DBF_DEBUG,
"%s(%s): %02x", "%s(%s): %02x",
......
...@@ -327,8 +327,7 @@ lcs_set_allowed_threads(struct lcs_card *card, unsigned long threads) ...@@ -327,8 +327,7 @@ lcs_set_allowed_threads(struct lcs_card *card, unsigned long threads)
spin_unlock_irqrestore(&card->mask_lock, flags); spin_unlock_irqrestore(&card->mask_lock, flags);
wake_up(&card->wait_q); wake_up(&card->wait_q);
} }
static inline int static int lcs_threads_running(struct lcs_card *card, unsigned long threads)
lcs_threads_running(struct lcs_card *card, unsigned long threads)
{ {
unsigned long flags; unsigned long flags;
int rc = 0; int rc = 0;
...@@ -346,8 +345,7 @@ lcs_wait_for_threads(struct lcs_card *card, unsigned long threads) ...@@ -346,8 +345,7 @@ lcs_wait_for_threads(struct lcs_card *card, unsigned long threads)
lcs_threads_running(card, threads) == 0); lcs_threads_running(card, threads) == 0);
} }
static inline int static int lcs_set_thread_start_bit(struct lcs_card *card, unsigned long thread)
lcs_set_thread_start_bit(struct lcs_card *card, unsigned long thread)
{ {
unsigned long flags; unsigned long flags;
...@@ -373,8 +371,7 @@ lcs_clear_thread_running_bit(struct lcs_card *card, unsigned long thread) ...@@ -373,8 +371,7 @@ lcs_clear_thread_running_bit(struct lcs_card *card, unsigned long thread)
wake_up(&card->wait_q); wake_up(&card->wait_q);
} }
static inline int static int __lcs_do_run_thread(struct lcs_card *card, unsigned long thread)
__lcs_do_run_thread(struct lcs_card *card, unsigned long thread)
{ {
unsigned long flags; unsigned long flags;
int rc = 0; int rc = 0;
...@@ -444,8 +441,7 @@ lcs_setup_card(struct lcs_card *card) ...@@ -444,8 +441,7 @@ lcs_setup_card(struct lcs_card *card)
INIT_LIST_HEAD(&card->lancmd_waiters); INIT_LIST_HEAD(&card->lancmd_waiters);
} }
static inline void static void lcs_clear_multicast_list(struct lcs_card *card)
lcs_clear_multicast_list(struct lcs_card *card)
{ {
#ifdef CONFIG_IP_MULTICAST #ifdef CONFIG_IP_MULTICAST
struct lcs_ipm_list *ipm; struct lcs_ipm_list *ipm;
...@@ -656,8 +652,7 @@ __lcs_resume_channel(struct lcs_channel *channel) ...@@ -656,8 +652,7 @@ __lcs_resume_channel(struct lcs_channel *channel)
/** /**
* Make a buffer ready for processing. * Make a buffer ready for processing.
*/ */
static inline void static void __lcs_ready_buffer_bits(struct lcs_channel *channel, int index)
__lcs_ready_buffer_bits(struct lcs_channel *channel, int index)
{ {
int prev, next; int prev, next;
...@@ -1169,8 +1164,8 @@ lcs_get_mac_for_ipm(__be32 ipm, char *mac, struct net_device *dev) ...@@ -1169,8 +1164,8 @@ lcs_get_mac_for_ipm(__be32 ipm, char *mac, struct net_device *dev)
/** /**
* function called by net device to handle multicast address relevant things * function called by net device to handle multicast address relevant things
*/ */
static inline void static void lcs_remove_mc_addresses(struct lcs_card *card,
lcs_remove_mc_addresses(struct lcs_card *card, struct in_device *in4_dev) struct in_device *in4_dev)
{ {
struct ip_mc_list *im4; struct ip_mc_list *im4;
struct list_head *l; struct list_head *l;
...@@ -1196,8 +1191,9 @@ lcs_remove_mc_addresses(struct lcs_card *card, struct in_device *in4_dev) ...@@ -1196,8 +1191,9 @@ lcs_remove_mc_addresses(struct lcs_card *card, struct in_device *in4_dev)
spin_unlock_irqrestore(&card->ipm_lock, flags); spin_unlock_irqrestore(&card->ipm_lock, flags);
} }
static inline struct lcs_ipm_list * static struct lcs_ipm_list *lcs_check_addr_entry(struct lcs_card *card,
lcs_check_addr_entry(struct lcs_card *card, struct ip_mc_list *im4, char *buf) struct ip_mc_list *im4,
char *buf)
{ {
struct lcs_ipm_list *tmp, *ipm = NULL; struct lcs_ipm_list *tmp, *ipm = NULL;
struct list_head *l; struct list_head *l;
...@@ -1218,8 +1214,8 @@ lcs_check_addr_entry(struct lcs_card *card, struct ip_mc_list *im4, char *buf) ...@@ -1218,8 +1214,8 @@ lcs_check_addr_entry(struct lcs_card *card, struct ip_mc_list *im4, char *buf)
return ipm; return ipm;
} }
static inline void static void lcs_set_mc_addresses(struct lcs_card *card,
lcs_set_mc_addresses(struct lcs_card *card, struct in_device *in4_dev) struct in_device *in4_dev)
{ {
struct ip_mc_list *im4; struct ip_mc_list *im4;
......
...@@ -249,14 +249,14 @@ struct ll_header { ...@@ -249,14 +249,14 @@ struct ll_header {
* Compatibility macros for busy handling * Compatibility macros for busy handling
* of network devices. * of network devices.
*/ */
static inline void netiucv_clear_busy(struct net_device *dev) static void netiucv_clear_busy(struct net_device *dev)
{ {
struct netiucv_priv *priv = netdev_priv(dev); struct netiucv_priv *priv = netdev_priv(dev);
clear_bit(0, &priv->tbusy); clear_bit(0, &priv->tbusy);
netif_wake_queue(dev); netif_wake_queue(dev);
} }
static inline int netiucv_test_and_set_busy(struct net_device *dev) static int netiucv_test_and_set_busy(struct net_device *dev)
{ {
struct netiucv_priv *priv = netdev_priv(dev); struct netiucv_priv *priv = netdev_priv(dev);
netif_stop_queue(dev); netif_stop_queue(dev);
......
...@@ -857,11 +857,6 @@ static inline int qeth_get_ip_version(struct sk_buff *skb) ...@@ -857,11 +857,6 @@ static inline int qeth_get_ip_version(struct sk_buff *skb)
} }
} }
static inline int qeth_get_ip_protocol(struct sk_buff *skb)
{
return ip_hdr(skb)->protocol;
}
static inline void qeth_put_buffer_pool_entry(struct qeth_card *card, static inline void qeth_put_buffer_pool_entry(struct qeth_card *card,
struct qeth_buffer_pool_entry *entry) struct qeth_buffer_pool_entry *entry)
{ {
...@@ -951,8 +946,10 @@ int qeth_get_priority_queue(struct qeth_card *, struct sk_buff *, int, int); ...@@ -951,8 +946,10 @@ int qeth_get_priority_queue(struct qeth_card *, struct sk_buff *, int, int);
int qeth_get_elements_no(struct qeth_card *card, struct sk_buff *skb, int qeth_get_elements_no(struct qeth_card *card, struct sk_buff *skb,
int extra_elems, int data_offset); int extra_elems, int data_offset);
int qeth_get_elements_for_frags(struct sk_buff *); int qeth_get_elements_for_frags(struct sk_buff *);
int qeth_do_send_packet_fast(struct qeth_card *, struct qeth_qdio_out_q *, int qeth_do_send_packet_fast(struct qeth_card *card,
struct sk_buff *, struct qeth_hdr *, int, int); struct qeth_qdio_out_q *queue, struct sk_buff *skb,
struct qeth_hdr *hdr, unsigned int offset,
int hd_len);
int qeth_do_send_packet(struct qeth_card *, struct qeth_qdio_out_q *, int qeth_do_send_packet(struct qeth_card *, struct qeth_qdio_out_q *,
struct sk_buff *, struct qeth_hdr *, int); struct sk_buff *, struct qeth_hdr *, int);
int qeth_do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); int qeth_do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
......
This diff is collapsed.
...@@ -78,7 +78,7 @@ static ssize_t qeth_dev_card_type_show(struct device *dev, ...@@ -78,7 +78,7 @@ static ssize_t qeth_dev_card_type_show(struct device *dev,
static DEVICE_ATTR(card_type, 0444, qeth_dev_card_type_show, NULL); static DEVICE_ATTR(card_type, 0444, qeth_dev_card_type_show, NULL);
static inline const char *qeth_get_bufsize_str(struct qeth_card *card) static const char *qeth_get_bufsize_str(struct qeth_card *card)
{ {
if (card->qdio.in_buf_size == 16384) if (card->qdio.in_buf_size == 16384)
return "16k"; return "16k";
......
...@@ -231,13 +231,7 @@ static void qeth_l2_del_all_macs(struct qeth_card *card) ...@@ -231,13 +231,7 @@ static void qeth_l2_del_all_macs(struct qeth_card *card)
spin_unlock_bh(&card->mclock); spin_unlock_bh(&card->mclock);
} }
static inline u32 qeth_l2_mac_hash(const u8 *addr) static int qeth_l2_get_cast_type(struct qeth_card *card, struct sk_buff *skb)
{
return get_unaligned((u32 *)(&addr[2]));
}
static inline int qeth_l2_get_cast_type(struct qeth_card *card,
struct sk_buff *skb)
{ {
if (card->info.type == QETH_CARD_TYPE_OSN) if (card->info.type == QETH_CARD_TYPE_OSN)
return RTN_UNSPEC; return RTN_UNSPEC;
...@@ -248,8 +242,8 @@ static inline int qeth_l2_get_cast_type(struct qeth_card *card, ...@@ -248,8 +242,8 @@ static inline int qeth_l2_get_cast_type(struct qeth_card *card,
return RTN_UNSPEC; return RTN_UNSPEC;
} }
static inline void qeth_l2_hdr_csum(struct qeth_card *card, static void qeth_l2_hdr_csum(struct qeth_card *card, struct qeth_hdr *hdr,
struct qeth_hdr *hdr, struct sk_buff *skb) struct sk_buff *skb)
{ {
struct iphdr *iph = ip_hdr(skb); struct iphdr *iph = ip_hdr(skb);
...@@ -519,15 +513,6 @@ static int qeth_l2_request_initial_mac(struct qeth_card *card) ...@@ -519,15 +513,6 @@ static int qeth_l2_request_initial_mac(struct qeth_card *card)
/* fall back to alternative mechanism: */ /* fall back to alternative mechanism: */
} }
if (qeth_is_supported(card, IPA_SETADAPTERPARMS)) {
rc = qeth_query_setadapterparms(card);
if (rc) {
QETH_DBF_MESSAGE(2, "could not query adapter "
"parameters on device %s: x%x\n",
CARD_BUS_ID(card), rc);
}
}
if (card->info.type == QETH_CARD_TYPE_IQD || if (card->info.type == QETH_CARD_TYPE_IQD ||
card->info.type == QETH_CARD_TYPE_OSM || card->info.type == QETH_CARD_TYPE_OSM ||
card->info.type == QETH_CARD_TYPE_OSX || card->info.type == QETH_CARD_TYPE_OSX ||
...@@ -615,13 +600,13 @@ static void qeth_promisc_to_bridge(struct qeth_card *card) ...@@ -615,13 +600,13 @@ static void qeth_promisc_to_bridge(struct qeth_card *card)
* only if there is not in the hash table storage already * only if there is not in the hash table storage already
* *
*/ */
static void static void qeth_l2_add_mac(struct qeth_card *card, struct netdev_hw_addr *ha,
qeth_l2_add_mac(struct qeth_card *card, struct netdev_hw_addr *ha, u8 is_uc) u8 is_uc)
{ {
u32 mac_hash = get_unaligned((u32 *)(&ha->addr[2]));
struct qeth_mac *mac; struct qeth_mac *mac;
hash_for_each_possible(card->mac_htable, mac, hnode, hash_for_each_possible(card->mac_htable, mac, hnode, mac_hash) {
qeth_l2_mac_hash(ha->addr)) {
if (is_uc == mac->is_uc && if (is_uc == mac->is_uc &&
!memcmp(ha->addr, mac->mac_addr, OSA_ADDR_LEN)) { !memcmp(ha->addr, mac->mac_addr, OSA_ADDR_LEN)) {
mac->disp_flag = QETH_DISP_ADDR_DO_NOTHING; mac->disp_flag = QETH_DISP_ADDR_DO_NOTHING;
...@@ -638,9 +623,7 @@ qeth_l2_add_mac(struct qeth_card *card, struct netdev_hw_addr *ha, u8 is_uc) ...@@ -638,9 +623,7 @@ qeth_l2_add_mac(struct qeth_card *card, struct netdev_hw_addr *ha, u8 is_uc)
mac->is_uc = is_uc; mac->is_uc = is_uc;
mac->disp_flag = QETH_DISP_ADDR_ADD; mac->disp_flag = QETH_DISP_ADDR_ADD;
hash_add(card->mac_htable, &mac->hnode, hash_add(card->mac_htable, &mac->hnode, mac_hash);
qeth_l2_mac_hash(mac->mac_addr));
} }
static void qeth_l2_set_rx_mode(struct net_device *dev) static void qeth_l2_set_rx_mode(struct net_device *dev)
...@@ -707,7 +690,7 @@ static netdev_tx_t qeth_l2_hard_start_xmit(struct sk_buff *skb, ...@@ -707,7 +690,7 @@ static netdev_tx_t qeth_l2_hard_start_xmit(struct sk_buff *skb,
int data_offset = -1; int data_offset = -1;
int elements_needed = 0; int elements_needed = 0;
int hd_len = 0; int hd_len = 0;
int nr_frags; unsigned int nr_frags;
if (card->qdio.do_prio_queueing || (cast_type && if (card->qdio.do_prio_queueing || (cast_type &&
card->info.is_multicast_different)) card->info.is_multicast_different))
...@@ -747,6 +730,7 @@ static netdev_tx_t qeth_l2_hard_start_xmit(struct sk_buff *skb, ...@@ -747,6 +730,7 @@ static netdev_tx_t qeth_l2_hard_start_xmit(struct sk_buff *skb,
if (lin_rc) if (lin_rc)
goto tx_drop; goto tx_drop;
} }
nr_frags = skb_shinfo(new_skb)->nr_frags;
if (card->info.type == QETH_CARD_TYPE_OSN) if (card->info.type == QETH_CARD_TYPE_OSN)
hdr = (struct qeth_hdr *)skb->data; hdr = (struct qeth_hdr *)skb->data;
...@@ -760,11 +744,11 @@ static netdev_tx_t qeth_l2_hard_start_xmit(struct sk_buff *skb, ...@@ -760,11 +744,11 @@ static netdev_tx_t qeth_l2_hard_start_xmit(struct sk_buff *skb,
if (!hdr) if (!hdr)
goto tx_drop; goto tx_drop;
elements_needed++; elements_needed++;
skb_reset_mac_header(new_skb);
qeth_l2_fill_header(card, hdr, new_skb, cast_type); qeth_l2_fill_header(card, hdr, new_skb, cast_type);
hdr->hdr.l2.pkt_length = new_skb->len; hdr->hdr.l2.pkt_length = new_skb->len;
memcpy(((char *)hdr) + sizeof(struct qeth_hdr), skb_copy_from_linear_data(new_skb,
skb_mac_header(new_skb), ETH_HLEN); ((char *)hdr) + sizeof(*hdr),
ETH_HLEN);
} else { } else {
/* create a clone with writeable headroom */ /* create a clone with writeable headroom */
new_skb = skb_realloc_headroom(skb, new_skb = skb_realloc_headroom(skb,
...@@ -772,7 +756,6 @@ static netdev_tx_t qeth_l2_hard_start_xmit(struct sk_buff *skb, ...@@ -772,7 +756,6 @@ static netdev_tx_t qeth_l2_hard_start_xmit(struct sk_buff *skb,
if (!new_skb) if (!new_skb)
goto tx_drop; goto tx_drop;
hdr = skb_push(new_skb, sizeof(struct qeth_hdr)); hdr = skb_push(new_skb, sizeof(struct qeth_hdr));
skb_set_mac_header(new_skb, sizeof(struct qeth_hdr));
qeth_l2_fill_header(card, hdr, new_skb, cast_type); qeth_l2_fill_header(card, hdr, new_skb, cast_type);
if (new_skb->ip_summed == CHECKSUM_PARTIAL) if (new_skb->ip_summed == CHECKSUM_PARTIAL)
qeth_l2_hdr_csum(card, hdr, new_skb); qeth_l2_hdr_csum(card, hdr, new_skb);
...@@ -799,13 +782,10 @@ static netdev_tx_t qeth_l2_hard_start_xmit(struct sk_buff *skb, ...@@ -799,13 +782,10 @@ static netdev_tx_t qeth_l2_hard_start_xmit(struct sk_buff *skb,
if (!rc) { if (!rc) {
card->stats.tx_packets++; card->stats.tx_packets++;
card->stats.tx_bytes += tx_bytes; card->stats.tx_bytes += tx_bytes;
if (card->options.performance_stats) { if (card->options.performance_stats && nr_frags) {
nr_frags = skb_shinfo(new_skb)->nr_frags; card->perf_stats.sg_skbs_sent++;
if (nr_frags) { /* nr_frags + skb->data */
card->perf_stats.sg_skbs_sent++; card->perf_stats.sg_frags_sent += nr_frags + 1;
/* nr_frags + skb->data */
card->perf_stats.sg_frags_sent += nr_frags + 1;
}
} }
if (new_skb != skb) if (new_skb != skb)
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
...@@ -1744,11 +1724,26 @@ static int qeth_bridgeport_makerc(struct qeth_card *card, ...@@ -1744,11 +1724,26 @@ static int qeth_bridgeport_makerc(struct qeth_card *card,
return rc; return rc;
} }
static inline int ipa_cmd_sbp(struct qeth_card *card) static struct qeth_cmd_buffer *qeth_sbp_build_cmd(struct qeth_card *card,
enum qeth_ipa_sbp_cmd sbp_cmd,
unsigned int cmd_length)
{ {
return (card->info.type == QETH_CARD_TYPE_IQD) ? enum qeth_ipa_cmds ipa_cmd = (card->info.type == QETH_CARD_TYPE_IQD) ?
IPA_CMD_SETBRIDGEPORT_IQD : IPA_CMD_SETBRIDGEPORT_IQD :
IPA_CMD_SETBRIDGEPORT_OSA; IPA_CMD_SETBRIDGEPORT_OSA;
struct qeth_cmd_buffer *iob;
struct qeth_ipa_cmd *cmd;
iob = qeth_get_ipacmd_buffer(card, ipa_cmd, 0);
if (!iob)
return iob;
cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE);
cmd->data.sbp.hdr.cmdlength = sizeof(struct qeth_ipacmd_sbp_hdr) +
cmd_length;
cmd->data.sbp.hdr.command_code = sbp_cmd;
cmd->data.sbp.hdr.used_total = 1;
cmd->data.sbp.hdr.seq_no = 1;
return iob;
} }
static int qeth_bridgeport_query_support_cb(struct qeth_card *card, static int qeth_bridgeport_query_support_cb(struct qeth_card *card,
...@@ -1778,21 +1773,13 @@ static int qeth_bridgeport_query_support_cb(struct qeth_card *card, ...@@ -1778,21 +1773,13 @@ static int qeth_bridgeport_query_support_cb(struct qeth_card *card,
static void qeth_bridgeport_query_support(struct qeth_card *card) static void qeth_bridgeport_query_support(struct qeth_card *card)
{ {
struct qeth_cmd_buffer *iob; struct qeth_cmd_buffer *iob;
struct qeth_ipa_cmd *cmd;
struct _qeth_sbp_cbctl cbctl; struct _qeth_sbp_cbctl cbctl;
QETH_CARD_TEXT(card, 2, "brqsuppo"); QETH_CARD_TEXT(card, 2, "brqsuppo");
iob = qeth_get_ipacmd_buffer(card, ipa_cmd_sbp(card), 0); iob = qeth_sbp_build_cmd(card, IPA_SBP_QUERY_COMMANDS_SUPPORTED,
sizeof(struct qeth_sbp_query_cmds_supp));
if (!iob) if (!iob)
return; return;
cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE);
cmd->data.sbp.hdr.cmdlength =
sizeof(struct qeth_ipacmd_sbp_hdr) +
sizeof(struct qeth_sbp_query_cmds_supp);
cmd->data.sbp.hdr.command_code =
IPA_SBP_QUERY_COMMANDS_SUPPORTED;
cmd->data.sbp.hdr.used_total = 1;
cmd->data.sbp.hdr.seq_no = 1;
if (qeth_send_ipa_cmd(card, iob, qeth_bridgeport_query_support_cb, if (qeth_send_ipa_cmd(card, iob, qeth_bridgeport_query_support_cb,
(void *)&cbctl) || (void *)&cbctl) ||
qeth_bridgeport_makerc(card, &cbctl, qeth_bridgeport_makerc(card, &cbctl,
...@@ -1846,7 +1833,6 @@ int qeth_bridgeport_query_ports(struct qeth_card *card, ...@@ -1846,7 +1833,6 @@ int qeth_bridgeport_query_ports(struct qeth_card *card,
{ {
int rc = 0; int rc = 0;
struct qeth_cmd_buffer *iob; struct qeth_cmd_buffer *iob;
struct qeth_ipa_cmd *cmd;
struct _qeth_sbp_cbctl cbctl = { struct _qeth_sbp_cbctl cbctl = {
.data = { .data = {
.qports = { .qports = {
...@@ -1859,16 +1845,9 @@ int qeth_bridgeport_query_ports(struct qeth_card *card, ...@@ -1859,16 +1845,9 @@ int qeth_bridgeport_query_ports(struct qeth_card *card,
QETH_CARD_TEXT(card, 2, "brqports"); QETH_CARD_TEXT(card, 2, "brqports");
if (!(card->options.sbp.supported_funcs & IPA_SBP_QUERY_BRIDGE_PORTS)) if (!(card->options.sbp.supported_funcs & IPA_SBP_QUERY_BRIDGE_PORTS))
return -EOPNOTSUPP; return -EOPNOTSUPP;
iob = qeth_get_ipacmd_buffer(card, ipa_cmd_sbp(card), 0); iob = qeth_sbp_build_cmd(card, IPA_SBP_QUERY_BRIDGE_PORTS, 0);
if (!iob) if (!iob)
return -ENOMEM; return -ENOMEM;
cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE);
cmd->data.sbp.hdr.cmdlength =
sizeof(struct qeth_ipacmd_sbp_hdr);
cmd->data.sbp.hdr.command_code =
IPA_SBP_QUERY_BRIDGE_PORTS;
cmd->data.sbp.hdr.used_total = 1;
cmd->data.sbp.hdr.seq_no = 1;
rc = qeth_send_ipa_cmd(card, iob, qeth_bridgeport_query_ports_cb, rc = qeth_send_ipa_cmd(card, iob, qeth_bridgeport_query_ports_cb,
(void *)&cbctl); (void *)&cbctl);
if (rc < 0) if (rc < 0)
...@@ -1900,7 +1879,6 @@ int qeth_bridgeport_setrole(struct qeth_card *card, enum qeth_sbp_roles role) ...@@ -1900,7 +1879,6 @@ int qeth_bridgeport_setrole(struct qeth_card *card, enum qeth_sbp_roles role)
int rc = 0; int rc = 0;
int cmdlength; int cmdlength;
struct qeth_cmd_buffer *iob; struct qeth_cmd_buffer *iob;
struct qeth_ipa_cmd *cmd;
struct _qeth_sbp_cbctl cbctl; struct _qeth_sbp_cbctl cbctl;
enum qeth_ipa_sbp_cmd setcmd; enum qeth_ipa_sbp_cmd setcmd;
...@@ -1908,32 +1886,24 @@ int qeth_bridgeport_setrole(struct qeth_card *card, enum qeth_sbp_roles role) ...@@ -1908,32 +1886,24 @@ int qeth_bridgeport_setrole(struct qeth_card *card, enum qeth_sbp_roles role)
switch (role) { switch (role) {
case QETH_SBP_ROLE_NONE: case QETH_SBP_ROLE_NONE:
setcmd = IPA_SBP_RESET_BRIDGE_PORT_ROLE; setcmd = IPA_SBP_RESET_BRIDGE_PORT_ROLE;
cmdlength = sizeof(struct qeth_ipacmd_sbp_hdr) + cmdlength = sizeof(struct qeth_sbp_reset_role);
sizeof(struct qeth_sbp_reset_role);
break; break;
case QETH_SBP_ROLE_PRIMARY: case QETH_SBP_ROLE_PRIMARY:
setcmd = IPA_SBP_SET_PRIMARY_BRIDGE_PORT; setcmd = IPA_SBP_SET_PRIMARY_BRIDGE_PORT;
cmdlength = sizeof(struct qeth_ipacmd_sbp_hdr) + cmdlength = sizeof(struct qeth_sbp_set_primary);
sizeof(struct qeth_sbp_set_primary);
break; break;
case QETH_SBP_ROLE_SECONDARY: case QETH_SBP_ROLE_SECONDARY:
setcmd = IPA_SBP_SET_SECONDARY_BRIDGE_PORT; setcmd = IPA_SBP_SET_SECONDARY_BRIDGE_PORT;
cmdlength = sizeof(struct qeth_ipacmd_sbp_hdr) + cmdlength = sizeof(struct qeth_sbp_set_secondary);
sizeof(struct qeth_sbp_set_secondary);
break; break;
default: default:
return -EINVAL; return -EINVAL;
} }
if (!(card->options.sbp.supported_funcs & setcmd)) if (!(card->options.sbp.supported_funcs & setcmd))
return -EOPNOTSUPP; return -EOPNOTSUPP;
iob = qeth_get_ipacmd_buffer(card, ipa_cmd_sbp(card), 0); iob = qeth_sbp_build_cmd(card, setcmd, cmdlength);
if (!iob) if (!iob)
return -ENOMEM; return -ENOMEM;
cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE);
cmd->data.sbp.hdr.cmdlength = cmdlength;
cmd->data.sbp.hdr.command_code = setcmd;
cmd->data.sbp.hdr.used_total = 1;
cmd->data.sbp.hdr.seq_no = 1;
rc = qeth_send_ipa_cmd(card, iob, qeth_bridgeport_set_cb, rc = qeth_send_ipa_cmd(card, iob, qeth_bridgeport_set_cb,
(void *)&cbctl); (void *)&cbctl);
if (rc < 0) if (rc < 0)
......
...@@ -247,7 +247,8 @@ int qeth_l3_delete_ip(struct qeth_card *card, struct qeth_ipaddr *tmp_addr) ...@@ -247,7 +247,8 @@ int qeth_l3_delete_ip(struct qeth_card *card, struct qeth_ipaddr *tmp_addr)
return -ENOENT; return -ENOENT;
addr->ref_counter--; addr->ref_counter--;
if (addr->type == QETH_IP_TYPE_NORMAL && addr->ref_counter > 0) if (addr->ref_counter > 0 && (addr->type == QETH_IP_TYPE_NORMAL ||
addr->type == QETH_IP_TYPE_RXIP))
return rc; return rc;
if (addr->in_progress) if (addr->in_progress)
return -EINPROGRESS; return -EINPROGRESS;
...@@ -329,8 +330,9 @@ int qeth_l3_add_ip(struct qeth_card *card, struct qeth_ipaddr *tmp_addr) ...@@ -329,8 +330,9 @@ int qeth_l3_add_ip(struct qeth_card *card, struct qeth_ipaddr *tmp_addr)
kfree(addr); kfree(addr);
} }
} else { } else {
if (addr->type == QETH_IP_TYPE_NORMAL) if (addr->type == QETH_IP_TYPE_NORMAL ||
addr->ref_counter++; addr->type == QETH_IP_TYPE_RXIP)
addr->ref_counter++;
} }
return rc; return rc;
...@@ -784,11 +786,11 @@ void qeth_l3_del_rxip(struct qeth_card *card, enum qeth_prot_versions proto, ...@@ -784,11 +786,11 @@ void qeth_l3_del_rxip(struct qeth_card *card, enum qeth_prot_versions proto,
ipaddr = qeth_l3_get_addr_buffer(proto); ipaddr = qeth_l3_get_addr_buffer(proto);
if (ipaddr) { if (ipaddr) {
if (proto == QETH_PROT_IPV4) { if (proto == QETH_PROT_IPV4) {
QETH_CARD_TEXT(card, 2, "addrxip4"); QETH_CARD_TEXT(card, 2, "delrxip4");
memcpy(&ipaddr->u.a4.addr, addr, 4); memcpy(&ipaddr->u.a4.addr, addr, 4);
ipaddr->u.a4.mask = 0; ipaddr->u.a4.mask = 0;
} else if (proto == QETH_PROT_IPV6) { } else if (proto == QETH_PROT_IPV6) {
QETH_CARD_TEXT(card, 2, "addrxip6"); QETH_CARD_TEXT(card, 2, "delrxip6");
memcpy(&ipaddr->u.a6.addr, addr, 16); memcpy(&ipaddr->u.a6.addr, addr, 16);
ipaddr->u.a6.pfxlen = 0; ipaddr->u.a6.pfxlen = 0;
} }
...@@ -867,7 +869,7 @@ static int qeth_l3_deregister_addr_entry(struct qeth_card *card, ...@@ -867,7 +869,7 @@ static int qeth_l3_deregister_addr_entry(struct qeth_card *card,
return rc; return rc;
} }
static inline u8 qeth_l3_get_qeth_hdr_flags4(int cast_type) static u8 qeth_l3_get_qeth_hdr_flags4(int cast_type)
{ {
if (cast_type == RTN_MULTICAST) if (cast_type == RTN_MULTICAST)
return QETH_CAST_MULTICAST; return QETH_CAST_MULTICAST;
...@@ -876,7 +878,7 @@ static inline u8 qeth_l3_get_qeth_hdr_flags4(int cast_type) ...@@ -876,7 +878,7 @@ static inline u8 qeth_l3_get_qeth_hdr_flags4(int cast_type)
return QETH_CAST_UNICAST; return QETH_CAST_UNICAST;
} }
static inline u8 qeth_l3_get_qeth_hdr_flags6(int cast_type) static u8 qeth_l3_get_qeth_hdr_flags6(int cast_type)
{ {
u8 ct = QETH_HDR_PASSTHRU | QETH_HDR_IPV6; u8 ct = QETH_HDR_PASSTHRU | QETH_HDR_IPV6;
if (cast_type == RTN_MULTICAST) if (cast_type == RTN_MULTICAST)
...@@ -890,22 +892,10 @@ static inline u8 qeth_l3_get_qeth_hdr_flags6(int cast_type) ...@@ -890,22 +892,10 @@ static inline u8 qeth_l3_get_qeth_hdr_flags6(int cast_type)
static int qeth_l3_setadapter_parms(struct qeth_card *card) static int qeth_l3_setadapter_parms(struct qeth_card *card)
{ {
int rc; int rc = 0;
QETH_DBF_TEXT(SETUP, 2, "setadprm"); QETH_DBF_TEXT(SETUP, 2, "setadprm");
if (!qeth_is_supported(card, IPA_SETADAPTERPARMS)) {
dev_info(&card->gdev->dev,
"set adapter parameters not supported.\n");
QETH_DBF_TEXT(SETUP, 2, " notsupp");
return 0;
}
rc = qeth_query_setadapterparms(card);
if (rc) {
QETH_DBF_MESSAGE(2, "%s couldn't set adapter parameters: "
"0x%x\n", dev_name(&card->gdev->dev), rc);
return rc;
}
if (qeth_adp_supported(card, IPA_SETADP_ALTER_MAC_ADDRESS)) { if (qeth_adp_supported(card, IPA_SETADP_ALTER_MAC_ADDRESS)) {
rc = qeth_setadpparms_change_macaddr(card); rc = qeth_setadpparms_change_macaddr(card);
if (rc) if (rc)
...@@ -1656,9 +1646,8 @@ static int qeth_l3_vlan_rx_kill_vid(struct net_device *dev, ...@@ -1656,9 +1646,8 @@ static int qeth_l3_vlan_rx_kill_vid(struct net_device *dev,
return 0; return 0;
} }
static inline int qeth_l3_rebuild_skb(struct qeth_card *card, static int qeth_l3_rebuild_skb(struct qeth_card *card, struct sk_buff *skb,
struct sk_buff *skb, struct qeth_hdr *hdr, struct qeth_hdr *hdr, unsigned short *vlan_id)
unsigned short *vlan_id)
{ {
__u16 prot; __u16 prot;
struct iphdr *ip_hdr; struct iphdr *ip_hdr;
...@@ -2408,7 +2397,7 @@ static int qeth_l3_do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) ...@@ -2408,7 +2397,7 @@ static int qeth_l3_do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
return rc; return rc;
} }
inline int qeth_l3_get_cast_type(struct qeth_card *card, struct sk_buff *skb) static int qeth_l3_get_cast_type(struct qeth_card *card, struct sk_buff *skb)
{ {
int cast_type = RTN_UNSPEC; int cast_type = RTN_UNSPEC;
struct neighbour *n = NULL; struct neighbour *n = NULL;
...@@ -2546,8 +2535,8 @@ static void qeth_l3_fill_header(struct qeth_card *card, struct qeth_hdr *hdr, ...@@ -2546,8 +2535,8 @@ static void qeth_l3_fill_header(struct qeth_card *card, struct qeth_hdr *hdr,
rcu_read_unlock(); rcu_read_unlock();
} }
static inline void qeth_l3_hdr_csum(struct qeth_card *card, static void qeth_l3_hdr_csum(struct qeth_card *card, struct qeth_hdr *hdr,
struct qeth_hdr *hdr, struct sk_buff *skb) struct sk_buff *skb)
{ {
struct iphdr *iph = ip_hdr(skb); struct iphdr *iph = ip_hdr(skb);
...@@ -2582,7 +2571,7 @@ static void qeth_tso_fill_header(struct qeth_card *card, ...@@ -2582,7 +2571,7 @@ static void qeth_tso_fill_header(struct qeth_card *card,
hdr->ext.hdr_len = 28; hdr->ext.hdr_len = 28;
/*insert non-fix values */ /*insert non-fix values */
hdr->ext.mss = skb_shinfo(skb)->gso_size; hdr->ext.mss = skb_shinfo(skb)->gso_size;
hdr->ext.dg_hdr_len = (__u16)(iph->ihl*4 + tcph->doff*4); hdr->ext.dg_hdr_len = (__u16)(ip_hdrlen(skb) + tcp_hdrlen(skb));
hdr->ext.payload_len = (__u16)(skb->len - hdr->ext.dg_hdr_len - hdr->ext.payload_len = (__u16)(skb->len - hdr->ext.dg_hdr_len -
sizeof(struct qeth_hdr_tso)); sizeof(struct qeth_hdr_tso));
tcph->check = 0; tcph->check = 0;
...@@ -2650,7 +2639,7 @@ static netdev_tx_t qeth_l3_hard_start_xmit(struct sk_buff *skb, ...@@ -2650,7 +2639,7 @@ static netdev_tx_t qeth_l3_hard_start_xmit(struct sk_buff *skb,
int tx_bytes = skb->len; int tx_bytes = skb->len;
bool use_tso; bool use_tso;
int data_offset = -1; int data_offset = -1;
int nr_frags; unsigned int nr_frags;
if (((card->info.type == QETH_CARD_TYPE_IQD) && if (((card->info.type == QETH_CARD_TYPE_IQD) &&
(((card->options.cq != QETH_CQ_ENABLED) && !ipv) || (((card->options.cq != QETH_CQ_ENABLED) && !ipv) ||
...@@ -2675,7 +2664,7 @@ static netdev_tx_t qeth_l3_hard_start_xmit(struct sk_buff *skb, ...@@ -2675,7 +2664,7 @@ static netdev_tx_t qeth_l3_hard_start_xmit(struct sk_buff *skb,
/* Ignore segment size from skb_is_gso(), 1 page is always used. */ /* Ignore segment size from skb_is_gso(), 1 page is always used. */
use_tso = skb_is_gso(skb) && use_tso = skb_is_gso(skb) &&
(qeth_get_ip_protocol(skb) == IPPROTO_TCP) && (ipv == 4); (skb_shinfo(skb)->gso_type & SKB_GSO_TCPV4);
if (card->info.type == QETH_CARD_TYPE_IQD) { if (card->info.type == QETH_CARD_TYPE_IQD) {
new_skb = skb; new_skb = skb;
...@@ -2727,6 +2716,7 @@ static netdev_tx_t qeth_l3_hard_start_xmit(struct sk_buff *skb, ...@@ -2727,6 +2716,7 @@ static netdev_tx_t qeth_l3_hard_start_xmit(struct sk_buff *skb,
if (lin_rc) if (lin_rc)
goto tx_drop; goto tx_drop;
} }
nr_frags = skb_shinfo(new_skb)->nr_frags;
if (use_tso) { if (use_tso) {
hdr = skb_push(new_skb, sizeof(struct qeth_hdr_tso)); hdr = skb_push(new_skb, sizeof(struct qeth_hdr_tso));
...@@ -2786,7 +2776,6 @@ static netdev_tx_t qeth_l3_hard_start_xmit(struct sk_buff *skb, ...@@ -2786,7 +2776,6 @@ static netdev_tx_t qeth_l3_hard_start_xmit(struct sk_buff *skb,
if (new_skb != skb) if (new_skb != skb)
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
if (card->options.performance_stats) { if (card->options.performance_stats) {
nr_frags = skb_shinfo(new_skb)->nr_frags;
if (use_tso) { if (use_tso) {
card->perf_stats.large_send_bytes += tx_bytes; card->perf_stats.large_send_bytes += tx_bytes;
card->perf_stats.large_send_cnt++; card->perf_stats.large_send_cnt++;
......
...@@ -895,9 +895,26 @@ static ssize_t qeth_l3_dev_rxip_add4_show(struct device *dev, ...@@ -895,9 +895,26 @@ static ssize_t qeth_l3_dev_rxip_add4_show(struct device *dev,
static int qeth_l3_parse_rxipe(const char *buf, enum qeth_prot_versions proto, static int qeth_l3_parse_rxipe(const char *buf, enum qeth_prot_versions proto,
u8 *addr) u8 *addr)
{ {
__be32 ipv4_addr;
struct in6_addr ipv6_addr;
if (qeth_l3_string_to_ipaddr(buf, proto, addr)) { if (qeth_l3_string_to_ipaddr(buf, proto, addr)) {
return -EINVAL; return -EINVAL;
} }
if (proto == QETH_PROT_IPV4) {
memcpy(&ipv4_addr, addr, sizeof(ipv4_addr));
if (ipv4_is_multicast(ipv4_addr)) {
QETH_DBF_MESSAGE(2, "multicast rxip not supported.\n");
return -EINVAL;
}
} else if (proto == QETH_PROT_IPV6) {
memcpy(&ipv6_addr, addr, sizeof(ipv6_addr));
if (ipv6_addr_is_multicast(&ipv6_addr)) {
QETH_DBF_MESSAGE(2, "multicast rxip not supported.\n");
return -EINVAL;
}
}
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment