summaryrefslogtreecommitdiffstats
path: root/sys/dev/sfxge
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2016-06-14 14:40:19 -0500
committerRenato Botelho <renato@netgate.com>2016-06-14 14:40:19 -0500
commit20a32898b6944f9ebcdbb846253d812943036066 (patch)
tree2d3bb1c4acf6d65a66c132d4c59643a3e99dfe34 /sys/dev/sfxge
parent4fdb7654ef71cc3e4f0353cc46f28f652cd35605 (diff)
parenta048478c507785f68e86db1a32431aa36773ee06 (diff)
downloadFreeBSD-src-20a32898b6944f9ebcdbb846253d812943036066.zip
FreeBSD-src-20a32898b6944f9ebcdbb846253d812943036066.tar.gz
Merge remote-tracking branch 'origin/master' into devel-11
Diffstat (limited to 'sys/dev/sfxge')
-rw-r--r--sys/dev/sfxge/common/ef10_nvram.c23
-rw-r--r--sys/dev/sfxge/sfxge_ev.c2
-rw-r--r--sys/dev/sfxge/sfxge_port.c4
-rw-r--r--sys/dev/sfxge/sfxge_tx.c4
-rw-r--r--sys/dev/sfxge/sfxge_version.h2
5 files changed, 22 insertions, 13 deletions
diff --git a/sys/dev/sfxge/common/ef10_nvram.c b/sys/dev/sfxge/common/ef10_nvram.c
index 7f93df3..73459d6 100644
--- a/sys/dev/sfxge/common/ef10_nvram.c
+++ b/sys/dev/sfxge/common/ef10_nvram.c
@@ -1658,7 +1658,7 @@ ef10_nvram_partn_write_tlv(
* Read a segment from nvram at the given offset into a buffer (segment_data)
* and optionally write a new tag to it.
*/
- static __checkReturn efx_rc_t
+static __checkReturn efx_rc_t
ef10_nvram_segment_write_tlv(
__in efx_nic_t *enp,
__in uint32_t partn,
@@ -1684,20 +1684,25 @@ ef10_nvram_segment_write_tlv(
*/
status = ef10_nvram_read_tlv_segment(enp, partn, *partn_offsetp,
*seg_datap, *src_remain_lenp);
- if (status != 0)
- return (EINVAL);
+ if (status != 0) {
+ rc = EINVAL;
+ goto fail1;
+ }
status = ef10_nvram_buf_segment_size(*seg_datap,
*src_remain_lenp, &original_segment_size);
- if (status != 0)
- return (EINVAL);
+ if (status != 0) {
+ rc = EINVAL;
+ goto fail2;
+ }
if (write) {
/* Update the contents of the segment in the buffer */
if ((rc = ef10_nvram_buf_write_tlv(*seg_datap,
*dest_remain_lenp, tag, data, size,
- &modified_segment_size)) != 0)
- goto fail1;
+ &modified_segment_size)) != 0) {
+ goto fail3;
+ }
*dest_remain_lenp -= modified_segment_size;
*seg_datap += modified_segment_size;
} else {
@@ -1714,6 +1719,10 @@ ef10_nvram_segment_write_tlv(
return (0);
+fail3:
+ EFSYS_PROBE(fail3);
+fail2:
+ EFSYS_PROBE(fail2);
fail1:
EFSYS_PROBE1(fail1, efx_rc_t, rc);
diff --git a/sys/dev/sfxge/sfxge_ev.c b/sys/dev/sfxge/sfxge_ev.c
index 4fb8e0e..7bdcf22 100644
--- a/sys/dev/sfxge/sfxge_ev.c
+++ b/sys/dev/sfxge/sfxge_ev.c
@@ -453,7 +453,7 @@ sfxge_ev_stat_update(struct sfxge_softc *sc)
goto out;
now = ticks;
- if (now - sc->ev_stats_update_time < hz)
+ if ((unsigned int)(now - sc->ev_stats_update_time) < (unsigned int)hz)
goto out;
sc->ev_stats_update_time = now;
diff --git a/sys/dev/sfxge/sfxge_port.c b/sys/dev/sfxge/sfxge_port.c
index c8b0334..2ebc521 100644
--- a/sys/dev/sfxge/sfxge_port.c
+++ b/sys/dev/sfxge/sfxge_port.c
@@ -62,7 +62,7 @@ sfxge_mac_stat_update(struct sfxge_softc *sc)
}
now = ticks;
- if (now - port->mac_stats.update_time < hz) {
+ if ((unsigned int)(now - port->mac_stats.update_time) < (unsigned int)hz) {
rc = 0;
goto out;
}
@@ -570,7 +570,7 @@ sfxge_phy_stat_update(struct sfxge_softc *sc)
}
now = ticks;
- if (now - port->phy_stats.update_time < hz) {
+ if ((unsigned int)(now - port->phy_stats.update_time) < (unsigned int)hz) {
rc = 0;
goto out;
}
diff --git a/sys/dev/sfxge/sfxge_tx.c b/sys/dev/sfxge/sfxge_tx.c
index 08fc885..198b1e5 100644
--- a/sys/dev/sfxge/sfxge_tx.c
+++ b/sys/dev/sfxge/sfxge_tx.c
@@ -992,7 +992,7 @@ static void tso_start(struct sfxge_txq *txq, struct sfxge_tso_state *tso,
tso->protocol = TSO_MBUF_PROTO(mbuf);
tso->nh_off = mbuf->m_pkthdr.l2hlen;
tso->tcph_off = mbuf->m_pkthdr.l3hlen;
- tso->packet_id = TSO_MBUF_PACKETID(mbuf);
+ tso->packet_id = ntohs(TSO_MBUF_PACKETID(mbuf));
#endif
#if !SFXGE_TX_PARSE_EARLY
@@ -1001,7 +1001,7 @@ static void tso_start(struct sfxge_txq *txq, struct sfxge_tso_state *tso,
KASSERT(tso_iph(tso)->ip_p == IPPROTO_TCP,
("TSO required on non-TCP packet"));
tso->tcph_off = tso->nh_off + 4 * tso_iph(tso)->ip_hl;
- tso->packet_id = tso_iph(tso)->ip_id;
+ tso->packet_id = ntohs(tso_iph(tso)->ip_id);
} else {
KASSERT(tso->protocol == htons(ETHERTYPE_IPV6),
("TSO required on non-IP packet"));
diff --git a/sys/dev/sfxge/sfxge_version.h b/sys/dev/sfxge/sfxge_version.h
index ab0ad54..af639ee 100644
--- a/sys/dev/sfxge/sfxge_version.h
+++ b/sys/dev/sfxge/sfxge_version.h
@@ -36,6 +36,6 @@
#ifndef _SFXGE_VERSION_H
#define _SFXGE_VERSION_H
-#define SFXGE_VERSION_STRING "v4.8.0.1071"
+#define SFXGE_VERSION_STRING "v4.8.0.1081"
#endif /* _SFXGE_DRIVER_VERSION_H */
OpenPOWER on IntegriCloud