diff options
| author | Peter Maydell <peter.maydell@linaro.org> | 2017-02-16 12:36:24 +0000 |
|---|---|---|
| committer | Peter Maydell <peter.maydell@linaro.org> | 2017-02-16 12:36:24 +0000 |
| commit | ca5266de6cde132b647b44a108f6c0c009785fdd (patch) | |
| tree | a3dfadd929794d9ea5bd6bd80cfa76ee6a8a4602 /hw/net/imx_fec.c | |
| parent | 5dae13cd71f0755a1395b5a4cde635b8a6ee3f58 (diff) | |
| parent | 4154c7e03fa55b4cf52509a83d50d6c09d743b77 (diff) | |
| download | focaccia-qemu-ca5266de6cde132b647b44a108f6c0c009785fdd.tar.gz focaccia-qemu-ca5266de6cde132b647b44a108f6c0c009785fdd.zip | |
Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into staging
# gpg: Signature made Wed 15 Feb 2017 03:46:59 GMT # gpg: using RSA key 0xEF04965B398D6211 # gpg: Good signature from "Jason Wang (Jason Wang on RedHat) <jasowang@redhat.com>" # gpg: WARNING: This key is not certified with sufficiently trusted signatures! # gpg: It is not certain that the signature belongs to the owner. # Primary key fingerprint: 215D 46F4 8246 689E C77F 3562 EF04 965B 398D 6211 * remotes/jasowang/tags/net-pull-request: net: e1000e: fix an infinite loop issue net: imx: limit buffer descriptor count colo-compare: sort TCP packet queue by sequence number net: e1000e: fix dead code in e1000e_write_packet_to_guest net: Mark 'vlan' parameter as deprecated Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/net/imx_fec.c')
| -rw-r--r-- | hw/net/imx_fec.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/hw/net/imx_fec.c b/hw/net/imx_fec.c index 50c75642c6..90e6ee35ba 100644 --- a/hw/net/imx_fec.c +++ b/hw/net/imx_fec.c @@ -55,6 +55,8 @@ } \ } while (0) +#define IMX_MAX_DESC 1024 + static const char *imx_default_reg_name(IMXFECState *s, uint32_t index) { static char tmp[20]; @@ -402,12 +404,12 @@ static void imx_eth_update(IMXFECState *s) static void imx_fec_do_tx(IMXFECState *s) { - int frame_size = 0; + int frame_size = 0, descnt = 0; uint8_t frame[ENET_MAX_FRAME_SIZE]; uint8_t *ptr = frame; uint32_t addr = s->tx_descriptor; - while (1) { + while (descnt++ < IMX_MAX_DESC) { IMXFECBufDesc bd; int len; @@ -453,12 +455,12 @@ static void imx_fec_do_tx(IMXFECState *s) static void imx_enet_do_tx(IMXFECState *s) { - int frame_size = 0; + int frame_size = 0, descnt = 0; uint8_t frame[ENET_MAX_FRAME_SIZE]; uint8_t *ptr = frame; uint32_t addr = s->tx_descriptor; - while (1) { + while (descnt++ < IMX_MAX_DESC) { IMXENETBufDesc bd; int len; |