qeth: Extend priority queueing to IPv6
Make the current priority queueing logic apply to IPv6 traffic. Signed-off-by: Stefan Raspl <raspl@linux.vnet.ibm.com> Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com> Reviewed-by: Ursula Braun <ursula.braun@de.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
9262c6c299
commit
290b8348c0
|
@ -268,10 +268,6 @@ static inline int qeth_is_ipa_enabled(struct qeth_ipa_info *ipa,
|
||||||
#define QETH_NO_PRIO_QUEUEING 0
|
#define QETH_NO_PRIO_QUEUEING 0
|
||||||
#define QETH_PRIO_Q_ING_PREC 1
|
#define QETH_PRIO_Q_ING_PREC 1
|
||||||
#define QETH_PRIO_Q_ING_TOS 2
|
#define QETH_PRIO_Q_ING_TOS 2
|
||||||
#define IP_TOS_LOWDELAY 0x10
|
|
||||||
#define IP_TOS_HIGHTHROUGHPUT 0x08
|
|
||||||
#define IP_TOS_HIGHRELIABILITY 0x04
|
|
||||||
#define IP_TOS_NOTIMPORTANT 0x02
|
|
||||||
|
|
||||||
/* Packing */
|
/* Packing */
|
||||||
#define QETH_LOW_WATERMARK_PACK 2
|
#define QETH_LOW_WATERMARK_PACK 2
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
#include <linux/kthread.h>
|
#include <linux/kthread.h>
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
#include <net/iucv/af_iucv.h>
|
#include <net/iucv/af_iucv.h>
|
||||||
|
#include <net/dsfield.h>
|
||||||
|
|
||||||
#include <asm/ebcdic.h>
|
#include <asm/ebcdic.h>
|
||||||
#include <asm/io.h>
|
#include <asm/io.h>
|
||||||
|
@ -3670,42 +3671,49 @@ void qeth_qdio_output_handler(struct ccw_device *ccwdev,
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(qeth_qdio_output_handler);
|
EXPORT_SYMBOL_GPL(qeth_qdio_output_handler);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Note: Function assumes that we have 4 outbound queues.
|
||||||
|
*/
|
||||||
int qeth_get_priority_queue(struct qeth_card *card, struct sk_buff *skb,
|
int qeth_get_priority_queue(struct qeth_card *card, struct sk_buff *skb,
|
||||||
int ipv, int cast_type)
|
int ipv, int cast_type)
|
||||||
{
|
{
|
||||||
|
u8 tos;
|
||||||
|
|
||||||
if (!ipv && (card->info.type == QETH_CARD_TYPE_OSD ||
|
if (!ipv && (card->info.type == QETH_CARD_TYPE_OSD ||
|
||||||
card->info.type == QETH_CARD_TYPE_OSX))
|
card->info.type == QETH_CARD_TYPE_OSX))
|
||||||
return card->qdio.default_out_queue;
|
return card->qdio.default_out_queue;
|
||||||
switch (card->qdio.no_out_queues) {
|
|
||||||
case 4:
|
|
||||||
if (cast_type && card->info.is_multicast_different)
|
|
||||||
return card->info.is_multicast_different &
|
|
||||||
(card->qdio.no_out_queues - 1);
|
|
||||||
if (card->qdio.do_prio_queueing && (ipv == 4)) {
|
|
||||||
const u8 tos = ip_hdr(skb)->tos;
|
|
||||||
|
|
||||||
if (card->qdio.do_prio_queueing ==
|
if (cast_type && card->info.is_multicast_different)
|
||||||
QETH_PRIO_Q_ING_TOS) {
|
return card->info.is_multicast_different &
|
||||||
if (tos & IP_TOS_NOTIMPORTANT)
|
(card->qdio.no_out_queues - 1);
|
||||||
return 3;
|
|
||||||
if (tos & IP_TOS_HIGHRELIABILITY)
|
switch (card->qdio.do_prio_queueing) {
|
||||||
return 2;
|
case QETH_PRIO_Q_ING_TOS:
|
||||||
if (tos & IP_TOS_HIGHTHROUGHPUT)
|
case QETH_PRIO_Q_ING_PREC:
|
||||||
return 1;
|
switch (ipv) {
|
||||||
if (tos & IP_TOS_LOWDELAY)
|
case 4:
|
||||||
return 0;
|
tos = ipv4_get_dsfield(ip_hdr(skb));
|
||||||
}
|
break;
|
||||||
if (card->qdio.do_prio_queueing ==
|
case 6:
|
||||||
QETH_PRIO_Q_ING_PREC)
|
tos = ipv6_get_dsfield(ipv6_hdr(skb));
|
||||||
return 3 - (tos >> 6);
|
break;
|
||||||
} else if (card->qdio.do_prio_queueing && (ipv == 6)) {
|
default:
|
||||||
/* TODO: IPv6!!! */
|
return card->qdio.default_out_queue;
|
||||||
}
|
}
|
||||||
return card->qdio.default_out_queue;
|
if (card->qdio.do_prio_queueing == QETH_PRIO_Q_ING_PREC)
|
||||||
case 1: /* fallthrough for single-out-queue 1920-device */
|
return ~tos >> 6 & 3;
|
||||||
|
if (tos & IPTOS_MINCOST)
|
||||||
|
return 3;
|
||||||
|
if (tos & IPTOS_RELIABILITY)
|
||||||
|
return 2;
|
||||||
|
if (tos & IPTOS_THROUGHPUT)
|
||||||
|
return 1;
|
||||||
|
if (tos & IPTOS_LOWDELAY)
|
||||||
|
return 0;
|
||||||
default:
|
default:
|
||||||
return card->qdio.default_out_queue;
|
break;
|
||||||
}
|
}
|
||||||
|
return card->qdio.default_out_queue;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(qeth_get_priority_queue);
|
EXPORT_SYMBOL_GPL(qeth_get_priority_queue);
|
||||||
|
|
||||||
|
|
|
@ -725,15 +725,20 @@ static int qeth_l2_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
|
||||||
int elements = 0;
|
int elements = 0;
|
||||||
struct qeth_card *card = dev->ml_priv;
|
struct qeth_card *card = dev->ml_priv;
|
||||||
struct sk_buff *new_skb = skb;
|
struct sk_buff *new_skb = skb;
|
||||||
int ipv = qeth_get_ip_version(skb);
|
|
||||||
int cast_type = qeth_l2_get_cast_type(card, skb);
|
int cast_type = qeth_l2_get_cast_type(card, skb);
|
||||||
struct qeth_qdio_out_q *queue = card->qdio.out_qs
|
struct qeth_qdio_out_q *queue;
|
||||||
[qeth_get_priority_queue(card, skb, ipv, cast_type)];
|
|
||||||
int tx_bytes = skb->len;
|
int tx_bytes = skb->len;
|
||||||
int data_offset = -1;
|
int data_offset = -1;
|
||||||
int elements_needed = 0;
|
int elements_needed = 0;
|
||||||
int hd_len = 0;
|
int hd_len = 0;
|
||||||
|
|
||||||
|
if (card->qdio.do_prio_queueing || (cast_type &&
|
||||||
|
card->info.is_multicast_different))
|
||||||
|
queue = card->qdio.out_qs[qeth_get_priority_queue(card, skb,
|
||||||
|
qeth_get_ip_version(skb), cast_type)];
|
||||||
|
else
|
||||||
|
queue = card->qdio.out_qs[card->qdio.default_out_queue];
|
||||||
|
|
||||||
if ((card->state != CARD_STATE_UP) || !card->lan_online) {
|
if ((card->state != CARD_STATE_UP) || !card->lan_online) {
|
||||||
card->stats.tx_carrier_errors++;
|
card->stats.tx_carrier_errors++;
|
||||||
goto tx_drop;
|
goto tx_drop;
|
||||||
|
|
|
@ -2926,8 +2926,11 @@ static int qeth_l3_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
|
||||||
struct sk_buff *new_skb = NULL;
|
struct sk_buff *new_skb = NULL;
|
||||||
int ipv = qeth_get_ip_version(skb);
|
int ipv = qeth_get_ip_version(skb);
|
||||||
int cast_type = qeth_l3_get_cast_type(card, skb);
|
int cast_type = qeth_l3_get_cast_type(card, skb);
|
||||||
struct qeth_qdio_out_q *queue = card->qdio.out_qs
|
struct qeth_qdio_out_q *queue =
|
||||||
[qeth_get_priority_queue(card, skb, ipv, cast_type)];
|
card->qdio.out_qs[card->qdio.do_prio_queueing
|
||||||
|
|| (cast_type && card->info.is_multicast_different) ?
|
||||||
|
qeth_get_priority_queue(card, skb, ipv, cast_type) :
|
||||||
|
card->qdio.default_out_queue];
|
||||||
int tx_bytes = skb->len;
|
int tx_bytes = skb->len;
|
||||||
bool large_send;
|
bool large_send;
|
||||||
int data_offset = -1;
|
int data_offset = -1;
|
||||||
|
|
Loading…
Reference in New Issue