Skip to content

Commit 5416953

Browse files
committed
Merge branch 's390-qeth-next'
Julian Wiedmann says: ==================== s390/qeth: updates 2017-09-18 first batch of patches for 4.15. One larger item in there is Hans' addition of new configuration options for flexible packet processing ('VNIC characteristics'). The patch descriptions have all the details. Please apply. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents f231c41 + e878c5e commit 5416953

File tree

9 files changed

+819
-103
lines changed

9 files changed

+819
-103
lines changed

drivers/s390/net/qeth_core.h

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,21 @@ struct qeth_sbp_info {
182182
__u32 reflect_promisc_primary:1;
183183
};
184184

185+
struct qeth_vnicc_info {
186+
/* supported/currently configured VNICCs; updated in IPA exchanges */
187+
u32 sup_chars;
188+
u32 cur_chars;
189+
/* supported commands: bitmasks which VNICCs support respective cmd */
190+
u32 set_char_sup;
191+
u32 getset_timeout_sup;
192+
/* timeout value for the learning characteristic */
193+
u32 learning_timeout;
194+
/* characteristics wanted/configured by user */
195+
u32 wanted_chars;
196+
/* has user explicitly enabled rx_bcast while online? */
197+
bool rx_bcast_enabled;
198+
};
199+
185200
static inline int qeth_is_ipa_supported(struct qeth_ipa_info *ipa,
186201
enum qeth_ipa_funcs func)
187202
{
@@ -673,6 +688,7 @@ struct qeth_card_options {
673688
struct qeth_routing_info route6;
674689
struct qeth_ipa_info ipa6;
675690
struct qeth_sbp_info sbp; /* SETBRIDGEPORT options */
691+
struct qeth_vnicc_info vnicc; /* VNICC options */
676692
int fake_broadcast;
677693
int layer2;
678694
int performance_stats;
@@ -946,13 +962,13 @@ int qeth_get_priority_queue(struct qeth_card *, struct sk_buff *, int, int);
946962
int qeth_get_elements_no(struct qeth_card *card, struct sk_buff *skb,
947963
int extra_elems, int data_offset);
948964
int qeth_get_elements_for_frags(struct sk_buff *);
949-
int qeth_do_send_packet_fast(struct qeth_card *card,
950-
struct qeth_qdio_out_q *queue, struct sk_buff *skb,
965+
int qeth_do_send_packet_fast(struct qeth_qdio_out_q *queue, struct sk_buff *skb,
951966
struct qeth_hdr *hdr, unsigned int offset,
952967
unsigned int hd_len);
953968
int qeth_do_send_packet(struct qeth_card *card, struct qeth_qdio_out_q *queue,
954969
struct sk_buff *skb, struct qeth_hdr *hdr,
955-
unsigned int hd_len, unsigned int offset, int elements);
970+
unsigned int offset, unsigned int hd_len,
971+
int elements_needed);
956972
int qeth_do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
957973
int qeth_core_get_sset_count(struct net_device *, int);
958974
void qeth_core_get_ethtool_stats(struct net_device *,

drivers/s390/net/qeth_core_main.c

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4040,35 +4040,23 @@ static int qeth_fill_buffer(struct qeth_qdio_out_q *queue,
40404040
return flush_cnt;
40414041
}
40424042

4043-
int qeth_do_send_packet_fast(struct qeth_card *card,
4044-
struct qeth_qdio_out_q *queue, struct sk_buff *skb,
4043+
int qeth_do_send_packet_fast(struct qeth_qdio_out_q *queue, struct sk_buff *skb,
40454044
struct qeth_hdr *hdr, unsigned int offset,
40464045
unsigned int hd_len)
40474046
{
4048-
struct qeth_qdio_out_buffer *buffer;
4049-
int index;
4047+
int index = queue->next_buf_to_fill;
4048+
struct qeth_qdio_out_buffer *buffer = queue->bufs[index];
40504049

4051-
/* spin until we get the queue ... */
4052-
while (atomic_cmpxchg(&queue->state, QETH_OUT_Q_UNLOCKED,
4053-
QETH_OUT_Q_LOCKED) != QETH_OUT_Q_UNLOCKED);
4054-
/* ... now we've got the queue */
4055-
index = queue->next_buf_to_fill;
4056-
buffer = queue->bufs[queue->next_buf_to_fill];
40574050
/*
40584051
* check if buffer is empty to make sure that we do not 'overtake'
40594052
* ourselves and try to fill a buffer that is already primed
40604053
*/
40614054
if (atomic_read(&buffer->state) != QETH_QDIO_BUF_EMPTY)
4062-
goto out;
4063-
queue->next_buf_to_fill = (queue->next_buf_to_fill + 1) %
4064-
QDIO_MAX_BUFFERS_PER_Q;
4065-
atomic_set(&queue->state, QETH_OUT_Q_UNLOCKED);
4055+
return -EBUSY;
4056+
queue->next_buf_to_fill = (index + 1) % QDIO_MAX_BUFFERS_PER_Q;
40664057
qeth_fill_buffer(queue, buffer, skb, hdr, offset, hd_len);
40674058
qeth_flush_buffers(queue, index, 1);
40684059
return 0;
4069-
out:
4070-
atomic_set(&queue->state, QETH_OUT_Q_UNLOCKED);
4071-
return -EBUSY;
40724060
}
40734061
EXPORT_SYMBOL_GPL(qeth_do_send_packet_fast);
40744062

@@ -4923,7 +4911,6 @@ static void qeth_qdio_establish_cq(struct qeth_card *card,
49234911
if (card->options.cq == QETH_CQ_ENABLED) {
49244912
int offset = QDIO_MAX_BUFFERS_PER_Q *
49254913
(card->qdio.no_in_queues - 1);
4926-
i = QDIO_MAX_BUFFERS_PER_Q * (card->qdio.no_in_queues - 1);
49274914
for (i = 0; i < QDIO_MAX_BUFFERS_PER_Q; ++i) {
49284915
in_sbal_ptrs[offset + i] = (struct qdio_buffer *)
49294916
virt_to_phys(card->qdio.c_q->bufs[i].buffer);

drivers/s390/net/qeth_core_mpc.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ static struct ipa_rc_msg qeth_ipa_rc_msg[] = {
167167
{IPA_RC_IP_TABLE_FULL, "Add Addr IP Table Full - ipv6"},
168168
{IPA_RC_UNKNOWN_ERROR, "IPA command failed - reason unknown"},
169169
{IPA_RC_UNSUPPORTED_COMMAND, "Command not supported"},
170-
{IPA_RC_TRACE_ALREADY_ACTIVE, "trace already active"},
170+
{IPA_RC_VNICC_OOSEQ, "Command issued out of sequence"},
171171
{IPA_RC_INVALID_FORMAT, "invalid format or length"},
172172
{IPA_RC_DUP_IPV6_REMOTE, "ipv6 address already registered remote"},
173173
{IPA_RC_SBP_IQD_NOT_CONFIGURED, "Not configured for bridgeport"},
@@ -193,6 +193,7 @@ static struct ipa_rc_msg qeth_ipa_rc_msg[] = {
193193
{IPA_RC_L2_INVALID_VLAN_ID, "L2 invalid vlan id"},
194194
{IPA_RC_L2_DUP_VLAN_ID, "L2 duplicate vlan id"},
195195
{IPA_RC_L2_VLAN_ID_NOT_FOUND, "L2 vlan id not found"},
196+
{IPA_RC_VNICC_VNICBP, "VNIC is BridgePort"},
196197
{IPA_RC_SBP_OSA_NOT_CONFIGURED, "Not configured for bridgeport"},
197198
{IPA_RC_SBP_OSA_OS_MISMATCH, "OS mismatch"},
198199
{IPA_RC_SBP_OSA_ANO_DEV_PRIMARY, "Primary bridgeport exists already"},
@@ -253,6 +254,7 @@ static struct ipa_cmd_names qeth_ipa_cmd_names[] = {
253254
{IPA_CMD_DELGMAC, "delgmac"},
254255
{IPA_CMD_SETVLAN, "setvlan"},
255256
{IPA_CMD_DELVLAN, "delvlan"},
257+
{IPA_CMD_VNICC, "vnic_characteristics"},
256258
{IPA_CMD_SETBRIDGEPORT_OSA, "set_bridge_port(osa)"},
257259
{IPA_CMD_SETCCID, "setccid"},
258260
{IPA_CMD_DELCCID, "delccid"},

drivers/s390/net/qeth_core_mpc.h

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ enum qeth_ipa_cmds {
9090
IPA_CMD_DELGMAC = 0x24,
9191
IPA_CMD_SETVLAN = 0x25,
9292
IPA_CMD_DELVLAN = 0x26,
93+
IPA_CMD_VNICC = 0x2a,
9394
IPA_CMD_SETBRIDGEPORT_OSA = 0x2b,
9495
IPA_CMD_SETCCID = 0x41,
9596
IPA_CMD_DELCCID = 0x42,
@@ -165,6 +166,8 @@ enum qeth_ipa_return_codes {
165166
IPA_RC_L2_INVALID_VLAN_ID = 0x2015,
166167
IPA_RC_L2_DUP_VLAN_ID = 0x2016,
167168
IPA_RC_L2_VLAN_ID_NOT_FOUND = 0x2017,
169+
IPA_RC_L2_VLAN_ID_NOT_ALLOWED = 0x2050,
170+
IPA_RC_VNICC_VNICBP = 0x20B0,
168171
IPA_RC_SBP_OSA_NOT_CONFIGURED = 0x2B0C,
169172
IPA_RC_SBP_OSA_OS_MISMATCH = 0x2B10,
170173
IPA_RC_SBP_OSA_ANO_DEV_PRIMARY = 0x2B14,
@@ -197,6 +200,9 @@ enum qeth_ipa_return_codes {
197200
IPA_RC_ENOMEM = 0xfffe,
198201
IPA_RC_FFFF = 0xffff
199202
};
203+
/* for VNIC Characteristics */
204+
#define IPA_RC_VNICC_OOSEQ 0x0005
205+
200206
/* for SET_DIAGNOSTIC_ASSIST */
201207
#define IPA_RC_INVALID_SUBCMD IPA_RC_IP_TABLE_FULL
202208
#define IPA_RC_HARDWARE_AUTH_ERROR IPA_RC_UNKNOWN_ERROR
@@ -551,6 +557,71 @@ struct qeth_ipacmd_diagass {
551557
__u8 cdata[64];
552558
} __attribute__ ((packed));
553559

560+
/* VNIC Characteristics IPA Command: *****************************************/
561+
/* IPA commands/sub commands for VNICC */
562+
#define IPA_VNICC_QUERY_CHARS 0x00000000L
563+
#define IPA_VNICC_QUERY_CMDS 0x00000001L
564+
#define IPA_VNICC_ENABLE 0x00000002L
565+
#define IPA_VNICC_DISABLE 0x00000004L
566+
#define IPA_VNICC_SET_TIMEOUT 0x00000008L
567+
#define IPA_VNICC_GET_TIMEOUT 0x00000010L
568+
569+
/* VNICC flags */
570+
#define QETH_VNICC_FLOODING 0x80000000
571+
#define QETH_VNICC_MCAST_FLOODING 0x40000000
572+
#define QETH_VNICC_LEARNING 0x20000000
573+
#define QETH_VNICC_TAKEOVER_SETVMAC 0x10000000
574+
#define QETH_VNICC_TAKEOVER_LEARNING 0x08000000
575+
#define QETH_VNICC_BRIDGE_INVISIBLE 0x04000000
576+
#define QETH_VNICC_RX_BCAST 0x02000000
577+
578+
/* VNICC default values */
579+
#define QETH_VNICC_ALL 0xff000000
580+
#define QETH_VNICC_DEFAULT QETH_VNICC_RX_BCAST
581+
/* default VNICC timeout in seconds */
582+
#define QETH_VNICC_DEFAULT_TIMEOUT 600
583+
584+
/* VNICC header */
585+
struct qeth_ipacmd_vnicc_hdr {
586+
u32 sup;
587+
u32 cur;
588+
};
589+
590+
/* VNICC sub command header */
591+
struct qeth_vnicc_sub_hdr {
592+
u16 data_length;
593+
u16 reserved;
594+
u32 sub_command;
595+
};
596+
597+
/* query supported commands for VNIC characteristic */
598+
struct qeth_vnicc_query_cmds {
599+
u32 vnic_char;
600+
u32 sup_cmds;
601+
};
602+
603+
/* enable/disable VNIC characteristic */
604+
struct qeth_vnicc_set_char {
605+
u32 vnic_char;
606+
};
607+
608+
/* get/set timeout for VNIC characteristic */
609+
struct qeth_vnicc_getset_timeout {
610+
u32 vnic_char;
611+
u32 timeout;
612+
};
613+
614+
/* complete VNICC IPA command message */
615+
struct qeth_ipacmd_vnicc {
616+
struct qeth_ipacmd_vnicc_hdr hdr;
617+
struct qeth_vnicc_sub_hdr sub_hdr;
618+
union {
619+
struct qeth_vnicc_query_cmds query_cmds;
620+
struct qeth_vnicc_set_char set_char;
621+
struct qeth_vnicc_getset_timeout getset_timeout;
622+
};
623+
};
624+
554625
/* SETBRIDGEPORT IPA Command: *********************************************/
555626
enum qeth_ipa_sbp_cmd {
556627
IPA_SBP_QUERY_COMMANDS_SUPPORTED = 0x00000000L,
@@ -692,6 +763,7 @@ struct qeth_ipa_cmd {
692763
struct qeth_ipacmd_diagass diagass;
693764
struct qeth_ipacmd_setbridgeport sbp;
694765
struct qeth_ipacmd_addr_change addrchange;
766+
struct qeth_ipacmd_vnicc vnicc;
695767
} data;
696768
} __attribute__ ((packed));
697769

drivers/s390/net/qeth_l2.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ int qeth_l2_create_device_attributes(struct device *);
1414
void qeth_l2_remove_device_attributes(struct device *);
1515
void qeth_l2_setup_bridgeport_attrs(struct qeth_card *card);
1616

17+
int qeth_l2_vnicc_set_state(struct qeth_card *card, u32 vnicc, bool state);
18+
int qeth_l2_vnicc_get_state(struct qeth_card *card, u32 vnicc, bool *state);
19+
int qeth_l2_vnicc_set_timeout(struct qeth_card *card, u32 timeout);
20+
int qeth_l2_vnicc_get_timeout(struct qeth_card *card, u32 *timeout);
21+
bool qeth_l2_vnicc_is_in_use(struct qeth_card *card);
22+
1723
struct qeth_mac {
1824
u8 mac_addr[OSA_ADDR_LEN];
1925
u8 is_uc:1;

0 commit comments

Comments
 (0)